BGP Route Flap Dampening



Route dampening (introduced in Cisco IOS version 11.0) is a mechanism to minimize the instability caused by route flapping and oscillation over the network. To accomplish this, criteria are defined to identify poorly behaved routes. A route which is flapping gets a penalty for each flap (1000). As soon as the cumulative penalty reaches a predefined "suppress−limit", the advertisement of the route will be suppressed. The penalty will be exponentially decayed based on a preconfigured "half−time". Once the penalty decreases below a predefined "reuse−limit", the route advertisement will be un−suppressed.

Routes, external to an AS, learned via IBGP will not be dampened. This is to avoid the IBGP peers having higher penalty for routes external to the AS.

The penalty will be decayed at a granularity of 5 seconds and the routes will be un−suppressed at a granularity of 10 seconds. The dampening information is kept until the penalty becomes less than half of "reuse−limit" , at that point the information is purged from the router.

Initially, dampening will be off by default. This might change if there is a need to have this feature enabled by default. The following are the commands used to control route dampening:

  • bgp dampening (will turn on dampening)
  • no bgp dampening (will turn off dampening)
  • bgp dampening (will change the half−life−time)

A command that sets all parameters at the same time is:

  • bgp dampening
  • (range is 1−45 min, current default is 15 min)
  • (range is 1−20000, default is 750)
  • (range is 1−20000, default is 2000)
  • (maximum duration a route can be suppressed, range is 1−255, default is 4 times half−life−time)
RTB#
hostname RTB
interface Serial0
ip address 203.250.15.2 255.255.255.252
interface Serial1
ip address 192.208.10.6 255.255.255.252
router bgp 100
bgp dampening
network 203.250.15.0
neighbor 192.208.10.5 remote−as 300

RTD#
hostname RTD
interface Loopback0
ip address 192.208.10.174 255.255.255.192
interface Serial0/0
ip address 192.208.10.5 255.255.255.252
router bgp 300
network 192.208.10.0
neighbor 192.208.10.6 remote−as 100
RTB is configured for route dampening with default parameters. Assuming the EBGP link to RTD is stable, RTB's BGP table would look like this:

RTB#show ip bgp
BGP table version is 24, local router ID is 203.250.15.2 Status codes: s
suppressed, d damped, h history, * valid, > best, i − internal Origin
codes: i − IGP, e − EGP, ? − incomplete


NetworkNext HopMetricLocPrfWeightPath
*>192.208.10.0192.208.10.50
0300 i
*>203.250.15.00.0.0.00
32768i

In order to simulate a route flap, use clear ip bgp 192.208.10.6 on RTD. RTB's BGP table will look like this:

RTB#show ip bgp
BGP table version is 24, local router ID is 203.250.15.2 Status codes: s
suppressed, d damped, h history, * valid, > best, i − internal Origin
codes: i − IGP, e − EGP, ? − incomplete



NetworkNext HopMetricLocPrfWeightPath
h192.208.10.0192.208.10.50
0300 i
*>203.250.15.00.0.0.00
32768i

The BGP entry for 192.208.10.0 has been put in a "history" state. Which means that we do not have a best path to the route but information about the route flapping still exists.

RTB#show ip bgp 192.208.10.0
BGP routing table entry for 192.208.10.0 255.255.255.0, version 25
Paths: (1 available, no best path)
300 (history entry)
192.208.10.5 from 192.208.10.5 (192.208.10.174)
Origin IGP, metric 0, external
Dampinfo: penalty 910, flapped 1 times in 0:02:03
The route has been given a penalty for flapping but the penalty is still below the "suppress limit" (default is 2000). The route is not yet suppressed. If the route flaps few more times we will see the following:

RTB#show ip bgp
BGP table version is 32, local router ID is 203.250.15.2 Status codes:
s suppressed, d damped, h history, * valid, > best, i − internal Origin codes:
i − IGP, e − EGP, ? − incomplete


NetworkNext HopMetricLocPrfWeightPath
*d192.208.10.0192.208.10.50
0300 i
*>203.250.15.00.0.0.00
32768i

RTB#show ip bgp 192.208.10.0
BGP routing table entry for 192.208.10.0 255.255.255.0, version 32
Paths: (1 available, no best path)
300, (suppressed due to dampening)
192.208.10.5 from 192.208.10.5 (192.208.10.174)
Origin IGP, metric 0, valid, external
Dampinfo: penalty 2615, flapped 3 times in 0:05:18 , reuse in 0:27:00

The route has been dampened (suppressed). The route will be reused when the penalty reaches the "reuse value", in our case 750 (default).The dampening information will be purged when the penalty becomes less than half of the reuse−limit, in our case (750/2=375). The following are the commands used to show and clear flap statistics information:
  • show ip bgp flap−statistics (displays flap statistics for all the paths)
  • show ip bgp−flap−statistics regexp (displays flap statistics for all paths that match the regexp)
  • show ip bgp flap−statistics filter−list (displays flap statistics for all paths that pass the filter)
  • show ip bgp flap−statistics A.B.C.D m.m.m.m (displays flap statistics for a single entry)
  • show ip bgp flap−statistics A.B.C.D m.m.m.m longer−prefixes (displays flap statistics for more specific entries)
  • show ip bgp neighbor [dampened−routes] | [flap−statistics] (displays flap statistics for all paths from a neighbor)
  • clear ip bgp flap−statistics (clears flap statistics for all routes)
  • clear ip bgp flap−statistics regexp (clears flap statistics for all the paths that match the regexp)
  • clear ip bgp flap−statistics filter−list (clears flap statistics for all the paths that pass the filter)
  • clear ip bgp flap−statistics A.B.C.D m.m.m.m (clears flap statistics for a single entry)
  • clear ip bgp A.B.C.D flap−statistics (clears flap statistics for all paths from a neighbor)