Tuesday, October 11, 2011

LAB: BGP Dampening

- Create Looback1 interface in R1 with the IP address 1.1.1.1/24 and advertise it into BGP.
-  Configure AS 200 routers to suppress advertisement of oscillating networks.
- Once a prefix flaps two times in a row, the advertisement should resume in 5 minutes.

Two main methods to reduce the impact of network instabilities are

1.  summarization (information hiding) and prefix dampening. Summarization aggregates reachability information and hides flaps of the specific prefixes constituting a summary.

2.  Dampening is the process of suppressing a flapping prefix advertisement till the moment it becomes “stable”. This introduces some “inertial” mechanism to new prefix advertisement, delaying the changes announcements for oscillating prefixes.

1000 - additive penalty value.
If the accumulated penalty value exceeds the Suppress Limit, which defaults to 2000, BGP process will mark the route as damped.

BGP will not advertise it to any peers. Every five seconds the BGP process exponentially decreases the penalty value assigned to the prefix. The exponential decay process has one parameter - Half-Life time period, which specifies the amount of time needed to decrease the current penalty to the value twice smaller. That is, the decay process follows the equation
P(t) = P(0)/2^(t/Half_Life) 
with the default Half_Life time of 15 minutes. As soon as the penalty falls below the Reuse Limit, the router will unsuppress the route and start advertising it again. The decision to unsuppress a prefix is made every 10 seconds.

That is, when the scenario says “flaps twotimes in a row” you may assume the flaps immediately once after another. Thisresults in accumulated penalty of 2000 and route being damped. We now need to find the Half_Life value that will make the router reuse the prefix in 5 minutes. Wetake the penalty evolution equation and write it as follows:

P(5) = P(0)/2^(5/Half_Life)
And substitute P(5)=750 (the reuse limit) and P(0)=2000 (Suppress Limit). The equation then becomes:
200/750=2^(5/Half_Life)
From this equation we can find the Half_Life value by taking logarithm of the both sides:
Half_Life=5*Ln(2)/Ln(200/75)=3.5 (approximately).

We may round the result up to 4 minutes. That is, the task could be accomplished by setting the Half_Life value to 4 minutes. Now, the BGP command to apply the dampening parameters is

bgp dampening [<Half_Life> <ReuseLimit> <SuppressLimit> <MaximumSuppressTime>] 

The last parameter, <MaximumSuppressTime>, specifies the time limit to keep the prefix damped if it keeps oscillating. The default value if 4xHalf_Life or 60 minutes. The router sets the maximum penalty value based on this timer using the formula Max_Penalty = ReuseLimit *2^(MaximumSuppressTime/Half_Life). You may review the current dampening parameters (if enabled) using the command show ip bgp dampening parameters.

configuration:

router bgp 200
bgp dampening 4 750 2000 16
R1:
!
! We adjust the advertisement interval to minimize prefix batching
! and make R1 advertise prefix changes ASAP
!
router bgp 146
network 1.1.1.0 mask 255.255.255.0
neighbor 155.1.13.3 advertisement-interval 0
!
interface Loopback1
ip address 1.1.1.1 255.255.255.0

verification:

Rack1R3#show ip bgp dampening dampened-paths
BGP table version is 240, local router ID is 150.1.3.3
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.0/24       155.1.13.1       00:07:30 100 i
 
Rack1R3#show ip bgp dampening flap-statistics
BGP table version is 240, local router ID is 150.1.3.3
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.0/24       155.1.37.7      2     00:01:07          65089 100
*d                  155.1.13.1      3     00:01:07 00:07:10 100

Rack1R3#show ip bgp 1.1.1.0
BGP routing table entry for 1.1.1.0/24, version 240
Paths: (3 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1          2          3        
  100
    155.1.45.4 (metric 2175232) from 155.1.0.5 (150.1.5.5)
      Origin IGP, metric 0, localpref 100, valid, internal, best
  65089 100, (received & used)
    155.1.37.7 from 155.1.37.7 (150.1.77.77)
      Origin IGP, localpref 100, valid, external
      Dampinfo: penalty 1314, flapped 2 times in 00:02:45
  100, (suppressed due to dampening), (received & used)
    155.1.13.1 from 155.1.13.1 (150.1.1.1)
      Origin IGP, metric 0, localpref 100, valid, external
      Dampinfo: penalty 1971, flapped 3 times in 00:02:45, reuse in 00:05:30

No comments:

Post a Comment