The BFD (Bidirectional Forwarding Detection) protocol is a set of standard and unified detection mechanism, used to detect and monitor the path in the network or IP route forwarding connection status fast. It provides one universal, standard, medium-independent, and protocol-independent fast fault detection mechanism. It can fast detect the line fault between two devices for the upper-layer protocols, such as routing protocol and MPLS.
BFD can provide the fault detection on any type of path between the systems. One BFD session is set up based on the specific application demand. If multiple application protocols correspond to the same path, you can use one BFD session to detect.
The processing flow of the BFD protocol and the upper application protocol includes:
The upper application protocol sends the neighbor information (including peer IP address, local IP address, interface and so on) to the BFD protocol.
The BFD protocol queries whether there is the corresponding session. If no, create the corresponding session according to the received neighbor information and then the BFD session sends the BFD control packet to drive the running of the status machine. The BFD control packet completes the session via three-time handshake mechanism, experiencing the transfer from Down to Init and from Init to Up. When setting up the session, the session parameters are negotiated, including the interval of sending packets and detection interval.
After the session is set up, send the detection packets periodically to detect the path status. If the BFD control packets of the peer device are not received within the detection interval, the BFD protocol regards that the path has fault and informs the fault information to the upper application protocol.
After the upper application protocol receives the fault report, inform the BFD protocol to delete the session when disabling or deleting the neighbor. If no other upper-layer protocol needs to detect the session link, delete the corresponding session.
According to the type of the detection path, it includes the single-hop IP path detection neighboring with the local end and the peer, and the multi-hop IP path detection not neighboring with the local end and peer. Currently, linking OSPF, RIP, EBGP, ISIS, LDP, RSVP-TE, TRACK, and static route protocols with BFD belongs to the single-hop IP path detection. IBGP linking with BFD belongs to multi-hop IP path detection.