eBPF, XDP and AF_XDP
eBPF, XDP and AF_XDP are Kernel Feature for high speed packet processing
* [eBPF](https://ebpf.io/what-is-ebpf/) (extended Berkeley Packet Filter) is a kind of virtual machine that runs sandboxed programs inside the Linux kernel.
- TCP Dump uses BPF.
- Not tied specifically to networking
- in kernel verifiers. No endless loop. no access to invalid memory.
Instructions
- RFC by IETF defines instruction set
- VM + limited instruction set
- JIT
Program Types
1. XDP
2. socket filtering, kprobe, tc schedular (action, classifiers), performance events
3. tracing: function entry, function exit, modify return value
4. cgroups, light weight tunnels
5. TCP stream parsing ( kernel assisted TLS and KCM = kernel connection machine. IP multiplex)
$ bpftool prog
$ clang target bpf
eBPF maps
1. K-v store
2. hash, array, radix-tree, bloom filter
3. _per_cpu variants for multi-processor efficiency
Use cases
1. device driver for DPDK, VPP and related user plane frameworks
2. load balancer (e.g. dnsdist)
3. software switch (e.g. vSwitch)
4. DoS protection filter
5. Intrusion Detection Systems (e.g. Suricata)
6. eupf = eBPF + AF_XDP for accelerated 5G UPF
* [XDP](https://docs.cilium.io/en/latest/bpf/progtypes/#xdp) (eXpress Data Path) is a framework for eBPF that enables high-performance programmable packet processing in the Linux kernel* [AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html) is an *address family* that is optimized for high-performance packet processing. It allows in-kernel XDP eBPF programs to efficiently pass packets to userspace via memory-mapped ring buffers.
0 comments:
Post a Comment