< Home

BFD Mechanism

This section describes the BFD mechanism, including detection mode, detection time and detection parameter negotiation.

In the BFD mechanism, a BFD session is established between two systems, and BFD control packets are sent periodically along the path. If one system does not receive any BFD control packets in a certain period, it is regarded that a fault occurs on the path.

BFD control packets are encapsulated in UDP packets for transmission. At the beginning of a session, two systems negotiate with each other through the parameters (including the session identifier, minimum expected packet sending/receiving interval, and BFD session status on the local end) in BFD control packets. After the negotiation succeeds, BFD control packets are transmitted along the path on the basis of the negotiated packet sending/receiving interval.

To ensure fast detection, the packet sending/receiving interval is specified to the microsecond level by the BFD protocol. Limited by device processing capability, BFD only reaches the millisecond level on the devices of most vendors, and is further converted to the microsecond level during internal processing.

Detection Mode

BFD supports the following detection modes:
  • Asynchronous mode

    In this mode, two systems periodically transmit BFD control packets to each other on the basis of the negotiated packet sending/receiving interval. If one system does not receive any BFD control packets from the other system in the detection period, it is regarded that the BFD session is Down. The asynchronous mode is the most frequently used BFD mode.

  • Demand mode

    In this mode, once a BFD session is established, the system does not periodically send BFD control packets. Instead, other detection mechanisms (such as the Hello mechanism of routing protocols and hardware detection mechanism) are adopted to reduce the costs caused by BFD sessions. In demand mode, there is a timer in the system. When the timer expires, the system sends a query packet with short sequence to check the link. If the system does not receive the reply packet, it is regarded that the session is Down.

A supplementary function for the previous modes is the echo function. When the echo function is enabled, a BFD control packet is transmitted in this method: The local system sends a BFD control packet, and the remote system loops it back through the forwarding channel. If none of several consecutive echo packets is received, it is regarded that the BFD session is Down. The echo function can interwork with the asynchronous mode or demand mode.

Currently, the system supports only the passive echo function for the one-hop session in asynchronous mode. If devices supporting the echo function are available on the network, you need to configure the BFD passive echo function on the device to enable its compatibility with other devices. When the device enters the passive echo mode, the interval for transmitting BFD control packets is increased. The devices on both ends of the BFD session send the BFD echo packets (the source and destination IP address are both the IP address of the outbound interface on the local end) which returns to the local end through ICMP redirection. In this way, the link status is checked.

Detection Time

The BFD time is determined by the following three values:
  • Desired Min Tx Interval (DMTI): the minimum interval for the transmission of BFD control packets desired by the local end
  • Required Min Rx Interval (RMRI): the minimum interval for the reception of BFD control packets required by the local end
  • Detect time multiplier (Detect Mult): the detect time multiplier

After one system receives the BFD control packet from the peer end, it compares the RMRI attached in the packet with the local DMTI, and uses the larger value as the interval for the transmission of BFD control packets. That is, the system with a slower speed determines the transmission rate of BFD control packets.

The value of Detect Mult is not negotiated. It is configured by the two systems on both ends.

The detection time in asynchronous mode equals to the value of the received Detect Mult from the peer end times the larger value of the local RMRI and the received DMTI.

The detection time in demand mode equals to the value of the local Detect Mult times the larger value of the local DMTI and the received RMRI.

For example, the value of the local RMRI is 400 milliseconds; the value of the local DMTI is 300 milliseconds; the value of the received DMTI is 300 milliseconds, the value of the received RMRI is 400 milliseconds, the value of the received Detect Mult is 4, and the value of the local Detect Mult is 5.

The detection time in asynchronous mode = 4 x maximum (400 milliseconds and 300 milliseconds) = 1600 milliseconds. And the detection time in demand mode = 5 x maximum (300 milliseconds and 400 milliseconds) = 2000 milliseconds.

The values of DMTI, RMRI, and Detect Mult can be configured independently. Therefore, the two systems may differ in the transmission rate of BFD control packets.

You are advised to configure the same value on both ends for hardware using the same transmission medium.

Detection Parameter Negotiation

After a BFD session is established, you can dynamically modify the detection parameters, without changing the current session status. After you modify the detection parameters, the device performs the following actions:
  • DMTI change

    1. The local end immediately sends a BFD control packet (carries a new DMTI) with P bit as 1 in the transmission interval.
    2. The local end recounts the transmission interval, and compares it with the current one.

      If the transmission interval needs to be changed to a smaller value, the following occurs:
      • The local end immediately restarts the sending timer, and sends BFD control packets with P bit as 1 based on the new transmission interval.
      • After receiving the BFD control packet with P bit as 1, the peer end replies a BFD packet with F bit as 1. The peer end recounts the detection time, restarts the detection timer immediately, and detects the link based on the new detection time.
      • After receiving the BFD packet with F bit as 1 from the peer end, the local end stops sending BFD control packets with P bit as 1.
      If the transmission interval needs to be changed to a larger value, the following occurs:
      • The local end sends BFD control packets (carries a new DMTI) with P bit as 1 based on the current transmission interval.
      • After receiving the BFD control packet with P bit as 1, the peer end replies a BFD packet with F bit as 1. The peer end recounts the detection time, restarts the detection timer immediately, and detects the link based on the new detection time.
      • After receiving the BFD packet with F bit as 1 from the peer end, the local end stops sending BFD control packets with P bit as 1. The local end restarts the sending timer, and sends BFD control packets based on the new transmission interval.

      If the recalculated transmission interval and the current transmission interval are equal, the local end does not change the transmission interval.

  • RMRI change

    1. The local end immediately sends a BFD control packet (carries a new RMRI) with P bit as 1 in the transmission interval.
    2. The local end recounts the detection time, and compares it with the current one.

      If the detection time becomes greater, the following situation occurs:
      • The local end restarts the detection timer, and detects links based on the new detection time. The local end continues sending BFD control packets (carries a new RMRI) with P bit as 1.
      • After receiving the BFD control packets with P bit as 1, the peer end immediately replies a BFD control packets with F bit as 1, recounts the transmission interval, and restarts the sending timer.
      • After receiving the BFD packet with F bit as 1 from the peer end, the local end stops sending BFD control packets with P bit as 1.
      If the detection time becomes smaller, the following occurs:
      • The local end sends BFD control packets (carries a new RMRI) with P bit as 1 based on the current transmission interval.
      • After receiving the BFD control packets with P bit as 1, the peer end immediately replies a BFD control packets with F bit as 1, recounts the transmission interval, and restarts the sending timer.
      • After receiving the BFD packet with F bit as 1 from the peer end, the local end stops sending BFD control packets with P bit as 1, updates the detection time, and restarts the detection timer.

      If the recalculated detection time and the current detection time are equal, the local end does not change the detection time.

    3. Detect Mult change

      1. The local end immediately sends a BFD control packet (carries a new detect time multiplier) with P bit as 1 in the transmission interval. The new detect time multiplier is attached in every packet from then on.
      2. After receiving the BFD control packet, the peer end recounts the detection time, and detects links based on the new detection time.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >