As we agreed in the last post, we are going to discuss the available tools and parameters for BGP performance tuning. In this post we are going to start discussing the different types of timers that BGP uses for its operation.
BGP network timers (Keepalive and Holdtime)
Keepalive messages are sent periodically to ensure the liveness of the connection, RFC4271 suggests 30 seconds for Keepalive and 90 seconds for HoldTime, with a recommendation that with any implementation of BGP the reasonable maximum time between keepalive messages would be one third of the HoldTime interval. If a router didn’t receive a keepalive message within the HoldTime interval the software declares the peer dead.
The Cisco IOS default keepalive timer is 60 seconds and the default HoldTime is 180 seconds, while Juniper routers use a default keepalive of 30 seconds and a default HoldTime of 90 seconds.
When a connection is started, BGP will negotiate the HoldTime with its neighbor(s). The smaller of the two HoldTimes will be chosen. The keepalive timer is then set based on the negotiated HoldTime and the locally configured keepalive time, each router may choose a different keepalive timer, since each router will compare the value of the negotiated HoldTime divided by 3 to its locally configured keepalive value, and the lower number will be used.
NOTE Juniper routers uses a default of 30/90 seconds – Accordingly if a Cisco and a Juniper routers are peering they will agree to use 30/90 seconds.
We can change these timers using the below commands:
Router(config-router)#timers bgp <0-65535><0-65535><0-65535>