BFD (Bidirectional Forwarding Detection)

bfd-session-establishment

What is BFD?

For networks, failure detection is very important. There are vairous mechanisms used for this purpose. One of them is BFD (Bidirectional Forwarding Detection). In this lesson, we will learn bfd meaning, what is BFD and why we use this mechanism between nodes.

 

BFD is basically another Hello protocol based on UDP that detects link failures on forwarding plane. It runs on top of Layer 2 protocols that is in use between two adjacent systems. You can also view wiki definion for BFD.

 

Bidirectional Forwarding Detection is independent from media, routing protocols and data protocols. By being independant from media, routing protocols and data protocols, BFD mechanism can be used with all routing protocols and data protocols.

 

Routing protocols has an hello mechanism by default to detect the link failures. But this mechanism is differenciate from router to router. With Bidirectional Forwarding Detection, a common link failure detection mechanism created. And this mechanism can be used with all routing protocols. So, using Bidirectional Forwarding Detection mechanism provides a very fast convergence after a link failure if you compare with routing protocol hello mechanism.

 

Bidirectional Forwarding Detection is one way protocol. So tu use this mechanism, you need to configure both ends with this protocol.

 

As you know there are two planes in a network. One of them is control plane, in which, route processing is done. And the other is forwarding plane, in which, the data sending is done after the establishment of the session.


control-plane-forwarding-plane
Bidirectional Forwarding Detection operates in the forwarding plane. It detects the link failures on forwarding plane.

 

Bidirectional Forwarding Detection has two versions. These are Version 0 and Version 1.

 


You can Download Cisco Packet Tracer Labs!


 

BFD Session Establishment

After learning bfd meaning and answering what is BFD question and learnign some general information about it, now, let’s learn BFD Session Establishment. Session establishment is done throught BFD messages. These messages sets the states of both ends as mentioned below:

  • Down
  • Init
  • Up

 

Bidirectional Forwarding Detection has two different Session Establishment modes. This is divided into two according to how is the discriminators that differ Bidirectional Forwarding Detection sessions are configured. What are these Session Establishement modes? These are :

  • Static Session Establishment
  • Dynamic Session Establishment

 

In Static Session Establishment, local and remote discriminators in BFD messages are configured with commands. In Dynamic Session Establishment, this is done by system dynamically. Let’ s check these Session Establishment Steps one by one.

 

As you can below, BFD Session Establishment is done with a three-way handshake. There are three basic steps to establish BFD Session in other words.

 

bfd-session-establishment

  1. Firstly, the two ends are in down state.
  2. When a BFD message comes from one end to the other end, the state field is changed as Init in that end.
  3. When the other end receive this BFD message, the state filed is changed as UP.

 


 

How BFD Works?

Bidirectional Forwarding Detection mechanism uses packets to inform both ends that the protocol is configured. With these packets, it provides basic connectivity and the parameter negotiation.

 

The main role of Bidirectional Forwarding Detection is detecting the link failures by sending BFD packets in regular intervals. It sends the packet and wait. If there is no reply until a certain of time, it determines that the link is down. This is the same as Hello messages.

 

Let’s give an example to understand this mechanism better. Below, there is a topology, that BFD Sessions are also established in each ends. Think about that a traffic is coming from Router 1 to Router 2.

 


bfd-mechanism-example
 

What if the connection between these two routers fails?

 

bfd-mechanism-failure-example
Both end Routers are informed by BFD mecahnism about this link failure. They say that “Link failed! You need to do a new route calculation!”. And after this message, router calculates a new route to the same destination.


bfd-mechanism-after-failure
As you can see above, the traffic is go through the new calculated route, through Router 3.

 

Bidirectional Forwarding Detection has different operation modes. These are :

  • Async Mode
  • Demand Mode
  • Echo Mode

 

In Asyncronous Mode, two end nodes send Conrol Packets each other periodically. If they do not get some of the Control Packets, they decide that there is a failure. In Async Mode, Conrol Packets flow in each direction.


bfd-asyn-mode
In Demand Mode, two end nodes send Control Packets only for a short time to dedect if are there any failure or not. In Demand Mode, Conrol Packets flow in each direction.


bfd-demand-mode
In Echo Mode, Echo Packets also used between two end beside Conrol Packets. Echo packets is used to test forwarding plane not host stack.


bfd-echo-mode

 


 

BFD Applications

AS we mentioned above, Bidirectional Forwarding Detection is used to detect link failure. But, there can be many types of link failures. BFD is generally used to check the below availabilities:

  • Routing Protocol link availability
  • Ethernet Link availability
  • MPLS and GRE Tunnel link availability
  • Edge Network availablity

 


 

Protocols Used With BFD

Bidirectional Forwarding Detection is used with many protocols for link failure detection. These protocols are:

  • Static routes
  • IGPs (OSPF, IS-IS)
  • BGP (eBGP, iBGP)
  • LDP
  • RSVP

 


 

Disadvantages of BFD

Beside the advantages of BFD, it has also some disadvantages. First of all it can have more resource demands. This changes from platform to platform.

 

Secondly, Bidirectional Forwarding Detection is not aware of Layer 2 link bundelling. When you configure it on one link, it operetas for single link, rather than the other bunde member.

 


 

Last Word

We have learned BFD meaning and the details of how it works. This one way protocol is basically a Hello protocol to detect link failures quickly. You will use this key protocol a lot in your networking operations.

 

Lesson tags: BFD
Back to: JNCIE > High Availability

Leave a Reply

Your email address will not be published. Required fields are marked *

JNCIE

Collapse
Expand
Latest Blog Posts