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.
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.
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.
DMTI change
The local end recounts the transmission interval, and compares it with the current one.
If the recalculated transmission interval and the current transmission interval are equal, the local end does not change the transmission interval.
RMRI change
The local end recounts the detection time, and compares it with the current one.
If the recalculated detection time and the current detection time are equal, the local end does not change the detection time.
Detect Mult change