In recent years, the concepts of Artificial Intelligence (AI) and Machine Learning (ML)...
BGP Route Dampening: obsolete or still used in the industry?
Let’s explain the BGP Route Dampening concept using the network topology depicted in Picture 1. The routers R1 (AS 64501) and R2 (AS 64502) are eBGP peers. Both routers are running Cisco IOS 15.6(2)T.
Picture 1: Network Topology
R2 Configuration
interface GigabitEthernet0/0 ip address 10.0.0.2 255.255.255.252
Static null routes are configured and presented in a routing table of R2 in order to advertise a route 1.1.1.1/32 toward the R1.
ip route 1.1.1.1 255.255.255.255 Null0 router bgp 64502 network 1.1.1.1 mask 255.255.255.255 neighbor 10.0.0.1 remote-as 64501
R1 Configuration
BGP Route dampening is disabled by default.
interface GigabitEthernet0/0 ip address 10.0.0.1 255.255.255.252 router bgp 64501 bgp dampening neighbor 10.0.0.2 remote-as 64502
The configuration of BGP dampening is pretty straightforward. When the command bgp dampening is enabled without configuring any optional arguments, the default values are used. The default IOS dampening values are 15 750 2000 60. They can be checked with the command below:
R1# show ip bgp dampening parameters
Picture 2: Checking Dampening Parameters
The meaning of the default dampening parameters:
The penalty will be reduced to half after 15 minutes (Half-life time). The routes will not be used when the Suppress penalty 2000 is reached. The dampened route will be reused when the penalty is decoyed into 750 (Reuse penalty). The routes experiencing route flaps should not be suppressed for more than 60 minutes (Max suppress time).
In order to explain all parameters, we will configure R2 to flap the route 1.1.1.1/32. This will be simulated by putting the command no ip route 1.1.1.1 255.255.255.255 in the configuration of R2. Afterwards, we will let the route 1.1.1.1/32 appear in the routing table of R2 again, issuing the command ip route 1.1.1.1 255.255.255.255.
The R1 router is configured for BGP route dampening. Once it receives the route withdraw inside the UPDATE message, the first flap of the route 1.1.1.1/32 is detected. R1 charges a 1000 penalty for the prefix 1.1.1.1/32 (Picture 3). The penalty is charged every time the route flaps. The letter ‘h’ left to the route means that the route is put into a history state.
R1# debug ip bgp dampening
Picture 3: Charged Penalty 1000 for Route 1.1.1.1/32
The flapped route is marked as having flap history and the flap counter is set to 1. However, the flapped route is still advertised to the neighbor. The penalty is decreased by half after the half-life point is reached which is the default 15 minutes. For instance, when a single flap occurs, after 15 minutes the penalty decreases from 1000 to 500.
R1# show ip bgp dampening flap-statistics
Picture 4: Route 1.1.1.1/32 in History State After First Flap
The penalty continues to decrease exponentially with time if no further flaps occur (Picture 5). This process of decoying penalty occurs every 5 seconds.
Picture 5: Penalty Decays
Penalties are cumulative, they are added with each flap. When another flap occurs, the penalty value is increased by 1000. After the second flap, the penalty is 1782 (Picture 6).
Picture 6: Penalty Value After Second Flap
After the third flap, the penalty value is 2635 (Picture 7). The penalty value exceeds the suppress limit (2000 by default) and the route 1.1.1.1/32 is suppressed. The route is not used for forwarding and it is not advertised to any eBGP neighbor. The state of a route is changed from History to Damp (Picture 8).
Picture 7: Penalty Value After Third Flap
The routes in dampened state are marked with the letter “d” and they are not advertised to the neighbors until the reuse limit is reached. There are 3 minutes and 29 seconds left until reaching the reuse limit. (Picture 8)
R1# show ip bgp dampening flap-statistics
Picture 8: Dampened Route 1.1.1.1/32 in BGP Table
Once a route is stabilized and is dropped below a reuse limit, the route 1.1.1.1/32 gets to be re-advertised again (Picture 9). The default reuse value is 750, the router checks every 10 second for the routes that have fallen under the reuse-limit.
R1# show ip bgp dampening flap-statistics
Picture 9: Default Reuse limit 750 Reached
The penalty value continues to decay if the route 1.1.1.1/32 does not flap again (Picture 10). However, If the prefix carries on flapping, penalty is incremented.
Picture 10: Decoying Flap Value
The penalty value is eventually reset to zero when the penalty is less than ½ of the reuse limit (375 by default) (Picture 11).
R1# show ip bgp dampening flap-statistics
Picture 11: Route 1.1.1.1/32 Cleared from Memory
Conclusion:
The increase of routers’ processing power has made the practice of using BGP dampening to prevent CPU consumption obsolete. Modern routers have enough CPU power to support BGP updates without negatively affecting performance, mostly when they hold only a subset of a full BGP table. BGP Flap dampening is not considered a good practice any longer. There is a number of negative effects associated with the use of technology described in the RIPE Routing Working Group Recommendations On Route-flap Damping. It makes complete sense for this feature to be disabled by default on Cisco routers. Nevertheless it can still be used between the eBGP peers on private links. For instance, it can prevent traffic oscillation between the primary and the backup paths.
Boost BGP Performance
Automate BGP Routing optimization with Noction IRP
SUBSCRIBE TO NEWSLETTER
You May Also Like
When Critical Infrastructure is Vulnerable: Rethinking Network Resilience
Recent disruptions to two undersea internet cables in the Baltic Sea have yet again highlighted a pressing issue for...
From Idle to Established: BGP states, BGP ports and TCP interactions
Understanding BGP states is essential to grasp how BGP operates. Similar to interior gateway protocols (IGPs) like...
ACK and NACK in Networking
In networking, communication between devices relies on the efficient exchange of data packets. Among the essential...