Route Dampening is a way to suppress flapping routes so that they are "suppressed" instead of being advertised. An unstable network can cause BGP routes to flap, which can cause other BGP routers in the network to constantly reconverge. This wastes valuable CPU cycles and can cause severe problems in the network. As a best practice most ISPs use route dampening regularly.
Definitions of the Route Dampening terms:
Penalty -
An incremented numeric value that is assigned to a route each time it flaps. A route is penalized 1000 every time it flaps. A route is considered to have flapped when we receive a WITHDRAW and then an UPDATE for a route. If we drop and regain our adjacency with a BGP peer we do not assign a penalty to the routes learned from that peer.
Half life time -
A configurable numeric value that describes the amount of time that must elapse to reduce the penalty by one half. The default value is 15 minutes but can range from 1 minute up to 45 minutes.
Suppress limit -
A numeric value that is compared with the penalty. If the penalty is greater than the suppress limit, the route is suppressed. The default is 2000 but can range from 1 to 20000.
Reuse limit -
A configurable numeric value that is compared with the penalty. If the penalty is less than the reuse limit, a suppressed route that is up will no longer be suppressed. The default value is 750 but can range from 1 to 20,000.
Max suppress limit
- The longest amount of time that a route can be suppressed. The default is 4x the half life time but can range from 1 to 255.
Suppressed route
- A route that is not advertised, even if it is up. A route is suppressed if the penalty is more than the suppress limit.
History entry -
An entry used to store flap information. For the purposes of monitoring and calculating the level of oscillation of a route, it is important to store oscillation information in the router. When the route stabilizes, the history entry will become useless and will be flushed from the router.
Let's take an example to understand route dampening,
Topology:
Assume that RB is using route dampening with all of the defaults for half-life-time, etc.
1st Case : When everything for 10.0.0.0/8 looks fine:
RB#
RB#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 185404176
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x200
10
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, localpref 100, valid, external, best
RB#show ip bgp flap-statistics
<<< No flaps
RB#show ip bgp dampened-paths
<<< No route is dampened
RB#
Case 2: After the route that RA is advertising to RB has flapped once:
RB#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 96
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x208
10 (history entry)
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, localpref 100, external
Dampinfo: penalty 992, flapped 1 times in 00:00:13
!---Here We see route flapped once.
!---- Penality << Supress time (2000)
!--- Route was penalized by 1000 but the route is not supressed because
penality<supresstime (2000)
RB#show ip bgp flap-statistics
BGP table version is 96, local router ID is 20.1.75.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
h 10.0.0.0/8 1.1.1.1 1 00:00:36 10
RB#
RB#show ip bgp dampened-paths
<<<< No route is dampened
Case 3: Now let us see what the penalty situation is after the route has flapped twice:
RB#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 105
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x208
10
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, localpref 100, valid, external, best
Dampinfo: penalty 1836, flapped 2 times in 00:03:28
!----Here we see route flapped twice and Penality is still < Supress time (2000).
Hence we still advertising the route.We are still under the supress limit of 2000,
so everything is ok.
RB#show ip bgp flap-statistics
BGP table version is 106, local router ID is 20.1.75.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
*> 10.0.0.0/8 1.1.1.1 2 00:03:31 10
RB#show ip bgp dampened-paths
<<< No route is dampened
Case 4: Now let us see what happens when the route flaps a third time:
RB#sh ip bgp 10.0.0.0
BGP routing table entry for 10.0.0.0/8, version 110
Paths: (1 available, best #1, table Default-IP-Routing-Table)
10, (suppressed due to dampening)
1.1.1.1 from 1.1.1.1 (1.1.1.1)
Origin IGP, localpref 100, valid, external
Dampinfo: penalty 2621, flapped 3 times in 00:05:35, reuse in 00:27:00
Here we see route flapped thrice and Penality (2621) > Supress time (2000)
RB#
RB#show ip bgp flap-statistics
BGP table version is 110, local router ID is 20.1.75.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Flaps Duration Reuse Path
*d 10.0.0.0/8 1.1.1.1 3 00:05:38 00:27:00 10
RB#
RB#show ip bgp dampened-paths
!-- Now we see route is dampened
BGP table version is 110, local router ID is 20.1.75.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
Network From Reuse Path
*d 10.0.0.0/8 1.1.1.1 00:27:00 10 i
We see something as Reuse timer. It tells us that it will be 27 minutes until this route is advertised again.
If you need the route to be reused in less than 27 minutes then you can use "clear ip bgp dampening" command to reset the penality
values.
Enjoy and please carry on with dampening your BGP routes frequently.