BFD Component
Overview
BFD (Bidirectional Forwarding Detection) provides sub-second failure detection for routing protocols. BFD sessions are created by protocols (BGP, OSPF, static routes) rather than configured directly. When a BFD session detects that a neighbor is unreachable, the associated protocol is notified immediately, enabling faster convergence than relying on protocol-level hello timers alone.
Configuration
BFD sessions are not configured independently. Instead, BFD is enabled per-protocol:
BFD for OSPFv2 / OSPFv3 interfaces
Enable BFD on an OSPF interface by adding a bfd object with multiplier and min_tx parameters.
"ospfv2": {
"vrfs": {
"default": {
"router_id": "10.0.100.1",
"areas": {
"0.0.0.0": {
"intfs": {
"^eth": {
"bfd": {
"multiplier": 3,
"min_tx": 1000
}
}
}
}
}
}
}
}
The same configuration applies to OSPFv3 interfaces under the ospfv3 object.
BFD for BGP neighbors
Enable BFD on a BGP neighbor by adding a bfd object with multiplier and min_tx parameters.
"bgp": {
"asn": 65016,
"id": "172.16.10.1",
"vrfs": {
"default": {
"neighs": {
"172.16.20.2 172.16.20.1": {
"asn": 65016,
"bfd": {
"multiplier": 3,
"min_tx": 1000
},
"afis": {
"ipv4-unicast": {}
}
}
}
}
}
}
BFD for static routes
Enable BFD on a static route by adding a bfd object to the route.
"static": {
"vrfs": {
"default": {
"routes": {
"192.0.2.128/25": {
"next_hops": [
{ "ip_addr": "10.0.1.2", "intf_name": "r1-n1" }
],
"bfd": {
"multiplier": 3,
"min_tx": 1000
}
}
}
}
}
}
BFD parameters
multiplier— the number of missed BFD packets before declaring the session down. Default is 3.min_tx— the minimum interval between transmitted BFD packets, in milliseconds (300is 300 ms). Default is 1000.
Both parameters are optional and take the defaults above when omitted, so "bfd": {} enables BFD with the defaults.
Static routes that reach the same next hop share one session, which keeps the settings of the route that created it; a route asking for different settings is logged and uses the existing session.
The detection time is multiplier × min_tx. For example, with a multiplier of 3 and a min_tx of 1000 (1 second), failure is detected within 3 seconds.
Operational State
BFD overview
flockc bfd overview
Show all BFD sessions
flockc bfd sessions
Filter sessions by destination IP
flockc bfd sessions --dest <ip-address>
Filter sessions by source IP
flockc bfd sessions --source <ip-address>
Filter sessions by interface name
flockc bfd sessions --intf-name <interface-name>
Filter sessions by status
flockc bfd sessions --status <init | up | down | admin-down>