SlideShare a Scribd company logo
8
Most read
9
Most read
11
Most read
Introduction to eBPF
Network Applications
Roger Coll - 3/12/2020
Universitat Politècnica de Catalunya
Linux Kernel
◉ Free and open-source
◉ Modular
◉ Multitasking
◉ Monolithic
◉ Written in C
About 33% of web servers use Linux as OS !
Monolithic Kernel
- The entire OS is working in the Kernel space
- All OS code runs in privileged mode
- High performance, but higher risk for system
crash
Introduction to eBPF
What is BPF?
Berkeley Packet Filter is a small virtual machine that can run
programs injected from the user space in the kernel space
without changing/recompiling the kernel code.
- First implementation (BPF) => Linux Kernel 3.15 (1992)
- Better known as the packet filter language for tcpdump
BPF workflow
tcpdump -d
Any benefit?
- Avoids copying unwanted packets from the OS to the
process/user space.
Huge impact on performance
So… what is eBPF?
- Extended Berkeley Packet Filter
- Fast and safe, in-kernel, register based, bytecode VM
- Linux Kernel 3.18 (2014)
Run code in the kernel without having
to write a kernel module.
BPF eBPF
- 32-bit
- Fixed length instructions
- One accumulator
- One index register
Arithmetic operations on the packets
data, compare and decide (accept/reject)
- 64-bit
- 512 byte stack
- Maps (key/value)
Wide range of applications
eBPF features
- Much more than just filtering packets
- bpf() syscall => run program developed in user space in
the kernel
C (limited) eBPF (Bytecode) Machine code
Kernel
JIT
compiler
Introduction to eBPF
Hello World
+ Kprobes example
Time to rethink the Kernel
From monolithic to microkernel or kernel with microservices
Introduction to eBPF
Network use cases
- SDN configuration
- DDos mitigation (cloudflare)
- Intrusion detection
- Network security at application layer => Cilium k8s
- Load balancing (facebook data centers)
- Servers performance
Iptables has not been designed for micro services
XDP throughput
IPVS throughput
Any questions ?
Thanks!

More Related Content

PPTX
eBPF Basics
ODP
eBPF maps 101
PPTX
Understanding eBPF in a Hurry!
PDF
eBPF - Rethinking the Linux Kernel
PDF
Introduction to eBPF and XDP
PDF
Deep dive into Kubernetes Networking
PDF
Anatomy of the loadable kernel module (lkm)
PDF
Memory Management with Page Folios
eBPF Basics
eBPF maps 101
Understanding eBPF in a Hurry!
eBPF - Rethinking the Linux Kernel
Introduction to eBPF and XDP
Deep dive into Kubernetes Networking
Anatomy of the loadable kernel module (lkm)
Memory Management with Page Folios

What's hot (20)

PDF
BPF: Tracing and more
PDF
BPF Internals (eBPF)
PDF
eBPF Trace from Kernel to Userspace
PDF
EBPF and Linux Networking
PDF
Accelerating Envoy and Istio with Cilium and the Linux Kernel
PDF
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
PDF
Systems@Scale 2021 BPF Performance Getting Started
PDF
Cilium - API-aware Networking and Security for Containers based on BPF
PDF
BPF - in-kernel virtual machine
PDF
DoS and DDoS mitigations with eBPF, XDP and DPDK
PDF
Linux BPF Superpowers
PDF
eBPF/XDP
PDF
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
PPTX
Tutorial: Using GoBGP as an IXP connecting router
PDF
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
ODP
Dpdk performance
PDF
eBPF - Observability In Deep
PDF
Xdp and ebpf_maps
PPTX
Staring into the eBPF Abyss
PDF
Using eBPF for High-Performance Networking in Cilium
BPF: Tracing and more
BPF Internals (eBPF)
eBPF Trace from Kernel to Userspace
EBPF and Linux Networking
Accelerating Envoy and Istio with Cilium and the Linux Kernel
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Systems@Scale 2021 BPF Performance Getting Started
Cilium - API-aware Networking and Security for Containers based on BPF
BPF - in-kernel virtual machine
DoS and DDoS mitigations with eBPF, XDP and DPDK
Linux BPF Superpowers
eBPF/XDP
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Tutorial: Using GoBGP as an IXP connecting router
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Dpdk performance
eBPF - Observability In Deep
Xdp and ebpf_maps
Staring into the eBPF Abyss
Using eBPF for High-Performance Networking in Cilium
Ad

Similar to Introduction to eBPF (20)

PDF
Kernel bug hunting
PDF
The Open Source Ecosystem for eBPF in Kubernetes
PDF
Unifying Network Filtering Rules for the Linux Kernel with eBPF
PDF
Kernel Recipes 2019 - BPF at Facebook
ODP
Advancement on embedded linux-v2
PDF
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
PDF
μ-Kernel Evolution
PDF
Architecture Of The Linux Kernel
PDF
Architecture Of The Linux Kernel
PPTX
Linux@assignment ppt
PDF
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
PDF
Not breaking userspace: the evolving Linux ABI
PDF
Walking around linux kernel
PDF
Network stack personality in Android phone - netdev 2.2
PPT
Binary system
PDF
eBPF — Divulging The Hidden Super Power.pdf
PDF
Linux-Internals-and-Networking
PDF
Security Monitoring with eBPF
PDF
ebpf and IO Visor: The What, how, and what next!
PPTX
Linux internals v4
Kernel bug hunting
The Open Source Ecosystem for eBPF in Kubernetes
Unifying Network Filtering Rules for the Linux Kernel with eBPF
Kernel Recipes 2019 - BPF at Facebook
Advancement on embedded linux-v2
Linux rumpkernel - ABC2018 (AsiaBSDCon 2018)
μ-Kernel Evolution
Architecture Of The Linux Kernel
Architecture Of The Linux Kernel
Linux@assignment ppt
Development of Signal Processing Algorithms using OpenCL for FPGA based Archi...
Not breaking userspace: the evolving Linux ABI
Walking around linux kernel
Network stack personality in Android phone - netdev 2.2
Binary system
eBPF — Divulging The Hidden Super Power.pdf
Linux-Internals-and-Networking
Security Monitoring with eBPF
ebpf and IO Visor: The What, how, and what next!
Linux internals v4
Ad

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
web development for engineering and engineering
PPTX
Geodesy 1.pptx...............................................
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Digital Logic Computer Design lecture notes
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
bas. eng. economics group 4 presentation 1.pptx
Lecture Notes Electrical Wiring System Components
Embodied AI: Ushering in the Next Era of Intelligent Systems
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
web development for engineering and engineering
Geodesy 1.pptx...............................................
UNIT 4 Total Quality Management .pptx
additive manufacturing of ss316l using mig welding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Digital Logic Computer Design lecture notes
CH1 Production IntroductoryConcepts.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Structs to JSON How Go Powers REST APIs.pdf

Introduction to eBPF

  • 1. Introduction to eBPF Network Applications Roger Coll - 3/12/2020 Universitat Politècnica de Catalunya
  • 2. Linux Kernel ◉ Free and open-source ◉ Modular ◉ Multitasking ◉ Monolithic ◉ Written in C About 33% of web servers use Linux as OS !
  • 3. Monolithic Kernel - The entire OS is working in the Kernel space - All OS code runs in privileged mode - High performance, but higher risk for system crash
  • 5. What is BPF? Berkeley Packet Filter is a small virtual machine that can run programs injected from the user space in the kernel space without changing/recompiling the kernel code. - First implementation (BPF) => Linux Kernel 3.15 (1992) - Better known as the packet filter language for tcpdump
  • 7. Any benefit? - Avoids copying unwanted packets from the OS to the process/user space. Huge impact on performance
  • 8. So… what is eBPF? - Extended Berkeley Packet Filter - Fast and safe, in-kernel, register based, bytecode VM - Linux Kernel 3.18 (2014) Run code in the kernel without having to write a kernel module.
  • 9. BPF eBPF - 32-bit - Fixed length instructions - One accumulator - One index register Arithmetic operations on the packets data, compare and decide (accept/reject) - 64-bit - 512 byte stack - Maps (key/value) Wide range of applications
  • 10. eBPF features - Much more than just filtering packets - bpf() syscall => run program developed in user space in the kernel C (limited) eBPF (Bytecode) Machine code Kernel JIT compiler
  • 13. Time to rethink the Kernel
  • 14. From monolithic to microkernel or kernel with microservices
  • 16. Network use cases - SDN configuration - DDos mitigation (cloudflare) - Intrusion detection - Network security at application layer => Cilium k8s - Load balancing (facebook data centers) - Servers performance
  • 17. Iptables has not been designed for micro services