eBPF
Original author(s) | Alexei Starovoitov, Daniel Borkmann[1][2] |
---|---|
Developer(s) | Open source community, Meta, Google, Isovalent, Microsoft, Netflix[1] |
Initial release | 2014[3] |
Repository | Linux: git Windows: github |
Written in | C |
Operating system | Linux, Windows[4] |
Type | Runtime system |
License | Linux: GPL Windows: MIT License |
Website | ebpf.io |
eBPF (sometimes referred to by the acronym BPF, standing for Berkeley Packet Filter)[2][5] is a technology that can run programs in a privileged context such as the operating system kernel.[6] It is used to safely and efficiently extend the capabilities of the kernel at runtime without requiring changes to kernel source code or loading kernel modules.[7] Safety is provided through an in-kernel verifier which performs static code analysis and rejects programs which crash, hang or otherwise interfere with the kernel negatively.[8][9] This validation model differs from sandboxed environments, where the execution environment is restricted and the runtime has no insight about the program.[10] Examples of programs that are automatically rejected are programs without strong exit guarantees (i.e. for/while loops without exit conditions) and programs dereferencing pointers without safety-checks.[11] Loaded programs which passed the verifier are either interpreted or in-kernel JIT compiled for native execution performance. The execution model is event-driven and with few exceptions run-to-completion,[2] meaning, programs can be attached to various hook points in the operating system kernel and are run upon triggering of an event. eBPF use cases include (but are not limited to) networking such as XDP, tracing and security subsystems.[6] Given eBPF's efficiency and flexibility opened up new possibilities to solve production issues, Brendan Gregg famously dubbed eBPF "superpowers for Linux".[12] Linus Torvalds said, "BPF has actually been really useful, and the real power of it is how it allows people to do specialized code that isn't enabled until asked for".[13] Due to its success in Linux, the eBPF runtime has been ported to other operating systems such as Windows.[4]
History
Evolution from classic BPF
eBPF was built on top of the Berkeley Packet Filter (cBPF). At the lowest level, it introduced the use of ten 64-bit registers (instead of two 32-bit long registers for cBPF), different jump semantics, a call instruction and corresponding register passing convention, new instructions, and a different encoding for these instructions.[14]
Date | Event |
---|---|
April 2011 | The first in-kernel Linux JIT compiler for the classic Berkeley Packet Filter got merged.[15] |
January 2012 | The first non-networking use case of the classic Berkeley Packet Filter, seccomp-bpf,[16] appeared; it allows filtering of system calls using a configurable policy implemented through BPF instructions. |
March 2014 | David S. Miller, primary maintainer of the Linux networking stack, accepted the rework of the old in-kernel BPF interpreter. It was replaced by an eBPF interpreter and the Linux kernel internally translates classic BPF (cBPF) into eBPF instructions.[17] |
March 2015 | The ability to attach eBPF to kprobes as first tracing use case was merged.[19] In the same month, initial infrastructure work got accepted to attach eBPF to the networking traffic control (tc) layer allowing to attach eBPF to the core ingress and later also egress paths of the network stack, later heavily used by projects such as Cilium.[20][21][22] |
August 2015 | The eBPF compiler backend got merged into LLVM 3.7.0 release.[23] |
September 2015 | Brendan Gregg announced a collection of new eBPF-based tracing tools as the bcc project, providing a front-end for eBPF to make it easier to write programs.[24] |
July 2016 | eBPF got the ability to be attached into network driver's core receive path. This layer is known today as eXpress DataPath (XDP) and was added as a response to DPDK to create a fast data path which works in combination with the Linux kernel rather than bypassing it.[25][26][27] |
August 2016 | Cilium was initially announced during LinuxCon as a project providing fast IPv6 container networking with eBPF and XDP. Today, Cilium has been adopted by major cloud provider's Kubernetes offerings and is one of the most widely used CNIs.[28][22][29] |
November 2016 | Netronome added offload of eBPF programs for XDP and tc BPF layer to their NIC.[30] |
May 2017 | Meta's layer 4 load-balancer, Katran, went live. Every packet towards facebook.com since then has been processed by eBPF & XDP.[31] |
November 2017 | eBPF becomes its own kernel subsystem to ease the continuously growing kernel patch management. The first pull request by eBPF maintainers was submitted.[32] |
September 2017 | Bpftool was added to the Linux kernel as a user space utility to introspect the eBPF subsystem.[33] |
January 2018 | A new socket family called AF_XDP was published, allowing for high performance packet processing with zero-copy semantics at the XDP layer.[34] Today, DPDK has an official AF_XDP poll-mode driver support.[35] |
February 2018 | The bpfilter prototype has been published, allowing translation of a subset of iptables rulesets into eBPF via a newly developed user mode driver. The work has caused controversies due to the ongoing nftables development effort and has not been merged into mainline.[36][37] |
October 2018 | The new bpftrace tool has been announced by Brendan Gregg as DTrace 2.0 for Linux.[38] |
November 2018 | eBPF introspection has been added for kTLS in order to support the ability for in-kernel TLS policy enforcement.[39] |
November 2018 | BTF (BPF Type Format) has been added to the Linux kernel as an efficient meta data format which is approximately 100x smaller in size than DWARF.[40] |
December 2019 | The first 880-page long book on BPF, written by Brendan Gregg, was released.[41] |
March 2020 | Google upstreamed BPF LSM support into the Linux kernel, enabling programmable LSMs through eBPF.[42] |
September 2020 | The eBPF compiler backend for GCC was merged.[43] |
Adoption
eBPF has been adopted by a number of large-scale production users, for example:
- Meta uses eBPF through their Katran layer 4 load-balancer for all traffic going to facebook.com[44][45][46][31]
- Google uses eBPF in GKE, developed and uses BPF LSM to replace audit and it uses eBPF for networking[29][47][48][49]
- Cloudflare uses eBPF for load-balancing and DDoS protection and security enforcement[50][51][52][53][54]
- Netflix uses eBPF for fleet-wide network observability and performance diagnosis[55][56]
- Dropbox uses eBPF through Katran for layer 4 load-balancing[57]
- Android uses eBPF for NAT46 and traffic monitoring[58][59][60]
- Alibaba uses eBPF for Kubernetes Pod load-balancing[61]
- Datadog uses eBPF for Kubernetes Pod networking and security enforcement[62][63][64]
- Trip.com uses eBPF for Kubernetes Pod networking[65][66]
- Microsoft ported eBPF and XDP to Windows[67][68][69]
- Seznam uses eBPF through Cilium for layer 4 load-balancing[70]
- CapitalOne uses eBPF for Kubernetes Pod networking[71]
- Apple uses eBPF for Kubernetes Pod security[72]
- Sky uses eBPF for Kubernetes Pod networking[73]
- Walmart uses eBPF for layer 4 load-balancing[74][75]
- Huawei uses eBPF through their DIGLIM secure boot system[76]
- Ikea uses eBPF for Kubernetes Pod networking[77]
Logo
The bee is the official logo for eBPF. At the first eBPF Summit there was a vote taken and the bee mascot was named "eBee".[78][79] The logo has originally been created by Vadim Shchekoldin.[79] Earlier unofficial eBPF mascots have existed in the past,[80] but haven't seen widespread adoption.
Naming
There has been controversy around the naming of eBPF. The alias eBPF is often interchangeably used with BPF, for example by the Linux kernel community. eBPF and BPF is referred to as a technology name like LLVM.[2] eBPF evolved from the Berkeley Packet Filter as an extended version, but its use case outgrew networking, and today eBPF as a pseudo-acronym is preferred.[2]
eBPF Foundation
The eBPF Foundation was created in August 2021 with the goal to expand the contributions being made to extend the powerful capabilities of eBPF and grow beyond Linux.[1] Founding members include Meta, Google, Isovalent, Microsoft and Netflix. The purpose is to raise, budget and spend funds in support of various open source, open data and/or open standards projects relating to eBPF technologies[81] to further drive the growth and adoption of the eBPF ecosystem. Since inception, Red Hat, Huawei, Crowdstrike, Tigera, DaoCloud, Datoms, FutureWei also joined.[82]
Security concerns
Due to the ease of programmability, eBPF has been used as a tool for implementing microarchitectural timing side-channel attacks such as Spectre against vulnerable microprocessors.[83] While unprivileged eBPF implemented mitigations against transient execution attacks,[84] unprivileged use has ultimately been disabled by the kernel community by default to protect from use against future hardware vulnerabilities.[85]
Conferences
The eBPF community organises a number of technical workshops and conferences to discuss ongoing research, development efforts, and use cases around eBPF. They can broadly be categorised into user-focused conferences and more developer-focused conferences.
User-focused conferences:
- eBPF Summit, a user conference around eBPF production users and projects building upon eBPF[86][87][88]
- Cloud Native eBPF Day, a CNCF event co-located with KubeCon for the cloud native community[89][90]
Developer-focused conferences:
- LSF/MM/BPF workshop, an annual technical workshop for the BPF Linux kernel community[91][92]
- BPF track at Linux Plumbers conference, a technical track for the BPF Linux kernel community and surrounding user space libraries and tooling[93][94][95][96][97][98]
See also
References
- ^ a b c "Meta, Google, Isovalent, Microsoft and Netflix Launch eBPF Foundation as Part of the Linux Foundation". Linux Foundation. 12 August 2021. Retrieved 1 July 2022.
- ^ a b c d e "BPF Internals". USENIX LISA 2021 conference. 1 June 2021. Retrieved 1 July 2022.
- ^ "eBPF and Kubernetes: Little Helper Minions for Scaling Microservices". CNCF KubeCon + CloudNativeCon Europe 2020. 19 August 2020. Retrieved 1 July 2022.
- ^ a b "Making eBPF work on Windows". Microsoft Open Source Blog. 10 May 2021. Retrieved 1 July 2022.
- ^ Brendan Gregg (December 2019). BPF Performance Tools. Addison-Wesley. ISBN 978-0136554820.
- ^ a b "eBPF Documentation: What is eBPF?". eBPF.io. Retrieved 1 July 2022.
- ^ "eBPF - Rethinking the Linux Kernel". QCon 2020. Retrieved 1 July 2022.
- ^ "Safe Programs The Foundation of BPF". eBPF Summit 2021. 8 November 2020. Retrieved 1 July 2022.
- ^ "BPF and Spectre: Mitigating transient execution attacks". POPL 2022 conference. 22 January 2022. Retrieved 1 July 2022.
- ^ "eBPF - The Silent Platform Revolution from Cloud Native" (PDF). SIGCOMM 2023, 1st Workshop on eBPF and Kernel Extensions. 10 September 2023. Retrieved 5 October 2023.
- ^ Hedam, Niclas (2021). "eBPF - From a Programmer's Perspective" (PDF). doi:10.13140/RG.2.2.33688.11529/3.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ "Linux BPF Superpowers". Brendan Gregg's Blog. 5 March 2016. Retrieved 1 July 2022.
- ^ "Linus Torvalds talks about coming back to work on Linux". zdnet Interview with Linus Torvalds. 23 October 2018. Retrieved 1 July 2022.
- ^ "Classic BPF vs eBPF". LWN. March 2014. Retrieved 6 January 2023.
- ^ "net: filter: Just In Time compiler". lore.kernel.org. April 2011. Retrieved 1 July 2022.
- ^ "Yet another new approach to seccomp". LWN. 1 January 2012. Retrieved 1 July 2022.
- ^ "BPF updates". lore.kernel.org. March 2014. Retrieved 1 July 2022.
- ^ "Happy birthday BPF!". lore.kernel.org. September 2014. Retrieved 1 July 2022.
- ^ "tracing: attach eBPF programs to kprobes". lore.kernel.org. March 2015. Retrieved 1 July 2022.
- ^ "eBPF support for cls_bpf". lore.kernel.org. March 2015. Retrieved 1 July 2022.
- ^ "net, sched: add clsact qdisc". lore.kernel.org. January 2016. Retrieved 1 July 2022.
- ^ a b "eBPF-based Networking, Observability, Security". cilium.io. January 2016. Retrieved 1 July 2022.
- ^ "LLVM 3.7 Release Notes". releases.llvm.org. August 2015. Retrieved 1 July 2022.
- ^ "bcc: Taming Linux 4.3+ Tracing Superpowers". brendangregg.com. September 2015. Retrieved 1 July 2022.
- ^ "Add driver bpf hook for early packet drop and forwarding". lore.kernel.org. July 2016. Retrieved 1 July 2022.
- ^ "eCHO episode 9: XDP and Load Balancing". youtube.com. June 2021. Retrieved 1 July 2022.
- ^ Høiland-Jørgensen, Toke; Brouer, Jesper Dangaard; Borkmann, Daniel; Fastabend, John; Herbert, Tom; Ahern, David; Miller, David (December 2018). "The eXpress data path: Fast programmable packet processing in the operating system kernel". Proceedings of the 14th International Conference on emerging Networking EXperiments and Technologies. acm.org. pp. 54–66. doi:10.1145/3281411.3281443. ISBN 9781450360807. S2CID 53779310. Retrieved 1 July 2022.
- ^ "Cilium - Fast IPv6 Container Networking with BPF and XDP". slideshare.net. August 2016. Retrieved 1 July 2022.
- ^ a b "New GKE Dataplane V2 increases security and visibility for containers". cloud.google.com. May 2021. Retrieved 16 August 2022.
- ^ "nfp ring reconfiguration and XDP support". lore.kernel.org. November 2016. Retrieved 1 July 2022.
- ^ a b "XDP 1.5 Years In Production. Evolution and Lessons Learned". lpc.events. November 2018. Retrieved 16 August 2022.
- ^ "pull-request: bpf 2017-11-23". lore.kernel.org. November 2017. Retrieved 1 July 2022.
- ^ "tools: add bpftool". lore.kernel.org. September 2017. Retrieved 1 July 2022.
- ^ "Introducing AF_XDP support". lore.kernel.org. January 2018. Retrieved 1 July 2022.
- ^ "AF_XDP Poll Mode Driver". doc.dpdk.org. August 2022. Retrieved 16 August 2022.
- ^ "BPF comes to firewalls". lwn.net. February 2018. Retrieved 1 July 2022.
- ^ "Why is the kernel community replacing iptables with BPF?". cilium.io. April 2018. Retrieved 1 July 2022.
- ^ "bpftrace (DTrace 2.0) for Linux 2018". brendangregg.com. October 2018. Retrieved 16 August 2022.
- ^ "Combining kTLS and BPF for Introspection and Policy Enforcement" (PDF). vger.kernel.org. November 2018. Retrieved 1 July 2022.
- ^ "BTF deduplication and Linux kernel BTF". nakryiko.com. November 2018. Retrieved 1 July 2022.
- ^ "BPF Performance Tools (book)". brendangregg.com. December 2019. Retrieved 16 August 2022.
- ^ "MAC and Audit policy using eBPF (KRSI)". lore.kernel.org. March 2020. Retrieved 16 August 2022.
- ^ "BPF in GCC". lwn.net. September 2020. Retrieved 16 August 2022.
- ^ "Open-sourcing Katran, a scalable network load balancer". fb.com. May 2018. Retrieved 16 August 2022.
- ^ "BPF at Facebook". youtube.com. December 2019. Retrieved 16 August 2022.
- ^ "From XDP to socket". lpc.events. September 2021. Retrieved 16 August 2022.
- ^ "eCHO episode 29: BPF LSM with KP Singh". youtube.com. November 2021. Retrieved 16 August 2022.
- ^ "BPF security auditing at Google - Brendan Jackman/KP Singh". youtube.com. November 2021. Retrieved 16 August 2022.
- ^ "Replacing HTB with EDT and BPF". netdevconf.info. July 2020. Retrieved 16 August 2022.
- ^ "Cloudflare architecture and how BPF eats the world". blog.cloudflare.com. May 2019. Retrieved 16 August 2022.
- ^ "It's crowded in here!". blog.cloudflare.com. October 2019. Retrieved 16 August 2022.
- ^ "Production ready eBPF, or how we fixed the BSD socket API". blog.cloudflare.com. February 2022. Retrieved 16 August 2022.
- ^ "Live-patching security vulnerabilities inside the Linux kernel with eBPF Linux Security Module". blog.cloudflare.com. June 2022. Retrieved 16 August 2022.
- ^ "Unimog - Cloudflare's edge load balancer". blog.cloudflare.com. September 2020. Retrieved 16 August 2022.
- ^ "How Netflix uses eBPF flow logs at scale for network insight". netflixtechblog.com. June 2021. Retrieved 16 August 2022.
- ^ "Extending Vector with eBPF to inspect host and container performance". netflixtechblog.com. February 2019. Retrieved 16 August 2022.
- ^ "Dropbox traffic infrastructure: Edge network". dropbox.tech. October 2018. Retrieved 16 August 2022.
- ^ "eBPF Traffic Monitoring". source.android.com. August 2022. Retrieved 16 August 2022.
- ^ "Extending the Kernel with eBPF". source.android.com. August 2022. Retrieved 16 August 2022.
- ^ "NAT46 translation with BPF". lore.kernel.org. April 2022. Retrieved 16 August 2022.
- ^ "How Does Alibaba Cloud Build High-Performance Cloud-Native Pod Networks in Production Environments?". alibabacloud.com. September 2020. Retrieved 16 August 2022.
- ^ "Datadog on eBPF". datadogon.datadoghq.com. February 2021. Retrieved 16 August 2022.
- ^ "Runtime Security Monitoring with eBPF" (PDF). sstic.org. February 2021. Retrieved 16 August 2022.
- ^ "Our eBPF Journey at Datadog - Laurent Bernaille & Tabitha Sable, Datadog". youtube.com. November 2020. Retrieved 16 August 2022.
- ^ "User Story - How Trip.com uses Cilium". cilium.io. February 2020. Retrieved 16 August 2022.
- ^ "Trip.com: Stepping into Cloud Native Networking Era with Cilium+BGP". arthurchiao.art. November 2020. Retrieved 16 August 2022.
- ^ "Making eBPF work on Windows". cloudblogs.microsoft.com. May 2021. Retrieved 16 August 2022.
- ^ "Getting Linux based eBPF programs to run with eBPF for Windows". cloudblogs.microsoft.com. February 2022. Retrieved 16 August 2022.
- ^ "Progress on making eBPF work on Windows". cloudblogs.microsoft.com. November 2019. Retrieved 16 August 2022.
- ^ "Cilium Standalone Layer 4 Load Balancer XDP". cilium.io. July 2022. Retrieved 16 August 2022.
- ^ "Building a Secure and Maintainable PaaS - Bradley Whitfield, Capital One". youtube.com. November 2020. Retrieved 16 August 2022.
- ^ "Think eBPF for Kernel Security Monitoring - Falco at Apple- Eric Sage & Melissa Kilby, Apple". youtube.com. October 2021. Retrieved 16 August 2022.
- ^ "eBPF & Cilium at Sky – Sebastian Duff, Anthony Comtois, Jospeh Samuel, Sky". youtube.com. August 2021. Retrieved 16 August 2022.
- ^ "Running and orchestrating multiple XDP and TC programs – Brian Merrell, Walmart". youtube.com. August 2021. Retrieved 16 August 2022.
- ^ "High Performance Load Balancing @Walmart – Kanthi Pavuluri & Karan Dalal, Walmart". youtube.com. August 2021. Retrieved 16 August 2022.
- ^ "DIGLIM eBPF: secure boot at application level with minimal changes to distros - Roberto Sassu". youtube.com. August 2022. Retrieved 16 August 2022.
- ^ "IKEA Private Cloud, eBPF Based Networking, Load Balancing, and Observability with... Karsten Nielsen". youtube.com. May 2022. Retrieved 16 August 2022.
- ^ "eBPF Summit Day Two". cilium.io. October 2020. Retrieved 1 July 2022.
- ^ a b "What is the bee named?". ebpf.io. Retrieved 1 July 2022.
- ^ "eBPF: One Small Step". Brendan Gregg's Blog. May 2015. Retrieved 1 July 2022.
- ^ "eBPF Foundation Charter". ebpf.foundation. June 2021. Retrieved 16 August 2022.
- ^ "eBPF Foundation Governance". ebpf.foundation. August 2022. Retrieved 16 August 2022.
- ^ "Reading privileged memory with a side-channel". googleprojectzero.blogspot.com. 3 January 2018. Retrieved 16 August 2022.
- ^ "BPF and Spectre: Mitigating transient execution attacks". popl22.sigplan.org. Retrieved 16 August 2022.
- ^ "bpf: Disallow unprivileged bpf by default". kernel.org. Retrieved 16 August 2022.
- ^ "eBPF Summit 2020". eBPF.io. August 2020. Retrieved 1 July 2022.
- ^ "eBPF Summit 2021". eBPF.io. August 2021. Retrieved 1 July 2022.
- ^ "eBPF Summit 2022". eBPF.io. August 2022. Retrieved 1 August 2022.
- ^ "Cloud Native eBPF Day North America 2021". linuxfoundation.org. October 2021. Retrieved 1 January 2022.
- ^ "Cloud Native eBPF Day Europe 2022". linuxfoundation.org. May 2022. Retrieved 1 July 2022.
- ^ "LSF/MM/BPF, bpfconf 2019". kernel.org. April 2019. Retrieved 1 July 2022.
- ^ "LSF/MM/BPF, bpfconf 2022". kernel.org. May 2022. Retrieved 1 July 2022.
- ^ "LPC 2017, Tracing & BPF micro-conference". lpc.events. September 2017. Retrieved 1 July 2022.
- ^ "LPC 2018, BPF micro-conference". kernel.org. November 2018. Retrieved 1 July 2022.
- ^ "LPC 2019, BPF micro-conference". lpc.events. September 2019. Retrieved 1 July 2022.
- ^ "LPC 2020, Networking and BPF Summit". lpc.events. August 2020. Retrieved 1 July 2022.
- ^ "LPC 2021, BPF & Networking Summit". lpc.events. September 2021. Retrieved 1 July 2022.
- ^ "LPC 2022, eBPF & Networking Summit". lpc.events. September 2022. Retrieved 16 August 2022.
Further reading
- Gregg, Brendan (December 2019). BPF Performance Tools. Addison-Wesley. ISBN 978-0136554820.
- David Calavera, Lorenzo Fontana (December 2019). Linux Observability With BPF. O'Reilly Media, Incorporated. ISBN 978-1492050209.
- Gregg, Brendan (December 2020). Systems Performance, Second edition. ISBN 978-0136820154.
- Rice, Liz (April 2022). What Is eBPF?. ISBN 978-1492097259.
- Rice, Liz (April 2023). Learning eBPF: Programming the Linux Kernel for Enhanced Observability, Networking, and Security. O'Reilly Media. ISBN 978-1098135126.