< Home

Understanding BFD

BFD Implementation

Two network devices establish a BFD session to monitor the path between them and serve upper-layer applications. BFD does not provide neighbor discovery. Instead, BFD obtains information about neighbors from the upper-layer applications it serves. After two devices establish a BFD session, devices periodically send BFD packets. If a device does not receive a response within a set time limit, the device considers the forwarding path faulty. BFD will then notify the upper-layer protocol. The following figure shows how Open Shortest Path First (OSPF) and BFD can be used together to create a BFD session.

Figure 1 BFD session setup

OSPF and BFD are configured on SwitchA and SwitchB. Following the steps in Figure 1, a BFD session is established:

  1. OSPF uses the Hello mechanism to discover neighbors and establishes a neighbor relationship.

  2. OSPF notifies BFD of neighbor information including source and destination addresses.

  3. BFD sets up a BFD session based on received neighbor information.

  4. After the BFD session is established, BFD starts to monitor link faults, responding quickly to faults.

Figure 2 BFD detecting link faults

Following the steps in Figure 2, once a faulty link is detected:

  1. The BFD session is considered Down.

  2. BFD notifies the local OSPF process that the neighbor is unreachable.

  3. The local OSPF process ends the OSPF neighbor relationship.

BFD Session Establishment

BFD sessions can be established in either static or dynamic mode. Static and dynamic BFD sessions differ in that local and remote discriminators are configured differently. BFD sessions are differentiated by local and remote discriminators in control packets.

  • Static establishment

    BFD session parameters, including the local and remote discriminators, are manually specified. A request for BFD session establishment is distributed manually.

  • Dynamic establishment

    When a BFD session is established dynamically, the system processes the local and remote discriminators as follows:

    • Dynamically allocated local discriminator

      When an application triggers the establishment of a dynamic BFD session, the system sets the local discriminator of the BFD session. Then the local system sends a BFD control packet with a remote discriminator of 0 to the remote system for BFD session negotiation.

    • Self-learned remote discriminator

      When one end of a BFD session receives a BFD control packet with the remote discriminator of 0, it checks the BFD control packet. If the packet matches the local BFD session, this end learns the value of the local discriminator in the received BFD control packet to obtain the remote discriminator.

BFD Detection Mechanism

Two systems establish a BFD session and periodically send BFD control packets along the path between them. If one system does not receive BFD control packets within a specified period, the system considers the path faulty.

In asynchronous mode, two systems periodically send BFD control packets to each other. If one system receives no packets consecutively, the system considers the BFD session Down.

BFD Session Management

The BFD session has the following statuses: Down, Init, Up, and AdminDown. The State field of a BFD control packet shows the session status. The system changes the session status based on the local session status and the received session status of the peer. The BFD state machine implements a three-way handshake for BFD session setup or deletion to ensure that the two systems detect the status change. The following shows BFD session establishment to describe the state machine transition process.

Figure 3 BFD session setup
  1. SwitchA and SwitchB each start BFD state machines. The initial status of BFD state machine is Down. SwitchA and SwitchB send BFD control packets with the State field set to Down. If BFD sessions are configured statically, the values of Remote Discriminator in BFD packets are specified. If BFD sessions are configured dynamically, the value of Remote Discriminator is 0.

  2. After receiving the BFD packet with the State field set to Down, SwitchB switches the session status to Init and sends a BFD packet with State field set to Init.

  3. After the local BFD session status of SwitchB changes to Init, SwitchB no longer processes the received BFD packets with the State field set to Down.

  4. The BFD session status change on SwitchA is similar to that on SwitchB.

  5. After receiving the BFD packet with the State field set to Init, SwitchB changes the local BFD session status to Up.

  6. The BFD session status change on SwitchA is similar to that on SwitchB.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >