Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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": "1s"
                            }
                        }
                    }
                }
            }
        }
    }
}

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": "1s"
                    },
                    "afis": {
                        "ipv4-unicast": {}
                    }
                }
            }
        }
    }
}

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. Specified as a duration string (e.g., "1s", "300ms").

The detection time is multiplier × min_tx. For example, with multiplier: 3 and min_tx: "1s", failure is detected within 3 seconds.

Operational State

BFD overview

flockc bfd

Show all BFD sessions

flockc bfd -s

Filter sessions by destination IP

flockc bfd -s --dest_ip <ip-address>

Filter sessions by source IP

flockc bfd -s --src_ip <ip-address>

Filter sessions by interface name

flockc bfd -s --intf_name <interface-name>