Route dampening is a mechanism used to minimize the instability caused by route flapping and oscillation over the network. The following is the command used to control route dampening:
bgp dampening [[route-map map-name] [half-life-time reuse-value suppress-value maximum-suppress-time]]
half-life-time is in the range of 1 to 45 minutes. The current default is 15 minutes.
reuse-value is in the range of 1 to 20000. The default is 750.
suppress-value is in the range of 1 to 20000. The default is 2000.
maximum-suppress-time is the maximum duration that a route can be suppressed. The range is 1 to 255. The default is 4 × half-life-time.
A route map can be associated with BGP dampening to selectively apply the dampening parameters if certain criteria are found. Sample criteria include matching on a specific IP route, AS_PATH, or community.
Figure 12-15 shows two ASs, AS3 and AS1. RTA in AS3 is running IBGP with RTG in AS3 and EBGP with RTC in AS1. Information coming via EBGP from AS3 is injected into OSPF in AS1.
RTC has noticed lots of fluctuations in network 172.16.220.0/24 coming from AS3, causing oscillation in its BGP and consequently in OSPF. The 172.16.220.0/24 keeps showing up and disappearing from RTH's routing table. To rectify the problem, RTC will apply dampening to the BGP routes by using a route map to selectively dampen route 172.16.220.0/24 only. Example 12-88 and Example 12-89 show the configurations for RTG and RTA, respectively.
router bgp 3 no synchronization network 172.16.112.0 mask 255.255.255.0 neighbor 172.16.70.1 remote-as 3 no auto-summary |
router bgp 3 no synchronization network 172.16.220.0 mask 255.255.255.0 network 172.16.70.0 mask 255.255.255.0 neighbor 172.16.20.1 remote-as 1 neighbor 172.16.70.2 remote-as 3 neighbor 172.16.70.2 next-hop-self no auto-summary |
RTC is EBGP peered with RTA, and IBGP peered with RTH. RTC is injecting the BGP routes it receives into OSPF, which is running in AS1. RTC is applying BGP dampening with a route map SELECTIVE_DAMPENING, which applies the dampening parameters to network 172.16.220.0/24 only. All other routes such as 172.16.112.0/24 will not be dampened.
The RTC configuration in Example 12-90 specifies the dampening parameters in the following manner:
The half-life-time is 20 minutes.
The reuse limit for the penalty is 950.
Routes will be suppressed if the cumulative penalty exceeds 2500.
The maximum time a route could be suppressed is 80 minutes.
router ospf 10 redistribute bgp 1 subnets network 192.68.0.0 0.0.255.255 area 0 router bgp 1 bgp dampening route-map SELECTIVE_DAMPENING network 192.68.11.0 neighbor 172.16.20.2 remote-as 3 neighbor 192.68.6.1 remote-as 1 no auto-summary access-list 1 permit 172.16.220.0 0.0.0.255 route-map SELECTIVE_DAMPENING permit 10 match ip address 1 set dampening 20 950 2500 80 route-map SELECTIVE_DAMPENING permit 20 |
The output in Example 12-90 shows how RTC treats the flapping route 172.16.220.0/24. A flap is counted anytime the path information changes for a route. The BGP table in Example 12-91 shows the route before any flaps have occurred.
RTC#show ip bgp 172.16.220.0
BGP routing table entry for 172.16.220.0/24, version 326
Paths: (1 available, best #1, advertised over IBGP)
3
172.16.20.2 from 172.16.20.2 (172.16.220.1)
Origin IGP, metric 0, valid, external, best
|
The output in Example 12-92 shows the route after one flap. The route is down and is put in the history state. The route was given the default penalty of 1000, which has already decayed to 997.
RTC#show ip bgp 172.16.220.0
BGP routing table entry for 172.16.220.0/24, version 327
Paths: (1 available, no best path, advertised over IBGP)
3 (history entry)
172.16.20.2 from 172.16.20.2 (172.16.220.1)
Origin IGP, metric 0, external
Dampinfo: penalty 997, flapped 1 times in 00:00:06
|
The output in Example 12-93 shows the route after a second flap (it has come back up again). Another penalty of 1000 has been added, and the cumulative penalty after decay has reached 1454.
RTC#show ip bgp 172.16.220.0
BGP routing table entry for 172.16.220.0/24, version 328
Paths: (1 available, best #1, advertised over IBGP)
3
172.16.20.2 from 172.16.20.2 (172.16.220.1)
Origin IGP, metric 0, valid, external, best
Dampinfo: penalty 1454, flapped 2 times in 00:01:20
|
Example 12-94 shows the route after four flaps. The penalty is now 2851, which exceeds the 2500 limit. The route is now suppressed (dampened) and will not be passed on to RTH. The route will be usable in 31 minutes and 40 seconds. At that time, the penalty will decay to the reuse limit of 950.
RTC#show ip bgp 172.16.220.0
BGP routing table entry for 172.16.220.0/24, version 329
Paths: (1 available, no best path, advertised over IBGP)
3, (suppressed due to dampening)
172.16.20.2 from 172.16.20.2 (172.16.220.1)
Origin IGP, metric 0, valid, external
Dampinfo: penalty 2851, flapped 4 times in 00:03:05, reuse in 00:31:40
|
The output in Example 12-95 shows the same route after six flaps. The differences are that the half-life-time has been set to 5 minutes instead of 20 minutes, and the maximum-suppress-time is 20 minutes instead of 80. With a shorter half-life-time, the penalty will be decayed much faster, and the route will be used a lot sooner. Note the reuse time of 8 minutes and 10 seconds.
RTC#show ip bgp 172.16.220.0
BGP routing table entry for 172.16.220.0/24, version 336
Paths: (1 available, no best path, advertised over IBGP)
3, (suppressed due to dampening)
172.16.20.2 from 172.16.20.2 (172.16.220.1)
Origin IGP, metric 0, valid, external
Dampinfo: penalty 2939, flapped 6 times in 00:08:21, reuse in 00:08:10
|
Adjusting the dampening timers becomes essential when administrators cannot afford to have a long outage for a specific route. BGP dampening with route maps is a powerful tool to selectively penalize ill-behaved routes in a user-configurable and controlled manner.
3.141.24.134