Tuesday, October 11, 2011

LAB: BGP Timers Tuning

- Configure R2’s BGP process to process conditional route advertisement every 20 seconds.
-  R2 should not batch routing updates to BB2 and advertise them immediately.
- Configure R2 so that session deactivation happens within 15 seconds of no session activity.

BGP routing process is complicated and uses many data structures and periodically scheduled tasks. One of the most important BGP processes is “BGP scanner” runs every 60 seconds by default, which performs the following important functions:

1) Runs through all prefixes in BGP table and check the validity and reachability of BGP NEXT_HOP attribute.
2) Performs conditional advertisement and route injection.
3) Imports new routes into BGP table from RIB (via network and redistribute commands).
4) Performs route dampening.

The shorter is the interval, the better is routing convergence, but at the same time the more load is put on the router’s CPU. You may check the BGP scanner runs using the command

debug ip bgp events

Another important BGP process is “BGP I/O”, which processes BGP UPDATE and KEEPALIVE messages. By default, BGP batches all new prefixes and delays the sending of an update packet to the peer until the next advertisementinterval timer expires. This interval is configured on a per-peer basis using the command

neighbor <IP> advertisement-interval <seconds>

Decreasing this interval (the minimum value is zero) improves BGP convergence but generates more BGP traffic and puts more stress on router’s CPU. The last important timer is the BGP session keepalive interval. Keepalives are important to validate BGP session health, to avoid routing blackholes. BGP peers advertise the hold time interval when establishing BGP peering session and send KEEPALIVE message to inform each other of their availability. Peers may  advertise different hold-time interval – it’s only important that the peer receive the KEEPALIVE message until its hold-time interval expires. You can change the keepalive and hold-time periods on per-process basis using the command

timers bgp <keepalive> <holdtime>

The default values are 60 and 180 for keepalive and holdtime intervals respectively. Setting the keepalive interval too small results in faster peering deactivation detection, but may lead to “false positives” and disruption of BGP session by mistake and excessive route flapping. Keep in mind that you need to completely reset the BGP session in order for the new keepalive timers to take effect. If you want to observe the BGP keepalive exchange process, use the command

debug ip bgp keepalive.

R2:
 router bgp 200
timers bgp 5 15
neighbor 192.10.1.254 advertisement-interval 0
bgp scan-time 20

verification:

Rack1R2#show ip bgp summary | inclu scan
BGP activity 34/7 prefixes, 199/152 paths, scan interval 20 secs

Rack1R2#show ip bgp neighbors 192.10.1.254 | inc advertisement|keepalive
  Last read 00:00:52, last write 00:00:07, hold time is 180, keepalive interval is 60 seconds
  Configured hold time is 15,keepalive interval is 5 seconds, Minimum holdtime from neighbor is 0 seconds
  Default minimum time between advertisement runs is 30 seconds
  Route map for incoming advertisements is SET_COMMUNITY
  Minimum time between advertisement runs is 0 seconds

No comments:

Post a Comment