BFD functions as a simple "Hello" protocol. It is similar to the adjacency test of a routing protocol in many aspects.
Two systems periodically send BFD packets on the path between them. If one system does not receive any BFD packet from its peer within the detection period, the system considers that the bidirectional path to its peer is faulty. Under some conditions, systems need to negotiate the sending and receiving rates to reduce the load.
BFD is classified into static BFD and dynamic BFD.
BFD uses the local discriminator and remote discriminator to differentiate multiple BFD sessions between the same pair of systems.
Static BFD
In static BFD, BFD session parameters including local and remote discriminators are set through commands, and the requests for establishing BFD sessions are manually delivered.
Dynamic BFD
In dynamic BFD, the establishment of BFD sessions is triggered by routing protocols. The local discriminator is dynamically assigned, and the remote discriminator is learned by a routing protocol.
In BFD for IS-IS, the establishment of a BFD session is dynamically triggered by IS-IS instead of being performed manually. When detecting a fault, BFD notifies IS-IS of the fault through the RM module. IS-IS then sets the status of the associated neighbor relationship to Down, rapidly advertises the changed Link State PDU (LSP), and performs incremental SPF. In this manner, fast route convergence is implemented.
Generally, the interval for sending Hello packets is set to 10s. The interval for advertising that a neighbor is Down, that is, the Holddown time for keeping the neighbor relationship, is three times the interval for sending Hello packets. If a router does not receive any Hello packet from its neighbor within the Holddown time, the router deletes the associated neighbor relationship.
A router can detect a neighbor fault at only the second level. As a result, a large number of packets may be lost on a high-speed network.
BFD, which can provide link fault detection of light load and high speed (in milliseconds), is introduced to solve the preceding problem.
BFD can provide millisecond-level fault detection. BFD does not take the place of the Hello mechanism of IS-IS, but works with IS-IS to more quickly detect the faults that occur on neighboring devices or links, and instructs IS-IS to recalculate routes to correctly guide packet forwarding.
In static BFD, BFD session parameters including local and remote discriminators are set through commands, and the requests for establishing BFD sessions are manually delivered.
In this mode, the creation and deletion of BFD sessions need to be triggered manually, which is inflexible. Moreover, manual configuration errors may occur, for example, the local discriminator and the remote discriminator are incorrectly configured, which causes the abnormal functioning of the BFD session.
In dynamic BFD, the establishment of BFD sessions is triggered by routing protocols. The establishment of a BFD-for-IPv4 session is triggered by IS-IS when an IPv4 neighbor relationship is set up.
When setting up a new neighbor relationship, IS-IS sends parameters of the neighbors and detection parameters (including source and destination IP addresses) to BFD. BFD then sets up a session according to the received parameters. Dynamic BFD is more flexible than static BFD.
The RM module provides related services for the association with the BFD module for IS-IS. Through RM, IS-IS instructs BFD to set up or tear down BFD sessions by sending notification messages. In addition, BFD events are transmitted to IS-IS through RM.
Conditions for setting up a BFD session
Basic IS-IS functions are configured on each router and IS-IS is enabled on the interfaces of the routers.
Process of setting up a BFD session
P2P network
After the conditions for setting up a BFD session are satisfied, IS-IS instructs BFD through RM to directly set up a BFD session between neighbors.
Broadcast network
After the conditions for establishing BFD sessions are met, and the DIS is elected, IS-IS instructs BFD through RM to establish a BFD session between the DIS and each router. No BFD session is established between non-DISs.
On a broadcast network, the routers (including non-DIS routers) of the same level on the same network segment can set up neighbor relationships. In the implementation of IS-IS BFD, however, BFD sessions are set up between the DIS and non-DIS devices rather than between non-DISs. On a P2P network, BFD sessions are directly set up between neighbors.
If a Level-1-2 neighbor relationship is set up between two routers on a link, IS-IS sets up two BFD sessions for the Level-1 neighbor and the Level-2 neighbor on a broadcast network, but sets up only one BFD session on a P2P network.
Conditions for tearing down a BFD session
P2P network
When a neighbor relationship set up on P2P interfaces by IS-IS is torn down (that is, the neighbor relationship is not in the Up state) or when the IP protocol type of a neighbor is deleted, IS-IS tears down the BFD session.
Broadcast network
When a neighbor relationship set up on P2P interfaces by IS-IS is torn down (that is, the neighbor relationship is not in the Up state) when the IP protocol type of a neighbor is deleted, or when the DIS is re-elected, IS-IS tears down the BFD session.
When the configurations of a dynamically established BFD session are deleted or BFD for IS-IS is disabled on an interface, all BFD sessions to which neighbor relationships between devices or between devices and the DIS correspond on the interface are deleted.
After dynamic BFD is globally disabled in an IS-IS process, the BFD sessions on all the interfaces in this IS-IS process are deleted.
BFD detects only one-hop links between IS-IS neighbors, because IS-IS establishes only one-hop neighbor relationships.
Response to the Down event of a BFD session
When detecting a link failure, BFD generates a Down event, and then notifies RM of the event. RM then instructs IS-IS to delete the neighbor relationship. IS-IS recalculates routes to speed up route convergence on the entire network. After BFD for IPv4 informs IS-IS of the link failure, IS-IS changes only the IPv4 route.
When a router and its neighbor are Level-1-2 routers, they set up two neighbor relationships, that is, the Level-1 neighbor relationship and the Level-2 neighbor relationship. Then, IS-IS sets up two BFD sessions for the Level-1 neighbor relationship and the Level-2 neighbor relationship. In this case, the RM module deletes the neighbor relationship of a specific level.
BFD needs to be configured according to the actual network environment. If timer parameters are set improperly, network flapping may occur.
BFD for IS-IS can fast sense link changes to implement route convergence.
The configuration requirements are as follows:
Enable IS-IS on the FWs, as shown in Figure 1.
Thus, when the link between FW_A and FW_B becomes faulty, BFD can fast detect the fault and then notify it to IS-IS. IS-IS then turns the neighbor relationship on the interface Down and deletes the IP protocol type to which the neighbor relationship corresponds, which triggers route calculation. In addition, IS-IS updates LSPs so that the neighbors such as FW_C can receive updated LSPs from FW_B. Fast convergence of IS-IS is thus implemented.