SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
Introduction of eBPF
時下最夯的Linux Technology
梁維恩
Jace Liang
SW / Infra. engineer at ITRI
Facebook: jace.liang
github: mJace
TOC Votes to Move Falco into CNCF Incubator
By Jessie January 8, 2020 in Blog
Today, the Cloud Native Computing Foundation (CNCF) Technical Oversight Committee (TOC) voted to accept
Falco as an incubation-level hosted project.
Falco, which entered the CNCF Sandbox in October 2018, is an open source Kubernetes runtime security
project. It provides intrusion and abnormality detection for cloud native platforms such as Kubernetes,
Mesosphere, and Cloud Foundry.
BPF security capabilities
• Which processes are being
executed? By which processes?
• What network connections are
being made? By which processes?
• What permission denied errors
are happening on the system?
• Is this kernel/user function being
executed with these arguments?
Take away
• What’s eBPF
• Use eBPF based tools to debug
• New design idea
You don't need to know how to operate an X-ray machine,
but you do need to know that if you swallow a penny, an X-ray is an option!
www.bredangregg.com
What’s BPF?
• BPF全名為Berkeley Packet Filter, Introduced by Lawrence Berkeley
National Laboratory, 1992.
• 當時推出的目的是為了提高 BSD-based Kernel過濾封包的效率。
原理是將封包的過濾程式編譯後由Kernel中類似虛擬機的環境執
行。
• 和原先在Userspace過濾封包相比有更好的效能。
且透過編譯以及在核心內沙盒中執行的特性,能夠避免使用者把
Kernel搞壞掉。
Example of BPF – Tcpdump
Example of BPF – Tcpdump cont.
#檢查是否為IPV6,如果不是(jf),則視為IPV4 (GOTO Line:006)
#檢查是否為TCP
#檢查dst port是否為7070(0x1b9e),if so (jt) L014
#檢查是否為 ipv4封包
#檢查是否為 tcp封包
#檢查是否為 ip fragment packet
#找到tcp封包中 dest port 的所在位置
#檢查dst port是否為7070,若為真(jt) GOT L014
#Packet Match!
#Packet Mis-match!
How about eBPF (enhanced BPF)?
• 原先Kernel內bpf虛擬機的設計過時,不支援新硬體CPU架構
• eBPF相對bpf有更佳的硬體相容性,支援更大的register
• eBPF相對bpf有更快的編譯速度,在過濾網路封包時的效能也更好
• eBPF於2014年的版本後,便可直接從userspace操作
“Super powers have finally come to Linux“ – Brendan Gregg, Linux Conf. 2017
eBPF Architecture.
What can you do with eBPF?
• Filter traffic, at the lowest entry of linux network stack.
• Programs can be attached to tracepoints, kprobes, system calls, perf events,
etc.
Velocity 2017: Performance Analysis Superpowers with Linux eBPF - Brendan Gregg
https://www.youtube.com/watch?v=bj3qdEDbCD4
Use case of eBPF – Userspace tracing
https://github.com/iovisor/kubectl-trace
relationship between userspace threads
fnc
tid/pid/arg/ret
fnc
tid/pid/arg/ret
pkt
pkt
pkt
pkt
enqueue
tid/pid/arg/ret
dequeue
tid/pid/arg/ret
Get relationship by en/dequeue args and retval
https://github.com/mJace/ebpfKit/blob/master/Examples/cpp/README.md
eBPF related projects – XDP (express data path)
• Since Kernel v4.8
• Based on eBPF
• DDOS Protection
• Network security
• Network accelerate
eBPF related projects – sysdig
• Embed Security, Compliance and Performance Into Your DevOps Workflows
eBPF related projects – Falco
• Cloud-Native Runtime Security
Falco efficiently leverages Extended Berkeley Packet Filter (eBPF), a secure
mechanism, to capture system calls and gain deep visibility. By adding
Kubernetes application context and Kubernetes API audit events, teams can
understand who did what.
Other eBPF related implementations…
• Cilium – XDP based CNI
• Weavescope – ebpf based monitor tool
• Iptables – Bpfilter implementations to optimize ingress/outgress security
rules
• Calicio – Just release a alpha version that lavages ebpf
• Systemtap – Support eBPF now.
eBPF related projects – BCC
• BPF Compiler Collection (BCC)
BCC is a toolkit for creating efficient kernel tracing and manipulation programs, and includes several useful
tools and examples
https://github.com/iovisor/bcc
BCC tools example – tcpconlat (tcp latency)
BCC tools example – execsnoop ( trace syscall- exec)
bpftrace tool example – cpuwalk.
Demo 1 – containerized ebpf tool
• Bcc tools inside a container, and trace other container’s processes.
Target
container
ebpf
container
Host Machine
Kernel
ebpf
program
ebpf
map
https://github.com/mJace/ebpfKit/blob/master/Examples/bcc-demo/demo-01.md
Demo 2.
• Namespace-based tracing.
ebpf
container
Target Container
P3
P2
P1 How to trace all processes?????
Even process just created?
https://github.com/mJace/ebpfKit/blob/master/Examples/bcc-demo/demo-02.md
Software stack for ebpf related project
bpf,ebpf – main framework
XDP – Express data plane powered by ebpf
Bcc lib – library for higher app to communicate with bpf
go-bpf – golang lib for bpf
Bcc tools – userspace tool like tcptracer to trace all tcp status
bpftrace – high level userspace bpf based trace tool.
bpfebpf
Bcc lib
Kernel Space
User Space
Bcc tools
go-bpf
bpftrace tools
XDP
The future of eBPF
Kernel operations structures in BPF
what has been merged for 5.6 is not just a mechanism for hooking in TCP congestion-control algorithms……
this new infrastructure can be used to allow a BPF program to replace any "operations structure“ (in kernel)
https://lwn.net/Articles/811631/?fbclid=IwAR3otEAmjW4GS5i3hcWHzsy6hfmTIJwb_nUGHcT-
sS2aCOX1xcn9DuTfcwA
➢Update kernel without building kernel, even rebooting
➢Dynamic driver? Runtime configurable kernel driver, without re-bulding
➢Kernel layer cloud native application?
Q n’ A / Take away
• What’s eBPF
• 一種Linux內的技術,能讓人動態的觀察系統內的行為
• Use eBPF based tools to debug
• ebpf tool產生的overhead,遠低於傳統userspace monitor tool
• 可觀測幾乎所有系統內行為,從kernel到userspace
• New design idea
• eBPF打破以往kernel layer application可攜性極低的問題
You don't need to know how to operate an X-ray machine,
but you do need to know that if you swallow a penny, an X-ray is an option!
www.bredangregg.com
Reference.
• http://www.brendangregg.com/blog/2019-01-01/learn-ebpf-tracing.html
• https://hackmd.io/@sysprog/SJTuuG9a7?type=view
• https://github.com/iovisor/bpftrace
• https://github.com/iovisor/bcc
• https://github.com/iovisor/kubectl-trace

Contenu connexe

Tendances

Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Brendan Gregg
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringScyllaDB
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_mapslcplcp1
 
Linux BPF Superpowers
Linux BPF SuperpowersLinux BPF Superpowers
Linux BPF SuperpowersBrendan Gregg
 
[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?Akihiro Suda
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and moreBrendan Gregg
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerShu Sugimoto
 
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux KernelAccelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux KernelThomas Graf
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveMichal Rostecki
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumScyllaDB
 
Using GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnlUsing GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnlKentaro Ebisawa
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating SystemThomas Graf
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic ControlSUSE Labs Taipei
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPThomas Graf
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDPlcplcp1
 

Tendances (20)

Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)Performance Wins with eBPF: Getting Started (2021)
Performance Wins with eBPF: Getting Started (2021)
 
eBPF Basics
eBPF BasicseBPF Basics
eBPF Basics
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
DPDK In Depth
DPDK In DepthDPDK In Depth
DPDK In Depth
 
Xdp and ebpf_maps
Xdp and ebpf_mapsXdp and ebpf_maps
Xdp and ebpf_maps
 
Linux BPF Superpowers
Linux BPF SuperpowersLinux BPF Superpowers
Linux BPF Superpowers
 
[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?
 
BPF: Tracing and more
BPF: Tracing and moreBPF: Tracing and more
BPF: Tracing and more
 
eBPF/XDP
eBPF/XDP eBPF/XDP
eBPF/XDP
 
Tutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting routerTutorial: Using GoBGP as an IXP connecting router
Tutorial: Using GoBGP as an IXP connecting router
 
Accelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux KernelAccelerating Envoy and Istio with Cilium and the Linux Kernel
Accelerating Envoy and Istio with Cilium and the Linux Kernel
 
Kubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep DiveKubernetes Networking with Cilium - Deep Dive
Kubernetes Networking with Cilium - Deep Dive
 
Using eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in CiliumUsing eBPF for High-Performance Networking in Cilium
Using eBPF for High-Performance Networking in Cilium
 
eBPF maps 101
eBPF maps 101eBPF maps 101
eBPF maps 101
 
Using GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnlUsing GTP on Linux with libgtpnl
Using GTP on Linux with libgtpnl
 
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
BPF  & Cilium - Turning Linux into a Microservices-aware Operating SystemBPF  & Cilium - Turning Linux into a Microservices-aware Operating System
BPF & Cilium - Turning Linux into a Microservices-aware Operating System
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic Control
 
How to run P4 BMv2
How to run P4 BMv2How to run P4 BMv2
How to run P4 BMv2
 
Cilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDPCilium - Container Networking with BPF & XDP
Cilium - Container Networking with BPF & XDP
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 

Similaire à Introduction of eBPF - 時下最夯的Linux Technology

eBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfeBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfSGBSeo
 
Dataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and toolsDataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and toolsStefano Salsano
 
story_of_bpf-1.pdf
story_of_bpf-1.pdfstory_of_bpf-1.pdf
story_of_bpf-1.pdfhegikip775
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthScyllaDB
 
eBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfeBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfseo18
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!Affan Syed
 
Kernel bug hunting
Kernel bug huntingKernel bug hunting
Kernel bug huntingAndrea Righi
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?Niklas Heidloff
 
Calico-eBPF-Dataplane-CNCF-Webinar-Slides.pdf
Calico-eBPF-Dataplane-CNCF-Webinar-Slides.pdfCalico-eBPF-Dataplane-CNCF-Webinar-Slides.pdf
Calico-eBPF-Dataplane-CNCF-Webinar-Slides.pdfyingxinwang4
 
"APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre...
"APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre..."APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre...
"APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre...Edge AI and Vision Alliance
 
給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗William Yeh
 
DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...
DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...
DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...InfluxData
 
DEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depthDEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depthFelipe Prado
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdatedoscon2007
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017Patrick Chanezon
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In DeepMydbops
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Patrick Chanezon
 
How to Contribute to Cloud Native Computing Foundation
How to Contribute to Cloud Native Computing FoundationHow to Contribute to Cloud Native Computing Foundation
How to Contribute to Cloud Native Computing FoundationCodeOps Technologies LLP
 
How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)Krishna-Kumar
 

Similaire à Introduction of eBPF - 時下最夯的Linux Technology (20)

eBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfeBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdf
 
Dataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and toolsDataplane programming with eBPF: architecture and tools
Dataplane programming with eBPF: architecture and tools
 
story_of_bpf-1.pdf
story_of_bpf-1.pdfstory_of_bpf-1.pdf
story_of_bpf-1.pdf
 
Using eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster HealthUsing eBPF to Measure the k8s Cluster Health
Using eBPF to Measure the k8s Cluster Health
 
eBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfeBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdf
 
ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!ebpf and IO Visor: The What, how, and what next!
ebpf and IO Visor: The What, how, and what next!
 
Kernel bug hunting
Kernel bug huntingKernel bug hunting
Kernel bug hunting
 
When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?When to use Serverless? When to use Kubernetes?
When to use Serverless? When to use Kubernetes?
 
Calico-eBPF-Dataplane-CNCF-Webinar-Slides.pdf
Calico-eBPF-Dataplane-CNCF-Webinar-Slides.pdfCalico-eBPF-Dataplane-CNCF-Webinar-Slides.pdf
Calico-eBPF-Dataplane-CNCF-Webinar-Slides.pdf
 
"APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre...
"APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre..."APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre...
"APIs for Accelerating Vision and Inferencing: Options and Trade-offs," a Pre...
 
給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗給 RD 的 Kubernetes 初體驗
給 RD 的 Kubernetes 初體驗
 
DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...
DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...
DISTRIBUTED PERFORMANCE ANALYSIS USING INFLUXDB AND THE LINUX EBPF VIRTUAL MA...
 
Meetup 2009
Meetup 2009Meetup 2009
Meetup 2009
 
DEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depthDEF CON 27 - JEFF DILEO - evil e bpf in depth
DEF CON 27 - JEFF DILEO - evil e bpf in depth
 
Os Grossupdated
Os GrossupdatedOs Grossupdated
Os Grossupdated
 
What's New in Docker - February 2017
What's New in Docker - February 2017What's New in Docker - February 2017
What's New in Docker - February 2017
 
eBPF - Observability In Deep
eBPF - Observability In DeepeBPF - Observability In Deep
eBPF - Observability In Deep
 
Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017Moby Open Source Summit North America 2017
Moby Open Source Summit North America 2017
 
How to Contribute to Cloud Native Computing Foundation
How to Contribute to Cloud Native Computing FoundationHow to Contribute to Cloud Native Computing Foundation
How to Contribute to Cloud Native Computing Foundation
 
How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)How to contribute to cloud native computing foundation (CNCF)
How to contribute to cloud native computing foundation (CNCF)
 

Dernier

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Dernier (20)

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

Introduction of eBPF - 時下最夯的Linux Technology

  • 2. 梁維恩 Jace Liang SW / Infra. engineer at ITRI Facebook: jace.liang github: mJace
  • 3. TOC Votes to Move Falco into CNCF Incubator By Jessie January 8, 2020 in Blog Today, the Cloud Native Computing Foundation (CNCF) Technical Oversight Committee (TOC) voted to accept Falco as an incubation-level hosted project. Falco, which entered the CNCF Sandbox in October 2018, is an open source Kubernetes runtime security project. It provides intrusion and abnormality detection for cloud native platforms such as Kubernetes, Mesosphere, and Cloud Foundry.
  • 4. BPF security capabilities • Which processes are being executed? By which processes? • What network connections are being made? By which processes? • What permission denied errors are happening on the system? • Is this kernel/user function being executed with these arguments?
  • 5. Take away • What’s eBPF • Use eBPF based tools to debug • New design idea You don't need to know how to operate an X-ray machine, but you do need to know that if you swallow a penny, an X-ray is an option! www.bredangregg.com
  • 6. What’s BPF? • BPF全名為Berkeley Packet Filter, Introduced by Lawrence Berkeley National Laboratory, 1992. • 當時推出的目的是為了提高 BSD-based Kernel過濾封包的效率。 原理是將封包的過濾程式編譯後由Kernel中類似虛擬機的環境執 行。 • 和原先在Userspace過濾封包相比有更好的效能。 且透過編譯以及在核心內沙盒中執行的特性,能夠避免使用者把 Kernel搞壞掉。
  • 7. Example of BPF – Tcpdump
  • 8. Example of BPF – Tcpdump cont. #檢查是否為IPV6,如果不是(jf),則視為IPV4 (GOTO Line:006) #檢查是否為TCP #檢查dst port是否為7070(0x1b9e),if so (jt) L014 #檢查是否為 ipv4封包 #檢查是否為 tcp封包 #檢查是否為 ip fragment packet #找到tcp封包中 dest port 的所在位置 #檢查dst port是否為7070,若為真(jt) GOT L014 #Packet Match! #Packet Mis-match!
  • 9. How about eBPF (enhanced BPF)? • 原先Kernel內bpf虛擬機的設計過時,不支援新硬體CPU架構 • eBPF相對bpf有更佳的硬體相容性,支援更大的register • eBPF相對bpf有更快的編譯速度,在過濾網路封包時的效能也更好 • eBPF於2014年的版本後,便可直接從userspace操作 “Super powers have finally come to Linux“ – Brendan Gregg, Linux Conf. 2017
  • 11. What can you do with eBPF? • Filter traffic, at the lowest entry of linux network stack. • Programs can be attached to tracepoints, kprobes, system calls, perf events, etc.
  • 12. Velocity 2017: Performance Analysis Superpowers with Linux eBPF - Brendan Gregg https://www.youtube.com/watch?v=bj3qdEDbCD4
  • 13. Use case of eBPF – Userspace tracing https://github.com/iovisor/kubectl-trace
  • 14. relationship between userspace threads fnc tid/pid/arg/ret fnc tid/pid/arg/ret pkt pkt pkt pkt enqueue tid/pid/arg/ret dequeue tid/pid/arg/ret Get relationship by en/dequeue args and retval https://github.com/mJace/ebpfKit/blob/master/Examples/cpp/README.md
  • 15.
  • 16. eBPF related projects – XDP (express data path) • Since Kernel v4.8 • Based on eBPF • DDOS Protection • Network security • Network accelerate
  • 17. eBPF related projects – sysdig • Embed Security, Compliance and Performance Into Your DevOps Workflows
  • 18. eBPF related projects – Falco • Cloud-Native Runtime Security Falco efficiently leverages Extended Berkeley Packet Filter (eBPF), a secure mechanism, to capture system calls and gain deep visibility. By adding Kubernetes application context and Kubernetes API audit events, teams can understand who did what.
  • 19. Other eBPF related implementations… • Cilium – XDP based CNI • Weavescope – ebpf based monitor tool • Iptables – Bpfilter implementations to optimize ingress/outgress security rules • Calicio – Just release a alpha version that lavages ebpf • Systemtap – Support eBPF now.
  • 20. eBPF related projects – BCC • BPF Compiler Collection (BCC) BCC is a toolkit for creating efficient kernel tracing and manipulation programs, and includes several useful tools and examples https://github.com/iovisor/bcc
  • 21. BCC tools example – tcpconlat (tcp latency)
  • 22. BCC tools example – execsnoop ( trace syscall- exec)
  • 23. bpftrace tool example – cpuwalk.
  • 24. Demo 1 – containerized ebpf tool • Bcc tools inside a container, and trace other container’s processes. Target container ebpf container Host Machine Kernel ebpf program ebpf map https://github.com/mJace/ebpfKit/blob/master/Examples/bcc-demo/demo-01.md
  • 25. Demo 2. • Namespace-based tracing. ebpf container Target Container P3 P2 P1 How to trace all processes????? Even process just created? https://github.com/mJace/ebpfKit/blob/master/Examples/bcc-demo/demo-02.md
  • 26. Software stack for ebpf related project bpf,ebpf – main framework XDP – Express data plane powered by ebpf Bcc lib – library for higher app to communicate with bpf go-bpf – golang lib for bpf Bcc tools – userspace tool like tcptracer to trace all tcp status bpftrace – high level userspace bpf based trace tool. bpfebpf Bcc lib Kernel Space User Space Bcc tools go-bpf bpftrace tools XDP
  • 27. The future of eBPF Kernel operations structures in BPF what has been merged for 5.6 is not just a mechanism for hooking in TCP congestion-control algorithms…… this new infrastructure can be used to allow a BPF program to replace any "operations structure“ (in kernel) https://lwn.net/Articles/811631/?fbclid=IwAR3otEAmjW4GS5i3hcWHzsy6hfmTIJwb_nUGHcT- sS2aCOX1xcn9DuTfcwA ➢Update kernel without building kernel, even rebooting ➢Dynamic driver? Runtime configurable kernel driver, without re-bulding ➢Kernel layer cloud native application?
  • 28. Q n’ A / Take away • What’s eBPF • 一種Linux內的技術,能讓人動態的觀察系統內的行為 • Use eBPF based tools to debug • ebpf tool產生的overhead,遠低於傳統userspace monitor tool • 可觀測幾乎所有系統內行為,從kernel到userspace • New design idea • eBPF打破以往kernel layer application可攜性極低的問題 You don't need to know how to operate an X-ray machine, but you do need to know that if you swallow a penny, an X-ray is an option! www.bredangregg.com
  • 29. Reference. • http://www.brendangregg.com/blog/2019-01-01/learn-ebpf-tracing.html • https://hackmd.io/@sysprog/SJTuuG9a7?type=view • https://github.com/iovisor/bpftrace • https://github.com/iovisor/bcc • https://github.com/iovisor/kubectl-trace