BGP Route Dampening
BGP route dampening is a feature to limit the propagation of flapping routes. BGP route dampening feature has three goals-
This feature can be configured as follows-
BGP Route Dampening Configuration
router bgp 100
bgp dampening half-life reuse-limit suppress-limit maximum-suppress-limit
!
Route dampening maintains a route-flap history for each prefix. The following parameters are used-
The BGP dampening feature affects only eBGP routes. Further, this feature operates on routes on a per-path basis. For instance, if a prefix has two paths, and one is dampened, the other prefix is still available and is advertised to BGP peers.
R2 and R3 routers are configured for BGP dampening with default values. Suppress limit = 2000, half-life period = 15 minutes, reuse-limit = 750 and maximum suppress-limit = 60 minutes.
R3 router adverises 1.1.1.1/32 prefix to R2 router via eBGP.
When 1.1.1.1/32 route flaps for the first time, its state is changed to History. Also, a penalty of 1000 is applied to the route 1.1.1.1/32. The debug ip bgp dampening command displays this information.
First flap
02:01:19.687: EvD: charge penalty 1000, new accum. penalty 1000, flap count 1
02:01:19.687: EvD: unsuppress item left in reuse timer array with penalty 1000
02:01:19.687: BGP(0): charge penalty for 1.1.1.1/32 path 300 with halflife-time 15 reuse/suppress 750/2000
02:01:19.687: BGP(0): flapped 1 times since 00:00:00. New penalty is 1000
R2# show ip bgp dampening flap-statistics
BGP table version is 9, local router ID is 10.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
h 1.1.1.1/32 10.2.2.2 1 00:34:34 300
The penalty decreases with time if no further flaps are noticed.
Reducing penalty
02:01:49.567: EvD: accum. penalty 980, not suppressed
02:02:15.931: EvD: accum. penalty decayed to 961 after 27 second(s)
When the route suffers a second flap, the further penalty of 1000 is applied. However, since the accumulated penalty does not exceed maximum suppress limit (2000), the route is not dampened.
Second flap
02:02:45.599: EvD: accum. penalty decayed to 942 after 29 second(s)
02:02:45.599: EvD: charge penalty 1000, new accum. penalty 1942, flap count 2
02:02:45.599: EvD: unsuppress item left in reuse timer array with penalty 1942
02:02:45.599: BGP(0): charge penalty for 1.1.1.1/32 path 300 with halflife-time 15 reuse/suppress 750/2000
02:02:45.603: BGP(0): flapped 2 times since 00:01:25. New penalty is 1942
The show ip bgp dampening flap-statistics command shows BGP dampening flap-statistics for prefixes.
show ip bgp dampening flap-statistics
R2# show ip bgp dampening flap-statistics
BGP table version is 6, local router ID is 10.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
*> 1.1.1.1/32 10.2.2.2 2 00:02:17 300
Now when the route flaps the third time, a further penalty of 1000 is applied to the route. This time, the accumulated penalty exceeds the max suppress limit 2000 and hence the route is suppressed/ dampened and not advertised.
Third flap
02:04:31.463: BGP(0): suppress 1.1.1.1/32 path 300 for 00:28:10 (penalty 2766)
02:04:31.463: halflife-time 15, reuse/suppress 750/2000
02:04:31.463: EvD: accum. penalty 2766, now suppressed with a reuse intervals of 169
The show ip bgp dampening dampened-paths command shows the routes currently dampened. The 'd' at the start of the prefix indicates the route is dampened.
show ip bgp dampening dampened-paths
R2# show ip bgp dampening flap-statistics
BGP table version is 7, local router ID is 10.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
*d 1.1.1.1/32 10.2.2.2 3 00:06:36 00:02:59 300
R2# show ip bgp dampening dampened-paths
BGP table version is 7, local router ID is 10.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Reuse Path
*d 1.1.1.1/32 10.2.2.2 00:06:19 300 i
When the penalty falls below the reuse-limit 750, the route is unsuppressed and advertised again.
Unsuppressed route
02:32:53.147: EvD: accum. penalty decayed to 756 after 12 second(s)
02:32:53.147: EvD: accum. penalty 756, now unsuppressed
02:32:53.151: BGP(0): Unsuppressed 1.1.1.1/32, path 300
R2# show ip bgp dampening flap-statistics
BGP table version is 8, local router ID is 10.2.2.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
*> 1.1.1.1/32 10.2.2.2 3 00:31:59 300