[RFC] xdp-bfd: external BFD dataplane over bfddp with an XDP fast path
Hi, I've built an external BFD dataplane against bfdd's distributed-BFD protocol and wanted to share it here: https://github.com/w453y/xdp-bfd What it is: session RX/detection and steady-state TX run in XDP (detection via a bpf_timer sweep over a session map; TX is RX-clocked - each valid peer packet is rewritten in place and returned with XDP_TX, ~30us turnaround in softirq). Userspace keeps the RFC 5880 FSM and slow-rate/bring-up, and speaks bfddp to bfdd. Works with unmodified FRR 10.5.1 over the ipv4c: transport - session lifecycle from bfdd, state changes and counters reported back (counters read from the BPF maps). Motivation was measured, not assumed: at 3x10ms timers under timer/hrtimer stress, stock bfdd on my testbed flapped 44 times in 120s with TX gaps up to 970ms while p99 stayed at 10.2ms - the starvation events are invisible to percentile monitoring. The same session offloaded through bfddp to the XDP path survived SCHED_FIFO starvation with 0 flaps and max gap 13ms, at normal process priority. All pcaps and the analysis are in the repo. Along the way I hit the unixc: client connect bug (EINVAL from oversized addrlen) - that's issue [#22608](https://github.com/FRRouting/frr/issues/22608), fixed in [PR #22621](https://github.com/FRRouting/frr/pull/22621). Thanks to Donald for the quick triage and Rafael for the review. Current limitations: single-hop IPv4 only, no auth/echo/demand, and sessions drop and re-establish across a bfdd reconnect. It's a lab-grade implementation, VM-tested (bare-metal reproduction pending). Two questions for people who know the dplane protocol better than I do: 1. Is there anything bfdd expects from a dataplane that I'm likely not doing? I handle DP_ADD_SESSION/DP_DELETE_SESSION, ECHO_REQUEST, and DP_REQUEST_SESSION_COUNTERS, and send BFD_STATE_CHANGE on transitions (including remote-timer renegotiation while Up). I never send ECHO_REQUEST myself - is the dataplane expected to probe? 2. Has anyone run distributed BFD in production with any dataplane? Curious whether session continuity across bfdd restarts is something operators expect the dataplane to provide, or whether drop-and-recreate is acceptable. Feedback on the dplane usage very welcome. Thanks & Regards, Abdul Wasey.
participants (1)
-
Abdul Wasey