Why BFD Protocol Uses UDP
Bidirectional Forwarding Detection (BFD) is a high-speed network protocol designed to detect path failures between two forwarding engines in sub-second intervals. BFD relies on the User Datagram Protocol (UDP) as its transport layer because UDP provides the low latency, minimal overhead, and connectionless communication model necessary for rapid liveliness checks without the processing bottlenecks and retransmission delays associated with connection-oriented protocols like TCP.
Minimal Overhead and Low Latency
The primary objective of BFD is to operate with extremely low latency, frequently sending probe packets at intervals measured in tens of milliseconds. UDP features a lightweight, fixed-size header of just 8 bytes, compared to TCP’s 20-byte base header and variable options. This reduced payload size minimizes bandwidth consumption and ensures that packets can be generated, transmitted, and parsed with minimal CPU and memory overhead.
Elimination of Connection Setup and Retransmission Delays
BFD does not require the reliability guarantees that protocols like TCP offer:
- No Handshake Delays: BFD establishes its own lightweight session states (Down, Init, Up, AdminDown). Avoiding the TCP three-way handshake allows BFD sessions to start or adapt instantly.
- No Retransmissions: If a BFD packet is dropped, retransmitting it is counterproductive. BFD relies on missed packets to indicate path degradation or failure. A delayed or retransmitted packet would mask the very network issues BFD is designed to detect.
- No Congestion Control or Flow Control: TCP throttles traffic when packets are lost. BFD must maintain strict, deterministic transmission timers regardless of packet loss to trigger failovers accurately.
Hardware Acceleration and ASIC Offloading
Modern enterprise and service provider routers process BFD packets directly in hardware (such as ASICs and Network Processing Units) rather than sending them to the main routing processor (Control Plane). Because UDP is a standard, well-defined transport protocol, network hardware can easily recognize UDP packets, parse the encapsulated BFD control information, and maintain high-rate transmission timers entirely in the fast-forwarding path (Data Plane).
Port Multiplexing and Identification
Using UDP gives BFD standard destination port numbers defined by the Internet Engineering Task Force (IETF), allowing network devices to classify and filter traffic effectively:
- UDP Port 3784: Designated for single-hop BFD control packets.
- UDP Port 3785: Designated for BFD Echo packets.
- UDP Port 4784: Designated for multihop BFD control packets.
- UDP Port 6784: Designated for BFD over Link Aggregation Groups (LAG).
These standardized ports allow network access control lists (ACLs), Quality of Service (QoS) policies, and firewalls to prioritize BFD traffic over general data traffic, ensuring forwarding checks are not dropped during periods of congestion.
Protocol Independence
BFD acts as a universal health-check mechanism for various routing protocols, including BGP, OSPF, IS-IS, and static routing. Encapsulating BFD within standard UDP/IP datagrams allows it to run over any medium that supports IP routing, whether across a direct physical link, across multiple hops, or over complex overlay tunnels (such as VXLAN and MPLS), without needing custom link-layer encapsulation.