Description

BFD has two modes: Centralized and Distributed modes. PPMD instructs the kernel to handle BFD packets for Centralized modes, whereas PPMD instructs the FPC to handle BFD packets for Distributed mode.

In Distributed modes, PPMD will choose an anchor FPC to handle the BFD packets for Multihop BFD sessions. All the other FPCs who receive the BFD packets will forward the packets to the anchor FPC to proceed further.

This article provides an example command output session demonstrating how the anchor FPC is selected and what happens when the anchor FPC is rebooted.

Solution

With Multihop BFD , Junos OS can select any FPC in the device as the anchor FPC. The hash calculation used to calculate which FPC will be the anchor FPC is based on the BFD session destination address. The anchor FPC selection is indeterministic, and there is no way to control it. Rebooting of the anchor FPC will trigger a BFD session flap. The anchor FPC will change to another FPC and it's not preemptable. An example is shown below.

Topology:

MX960(xe-1/0/0)-----(xe-2/0/0)MX240

  • Interface ae1.0 is configured between the two devices
  • ISIS and iBGP are established in between. BFD session is under ibgp


Example - Command output to identify anchor FPC:

BGP peer is established:

# run show bgp summary
Groups: 1 Peers: 1 Down peers: 0
Table          Tot Paths  Act Paths Suppressed    History Damp State    Pending
Peer                     AS      InPkt     OutPkt    OutQ   Flaps Last Up/Dwn State|#Active/Received/Accepted/Damped...
172.22.32.2           65001          3          5       0       2          57 Establ
  inet.0: 0/0/0/0

# run show bfd session
                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
172.22.32.2              Up                       15.000    5.000        3 
1 sessions, 1 clients
Cumulative transmit rate 0.2 pps, cumulative receive rate 0.2 pps


The commands below show that FPC0 is the anchor FPC. (PPMD can choose any FPC inside the device as the anchor FPC even it's not direct connected with peer device.)

labroot@jtac-mx960-re0# run show bfd session extensive
                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
172.22.32.2              Up                       15.000    5.000        3  
 Client BGP, TX interval 5.000, RX interval 5.000
 Session up time 00:14:17
 Local diagnostic None, remote diagnostic None
 Remote state Up, version 1
 Replicated
 Session type: Multi hop BFD  <<<<<
 Min async interval 5.000, min slow interval 5.000
 Adaptive async TX interval 5.000, RX interval 5.000
 Local min TX interval 5.000, minimum RX interval 5.000, multiplier 3
 Remote min TX interval 5.000, min RX interval 5.000, multiplier 3
 Local discriminator 29, remote discriminator 27
 Echo mode disabled/inactive
 Remote is control-plane independent
 Multi-hop route table 0, local-address 172.22.32.1
  Session ID: 0x0
 
labroot@jtac-mx960-re0# run show ppm adjacencies detail
Protocol: BFD, Hold time: 15000, IFL-index: 0
Distributed: TRUE
Replicated
BFD discriminator: 29, BFD routing table index: 0
Redirection Type: DYNAMIC_FILTER, Rule Term Src: 172.22.32.2, Rule Term Port: 4784, Rule Term Action: 832
Num Packets: 2, Absorbed Packets: 0, Rx Packet: 20 C8 03 18 00 00 00 1B 00 00 00 1D 00 4C 4B 40 00 4C 4B 40 00 00 00 00
Distribution handle: 221, Distribution address: fpc0 <<<<< anchor FPC


To see how the anchor FPC was selected, you can run the following commands to verify:


FPC1 is the direct connecting FPC, and FPC0 is selected as the anchor FPC. All the other FPCs who receive the BFD packets will be forced to transfer the packets to FPC0 by an internal filter as below:
NPC1(jtac-mx960-re0 vty)# show filter
Program Filters:
---------------
   Index     Dir     Cnt    Text     Bss  Name
--------  ------  ------  ------  ------  --------
 
Term Filters:
------------
   Index    Semantic  Properties   Name
--------  ---------- --------  ------
       1  Classic    -         __default_bpdu_filter__
   17000  Classic    -         __default_arp_policer__
   57008  Classic    -         __cfm_filter_shared_lc__
   65280  Classic    -         __auto_policer_template__
   65281  Classic    -         __auto_policer_template_1__
   65282  Classic    -         __auto_policer_template_2__
   65283  Classic    -         __auto_policer_template_3__
   65284  Classic    -         __auto_policer_template_4__
   65285  Classic    -         __auto_policer_template_5__
   65286  Classic    -         __auto_policer_template_6__
   65287  Classic    -         __auto_policer_template_7__
   65288  Classic    -         __auto_policer_template_8__
16777216  Classic    -         fnp-filter-level-all
46137345  Classic    -         HOSTBOUND_IPv4_FILTER
46137346  Classic    -         HOSTBOUND_IPv6_FILTER
46137353  Classic    -         filter-control-subtypes
54525952  Classic    -         ppmd-bfd-inet4  <<<< this filter!!
Resolve Filters:
---------------
   Index
 
labroot@jtac-mx960-re0# run start shell pfe network fpc1
NPC platform (1067Mhz MPC 8548 processor, 2048MB memory, 512KB flash)

NPC1(jtac-mx960-re0 vty)# show filter index 54525952 program   <<<<< Using the index in the 'show filter output, the nh-id is identified.
Filter index = 54525952
Optimization flag: 0xf7
Filter notify host id = 0
Filter properties: None
Filter state = CONSISTENT
term ppmd-29
term priority 0
    destination-port 
         4784
        false branch to match action in rule ppmd-default
    source-address 
        172.22.32.2/32
        false branch to match action in rule ppmd-default
    destination-address 
        172.22.32.1/32
        false branch to match action in rule ppmd-default
 
    then
        action next-hop, type (nh-id)
                  832   <<<<<   Note the next-hop id here. The PPMD filters redirect the packets to this nh-id.
        count ppmd-v4-29-4784-count
term ppmd-default
term priority 0
 
    then
        accept
 
NPC1(jtac-mx960-re0 vty)# show nhdb 
  832   Unicast  pfh-0/0/0.16384  128.0.0.16             IPv4   Unspecified  65535  0x0000000000000000  0x0000000000000000
<<< Note the next-hop IP address is 128.0.0.16. The filter redirects the bfd packets to the internal address 128.0.0.16.


The FPC0's hex value 0x10 is decimal 16. Therefore, this confirms that the filter redirects the packets to FPC0, which is the anchor FPC.

labroot@jtac-mx960-re0# run show tnp addresses
fpc0                    0x10 02:00:00:00:00:10 em0    1500 5 0 3



Example - Output when anchor FPC reboots:

Before the reboot, note that FPC0 is the anchor FPC and the BFD session is Up:

labroot@jtac-mx960-re0# run show ppm adjacencies detail
Protocol: BFD, Hold time: 15000, IFL-index: 0
Distributed: TRUE
Replicated
BFD discriminator: 29, BFD routing table index: 0
Redirection Type: DYNAMIC_FILTER, Rule Term Src: 172.22.32.2, Rule Term Port: 4784, Rule Term Action: 832
Num Packets: 2, Absorbed Packets: 0, Rx Packet: 20 C8 03 18 00 00 00 1B 00 00 00 1D 00 4C 4B 40 00 4C 4B 40 00 00 00 00
Distribution handle: 221, Distribution address: fpc0  <<<< anchor FPC

labroot@jtac-mx960-re0# run show bfd session
                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
172.22.32.2              Up                       15.000    5.000        3

When FPC0 is rebooted, it will trigger a BFD flap.

labroot@jtac-mx960-re0# run show bfd session  
                                                  Detect   Transmit
Address                  State     Interface      Time     Interval  Multiplier
172.22.32.2              AdminDown                15.000    5.000        3

labroot@jtac-mx960-re0# run show log messages | match bfd
Oct 31 20:51:09.102  jtac-mx960-re0 bfdd[15236]: BFD Session 172.22.32.2 (IFL 0) state Up -> Down LD/RD(29/27) Up time:00:43:40 Local diag: CtlExpire Remote diag: None Reason: Detect Timer Expiry.
Oct 31 20:51:09.102  jtac-mx960-re0 bfdd[15236]: BFDD_TRAP_MHOP_STATE_DOWN: local discriminator: 29, new state: down, peer addr: 172.22.32.2

This is expected behavior.
Another FPC will be chosen as the anchor FPC, and BFD will go up again.

Modification History

2023-08-22 version 2.0 Change visible option