Get start with XDP: write a network filter in 10m
summary
Shows how to write a minimal XDP filter that drops IPv6 packets by parsing Ethernet headers, using bounds checks the BPF verifier requires, and returning XDP_DROP vs XDP_PASS; builds the BPF ELF with clang -> xdp_drop.o and inspects sections with llvm-objdump. Loads with ip link or xdp_loader (use XDP_GENERIC to avoid cutting off networking), uses a per-CPU array map to count drops (example output: CPU0=13, CPU1=7) and provides a libbpf/libxdp user-space program that polls the map every 2s and prints totals.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:16Agenda
- 0:38What and Why We Use Fdp
- 2:48Build the Object
- 4:08Load the Ftp Object
- 10:15Bpf Maps
related talks
32mDemystifying eBPF - eBPF Firewall from scratch
32meBPF: BPF kernel infrastructure
37mEfficient and Flexible Virtual Machine Networking Through eBPF
28mLow-Latency, Deterministic Networking with Standard Linux using XDP Sockets
33mBringing packet queueing to XDP
33mXDP gaining access to NIC hardware hints via BTF
28mXDP for TSN
30mA Beginner's Guide to eBPF Programming for Networking
