In BGP Timers and Keepalive Messages are core to how Border Gateway Protocol (BGP) maintains stable and reliable connections (peerings) between routers.
BGP (Border Gateway Protocol) uses timers to maintain neighbor relationships, detect failures, and control how often messages are exchanged. These timers help routers decide when a peer is alive, unresponsive, or needs to be reset.
Key BGP Timers
Keepalive Timer
- Purpose: Ensures the BGP neighbor is still reachable.
- Default value: 60 seconds
- Behavior:
- A router sends a KEEPALIVE message every 60 seconds if no other BGP message has been sent.
- KEEPALIVE messages do not carry routing information.
Hold Timer
- Purpose: Detects when a neighbor has gone down.
- Default value: 180 seconds
- If no Keepalive (or Update) is received within the hold time, the neighbor is considered dead, and the BGP session is torn down
Connect / Retry Timers
- Used during session establishment.
- Connect Timer
- How long BGP waits for a TCP connection to be established.
- Retry Timer
- How long BGP waits before retrying a failed connection attempt.
- Connect Timer
- Typical default: 120 seconds
- Used during session establishment.