XDP Inside and Out: David S. Miller
XDP Inside and Out: David S. Miller
David S. Miller
Overview
XDP vs. userland frameworks
The checklists
“Safety”
Developing kernel code is “cray cray”, one typo crashes entire system
Van Jacobson and Steven McCane saw that at least one part of the kernel should
be fully programmable
Limited in scope to sockets, and mainly used for packet sniffing applications, this
incredible virus sat dormant for 24 years before spreading further
Programmable Policy?
This is not about changing the kernel
2 registers, A and X
Memory accesses must be strictly controlled (f.e. Socket filters can only access
packet data and metadata)
Remember: This is about implementing policy and only very simple operations
Enter XDP
eXpress Data Path
Run eBPF programs at the earliest place possible in the stack
Exactly when the device driver takes the packet from the RX ring
XDP eBPF program returns a verdict:
XDP datapath lives in full harmony with rest of kernel networking stack
XDP Applications
DDoS protection using “bad IPs” list in the form of an eBPF MAP
If XDP sees a packet with IP in this list, return XDP_DROP
“Safety”
Developer pervasiveness
Traffic loss
Arduino as a BPF Metaphor
The development process for both are similar
Linus Torvalds
Van Jacobson
Thomas Graf
Daniel Borkmann