BGP Route Flap Damping Explained: How It Works and How to Configure It - 夜莺博客

BGP Route Flap Damping Explained: How It Works and How to Configure It

BGP route flap damping is the mechanism that protects the global routing table from unstable prefixes. When a route flaps - goes up, down, up again - every flap is announced to every BGP peer, and a few flapping prefixes can burn router CPU across the whole internet. Damping assigns a penalty to a prefix every time it flaps; once the penalty crosses a suppress threshold the prefix is not advertised anymore, and it is only reused after the penalty decays below a reuse threshold. This article explains the mathematics of damping, shows real Cisco IOS and Junos configurations, and covers the caveats every network engineer should know before enabling it.

How Route Flap Damping Works

Each flap event adds a penalty (default 1000 per flap on Cisco) to the prefix's figure-of-merit. The penalty decays exponentially over time according to the half-life. Three parameters control the whole process:

  • Suppress threshold (default 2000): penalty above this stops advertisement of the route.
  • Reuse threshold (default 750): penalty must decay below this before the route is re-advertised.
  • Maximum suppress time (default 60 min): cap on how long a prefix can stay suppressed.
  • Half-life (default 15 min): time for the penalty to halve.

With defaults, two flaps (2 × 1000 = 2000) suppress the route immediately; after the penalty decays below 750 the route comes back.

Cisco IOS Configuration

router bgp 65001
 bgp dampening
 bgp dampening 15 750 2000 60
 bgp dampening route-map ONLY-DAMPEN

Plain bgp dampening uses defaults. The four-argument form is bgp dampening <half-life> <reuse> <suppress> <max-suppress>. A route-map lets you dampen only selected prefixes (for example, only customer routes, never transit or local prefixes).

Cisco Verification Commands

show ip bgp dampening parameters
show ip bgp dampening flap-statistics
show ip bgp dampened-paths
clear ip bgp dampening

show ip bgp flap-statistics lists flapping prefixes with their current penalty; show ip bgp dampened-paths shows prefixes currently suppressed.

Junos Configuration

Junos implements damping as a policy option applied to BGP import/export:

policy-options {
    damping DAMP {
        half-life 15;
        reuse 750;
        suppress 2000;
        max-suppress 60;
    }
}
protocols bgp {
    group CUSTOMERS {
        import DAMP-IMPORT;
        export DAMP-EXPORT;
    }
}

Then reference the damping profile in a policy statement:

policy-options {
    policy-statement DAMP-IMPORT {
        term damp {
            from protocol bgp;
            then {
                damping DAMP;
                accept;
            }
        }
    }
}

Junos Verification Commands

show route damping
show route damping flap-statistics
show route damping suppressed

When Damping Hurts (RFC 7196)

Research and RFC 7196 showed that damping can make things worse: a prefix that flaps repeatedly is often a slow-converging but stable destination, and damping delays its recovery, effectively blackholing it for minutes. As a result, most large ISPs have either disabled damping entirely or restrict it to customer edge prefixes. Practical guidance:

  • Never dampen iBGP or full-table routes from transit providers.
  • Dampen only customer-announced prefixes, and only when flap rates are pathological.
  • Use route-maps/policy to scope damping narrowly.

Related articles: BGP neighbor flapping root causes and fixes and BGP ECMP configuration on Cisco, Juniper and Arista.

原文链接:https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/46000-route-flap-damp.html