High Availability · Topic 4 of 5
Bidirectional Forwarding Detection
Learn BFD for the JN0-364: fast failure detection, minimum-interval and multiplier, detection time, OSPF, BGP and static route clients, and show bfd.
- 5 min
- BFD gives subsecond failure detection for client protocols.
- Configure it with
bfd-liveness-detectioninside OSPF, IS-IS, BGP, static routes and others. - Detection time = interval x multiplier; the default multiplier is 3.
What it is
Bidirectional Forwarding Detection (BFD) is a lightweight hello protocol that detects a failed path between two routers in well under a second. Routing protocol hellos are slow: an OSPF dead interval of 40 seconds means 40 seconds of lost traffic when a neighbor fails silently, for example behind a switch where the local link stays up.
BFD runs alongside a routing protocol, its client. When a BFD session goes down, BFD tells the client straight away, and the client drops the neighbor and reconverges without waiting for its own timers.
How it works
Timers and detection time
Each BFD session has a transmit interval and a multiplier. The detection time is how long a router waits without receiving BFD packets before declaring the session down:
detection time = interval x multiplier
| Setting | Meaning | Junos default |
|---|---|---|
minimum-interval | Sets both the transmit and the receive interval, in milliseconds | No default; you configure it |
minimum-receive-interval | Sets only the receive interval | Not set |
transmit-interval minimum-interval | Sets only the transmit interval | Not set |
multiplier | Missed packets before the session is declared down | 3 |
With minimum-interval 300 and the default multiplier of 3, the detection time is 900 ms. The two ends negotiate: each router sends no faster than the other side is willing to receive, so the slower setting wins.
| minimum-interval | multiplier | Detection time |
|---|---|---|
| 300 ms | 3 | 900 ms |
| 100 ms | 3 | 300 ms |
| 1000 ms | 5 | 5 seconds |
Transport
| Single hop | Multihop | |
|---|---|---|
| Use | Directly connected neighbors (OSPF, IS-IS, EBGP, static routes) | Neighbors several hops away, such as IBGP between loopbacks |
| UDP port | 3784 | 4784 |
BFD needs both ends configured. If only one router runs BFD for a neighbor, no session comes up, and the client protocol works as before with its own timers.
Configuration
BFD is configured inside each client with bfd-liveness-detection.
OSPF on one interface:
user@R1# set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 bfd-liveness-detection minimum-interval 300
user@R1# set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 bfd-liveness-detection multiplier 3
BGP for a group or neighbor:
user@R1# set protocols bgp group EBGP neighbor 10.0.12.2 bfd-liveness-detection minimum-interval 300
A static route, so the route is removed when the next hop stops answering BFD:
user@R1# set routing-options static route 0.0.0.0/0 next-hop 10.0.12.2 bfd-liveness-detection minimum-interval 300
IS-IS, RSVP and other protocols also support BFD under their own configuration. The neighbor must run BFD for the same addresses.
Monitoring
| Command | Shows |
|---|---|
show bfd session | Each session's neighbor, state, interface, detection time, transmit interval and multiplier |
show bfd session extensive | Clients using the session, negotiated timers, and the last state change |
show bfd session address 10.0.12.2 | One session |
user@R1> show bfd session
Detect Transmit
Address State Interface Time Interval Multiplier
10.0.12.2 Up ge-0/0/0.0 0.900 0.300 3
1 sessions, 1 clients
Cumulative transmit rate 3.3 pps, cumulative receive rate 3.3 pps
Here the detection time of 0.900 seconds is the transmit interval of 0.300 seconds times the multiplier of 3.
Troubleshooting checklist
| Symptom | Likely cause |
|---|---|
| No BFD session at all | BFD configured on one side only, or the client protocol neighbor is not up |
| Session stuck in Down or Init | A filter blocks UDP 3784 (or 4784 for multihop), or the addresses do not match |
| Session flaps under load | Intervals too aggressive for the platform or the path |
| Detection time longer than configured | The neighbor's slower setting won the negotiation |
To answer a detection time question, multiply the negotiated interval by the multiplier. If the two routers have different intervals, use the slower one.
Common mistakes
Thinking BFD replaces the routing protocol. BFD only detects failures. It has no routes and needs a client such as OSPF, BGP or a static route.
Configuring BFD on one side. Both routers must run BFD for the session to come up.
Assuming a default interval. minimum-interval has no default; it must be configured. Only the multiplier has a default of 3.
Using single hop settings for IBGP between loopbacks. That is a multihop session on UDP 4784.
Very short intervals can cause false failures when the router is busy, which then cause the routing protocol to flap. Use intervals the platform supports reliably.
What to remember for the exam
- BFD gives subsecond failure detection for client protocols.
- Configure it with
bfd-liveness-detectioninside OSPF, IS-IS, BGP, static routes and others. - Detection time = interval x multiplier; the default multiplier is 3.
minimum-intervalsets transmit and receive intervals and has no default.- Single hop BFD uses UDP 3784; multihop uses UDP 4784.
- Both ends must run BFD; the slower setting wins the negotiation.
- Verify with
show bfd session.
Check yourself
BFD runs with
minimum-interval 200and the default multiplier. What is the detection time?600 ms, because the default multiplier is 3.
A static route has BFD configured and the next hop stops answering BFD. What happens to the route?
It is removed from the routing table, so a backup route, if any, can take over.
Only R1 has BFD configured for its OSPF neighbor R2. What happens?
No BFD session comes up, and OSPF keeps working with its normal hello and dead timers.
Topic 4 of 5 in High Availability
Test yourself on High Availability
The full Juniper JNCIS-SP JN0-364 question bank has 860 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.