-
Notifications
You must be signed in to change notification settings - Fork 2
bfd
Pre-Alpha. This page describes behavior that may change.
Ze includes a full BFD implementation (RFC 5880/5881/5882/5883) as a plugin. BFD detects forwarding failures in tens to hundreds of milliseconds, one or two orders of magnitude faster than BGP keepalives. BGP peers opt in by adding a bfd { } block in their connection config.
| Scenario | BFD value |
|---|---|
| eBGP transit session | Sub-second failure detection without waiting for BGP hold time (default 90 s). |
| iBGP over a loopback | Multi-hop BFD can accelerate route reconvergence if the IGP alone is too slow. |
| Static route to a gateway | Withdraw the route when the gateway stops forwarding, even if the physical link is up. |
Do not use BFD between two routers where the IGP already runs fast BFD. The redundant sessions double the packet rate and can amplify instability.
Profiles are named bundles of timer and feature parameters. Sessions reference a profile by name.
bfd {
profile fast-link {
desired-min-tx-us 50000; # 50 ms
required-min-rx-us 50000;
detect-multiplier 3; # 150 ms detection time
}
profile ibgp-loopback {
desired-min-tx-us 300000;
required-min-rx-us 300000;
detect-multiplier 5;
}
}
All interval fields are in microseconds (RFC 5880 convention).
| Leaf | Range | Default | Meaning |
|---|---|---|---|
desired-min-tx-us |
1 - 4294967295 | 300000 | Local target transmit rate. |
required-min-rx-us |
0 - 4294967295 | 300000 | Minimum inter-packet gap the local end can handle. |
detect-multiplier |
1 - 255 | 3 | Consecutive missed packets that trigger Down. |
passive |
boolean | false | Wait for the peer's first packet instead of transmitting from creation. |
Profiles may carry an auth { ... } block for RFC 5880 S6.7 authentication. Four types are supported: keyed-md5, meticulous-keyed-md5, keyed-sha1, and meticulous-keyed-sha1. Simple Password is refused at config parse time.
bfd {
persist-dir "/var/lib/ze/bfd";
profile authenticated-fast {
desired-min-tx-us 50000;
required-min-rx-us 50000;
detect-multiplier 3;
auth {
type meticulous-keyed-sha1;
key-id 7;
secret "BFD-SHARED-SECRET-V1";
}
}
}
The persist-dir leaf stores the last TX sequence per session so Meticulous sessions resume above the peer's replay window after a restart.
Profiles may carry an echo { desired-min-echo-tx-us N } block for RFC 5880 S6.4 Echo mode. Echo mode is valid only on single-hop sessions.
bfd {
profile fast-echo {
desired-min-tx-us 100000;
required-min-rx-us 100000;
echo {
desired-min-echo-tx-us 50000;
}
}
}
Add a bfd { } container inside a BGP peer's connection { } block:
bgp {
peer peer1 {
connection {
local { ip 192.0.2.1; }
remote { ip 192.0.2.2; }
bfd {
enabled true;
mode single-hop;
profile fast-link;
}
}
session {
asn { local 65001; remote 65002; }
router-id 192.0.2.1;
family { ipv4/unicast; }
}
}
}
On session Established, the reactor opens a BFD session. When BFD reports Down, the reactor tears the BGP session with RFC 9384 Cease NOTIFICATION subcode 10 ("BFD Down") without waiting for the hold timer.
For iBGP between loopbacks:
bfd {
enabled true;
mode multi-hop;
min-ttl 250;
profile ibgp-loopback;
}
mode multi-hop uses UDP port 4784 and skips GTSM. min-ttl must be 256 - max-hops.
Sessions without a protocol client:
bfd {
single-hop-session 192.0.2.254 {
local 192.0.2.1;
interface eth0;
profile gateway;
}
multi-hop-session 198.51.100.7 {
local 10.0.0.1;
profile gateway;
min-ttl 254;
}
}
| Command | Description |
|---|---|
show bfd sessions |
All sessions with state, timers, packet counts. |
show bfd session <peer> |
Single session detail with transition history. |
show bfd profile |
Resolved profiles. |
| Metric | Type | Meaning |
|---|---|---|
ze_bfd_sessions |
gauge | Live session count by state, mode, VRF. |
ze_bfd_transitions_total |
counter | State changes by from/to/diag/mode. |
ze_bfd_detection_expired_total |
counter | Detection-timer expirations. |
ze_bfd_tx_packets_total |
counter | Control packets transmitted. |
ze_bfd_rx_packets_total |
counter | Control packets received. |
Single-hop BFD enforces GTSM (RFC 5082): packets are sent with TTL=255 and received packets with any other TTL are silently discarded. Multi-hop sessions use min-ttl as a weaker replacement. TX jitter per RFC 5880 S6.8.7 is applied automatically. SO_BINDTODEVICE binds sockets to the named interface for single-hop sessions.
| Feature | RFC | Status |
|---|---|---|
| Demand mode | 5880 S6.6 | Not implemented. Rarely deployed. |
| Seamless BFD (S-BFD) | 7880, 7881 | Not implemented. |
| Micro-BFD on LAG | 7130 | Not implemented. |
| Multipoint BFD | 8562 | Not implemented. |
- In-tree BFD guide for the full reference.
- Plugins for the plugin list.
Adapted from main/docs/guide/bfd.md.
Unreviewed draft. This wiki was authored in bulk and has not been reviewed. File corrections on the issue tracker.
- Overview
- YANG Model
- Editor Workflow
- Archive and Rollback
- System
- Interfaces
- VRRP
- BFD
- FIB
- OSPF
- IS-IS
- MPLS / LDP / RSVP-TE
- RSVP-TE
- SRv6
- Static Routes
- Policy Routing
- Firewall
- Traffic Control
- Class of Service
- L2TP/PPP
- PPPoE
- VPP Data Plane
- RPKI
- IPsec VPN
- TACACS+ AAA
- RADIUS AAA
- AS112 DNS
- Authorization
- Fleet
- BGP
- Starting and Stopping
- Show Commands
- Monitoring
- Flow Export
- DDoS Mitigation
- Anomaly Detection
- Health Checks
- Audit Trail
- Production Diagnostics
- Logging
- Operational Reports
- Healthcheck
- Self-Update
- Zero-Touch Provisioning
- MRT Analysis
- Upgrade and Restart
- Storage
- Policy
- Core
- Resilience
- Validation
- Capabilities
- Address Families
- Protocol
- Subsystems
- Infrastructure
- Route Server at an IXP
- Transit Edge with RPKI
- Public Looking Glass
- ExaBGP Migration Walkthrough
- FlowSpec Injection
- Chaos-Tested Peering
- AS Path Topology