Bidirectional Forwarding Detection (BFD)

BFD (Bidirectional Forwarding Detection) is a super fast protocol that is able to detect link failures within milliseconds or even microseconds.. All (routing) protocols have some sort of mechanism to detect link failures. OSPF uses hello packets and a dead interval, EIGRP uses hello packets and a holddown timer etc.

Networks that use real-time traffic like VoIP require fast convergence times. Routing protocols like OSPF or EIGRP are able to quickly select another path once they lose a neighbor but it takes a while for them to realize that something is wrong.

We can tune timers for fast convergence, for example OSPF can be configured to use a dead interval of only one second. The problem however is that all of these protocols were never really designed for sub-second failover. Hello packets and such are processed by the control plane so there is quite some overhead. BFD was designed to be fast, its packets can be processed by some interface modules or line cards so there isn’t much overhead.

BFD runs independent from any other (routing) protocols. Once it’s up and running, you can configure protocols like OSPF, EIGRP, BGP, HSRP, MPLS LDP etc. to use BFD for link failure detection instead of their own mechanisms. When the link fails, BFD will inform the protocol. Here’s how you can visualize this:

OSPF BFD R1 R2

R1 and R2 are configured to use BFD and will send control packets to each other. OSPF remains the same, it’s sending its OSPF packets. Once the link fails, this will happen:

BFD Informs OSPF Link Failure

 

When BFD doesn’t receive its control packets anymore it realizes we have a link failure and it will report this to OSPF. OSPF will then tear down the neighbor adjacency.

There are two operating modes to BFD, asynchronous mode and demand mode. The asynchronous mode is similar to the hello and holddown timers, BFD will keep sending hello packets (called BFD control packets) and when you don’t receive some of them, the session is teared down.

The demand mode is different, once BFD has found a neighbor it won’t continuously send control packets but only uses a polling mechanism. Another method has to be used to check reachability, for example it could check the receive and transmit statistics of the interface. Right now Cisco (or any other vendor I know of) doesn’t support BFD demand mode.

Both modes also support something called echo mode. When a device sends BFD echo packets then the receiver will return them without processing them. When the sender doesn’t get the echo packets back, it knows something is wrong and will tear down the session.

Anyway enough talk about BFD for now, let’s take a look at this in action!

Configuration

To see why BFD is great, we will look at a scenario with and without BFD. I’ll use OSPF but many other (routing) protocols can be used.

OSPF without BFD

This is the topology that we will use:

BFD R1 SW1 R2

Above we have two routers that are connected to a switch and running OSPF. Here’s the configuration:

R1 & R2
(config)#router ospf 1
(config-router)#network 192.168.12.0 0.0.0.255 area 0

Nothing special, just regular OSPF. Suddenly the link fails:

BFD Link Failure R1 SW1

Here’s what will happen:

R1#
Jul 30 11:54:46.011: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down
Jul 30 11:54:46.011: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.12.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

R1 will detect this link failure right away since it’s directly connected to SW1. It will immediately drop the neighbor adjacency. What about R2?

R2#
Jul 30 11:55:14.667: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.12.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

R2 stops receiving OSPF hello packets from R1 so once the dead interval expires, it decides that R1 is unreachable and it will drop the neighbor adjacency. This took about 28 seconds.

Even if you tune the OSPF timers, it will still take about one second. Let’s see how BFD performs…

OSPF with BFD

Let’s enable BFD on our two routers running OSPF. Here’s the topology again:

R1 SW1 R2

Let’s take a close look at the BFD command:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 657 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

528 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. Hi,

    what are the disadvantages of using bfd.
    also it would be helpful if you post an article on troubleshooting bfd.

  2. BFD does not work in GNS3. I was using 7200 with IOS 15.x. Checking on forums the consensus is a GNS3 bug. Does anyone have a workaround for this?

    Hostname R1
    !
    interface FastEthernet0/0
     ip address 10.0.0.9 255.255.255.252
     ip ospf 10 area 0
     duplex full
     bfd interval 500 min_rx 500 multiplier 3
    !
    router ospf 10
     router-id 10.0.0.1
     bfd all-interfaces
    

    -

    Hostname R2
    !
    interface FastEthernet0/0
     ip address 10.0.0.10 255.255.255.252
     ip ospf 10 area 0
     duplex full
     bfd interval 500 min_rx 500 multiplier 3
    !
    router ospf 10
     router-id 10.0.0.1
     bfd all-interfaces
    
    ... Continue reading in our forum

  3. Hi @tadeosho70,

    With echo mode, this is no problem. The packets you send are echoed back to you. For example, take a look at this output:

    R1(config)#interface FastEthernet 0/0
    R1(config-if)#bfd interval 300 min_rx 300 multiplier 3 
    
    R2(config)#interface FastEthernet 0/0
    R2(config-if)#bfd interval 300 min_rx 600 multiplier 3 
    

    The min_rx is set to 300 on R1 and 600 on R2. Here’s the output of R1 showing the 600 ms of R2:

    R1#show bfd neighbors details 
    
    NeighAddr                         LD/RD    RH/RS     State     Int
    192.168.12.2                       1/1     U
    ... Continue reading in our forum

39 more replies! Ask a question or join the discussion by visiting our Community Forum