BGP Route Dampening: Penalty, Half-Life and Reuse Limits - 夜莺博客

BGP Route Dampening: Penalty, Half-Life and Reuse Limits

BGP route dampening exists to stop one flapping prefix from consuming CPU cycles across the whole internet: every advertisement and withdrawal of an unstable route generates BGP UPDATE messages that every peer on the path must process. Dampening assigns a penalty to a route each time it flaps and, once the penalty crosses a threshold, suppresses the route entirely — it is neither installed in the routing table nor advertised onward. This article explains the five dampening attributes with their default values, then shows Cisco IOS and Junos configuration with the verification commands that prove dampening is working.

The Five Dampening Attributes

  • Penalty — each flap adds 1000 to the route's penalty.
  • Suppress-limit — when the penalty exceeds 2000 (default), the route is dampened.
  • Half-life — the penalty decays by 50% every 15 minutes (default).
  • Reuse-limit — when the penalty drops below 750 (default), the route is usable and advertised again.
  • Maximum suppress time — 60 minutes default, the cap on how long a route stays suppressed.

Worked example: a penalty of 4000 with a 15-minute half-life decays to 2000 after 15 minutes, 1000 after 30 and 500 after 45. Once below the reuse limit of 750 the route is reinstalled; below 50% of the reuse limit the penalty is removed completely. See also our primer BGP route flap damping explained for the history and rationale.

Cisco IOS Configuration

Enable dampening globally, or selectively per route with a route-map:

R2(config)# router bgp 2
R2(config-router)# bgp dampening
R2(config-router)# exit

Selective dampening uses a route-map that matches specific prefixes with ip prefix-list, so only fragile customer routes are dampened instead of the full table:

R2(config)# ip prefix-list FLAPPY permit 192.168.0.0/16 le 24
R2(config)# route-map DAMPEN permit 10
R2(config-route-map)# match ip address prefix-list FLAPPY
R2(config)# router bgp 2
R2(config-router)# bgp dampening route-map DAMPEN

Verification on Cisco IOS

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

The parameters output shows the running profile — for example dampening 15 750 2000 60 (DEFAULT) — while flap-statistics lists each suppressed prefix with its flap count, duration and reuse time. The d status flag marks a damped route.

Junos Damping and Modern Practice

Junos implements the same mechanics through BGP group damping settings; half-life, reuse and suppress thresholds are configured per peer group or globally with the damping statement, and Juniper's documentation on damping parameters explains the decay math in depth. Before enabling dampening anywhere, read the RIPE-580 recommendation referenced in NetworkLessons' lesson: modern routers are powerful enough that dampening mainly makes sense for very specific instability problems, and enabling it globally on an internet edge can suppress legitimate routes for an hour. Our Junos flap damping configuration guide walks through the parameter tuning.

原文链接:https://networklessons.com/bgp/bgp-route-dampening

The Dampening Attributes in Full

Dampening is a stateful reputation system for prefixes. Each time a route transitions between up and down, the router adds a fixed increment to a running penalty counter attached to that prefix. The counter decays exponentially. Cross the suppression threshold and the route is withdrawn from the decision process — it is neither installed in the RIB nor advertised to peers — until enough time passes for the penalty to decay below the reuse threshold. Every value below is a tunable, and the defaults differ substantially between implementations, which is a frequent source of confusion when your Cisco and Junos edges behave differently for the same flap.

Attribute Meaning Cisco IOS default Junos default
Penalty increment Added per flap 1000 1000
Half-life Time for the penalty to halve 15 minutes 15 minutes
Reuse limit Penalty below which the route is usable again 750 750
Suppress limit Penalty above which the route is suppressed 2000 2000
Maximum suppress time Hard cap on suppression duration 60 minutes (4 × half-life) 60 minutes

Two derived rules are worth memorising. First, with a penalty increment of 1000 and a suppress limit of 2000, a route is suppressed on its second flap inside the decay window — one withdrawal alone is not enough. Second, once the penalty decays below half of the reuse limit the entry is removed from the dampening table entirely, so the prefix starts with a clean slate next time. That is the "reuse limit/2" rule and it is why a prefix that flapped twice last week does not carry a grudge into today.

Working Through the Decay Maths

Start a prefix at a penalty of 4000 (four flaps). With a 15-minute half-life:

t =  0 min   penalty 4000   -> suppressed (above 2000)
t = 15 min   penalty 2000   -> still suppressed (at the limit)
t = 30 min   penalty 1000   -> still suppressed (above 750)
t = 45 min   penalty  500   -> below 750, route reused
t = 60 min   penalty  250   -> below 375 (reuse/2), entry removed

The route therefore comes back roughly 45 minutes after its last flap, and if it flaps once more while still above the reuse limit it is suppressed again immediately — a single further flap re-crosses 2000 because it starts from an elevated base. This is the behaviour people find counter-intuitive: a prefix that flaps regularly but never twice in quick succession tends to survive, while one that flaps in bursts gets pinned.

Cisco IOS: Global, Selective and Tuned

The simplest possible configuration applies the default profile to every prefix in the BGP table, including the full internet table if you take one:

R2(config)# router bgp 2
R2(config-router)# bgp dampening
R2(config-router)# exit

A tuned profile passes all five parameters positionally — half-life, reuse, suppress, max-suppress-time:

R2(config)# router bgp 2
R2(config-router)# bgp dampening 30 1500 3000 120
R2(config-router)# exit

That profile is deliberately patient: a 30-minute half-life, a suppress limit high enough that a route needs three flaps to be caught, and a reuse limit set to half the suppress limit so suppression ends before the route is completely stale. Selective dampening is the pattern most operators actually deploy, because it limits the blast radius to prefixes that are known to be fragile:

R2(config)# ip prefix-list FLAPPY permit 192.168.0.0/16 le 24
R2(config)# ip prefix-list FLAPPY permit 198.51.100.0/24 le 24
R2(config)# route-map DAMPEN permit 10
R2(config-route-map)# match ip address prefix-list FLAPPY
R2(config)# router bgp 2
R2(config-router)# bgp dampening route-map DAMPEN
R2(config-router)# exit

A route-map used with dampening can match on prefixes but not on communities or AS-path in all code versions — check your platform's documentation before assuming a community-based route-map will work. You can also remove dampening from specific neighbours by applying an empty route-map, or exclude a high-value prefix by matching it in a route-map applied with no bgp dampening route-map semantics.

Junos Configuration

Junos exposes the same five parameters, applied per group or per neighbour, and config uses named parameters rather than positional ones, which makes a Junos profile considerably easier to read back six months later:

set protocols bgp group EBGP-PEERS damping
set protocols bgp group EBGP-PEERS damping half-life 15
set protocols bgp group EBGP-PEERS damping reuse 750
set protocols bgp group EBGP-PEERS damping suppress 2000
set protocols bgp group EBGP-PEERS damping max-suppress-time 60

Junos additionally lets you apply damping through a routing policy by matching on a prefix-list and then naming the damp profile, and a per-neighbour override is inherited from the group unless explicitly restated. The verification commands differ from Cisco's but show the same information:

show bgp summary
show route damping parameters
show route damping history
show route damping suppressed
show route 192.168.1.0/24 detail

In show route detail a damped prefix carries a state token that includes the penalty and the reuse countdown, for example State: alongside metrics such as Penalty: 2520 and Reuse in 00:12:03. Those two numbers together tell you exactly when the prefix will return, which is far more actionable than a bare "it is damped" message.

Why Dampening Fell Out of Favour

Dampening was designed in an era when a single flapping prefix could measurably affect routers on the other side of the planet, and when CPU cycles for BGP processing were scarce. RFC 2439 formalised it. The problem, documented thoroughly in RIPE-580 and later in RFC 7196, is that the mechanism suppresses routes for far longer than the underlying instability lasts, and that suppression propagates the same decision to hundreds of downstream networks that had no say in it. The measurable result was that dampening could prolong outages: a prefix withdraws, is damped, comes back quickly, and stays invisible for another forty minutes on every router running default dampening.

RIPE recommended disabling dampening by default and re-tuning the parameters substantially if it is used at all — a much longer half-life, a much higher reuse limit relative to the suppress limit, and a cap on suppression time. RFC 7196 made the same argument for the IETF. The practical consensus today is that dampening belongs on very specific customer edge sessions and nowhere else, and that the parameters must be tuned rather than defaulted. Our primer BGP route flap damping explained traces the history in more depth, and the tuning walkthrough in BGP route flap damping: penalty and RIPE-580 tuning shows what a compliant profile looks like in numbers.

Alternatives and Complements

Before enabling dampening, decide what you are actually trying to protect, because each problem has a cheaper answer:

  • Protecting the router from update churn. Dampening helps only partly. Raising the minimum route advertisement interval or increasing the keepalive/hold timers reduces update frequency with far less collateral damage.
  • Protecting against a peer that sends too many routes. Use neighbor x maximum-prefix N with a restart interval. This is a hard, predictable limit that does not depend on decay maths.
  • Protecting against a physically flapping link. Fix the link layer: interface hold-time, flap detection, or BFD with appropriate timers. Dampening treats the symptom while the cause keeps generating outages.
  • Protecting convergence. Prefer BGP add-path, prefix-independent convergence or a proper fast-reroute mechanism. Dampening delays convergence by design.
R2(config)# router bgp 2
R2(config-router)# neighbor 192.0.2.2 maximum-prefix 1000 80 restart 60
R2(config-router)# neighbor 192.0.2.2 timers 5 20
R2(config-router)# exit

A layered approach works best: prefix-lists and a prefix counter at every eBGP session, dampening with tuned parameters on the handful of sessions where instability is a known problem, and real time spent on why the link flaps in the first place. If you are still deciding which attributes drive selection after the routes are restored, our BGP best path explainer covers the full cascade, and BGP neighbor flapping: root causes and fixes deals with the session-level problem rather than the route-level one.

Deployment Checklist

Work through the following list in order when introducing dampening to an existing network. Each step is designed so that a mistake is visible before it becomes an outage.

  • Record the current baseline: show ip bgp dampening parameters and show ip bgp dampening flap-statistics on every edge router, so you have a before-picture to compare against.
  • Decide the scope. Global dampening on an internet-facing edge is almost always the wrong answer; selective dampening on known-fragile customer sessions usually is not.
  • Choose parameters deliberately rather than accepting the defaults, and keep the reuse limit at or above half the suppress limit so a suppressed route returns as soon as it stabilises.
  • Apply the profile in a maintenance window on the router that carries the least traffic first, and leave it there for a full week before extending it.
  • Confirm that peers and downstream networks are not also running default dampening, because their suppression decisions will delay your convergence regardless of your own tuning.
  • Document the profile in the design document, including the reasoning, so that a future engineer does not revert a deliberate choice as an oversight.

Above all, remember that dampening is a mitigation for the symptom. If a prefix is flapping once a fortnight because an access circuit is failing, the useful work is on the circuit, not on the penalty timer.