Why Your BGP Session Keeps Flapping
A BGP session that resets every few hours is almost never a routing policy problem. The policy is static; the reset is periodic. Periodic failures in networking are almost always one of three things: an MTU mismatch that only shows up on large UPDATE messages, a keepalive timer disagreement, or a control-plane resource limit being hit on one side.
MTU is the usual suspect
BGP updates are small, so MTU rarely matters for updates themselves. What matters is the TCP session underneath. If one side has a 1500-byte MTU and the other has 9000, TCP will negotiate a MSS based on the smaller value at handshake, and everything works, until it does not. The failure case is a path in the middle with an even smaller MTU that nobody configured for, and PMTUD blackholing because ICMP is filtered by a security policy someone applied years ago.
The symptom is distinctive: the session stays up for a while, then dies during a burst of updates, then re-establishes. Small updates succeed; large ones vanish. If you see that pattern, run a ping with a fixed size and the do-not-fragment bit set, and walk the size down until it succeeds.
Timers and the hold-time trap
The default hold time is 180 seconds, which means keepalives every 60. Some implementations send them slightly early, some slightly late, and a few send them from a different CPU or a different process context than the one holding the session state. Under load, that is enough to miss the window.
I have seen sessions reset because the keepalive generator lost a scheduling slot on a pinned CPU shared with a packet processing thread. The routing was fine. The kernel was fine. The timer just did not fire when it was supposed to.
What to check first
- Interface counters for drops and errors, not just throughput
- TCP retransmissions on the session socket
- MTU consistency along the full path, not just the adjacent link
- Control-plane CPU and memory, especially route table size
- Whether the other side sees the same reset reason you do
The last point saves the most time. Both peers log a reason, and they often disagree. One side says "hold timer expired" and the other says "administrative reset." When they disagree, the truth is usually somewhere between them and involves a process restart that neither log mentions.