< Free Open Study > |
3-12 bgp dampening route-map route-map- nameSyntax Description:
Purpose: A route flap occurs when a prefix transitions from the up to the down state. When the prefix goes from up to down, BGP must send a WITHDRAWN message. When the prefix goes from down to up, BGP sends an UPDATE message. If the prefix is constantly flapping, this can cause high CPU utilization while the BGP routes are converging. Additionally, if you are redistributing BGP into your IGP, the flapping route can cause instability in the IGP. Dampening is a method to control the effect of a flapping route. The mechanics of route dampening are illustrated in Figure 3-8. Figure 3-8. BGP Dampening Parameters and Operation
Assume that BGP route dampening has been applied to a particular route. At time t1 in Figure 3-8, a route flap occurs. Remember that a route flap is when a prefix goes from the up to the down state. When a route flaps, a penalty of 1000 is applied to the route. This is a fixed parameter that cannot be changed. At time t1, the flapping route incurs a penalty of 1000. Because the penalty is less than the suppress limit, which has been configured to be 1500, the flapping route is not dampened. Because the route has not been dampened, BGP sends a WITHDRAWN message when the route goes from up to down and then an UPDATE message when the route goes from down to up. When route dampening is enabled, BGP must maintain a history of flapping routes. The penalty associated with the route decreases over time. The rate of decrease in the penalty is a function of the half-life. The half-life is the amount of time for the penalty to decrease to half of its current value. If the half-life is 15 minutes, the penalty decreases to 500 in 7.5 minutes. At time t2, the penalty decreases to 600, and another route flap occurs. The route is again penalized , with an additional value of 1000 added to the current value of the penalty. The total penalty associated with the route is now 1600. When the total penalty of a route becomes greater than the suppress limit, the route is dampened. A dampened route means that BGP no longer sends UPDATE messages when the prefix goes from the down to the up state. The flapping prefix remains in the WITHDRAWN state. The route remains in the WITHDRAWN state until its penalty decreases below the reuse limit. When the penalty decreases below the reuse limit, BGP sends an UPDATE message for the route. Routes learned via IBGP are not dampened. Cisco IOS Software Release: 11.0 Configuration Example 1: Default DampeningFigure 3-9 shows the configuration and monitoring of route dampening. Routers A and B are configured as EBGP neighbors. Router A is advertising network 172.16.2.0/24 to Router B via EBGP. This prefix is a loopback interface that we will cause to flap by administratively shutting down and reenabling the interface. Figure 3-9. BGP Dampening Parameters and Operation
Router A interface loopback 0 ip address 172.16.2.1 255.255.255.0 ! router bgp 1 neighbor 10.1.1.2 remote-as 2 network 172.16.2.0 mask 255.255.255.0 ___________________________________________________________________________ Router B router bgp 2 bgp dampening neighbor 10.1.1.1 remote-as 1 BGP dampening has been configured using the general form of the bgp dampening command. This applies route dampening to every BGP route with the following defaults:
Router B should have an entry for prefix 172.16.2.0/24 in its BGP table: Router B# show ip bgp BGP table version is 2, local router ID is 5.5.5.5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.2.0/24 10.1.1.1 0 0 1 i Shut down network 172.16.2.0 on Router A by shutting down the loopback 0 interface. Examine the BGP table on Router B: 2511# show ip bgp BGP table version is 3, local router ID is 5.5.5.5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path h 172.16.2.0/24 10.1.1.1 0 0 1 i The prefix 172.16.2.0/24 is still in the BGP table, but it is an invalid route. Because dampening is enabled on Router B, Router B must maintain a history for every route that has flapped. View the dampening parameters for prefix 172.16.2.0/24: rtrB# show ip bgp 172.16.2.0/24 BGP routing table entry for 172.16.2.0/24, version 3 Paths: (1 available, no best path) Not advertised to any peer 1 (history entry) 10.1.1.1 from 10.1.1.1 (172.16.88.2) Origin IGP, metric 0, localpref 100, external, ref 2 Dampinfo: penalty 996, flapped 1 times in 00:00:08 Reenable the loopback interface on Router A, and then reinspect the parameters for prefix 172.16.2.0/24 on Router B: rtrB# show ip bgp BGP table version is 4, local router ID is 10.1.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.2.0/24 10.1.1.1 0 0 1 I rtrB# show ip bgp 172.16.2.0/24 BGP routing table entry for 172.16.2.0/24, version 4 Paths: (1 available, best #1) Not advertised to any peer 1 10.1.1.1 from 10.1.1.1 (172.16.88.2) Origin IGP, metric 0, localpref 100, valid, external, best, ref 2 Dampinfo: penalty 871, flapped 1 times in 00:03:06 The route is now being advertised, and BGP is maintaining a history of the route. Notice that the penalty has decreased to 871. Now shut down the loopback interface on Router A and check the route's parameters on Router B: rtrB# show ip bgp BGP table version is 5, local router ID is 10.1.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path h 172.16.2.0/24 10.1.1.1 0 0 1 i rtrB# show ip bgp 172.16.2.0/24 BGP routing table entry for 172.16.2.0/24, version 5 Paths: (1 available, no best path) Not advertised to any peer 1 (history entry) 10.1.1.1 from 10.1.1.1 (172.16.88.2) Origin IGP, metric 0, localpref 100, external, ref 2 Dampinfo: penalty 1760, flapped 2 times in 00:05:52 The route is down, and BGP is maintaining a history of the flapping route. Because the total penalty is below the default suppress limit of 2000, when the route comes up, it is advertised. Reenable the loopback interface on Router A: rtrB# show ip bgp BGP table version is 6, local router ID is 10.1.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.2.0/24 10.1.1.1 0 0 1 I rtrB# show ip bgp 172.16.2.0/24 BGP routing table entry for 172.16.2.0/24, version 6 Paths: (1 available, best #1) Not advertised to any peer 1 10.1.1.1 from 10.1.1.1 (172.16.88.2) Origin IGP, metric 0, localpref 100, valid, external, best, ref 2 Dampinfo: penalty 1553, flapped 2 times in 00:08:39 Shut down and then reenable the loopback on Router A. This puts the penalty above the suppress limit of 2000, and the route will be suppressed even though it is up: rtrB# show ip bgp BGP table version is 7, local router ID is 10.1.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *d 172.16.2.0/24 10.1.1.1 0 0 1 I rtrB# show ip bgp 172.16.2.0/24 BGP routing table entry for 172.16.2.0/24, version 7 Paths: (1 available, no best path) Not advertised to any peer 1, (suppressed due to dampening) 10.1.1.1 from 10.1.1.1 (172.16.88.2) Origin IGP, metric 0, localpref 100, valid, external, ref 2 Dampinfo: penalty 2275, flapped 3 times in 00:12:12, reuse in 00:24:00 Even though the route is now up, it will not be advertised or injected into the IP routing table. The penalty for this prefix has exceeded the suppress limit, and we can see from the BGP table on Router B that the route is dampened. The specific BGP information for the dampened route shows that the route will be reused in 24 minutes, assuming that it does not flap again. Because the route is now dampened, WITHDRAWN and UPDATE messages will not be sent if the route flaps. If we are patient and wait 24 minutes, we will see BGP restore the route, and it will be installed in the IP routing table. Dampened paths can be viewed using the show ip bgp dampened-paths command: rtrB# show ip bgp dampened-paths BGP table version is 7, local router ID is 10.1.1.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 172.16.2.0/24 10.1.1.1 00:19:30 1 i Now wait 19 minutes and 30 seconds. BGP will reuse the route as long as the route does not flap while we are waiting. We can verify that the route is being reused by examining the BGP and IP routing tables: rtrB# show ip bgp BGP table version is 8, local router ID is 10.1.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 172.16.2.0/24 10.1.1.1 0 0 1 i rtrB# show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 172.16.0.0/24 is subnetted, 1 subnets B 172.16.2.0 [20/0] via 10.1.1.1, 00:00:12 10.0.0.0/30 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial0 Configuration Example 2: Configuring Dampening ParametersThe first example used the BGP dampening defaults. Two forms of the dampening command are available to customize the dampening parameters. The first form allows you to configure the half-life while using the defaults for suppress limit, reuse, and maximum suppress time: bgp dampening 30 The preceding command sets the half-life to 30 minutes and uses the defaults for suppress limit (2000), reuse (750), and maximum suppress time (4 times the half-life). The second form allows you to customize all the dampening parameters except the penalty. The penalty has a fixed value of 1000: bgp dampening half-life reuse suppress max-suppress-time When you use the preceding form of this command, the maximum suppress time cannot be less than the half-life. Configuration Example 3: Configuring Dampening Parameters Using a Route MapThe previous forms of the dampening command apply to every EBGP learned route. A route map allows you to apply different dampening parameters to different prefixes based on IP address or AS-path information. In the first example, we will apply dampening to prefixes 172.16.2.0/24 and 192.16.4.0/24 based on the IP address of the route using IP access lists: router bgp 2 bgp dampening route-map dampen neighbor 10.1.1.1 remote-as 1 ! access-list 1 permit 172.16.2.0 0.0.0.255 access-list 2 permit 192.16.4.0 0.0.0.255 ! route-map dampen permit 10 match ip address 1 set dampening 15 750 2000 60 route-map dampen permit 20 match ip address 2 set dampening 20 800 2200 80 In the second example, we will apply different parameters to routes originating from AS 1 and AS 3: router bgp 2 bgp dampening route-map dampen neighbor 10.1.1.1 remote-as 1 ! ip as-path access-list 1 permit ip as-path access-list 1 permit ^1$ ip as-path access-list 2 permit ip as-path access-list 1 permit ^3$ ! route-map dampen permit 10 match as-path 1 set dampening 15 750 2000 60 route-map dampen permit 20 match as-path 2 set dampening 20 800 2200 80 VerificationWhen using BGP dampening, you can tell if dampening is working only if a prefix is flapping. If route flaps are occurring, dampening can be verified using the commands described in the following examples. Use the show ip bgp command to verify that BGP is maintaining a history of flapping routes: rtrB# show ip bgp BGP table version is 5, local router ID is 10.1.1.2 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path h 172.16.2.0/24 10.1.1.1 0 0 1 i Use the show ip bgp prefix command to view the dampening parameters for a flapping route: rtrB# show ip bgp 172.16.2.0/24 BGP routing table entry for 172.16.2.0/24, version 5 Paths: (1 available, no best path) Not advertised to any peer 1 (history entry) 10.1.1.1 from 10.1.1.1 (172.16.88.2) Origin IGP, metric 0, localpref 100, external, ref 2 Dampinfo: penalty 1760, flapped 2 times in 00:05:52 Use the show ip bgp dampened-paths command to view which prefixes are dampened: rtrB# show ip bgp dampened-paths BGP table version is 7, local router ID is 10.1.1.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 172.16.2.0/24 10.1.1.1 00:19:30 1 i Use the show ip bgp flap-statistics command to view statistics for flapping prefixes: rtrB# show ip bgp flap-statistics BGP table version is 9, local router ID is 10.1.1.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 172.16.2.0/24 10.1.1.1 3 00:02:55 00:28:10 1 Troubleshooting
|
< Free Open Study > |