BFD: noticing a dead neighbor in milliseconds
When a neighbour's cable is pulled behind a switch, your own link stays up, so the routing protocol waits for its hold timer. Faster hellos have their own costs. Bidirectional Forwarding Detection detects the loss in milliseconds and tells the routing protocols, which then reroute: BFD routes nothing itself. Its timers are an interval, a min_rx and a multiplier.
By Arif, founder of Daveth · Updated
The full 11 min walkthrough is in Daveth Pro (Network). See what the plan opens
What this page answers
What is BFD (Bidirectional Forwarding Detection)?
A detection protocol that notices a dead neighbour in milliseconds and tells the routing protocols listening to it, which do the rerouting. It routes nothing itself. Read it in “BFD routes nothing”
How do you configure BFD for EIGRP?
Set the timers on each interface with bfd interval 50-999 min_rx 1-999 multiplier 3-50, then enable BFD for EIGRP with bfd interface in router EIGRP configuration mode. Read it in “Three numbers, and whose they are”
The link that stays up
Start a stopwatch. R1 and R2 are EIGRP neighbors, and between them there isn't one cable but two, with a switch in the middle. R2's cable to that switch has just been pulled. R1's own cable still has light, its interface is up, its line protocol is up.
R2 notices at once. When a link fails and the interface goes down, every neighbor attached to that interface goes down with it. No clock is involved. That's the EIGRP convergence lesson's case: detection takes no time.
R1 can't know that way. In some environments no carrier detect signaling is available to tell a router quickly that the link between it and its neighbor is down. R1's interface is talking to a healthy switch port, so its interface has nothing to report. When the failure isn't on the directly connected interface, the router has to rely on the routing protocol's keepalives to decide whether the far end is still reachable. For R1, that's EIGRP's hold timer: 15 seconds by default on links faster than a T1, three times the 5-second hello, reset by every hello that arrives; when it reaches zero, the neighbor is declared unreachable and DUAL is told.
So the two ends of one dead link disagree, for up to 15 seconds. R2 has already moved on. R1 is still sending traffic for R2 into a switch port that leads nowhere.
Call the problem loss-of-signal detection. Loss of signal is what carrier detect signaling reports: the link itself telling the interface that the far end has gone, so the interface goes down with no clock involved, the way R2's did. Three common places it goes missing: a Layer 2 switched network between the routers, DWDM gear that doesn't pass loss of signal through, and tunnels. Each one puts something between the router's interface and the failure, so the signal never reaches the router.

Three ways to put something between R1 and the failure. In each, R1's interface stays up, and only a missing packet can tell it.
The tunnel case gets one line here, because it belongs to the DMVPN lessons: a tunnel interface can keep its line protocol up while the hub behind it has been declared down.
How long is too long? Relying on keepalives can take an unacceptably long time by today's standards, and the standard example is OSPF, which by default waits 40 seconds to declare a neighbor down. That's the OSPF lesson's dead interval, four times the hello; when it reaches zero the neighbor goes down, the LSA goes out and SPF runs. Forty seconds is the default on broadcast and point-to-point networks; on nonbroadcast and point-to-multipoint ones the dead timer defaults to 120.
Why not just turn the hellos down?
The obvious fix: set the hello and keepalive timers to a very short interval. Try it on EIGRP. Hello 1, hold 3, and any neighbor problem is detected within 3 seconds, and convergence follows. Five times better than 15.
It has two problems. Fast hellos don't always bring detection down to a level where the network can route around the problem before time-sensitive applications notice the failure. Three seconds of dead air is a long time on a voice call. And fast hellos can tax the router's CPU, and they don't scale well as the number of neighbor sessions grows. In the EIGRP case, 1 and 3 might still not be quick enough, and the extra CPU for all those additional hellos might not be acceptable.
BGP shows the floor plainly. Its hold time has to be at least 3 seconds, or 0 to switch keepalives off, and the default is 180 with a keepalive every 60. However hard you push it, BGP's own clock can't notice a dead neighbor in under about 2 seconds, by our arithmetic: a 3-second minimum and a keepalive every third of it. Pushing it that far has a second cost. The two routers use the smaller of the hold times they offer, so a 3-second hold on your side is forced on the provider too, and a provider can refuse a hold time that short.
So the routing protocol's clock can be wound faster, but not fast enough, and every turn of it is paid for in hello packets on every neighbor.
The race
Here's the lab. R1 and R2 are EIGRP neighbors in AS 100 through a switch, R1 at 10.0.0.1 and R2 at 10.0.0.2 on 10.0.0.0/24, with R1's LAN 10.0.1.0/24 (R1 at 10.0.1.1) and R2's 10.0.2.0/24 (R2 at 10.0.2.1). The EIGRP timers are at their defaults of 5 and 15. And R1 and R2 are using BFD to keep track of reachability: BFD packets go every 100 milliseconds, and if three in a row are missed, BFD declares the session failed and notifies EIGRP.

The lab: two EIGRP neighbors through a switch, with BFD at 100 ms and 3 beside EIGRP's 5 and 15.
The case for BFD is this lab. Leave EIGRP at 5 and 15, and let the lightweight BFD packets keep track of the connection between the two routers. If anything happens to that connection, BFD notifies its client, EIGRP here, so EIGRP can converge without waiting for its hold timer to expire. BFD can provide failure detection in milliseconds, with minimal to no overhead, meaning small, cheap packets: it still sends a lot of them, as you'll see. Its timers can be set to subsecond values, which makes it possible to detect failures far faster than any routing protocol can.
Now race them: five clocks side by side, each starting when R2's cable is pulled. EIGRP at its defaults, EIGRP at 1 and 3, OSPF at 10 and 40 (the Hello 10 and Dead 40 of the OSPF lesson's interface output), BGP at 60 and 180, and BFD at the lab's 100 milliseconds and 3.
The step rule first. Every one of these clocks is reset when a packet arrives from the neighbor, and runs down when nothing arrives. So after the failure, each one runs out at its full time minus however long ago its own last packet came. Each kind of packet keeps its own schedule, so that "how long ago" is a separate number for each clock. BFD's full time on this lab is three packets of 100 milliseconds, 300 milliseconds. A router whose own interface went down doesn't wait for any clock at all. And a protocol that registered with BFD is notified when BFD fires, so it can converge without waiting for its own clock; the race draws that as the protocol dropping its neighbor at BFD's moment, which is our reading of "notified" (next section).

The answers. Cut 99 milliseconds after the last BFD packet, BFD fires at 300 less 99, 201 milliseconds, and R1's EIGRP drops R2 then; on its own clock it would have waited 15 seconds less 4.95, 10.05. R2 drops R1 at once, because its own interface went down. Pulled just after every packet, it's 300 milliseconds against 15 seconds; pulled just before each was due, each clock loses up to one interval: EIGRP just over 10 seconds, OSPF just over 30, BFD just over 200 milliseconds. Detection isn't a number, it's a window: from the full time minus one interval, up to the full time. That's why 1-and-3 hellos are said to detect a problem "within" 3 seconds. And unregistered, EIGRP waits its 15 seconds. Whether BFD even runs a session for nobody is the next section.
So is BFD cheaper because it sends less? No. At 100 milliseconds, each router sends ten BFD packets a second to each neighbor; EIGRP at 1-second hellos sends one. "Lightweight" is about the packet, not the count. BFD is a lightweight protocol with small fixed-length packets, which makes it less CPU intensive than fast routing protocol hellos. It's less CPU intensive because BFD packets are smaller and quicker to process than EIGRP's, and on distributed routing platforms it's more efficient still, because the line cards process the BFD packets instead of punting them to the CPU.
BFD routes nothing
Look again at the race. When BFD fired, R1's EIGRP was told. Which of the two rerouted R1's traffic: BFD, or EIGRP?
EIGRP. BFD routes nothing: it only shouts, very fast, and the routing protocols listening to it do the rest. It's a detection protocol, and that's meant literally: it works with all media types, routing protocols, topologies and encapsulations, and its job is to detect reachability failures between two routers in the same Layer 3 network quickly, so the problem is identified as soon as possible and convergence happens far faster. The convergence is somebody else's. When BFD declares the session down it notifies its client, and EIGRP converges. RFC 5882 says how a protocol with no other way to signal a dead path should react: a control protocol timeout should be emulated for that neighbor (§4.2.1). For EIGRP that's the neighbor dropped and DUAL recomputing, as if the hold timer had run out; that a current router does exactly that, we haven't confirmed. RFC 5882 puts the relationship plainly: BFD's role is advisory, and the clients use their own existing mechanisms to react. EIGRP doesn't learn anything new from BFD except "now".
Two edges on that line, and neither moves it. The listeners needn't be routing protocols: RFC 5882 lets other functions use a session too, its example a static route withdrawn when the session isn't Up; this lesson uses only routing protocols. And "very fast" is a setting, not a property: how promptly BFD notices is traded against protocol overhead and system load, and the lab's 300 milliseconds is a value someone chose. Whoever is listening, and however fast the shout, the rerouting is still somebody else's.
The shout has a limit, and it's the part people get wrong. BFD doesn't shout to the room. It tells only the protocols that asked it to watch that neighbor (RFC 5882 §2). And it can't find a neighbor on its own: there's no discovery mechanism in BFD, so the application decides it wants a session and supplies the address (RFC 5880 §3.1). The RFC's own example is OSPF asking for a session to a neighbor it found with its hellos. That's the unregistered question from the race, with its last piece: no client, no session at all, and EIGRP back on its 15 seconds.
So the wiring goes in two directions. The routing protocol registers a neighbor with BFD; BFD watches it and calls back when it goes. Several protocols can share one session to the same neighbor: an implementation should run only one BFD session per path for each data protocol, however many applications use it, and notifies all of them, and protocols wanting a session to the same system for the same data protocol must share it (RFC 5882 §2, §4.4).
For EIGRP it's two lines. You enable BFD on the interfaces taking part in EIGRP with bfd interface interface-type interface-number in router EIGRP configuration mode, and you set BFD's timers interface by interface with bfd interval [50-999] min_rx [1-999] multiplier [3-50]. The lab, written out (the interface name and min_rx are ours):
! R1 (R2 the same, with 10.0.0.2) interface GigabitEthernet0/0 ip address 10.0.0.1 255.255.255.0 bfd interval 100 min_rx 100 multiplier 3 ! router eigrp 100 bfd interface GigabitEthernet0/0
One line for BFD's timers and one for the client. Other protocols register their own way; for a BGP neighbor the form is neighbor ip-address fall-over bfd, which our network's case uses.
Two things come before BFD. CEF and IP routing must be enabled on all participating routers. And the IP routing protocols BFD supports must be configured on the routers before BFD is deployed: the wiring again, as we read it, no client and nothing to watch. For the first, show ip cef and show ipv6 cef print the CEF table when CEF is running, and %IPv4 CEF not running or %IPv6 CEF not running when it isn't.
What the configuration proves, briefly. bfd interface in the running configuration proves EIGRP was told to use BFD on that interface, not that a session is up. show bfd neighbors would prove there's a session to that neighbor and its state, not which protocols will be told; its details form lists the registered protocols. And none of them proves that traffic moves. After a failure, the neighbor list proves the neighbor was dropped; show ip route proves the new path is installed; only a traceroute shows the traffic took it.
The detector, in other words, knows first and does nothing. That's the design.
Three numbers, and whose they are
bfd interval takes three values, defined like this. The interval is how often, in milliseconds, to send a BFD packet. The min_rx value is described as how long in milliseconds to wait to receive a BFD packet. And the multiplier is how many consecutive packets not received will trigger a failure. The standard example: min_rx 200 and multiplier 3, and BFD only triggers a failure notification after 600 milliseconds, 200 times 3.
Now one with two different ends.
No, not 600. R1 can't miss three packets in 600 milliseconds when they're 300 apart. The 600 example is the symmetric case written short. RFC 5880 computes the detection time at the receiving end from both ends' values: the multiplier the remote system sends, times the greater of the local router's minimum receive interval and the remote router's desired transmit interval (§6.8.4). Map the three keywords onto those fields by their names (interval to desired transmit, min_rx to minimum receive, multiplier to the detect multiplier) and R1's detection time is 3 times the greater of 200 and 300: 900 milliseconds. Whether a current router does its own arithmetic that way, we haven't confirmed. So min_rx isn't a wait. It's the fastest rate this router says it can receive; the wait comes out of the arithmetic.
Two more things fall out of the rule. The multiplier that counts at R1 is R2's, the one R2 sends: give R2 multiplier 5 against R1's 3, both at 200, and R1 waits 1000 milliseconds while R2 still waits 600. And each direction is its own: the detection time is calculated independently by each receiver, and may differ in the two directions. In the lab both ends match, so both directions get 300.
The 600 example is right whenever both ends are the same and nobody sends slower than min_rx; when they differ, ask what the far end sends. Run all three cases, then set each end yourself.

Continue the lesson
The whole lesson, with its drawings and its questions. 3 more sections after the ones above.





