Description

A PTX running is seeing an issue with route damping. The PTX is running BGP with an external peer:

 

set protocols bgp group DT type external

set protocols bgp group DT import Policy-Route-Flap

set protocols bgp group DT family inet unicast

set protocols bgp group DT export Export-DT

set protocols bgp group DT peer-as 3320

set protocols bgp group DT graceful-restart

set protocols bgp group DT neighbor 200.0.0.2

set protocols bgp log-updown

set protocols bgp damping

set protocols bgp graceful-restart

set protocols bgp multipath

 

Set for damping. The policy, Policy-Route-Flap, calls out damping settings

 

set policy-options policy-statement Policy-Route-Flap then damping damping-settings-1

 

With a suppress set to 1500:

 

set policy-options damping damping-settings-1 half-life 4

set policy-options damping damping-settings-1 reuse 500

set policy-options damping damping-settings-1 suppress 1500

set policy-options damping damping-settings-1 max-suppress 5

 

A BGP peer is brought up to an Ixia with 101 routes;

 

labroot@cardinal-re0> show bgp summary 

 

Warning: License key missing; requires 'BGP' license

 

Threading mode: BGP I/O

Default eBGP mode: advertise - accept, receive - accept

Groups: 1 Peers: 1 Down peers: 0

Table     Tot Paths Act Paths Suppressed  History Damp State  Pending

inet.0        

           101    101     0     0     0     0

Peer           AS   InPkt   OutPkt  OutQ  Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...

200.0.0.2       3320    144     25    0    0    10:02 Establ

 inet.0: 101/101/101/0

  

One route to 128.103.1.0/24 is flapped:

 

labroot@cardinal-re0> show route 128.103.1.1   

 

inet.0: 112 destinations, 114 routes (110 active, 0 holddown, 2 hidden)

Restart Complete

+ = Active Route, - = Last Active, * = Both

 

128.103.1.0/24   *[BGP/170] 00:00:01, localpref 100

           AS path: 3320 I, validation-state: unverified

          > to 200.0.0.2 via et-0/0/2.0

 

{master}

labroot@cardinal-re0> show route 128.103.1.1   

 

inet.0: 112 destinations, 114 routes (109 active, 0 holddown, 3 hidden)

Restart Complete

+ = Active Route, - = Last Active, * = Both

 

0.0.0.0/0     *[Static/5] 00:08:10

          > to 10.85.158.1 via re0:mgmt-0.0

 

A check of the decayed table will show:

 

labroot@cardinal-re0> show route damping decayed 128.103.1.1 detail   

 

inet.0: 112 destinations, 114 routes (110 active, 0 holddown, 2 hidden)

Restart Complete

128.103.1.0/24 (1 entry, 1 announced)

    *BGP  Preference: 170/-101

        Next hop type: Router, Next hop index: 8026

        Address: 0x560ac7158c5c

        Next-hop reference count: 202, Next-hop session id: 1

        Kernel Table Id: 0

        Source: 200.0.0.2

        Next hop: 200.0.0.2 via et-0/0/2.0, selected

        Session Id: 1

        State: <Active Ext>

        Local AS: 5483 Peer AS: 3320

        Age: 1 

        Validation State: unverified 

        Task: BGP_3320.200.0.0.2

        Announcement bits (1): 0-KRT 

        AS path: 3320 I 

        Accepted

        Localpref: 100

        Router ID: 192.0.0.1

        Merit (last update/now): 1189/1189

        damping-parameters: damping-settings-1

        Last update:    00:00:01 First update:    00:00:09

        Flaps: 10

        Thread: junos-main 

 

{master}

 

Or, a merit value of 1189.

 

If the route is flapped continuously, the value never goes higher than 1189:

 

labroot@cardinal-re0> show route damping decayed 128.103.1.1 detail | match Merit | refresh 1 

 

---(refreshed at 2024-08-21 12:05:55 PDT)---

        Merit (last update/now): 1189/1189

---(refreshed at 2024-08-21 12:05:56 PDT)---

        Merit (last update/now): 1189/1189

---(refreshed at 2024-08-21 12:05:57 PDT)---

        Merit (last update/now): 1189/1189

---(refreshed at 2024-08-21 12:05:58 PDT)---

---(refreshed at 2024-08-21 12:05:59 PDT)---

        Merit (last update/now): 1189/1189

---(refreshed at 2024-08-21 12:06:00 PDT)---

        Merit (last update/now): 1189/1189

---(refreshed at 2024-08-21 12:06:01 PDT)---

        Merit (last update/now): 1189/1189

 

Which is based on this ceiling:

 

labroot@cardinal-re0> show policy damping 

...

Damping information for "damping-settings-1":

 Halflife: 4 minutes

 Reuse merit: 500 Suppress/cutoff merit: 1500

 Maximum suppress time: 5 minutes

 Computed values:

  Merit ceiling: 1189

  Maximum decay: 42034

 

If the value never goes higher than 1189, the threshold of 1500:

 

set policy-options damping damping-settings-1 suppress 1500

 

Will never be hit and the route will never be suppressed.

Solution

The issue is tied to the values entered. The system is functioning as designed. Junos and Junos Evolved use the following formula to compute the Merit ceiling:

 

The merit ceiling, εc, which is the maximum merit that a flapping route can collect, is calculated using the following formula:

 

εc ≤ εr e(t/λ) (ln 2)

 

εr is the figure-of-merit reuse threshold, t is the maximum hold-down time in minutes, and λ is the half-life in minutes. For example, if you use the default figure-of-merit values in this formula, but use a half-life of 30 minutes, the calculation is as follows:

 

εc ≤ 750 e(120/30) (ln 2)

 

εc ≤ 12000

 

From:

 

https://uat.juniper.net/documentation/us/en/software/junos23.2/routing-policy/topics/concept/policy-using-routing-policies-to-damp-bgp-route-flapping.html

 

The configuration values here:

 

set policy-options damping damping-settings-1 half-life 4

set policy-options damping damping-settings-1 reuse 500

set policy-options damping damping-settings-1 suppress 1500

set policy-options damping damping-settings-1 max-suppress 5

 

Result in the ceiling of 1189.

 

If the values are adjusted:

 

set policy-options damping damping-settings-1 half-life 7

set policy-options damping damping-settings-1 reuse 1300

set policy-options damping damping-settings-1 suppress 4200

set policy-options damping damping-settings-1 max-suppress 15

 

A new merit ceiling is computed, higher than the threshold:

 

labroot@cardinal-re0> show policy damping 

...

Damping information for "damping-settings-1":

 Halflife: 7 minutes

 Reuse merit: 1300 Suppress/cutoff merit: 4200

 Maximum suppress time: 15 minutes

 Computed values:

  Merit ceiling: 5748

  Maximum decay: 22615

 

If the route is once again flapped:

 

labroot@cardinal-re0> show route damping decayed 128.103.1.1 detail | match Merit | refresh 2  

---(refreshed at 2024-08-22 08:26:17 PDT)---

---(refreshed at 2024-08-22 08:26:19 PDT)---

---(refreshed at 2024-08-22 08:26:21 PDT)---

---(refreshed at 2024-08-22 08:26:23 PDT)---

---(refreshed at 2024-08-22 08:26:25 PDT)---

---(refreshed at 2024-08-22 08:26:27 PDT)---

---(refreshed at 2024-08-22 08:26:29 PDT)---

---(refreshed at 2024-08-22 08:26:31 PDT)---

        Merit (last update/now): 2000/2000

---(refreshed at 2024-08-22 08:26:33 PDT)---

        Merit (last update/now): 2000/2000

---(refreshed at 2024-08-22 08:26:35 PDT)---

---(refreshed at 2024-08-22 08:26:37 PDT)---

        Merit (last update/now): 4000/4000

---(refreshed at 2024-08-22 08:26:39 PDT)---

        Merit (last update/now): 4000/4000

---(refreshed at 2024-08-22 08:26:41 PDT)---

---(refreshed at 2024-08-22 08:26:43 PDT)---

---(refreshed at 2024-08-22 08:26:45 PDT)---

---(refreshed at 2024-08-22 08:26:47 PDT)---

---(refreshed at 2024-08-22 08:26:49 PDT)---

---(refreshed at 2024-08-22 08:26:51 PDT)---

---(*more 100%)---[abort]

 

The ceiling is hit and the route is suppressed:

 

labroot@cardinal-re0> show route 128.103.1.1 

 

inet.0: 112 destinations, 114 routes (109 active, 0 holddown, 3 hidden)

Restart Complete

+ = Active Route, - = Last Active, * = Both

 

0.0.0.0/0     *[Static/5] 20:31:26

          > to 10.85.158.1 via re0:mgmt-0.0

 

{master}

labroot@cardinal-re0> show route damping suppressed detail 

 

inet.0: 112 destinations, 114 routes (109 active, 0 holddown, 3 hidden)

Restart Complete

128.103.1.0/24 (1 entry, 0 announced)

     BGP         /-101

        Next hop type: Router, Next hop index: 8026

        Address: 0x560ac715927c

        Next-hop reference count: 201, Next-hop session id: 1

        Kernel Table Id: 0

        Source: 200.0.0.2

        Next hop: 200.0.0.2 via et-0/0/2.0, selected

        Session Id: 1

        State: <Hidden Ext>

        Local AS: 5483 Peer AS: 3320

        Age: 5 

        Validation State: unverified 

        Task: BGP_3320.200.0.0.2

        AS path: 3320 I 

        Localpref: 100

        Router ID: 192.0.0.1

        Merit (last update/now): 5748/5748

        damping-parameters: damping-settings-1

        Last update:    00:00:02 First update:    00:00:53

        Flaps: 19

        Suppressed. Reusable in:    00:15:00

        Preference will be: 170

        History entry. Expires in:    00:15:00

        Hidden reason: Suppressed by damping

        Thread: junos-main 

Modification History

2024-08-22 : Article Created