Thursday, April 15, 2010

BGP Route Dampening

Quick run through BGP Route Dampening this morning.  I'm in a hurry, so I might not hit all the details.  Heres the topology:

So in this scenario R1 and R0 are running OSPF between them, and RT1 is running EBGP with R2 in AS3.  R2 and R3 are running IBGP with each other in AS3.  RT1 is redistributing bgp routes into OSPF.  Now, R2's route to 172.16.220.0/24 is flapping.  The admin of AS1 wants to apply route dampening to that route, and suppress it if it goes over a certain penalty.
Half Life - 20 minutes
reuse-limit - 950
suppress-limit- 2500
max-suppress-time- 80 minutes

Heres the commands:

You should be able to see where I used the requirements above to plug in damening values into the route-map set statements.  Here is the output, after I bounced the route for 172.16.220.0/24 a couple of times:


The first one shows the route after it has flapped twice.  You can see that it has a penalty of 1932, below the 2500 that we set the suppression penalty to.  So the route is not suppressed yet.  It is important to note that the penalty slowly decreases over time as the route is stable.  This is how a route recovers from dampening also.  The next show ip bgp output actually shows the route after it has flapped 3 times.  Now it is suppressed, notice the message "suppressed due to dampening."  The dampinfo now shows the penalty 2841 (> 2500).  This is awesome!!!  So now the route is going to be suppressed until the penalty falls below 950.  I originally thought this would be in 9 minutes 49 seconds...but when this number go to 0,  the penalty was only at 2032, and it restarted the timer at like 10 minutes.  Check it out:

 Of course you can manually clear the dampening if you, or the administrator, feel that the route is stable again:


Here is some termonoligy from Cisco on dampening:

Understanding Route Dampening Terms

The following terms are used when describing route dampening:
Flap—A route is available, then unavailable, or vice versa.
History state—After a route flaps once, it is assigned a penalty and put into history state, meaning the router does not have the best path, based on historical information.
Penalty—Each time a route flaps, the router configured for route dampening in another autonomous system assigns the route a penalty of 1000. Penalties are cumulative. The penalty for the route is stored in the BGP routing table until the penalty exceeds the suppress limit. At that point, the route state changes from history to damp.
Damp state—In this state, the route has flapped so often that the router will not advertise this route to BGP neighbors.
Suppress limit—A route is suppressed when its penalty exceeds this limit. The default value is 2000.
Half-life—Once the route has been assigned a penalty, the penalty is decreased by half after the half-life period (which is 15 minutes by default). The process of reducing the penalty happens every 5 seconds.
Reuse limit—As the penalty for a flapping route decreases and falls below this reuse limit, the route is unsuppressed. That is, the route is added back to the BGP table and once again used for forwarding. The default reuse limit is 750. The process of unsuppressing routes occurs at 10-second increments. Every 10 seconds, the router finds out which routes are now unsuppressed and advertises them to the world.
Maximum suppress limit—This value is the maximum amount of time a route can be suppressed. The default value is four times the half-life.
The routes external to an autonomous system learned via iBGP are not dampened. This policy prevent the iBGP peers from having a higher penalty for routes external to the autonomous system. 

No comments:

Post a Comment