Slide 1

Slide 1 text

Save CPU Cycles with eBPF DONIA CHAIEHLOUDJ SENIOR SOFTWARE ENGINEER, ISOVALENT@CISCO

Slide 2

Slide 2 text

What is ? Makes the Linux kernel programmable

Slide 3

Slide 3 text

Overview of Userspace App Events: ● File is opening ● Network packet is received syscalls Linux Kernel event Program

Slide 4

Slide 4 text

Different type of Networking hooks ● ● ● ● XDP: high-performance network packet processing TC: traffic control by redirecting, filtering, or shaping network traffic socket_filter: filter packets at the socket layer, enabling custom packet filtering and processing for specific applications and much more!

Slide 5

Slide 5 text

Packet Flow

Slide 6

Slide 6 text

TC: Traffic Control ● ● ● ● Packet filtering Ingress or Egress Attached to networking interface Local node processing: such as applying L3/L4 endpoint policy and redirecting traffic to endpoints.

Slide 7

Slide 7 text

TC Packet Drop

Slide 8

Slide 8 text

TC Demo

Slide 9

Slide 9 text

XDP (eXpress Data Path)

Slide 10

Slide 10 text

XDP (eXpress Data Path) ● ● ● high-performance network packet processing framework in the Linux kernel Only ingress Runs on the packet data before any other processing can happen Filtering programs: drop malicious, unexpected traffic, DDOS protection mechanisms

Slide 11

Slide 11 text

XDP Packet Drop

Slide 12

Slide 12 text

XDP Demo

Slide 13

Slide 13 text

TC vs XDP: Saving CPU cycles Context: - virtio-net in a KVM guest (native XDP) - host over a tap: 1M UDP packets, plus a max-rate pktgen test

Slide 14

Slide 14 text

TC vs XDP: Saving CPU cycles Context: - virtio-net in a KVM guest (native XDP) - host over a tap: 1M UDP packets, plus a max-rate pktgen test The BPF programs cost the same. The saving is the kernel work XDP skips.

Slide 15

Slide 15 text

Cilium XDP Load Balancing

Slide 16

Slide 16 text

Cilium kube-proxy replacement https://cilium.io/blog/2020/06/22/cilium-18/

Slide 17

Slide 17 text

Thank you ● Resources ○ ○ ○ https://www.doniacld.com/blog/is-xdp-more-performant-than-tc/ https://cilium.io/blog/2022/04/12/cilium-standalone-L4LB-XDP/ https://www.datadoghq.com/blog/xdp-intro/