SlideShare a Scribd company logo
CILIUM: NETWORK AND
APPLICATION SECURITY
WITH BPF AND XDP
Thomas Graf
Co-founder & CTO
Covalent
Who is this guy?
Helped build the
biggest monolith
ever …
Who is this guy?
Helped build the
biggest monolith
ever …
Who is this guy?
Time to rethink the kernel
syscalls syscalls
Net IOBlock IO
Time to rethink the kernel
Time to rethink the kernel
From monolith to “microkernel” with BPF
syscalls syscalls
BPF
BPF
BPF
BPF
Net IOBlock IO
Time to rethink the kernel
From monolith to “microkernel” with BPF
syscalls syscalls
BPF
BPF
BPF
BPF
BPF
BPF
Security
Networking
Net IOBlock IO
BPF is revolutionizing…
• Tracing / Profiling
BPF is revolutionizing…
• Tracing / Profiling
Container	Performance	
Analysis
Brendan	Gregg
Wed	1:30pm	“Black	Belt”
BPF is revolutionizing…
• Tracing / Profiling
• Networking
Container	Performance	
Analysis
Brendan	Gregg
Wed	1:30pm	“Black	Belt”
BPF is revolutionizing…
• Tracing / Profiling
• Networking
• Security
Container	Performance	
Analysis
Brendan	Gregg
Wed	1:30pm	“Black	Belt”
Application
Architectures
Delivery Frequency
Operational
Complexity
Single Server
App
Yearly
Low
Delivery Frequency
Application
Architectures
Delivery Frequency
Operational
Complexity
Single Server
App
Yearly
Low
3-Tier App
Monthly
Moderate
Delivery Frequency
Application
Architectures
Delivery Frequency
Operational
Complexity
Single Server
App
Yearly
Low
Distributed
Microservices
10-100 x’s / day
Extreme
3-Tier App
Monthly
Moderate
Delivery Frequency
Network Security
has not evolved
$ iptables -A INPUT -p tcp 
-s 15.15.15.3 --dport 80 
-m conntrack --ctstate NEW 
-j ACCEPT
The world still runs on iptables
matching IPs and ports:
Your HTTP ports be like …
Network Security
for Microservices
Example
Gordon is
looking for
a job…
Gordon Job Postings
Example: Security for Microservices
GET /healthz
GET /jobs/{id}
PUT /jobs/{id}
POST /jobs
API
Gordon Job Postings
Example: Security for Microservices
GET /healthz
GET /jobs/{id}
PUT /jobs/{id}
POST /jobs
API
GET /jobs/331
Gordon Job Postings
Example: Security for Microservices
L3/L4
GET /healthz
GET /jobs/{id}
PUT /jobs/{id}
POST /jobs
API
iptables -s 10.1.1.1
-p tcp --dport 80
-j ACCEPT
GET /jobs/331
Gordon Job Postings
Example: Security for Microservices
L3/L4
GET /healthz
GET /jobs/{id}
PUT /jobs/{id}
POST /jobs
API
exposed
exposed
exposed
GET /jobs/331
Gordon Job Postings
Example: Security for Microservices
iptables -s 10.1.1.1
-p tcp --dport 80
-j ACCEPT
Not exactly
least privilege
Security team is
not amused
GET /healthz
GET /jobs/{id}
PUT /jobs/{id}
POST /jobs
API
GET /jobs/331
Gordon Job Postings
Example: Security for Microservices
L3/L4
GET /healthz
GET /jobs/{id}
PUT /jobs/{id}
POST /jobs
API
FROM Gordon
ALLOW GET /jobs/.*
GET /jobs/331
Gordon Job Postings
Example: Security for Microservices
We demand
a demo
BPF - The
Superpowers
inside Linux
SANDBOX
BPF
GET /foo
BPF: Transparent redirection into proxy
SANDBOX
BPF
Proxy
GET /foo
redirect
rules
sk
BPF: Transparent redirection into proxy
SANDBOX
BPF
Proxy
GET /foo
redirect
rules
sk
Shared State
• Orig Dest IP
• Identity
BPF: Transparent redirection into proxy
SANDBOX
BPF
Proxy
GET /foo
redirect
reinject
rules
sk sk
Shared State
• Orig Dest IP
• Identity
BPF: Transparent redirection into proxy
SANDBOX
BPF
Proxy
GET /foo
rules
BPF: Transparent redirection into proxy
sk sk
403
Access
Denied
So what is BPF exactly?
.insns = {
BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
BPF_ST_MEM(BPF_DW, BPF_REG_2, 0, 0),
BPF_LD_MAP_FD(BPF_REG_1, 0),
BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem),
BPF_MOV64_REG(BPF_REG_1, BPF_REG_10),
BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -152),
BPF_STX_MEM(BPF_DW, BPF_REG_1, BPF_REG_0, 0),
BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 0, 2),
BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_1, 0),
BPF_ST_MEM(BPF_DW, BPF_REG_3, 0, 42),
BPF_EXIT_INSN(),
}
What is
BPF?
Learn more about BPF: docs.cilium.io
BPF: Toolchain – from user to kernel
USER SPACE
SOURCE CODE [C]
</>
BPF: LLVM compiles program code to bytecode
USER SPACE
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
BPF: Bytecode is loaded and verified into kernel
USER SPACE
KERNELVERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
BPF: Bytecode runs inside safe kernel sandbox
USER SPACE
KERNELVERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
SANDBOX
BPF
BPF: Program is attached to event (packet-in)
USER SPACE
KERNELVERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
SANDBOX
BPF
BPF: Program can redirect to netns & sockets
USER SPACE
KERNELVERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
SANDBOX
BPF
BPF – An opportunity
to rethink security
policy enforcement
Status Quo: Policy Enforcement
connect()
Status Quo: Policy Enforcement
connect()
TCP
Status Quo: Policy Enforcement
connect()
TCP
Network
packets
Status Quo: Policy Enforcement
connect()
TCP
Network
packets
veth
veth
namespace boundary
Status Quo: Policy Enforcement
connect()
TCP
Network
packets
iptables
veth
veth
namespace boundary
Status Quo: Policy Enforcement
connect()
drop
TCP
Network
packets
iptables
veth
veth
namespace boundary
Status Quo: Policy Enforcement
connect()
drop
TCP
Network
packets
ETIMEDOUT
iptables
veth
veth
namespace boundary
Status Quo: Policy Enforcement
connect()
drop
TCP
Network
packets
ETIMEDOUT/
ECONNREFUSED
iptables
RST
veth
veth
namespace boundary
Can we do better?
connect()
BPF: Leverage user space tool chain
USER SPACE
KERNEL
connect()
VERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
BPF: Attach program to connect() syscall (LSM)
USER SPACE
KERNEL
connect()
VERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
BPF
LSM Hook
BPF: Return EACCESS – No packets created at all
USER SPACE
KERNEL
connect()
EACCESS
VERIFIER +
JIT
SOURCE CODE [C]
</>
BYTE CODE [BPF]
</>
BPF
LSM Hook
XDP/BPF – The
software loadbalancer
of the future
WHAT IF I TOLD YOU
XDP allows for 10x
IPVS performance
Source: https://www.netdevconf.org/2.1/slides/apr6/zhou-netdev-xdp-2017.pdf
FB moves from IPVS to BPF/XDP for L3/L4 LB
XDP	throughput
IPVS	throughput
Source:
Regular BPF mode
BPF
Driver Software Stack
XDP [Express Data Path] mode
BPF
Driver
Run BPF Program inside network
driver with access to DMA buffer
Software Stack
XDP [Express Data Path] mode
BPF
Driver
Can drop millions of packets per
Second while under DDoS
Software Stack
drop
XDP [Express Data Path] mode
BPF
Driver
Can pass packets to network stack
Software Stack
drop
Stack
XDP [Express Data Path] mode
BPF
Driver
Can perform loadbalancing and
transmit out the wire again
Software Stack
drop
LB & TX
Stack
How can I use BPF
with Docker?
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Cilium Architecture
Cilium
Agent
Cilium Architecture
Cilium
Agent
Plugins
Cilium Architecture
BPF
Cilium
Agent
Plugins
Cilium Architecture
BPF
BPF
Cilium
Agent
Plugins
Cilium Architecture
BPF
BPF
Cilium
Agent
Plugins
Cilium Architecture
BPF
BPF
BPF
Cilium
Agent
Plugins
Cilium Architecture
BPF
BPF
BPF
Cilium
Agent
Plugins
Cilium Architecture
BPF
BPF
BPF
Cilium
Agent
CLI Monitor Policy
Plugins
Project Status
• Initial	release	two	weeks	ago	
• Docker	&	Kubernetes	integration
• Looking	for	feedback	and	
contributions
Getting Started
• Play	with	our	vagrant	box:
$ git clone	https://github.com/cilium/cilium
$ cd	cilium/examples/getting-started
$ vagrant	up
Summary
Summary
• Never	underestimate	the	
Jedi
Summary
• Never	underestimate	the	
Jedi
• Traditional	L3/L4	network	
policies	are	insufficient	for	
microservices.	Least	
privilege	requires	HTTP	/	
API	/	Function	awareness.
Summary
• BPF/XDP	will	drive	the	
future	of	software	based	
networking	on	Linux.
• Never	underestimate	the	
Jedi
• Traditional	L3/L4	network	
policies	are	insufficient	for	
microservices.	Least	
privilege	requires	HTTP	/	
API	/	Function	awareness.
Summary
• Never	underestimate	the	
Jedi
• Traditional	L3/L4	network	
policies	are	insufficient	for	
microservices.	Least	
privilege	requires	HTTP	/	
API	/	Function	awareness.
• BPF/XDP	will	drive	the	
future	of	software	based	
networking	on	Linux.
• Cilium	brings	BPF/XDP	
and	L7	policies	to	
containers	and	
microservices.
Thank You!
github.com/cilium/cilium
http://cilium.io/
@ciliumproject
Want to chat? DM me! @tgraf__
Don’t	forget	
to	vote	and
grab	a	shirt	
on	the	way	
out!
75
140
205
240
325
365 370 365
410 412 425
445 450 460 460
490 495 505 515 525
545
565
0
100
200
300
400
500
600
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
BPF redirect() performance
[GBit per core]
Intel Xeon 3.5Ghz Sandy Bridge, 24 Cores,
(1 TCP GSO flow per core, netperf -t TCP_SENDFILE, 10K policies)

More Related Content

What's hot (20)

PDF
Kubernetes Networking with Cilium - Deep Dive
Michal Rostecki
 
PDF
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 
PDF
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
PDF
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
PDF
Linux Profiling at Netflix
Brendan Gregg
 
PDF
Introduction to eBPF and XDP
lcplcp1
 
PDF
Using eBPF for High-Performance Networking in Cilium
ScyllaDB
 
PDF
BPF Internals (eBPF)
Brendan Gregg
 
PDF
EBPF and Linux Networking
PLUMgrid
 
PDF
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
PDF
Linux BPF Superpowers
Brendan Gregg
 
PDF
Linux Networking Explained
Thomas Graf
 
PPTX
Understanding eBPF in a Hurry!
Ray Jenkins
 
PDF
Introduction and Deep Dive Into Containerd
Kohei Tokunaga
 
PDF
Physical Memory Management.pdf
Adrian Huang
 
PDF
ARM Trusted FirmwareのBL31を単体で使う!
Mr. Vengineer
 
PDF
Replacing iptables with eBPF in Kubernetes with Cilium
Michal Rostecki
 
PDF
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
 
PDF
Introduction to eBPF
RogerColl2
 
PDF
Launch the First Process in Linux System
Jian-Hong Pan
 
Kubernetes Networking with Cilium - Deep Dive
Michal Rostecki
 
eBPF Trace from Kernel to Userspace
SUSE Labs Taipei
 
Linux Performance Analysis: New Tools and Old Secrets
Brendan Gregg
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
Thomas Graf
 
Linux Profiling at Netflix
Brendan Gregg
 
Introduction to eBPF and XDP
lcplcp1
 
Using eBPF for High-Performance Networking in Cilium
ScyllaDB
 
BPF Internals (eBPF)
Brendan Gregg
 
EBPF and Linux Networking
PLUMgrid
 
Performance Wins with eBPF: Getting Started (2021)
Brendan Gregg
 
Linux BPF Superpowers
Brendan Gregg
 
Linux Networking Explained
Thomas Graf
 
Understanding eBPF in a Hurry!
Ray Jenkins
 
Introduction and Deep Dive Into Containerd
Kohei Tokunaga
 
Physical Memory Management.pdf
Adrian Huang
 
ARM Trusted FirmwareのBL31を単体で使う!
Mr. Vengineer
 
Replacing iptables with eBPF in Kubernetes with Cilium
Michal Rostecki
 
Cilium - Bringing the BPF Revolution to Kubernetes Networking and Security
Thomas Graf
 
Introduction to eBPF
RogerColl2
 
Launch the First Process in Linux System
Jian-Hong Pan
 

Similar to DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP (20)

PDF
Linux Native, HTTP Aware Network Security
Thomas Graf
 
PDF
Cilium - Network security for microservices
Thomas Graf
 
PDF
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
Docker, Inc.
 
PDF
Cilium – Kernel Native Security & DDOS Mitigation for Microservices with BPF
Cynthia Thomas
 
PDF
Efficient System Monitoring in Cloud Native Environments
Gergely Szabó
 
PDF
Chicago Docker Meetup Presentation - Mediafly
Mediafly
 
PDF
Cilium:: Application-Aware Microservices via BPF
Cynthia Thomas
 
PDF
Cilium - API-aware Networking and Security for Containers based on BPF
Thomas Graf
 
PDF
ebpf and IO Visor: The What, how, and what next!
Affan Syed
 
PDF
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Thomas Graf
 
PPTX
СТАНІСЛАВ КОЛЕНКІН «Cilium – Network security for microservices. Let’s see ho...
UA DevOps Conference
 
PDF
[Cisco Connect 2018 - Vietnam] Anh duc le reap the benefits of sdn with cisco...
Nur Shiqim Chok
 
PDF
Hyperledger composer
wonyong hwang
 
PDF
Next Stop, Android
National Cheng Kung University
 
PPTX
Révolution eBPF - un noyau dynamique
Raphaël PINSON
 
PPTX
Cfgmgmtcamp 2023 — eBPF Superpowers
Raphaël PINSON
 
PDF
OSN days 2019 - Open Networking and Programmable Switch
Chun Ming Ou
 
PDF
TFI2014 Session II - Requirements for SDN - Brian Field
Colorado Internet Society (CO ISOC)
 
PDF
eBPF - Observability In Deep
Mydbops
 
PDF
Introduction of eBPF - 時下最夯的Linux Technology
Jace Liang
 
Linux Native, HTTP Aware Network Security
Thomas Graf
 
Cilium - Network security for microservices
Thomas Graf
 
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
Docker, Inc.
 
Cilium – Kernel Native Security & DDOS Mitigation for Microservices with BPF
Cynthia Thomas
 
Efficient System Monitoring in Cloud Native Environments
Gergely Szabó
 
Chicago Docker Meetup Presentation - Mediafly
Mediafly
 
Cilium:: Application-Aware Microservices via BPF
Cynthia Thomas
 
Cilium - API-aware Networking and Security for Containers based on BPF
Thomas Graf
 
ebpf and IO Visor: The What, how, and what next!
Affan Syed
 
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Thomas Graf
 
СТАНІСЛАВ КОЛЕНКІН «Cilium – Network security for microservices. Let’s see ho...
UA DevOps Conference
 
[Cisco Connect 2018 - Vietnam] Anh duc le reap the benefits of sdn with cisco...
Nur Shiqim Chok
 
Hyperledger composer
wonyong hwang
 
Next Stop, Android
National Cheng Kung University
 
Révolution eBPF - un noyau dynamique
Raphaël PINSON
 
Cfgmgmtcamp 2023 — eBPF Superpowers
Raphaël PINSON
 
OSN days 2019 - Open Networking and Programmable Switch
Chun Ming Ou
 
TFI2014 Session II - Requirements for SDN - Brian Field
Colorado Internet Society (CO ISOC)
 
eBPF - Observability In Deep
Mydbops
 
Introduction of eBPF - 時下最夯的Linux Technology
Jace Liang
 
Ad

More from Thomas Graf (12)

PDF
BPF: Next Generation of Programmable Datapath
Thomas Graf
 
PDF
Cilium - Container Networking with BPF & XDP
Thomas Graf
 
PDF
Cilium - BPF & XDP for containers
Thomas Graf
 
PDF
Cilium - Fast IPv6 Container Networking with BPF and XDP
Thomas Graf
 
PDF
LinuxCon 2015 Stateful NAT with OVS
Thomas Graf
 
PDF
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
PDF
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Thomas Graf
 
PDF
2015 FOSDEM - OVS Stateful Services
Thomas Graf
 
PDF
Open vSwitch - Stateful Connection Tracking & Stateful NAT
Thomas Graf
 
PDF
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
Thomas Graf
 
PDF
SDN & NFV Introduction - Open Source Data Center Networking
Thomas Graf
 
PDF
DevConf 2014 Kernel Networking Walkthrough
Thomas Graf
 
BPF: Next Generation of Programmable Datapath
Thomas Graf
 
Cilium - Container Networking with BPF & XDP
Thomas Graf
 
Cilium - BPF & XDP for containers
Thomas Graf
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Thomas Graf
 
LinuxCon 2015 Stateful NAT with OVS
Thomas Graf
 
LinuxCon 2015 Linux Kernel Networking Walkthrough
Thomas Graf
 
Taking Security Groups to Ludicrous Speed with OVS (OpenStack Summit 2015)
Thomas Graf
 
2015 FOSDEM - OVS Stateful Services
Thomas Graf
 
Open vSwitch - Stateful Connection Tracking & Stateful NAT
Thomas Graf
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
Thomas Graf
 
SDN & NFV Introduction - Open Source Data Center Networking
Thomas Graf
 
DevConf 2014 Kernel Networking Walkthrough
Thomas Graf
 
Ad

Recently uploaded (20)

PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PDF
Executive Business Intelligence Dashboards
vandeslie24
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PPTX
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Executive Business Intelligence Dashboards
vandeslie24
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
Feb 2021 Cohesity first pitch presentation.pptx
enginsayin1
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 

DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP