Glossary

What is BFD?

BFD (RFC 5880) is a lightweight protocol that detects path failures in milliseconds, independent of BGP or OSPF, so the network reconverges fast.

Last updated:

BFD (Bidirectional Forwarding Detection) is a lightweight protocol defined in RFC 5880 that detects a failure in the forwarding path between two routers in milliseconds. It runs independently of routing protocols such as BGP or OSPF and is a shared, fast failure-signalling mechanism. The routers exchange very frequent, small control packets. When that stream stops, BFD immediately tells the associated protocol that the neighbour is unreachable, and traffic fails over to a backup path in under a second.

Why BFD is used

Routing protocols on their own detect a neighbour failure slowly because they rely on their own hold timers. By default BGP waits 180 seconds and OSPF 40 seconds before declaring a neighbour dead. When a failure does not bring down the physical signal (for example a break behind a switch, a one-way optical fault, or a problem on an MPLS path), the router gets no link-layer signal and keeps forwarding traffic into a black hole for tens of seconds. BFD removes that delay by providing a uniform, fast failure signal regardless of the medium or protocol.

How BFD works

Two routers establish a BFD session and exchange control packets at a fixed, negotiated rate. Each side declares its transmit interval, and a failure is declared when no packet arrives for a set multiple of that interval (the detect multiplier, typically 3). Its key operating characteristics are:

  • Protocol independence: a single BFD session can serve BGP, OSPF, IS-IS and static routes at the same time (RFC 5882).
  • Very low intervals: typically 50 to 300 ms, which with a multiplier of 3 yields sub-second failure detection.
  • Operating modes: asynchronous (continuous packet exchange) and Echo, where the packet is looped back by the neighbour.
  • Lightweight: small UDP packets and a simple state machine put minimal load on the link and the CPU.
  • Single-hop (RFC 5881) for directly connected links and multihop (RFC 5883) for sessions across several hops.

BFD paired with BGP and OSPF

BFD does not replace the routing protocol; it speeds up its reaction. Once enabled on a BGP session or an OSPF adjacency, the protocol registers as a BFD client and stops waiting for its own hold timer. When BFD detects a broken path it reports the event immediately, the protocol withdraws the routes and shifts traffic to the alternative. This cuts failover time from tens of seconds to a fraction of a second. Intervals must be chosen carefully, though, because overly aggressive values can cause false alarms during brief CPU load or momentary packet loss, so in practice operators usually enable dampening.

BFD and AS202520 SkyPass

On BGP sessions with AS202520 SkyPass we can agree on BFD to cut link-failure detection from minutes to a fraction of a second. This matters especially for operators in a multihoming setup. We enable it on IP transit links and, where the topology allows, on peering sessions in our Warsaw and Wrocław PoPs and on remote access to Polish IXPs (THINX, TPIX, WRIX, POZIX, 1-IX). We tune the session parameters together, balancing failover speed against stability.

Frequently asked questions

Does BFD replace BGP or OSPF?

No. BFD only detects a path failure quickly and reports it to the routing protocol. BGP or OSPF still make the routing decisions, but they react far faster.

How fast does BFD detect a failure?

Usually under a second. With an interval of 50 to 300 ms and a multiplier of 3 a failure is detected in 150 to 900 ms, instead of the 40 s (OSPF) or 180 s (BGP) of the default hold timers.

What is the detect multiplier?

It is the number of consecutive missed control packets after which the session is declared down. The default is 3, so detection time is roughly the transmit interval multiplied by 3.

Does BFD work across multiple hops?

Yes. RFC 5881 defines the single-hop variant for directly connected links, and RFC 5883 defines the multihop variant, which lets a session run between routers several hops apart, for example for multihop BGP.

Related articles