eBPF Tutorial Part 20 Explains Linux tc Traffic Control and Packet Filtering
A new installment of an eBPF tutorial series covers Linux Traffic Control (tc), a kernel subsystem long used to shape packet sending and receiving by rate and order. Since Linux 4.1, tc supports attaching eBPF programs as filters at additional attachment points. The article places tc at the link layer, after sk_buff allocation and beyond XDP, and describes how qdiscs, classes, filters, and actions form a packet classification pipeline. It also explains the direct-action mode, which lets eBPF filters return tc actions such as TC_ACT_OK directly. An example program attaches to ingress traffic, filters for IPv4 packets, and logs their total length and TTL using bpf_printk.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in