How abhikdps/zero-overhead-lb works
Zero-Overhead Load Balancer routes TCP/UDP traffic at the NIC through an XDP/eBPF data plane, while a userspace CLI configures and manages it. The main flow is packet parsing and VIP lookup, affinity-aware backend selection, packet rewriting and forwarding; unmatched traffic passes to the kernel. Userspace also supports health checks and live backend failover, map-based statistics, event streaming, and hitless reload. Sampled source shows the key calls and map interactions; other documented CLI capabilities are included where source excerpts are incomplete.
Main entry points: main.c CLI commands · xdp_lb_kern.c Packet routing · health.c Backend health · stats.c Stats reporting
Components 12
Control plane
- CLI commands
src/user/main.c - Config parsing
src/user/config.c
XDP data plane
- Packet routing
src/bpf/xdp_lb_kern.c
BPF map state
- Map data contract
src/bpf/xdp_lb_common.h - BPF maps
src/bpf/xdp_lb_kern.c
Health and observability
- Backend health
src/user/health.c - Stats reporting
src/user/stats.c - Event streaming
src/user/events.c
Other components
- Operator
- Incoming traffic
- Backend hosts
- Kernel network stack
Connections 17
- Operator → CLI commands: runs commands
README.md - Incoming traffic → Packet routing: enters XDP
README.md - CLI commands → Config parsing: loads and validates
src/user/main.c - CLI commands → Packet routing: loads and attaches
src/user/main.c - CLI commands → BPF maps: populates and reloads
src/user/main.c - Packet routing → Map data contract: uses shared structs
src/bpf/xdp_lb_kern.c - Packet routing → BPF maps: looks up and updates
src/bpf/xdp_lb_kern.c - Packet routing → Backend hosts: forwards packets
README.md - Packet routing → Kernel network stack: passes unmatched traffic
src/bpf/xdp_lb_kern.c - Packet routing → BPF maps: writes events and counters
src/bpf/xdp_lb_kern.c - CLI commands → Backend health: starts health checks
src/user/main.c - Backend health → Backend hosts: checks TCP health
src/user/health.c - Backend health → BPF maps: updates backend slots
src/user/health.c - CLI commands → Stats reporting: dispatches stats
README.md - Stats reporting → BPF maps: reads counters and backends
src/user/stats.c - CLI commands → Event streaming: dispatches events
README.md - Event streaming → BPF maps: consumes ring buffer
src/user/events.c