{"id":476,"date":"2023-07-23T18:46:17","date_gmt":"2023-07-23T18:46:17","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=476"},"modified":"2023-07-23T18:46:17","modified_gmt":"2023-07-23T18:46:17","slug":"ebpf","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=476","title":{"rendered":"What is eBPF?"},"content":{"rendered":"<p>eBPF, or Extended Berkeley Packet Filter, is a recent addition to the Linux kernel, fully available since the Linux 4.4 release.<\/p>\n<p>It is a highly efficient, <strong>sandboxed virtual machine<\/strong> within the Linux kernel that allows for the kernel to be programmable at native execution speed.<\/p>\n<p>This means that you can extend the capabilities of the kernel <strong>without having to modify the kernel&#8217;s source code<\/strong>, making it a powerful tool for developers and system administrators.<\/p>\n<p>For example, when a <strong>read system call<\/strong> event occurs, you can run a BPF program. This allows for a high degree of customization and control over system behavior.<\/p>\n<p>eBPF has a wide range of use cases, including:<\/p>\n<ol>\n<li><strong>Security<\/strong>: eBPF can be used to implement advanced security mechanisms, such as intrusion detection systems or firewalls. It can monitor system calls, network packets, and other events for suspicious activity.<\/li>\n<li><strong>Networking Tracing<\/strong>: eBPF can trace network packets as they pass through the various layers of the network stack, providing detailed information about network behavior and performance.<\/li>\n<li><strong>Profiling<\/strong>: eBPF can be used to profile system performance, helping to identify bottlenecks and optimize system behavior.<\/li>\n<li><strong>Observability<\/strong>: eBPF provides a powerful tool for system observability, allowing for detailed monitoring of system events and behavior.<\/li>\n<li><strong>Monitoring<\/strong>: eBPF can be used to implement advanced system monitoring tools, providing real-time information about system performance and behavior.<\/li>\n<\/ol>\n<p>Major companies like <strong>Google, Facebook, and Netflix <\/strong>have already implemented eBPF for various use cases in their production systems, demonstrating the power and flexibility of this technology.<\/p>\n<p>In the context of <strong>Kubernetes<\/strong>, the open-source network plugin Cilium uses BPF for Kubernetes networking, providing advanced networking features and performance enhancements.<\/p>\n<p>Furthermore, the Linux kernel development community has announced <strong>bpfilter<\/strong>, which will replace the in-kernel iptables implementation with a high-performance, Linux-based BPF network filtering mechanism. This represents a significant advancement in Linux networking technology.<\/p>\n<p>In conclusion, eBPF is a powerful and flexible technology that can greatly enhance the capabilities of the Linux kernel. Whether you&#8217;re a developer, a system administrator, or just a tech enthusiast, understanding and utilizing eBPF can provide significant benefits.<\/p>\n<h2 id=\"bpf-learning-resources\">BPF Learning resources<\/h2>\n<p>[1]. <a href=\"https:\/\/ebpf.io\/what-is-ebpf\/?ref=devopscube.com\">Getting Started With eBPF<\/a><\/p>\n<p>[2]. <a href=\"https:\/\/www.infoq.com\/presentations\/linux-cilium-ebpf\/?ref=devopscube.com\">How to Make Linux Microservice-Aware with Cilium and eBPF<\/a> \u2014 [[<a href=\"https:\/\/www.youtube.com\/watch?v=_Iq1xxNZOAo&#038;ref=devopscube.com\">Video<\/a>]<\/p>\n<p>[3]. <a href=\"https:\/\/www.youtube.com\/watch?v=7pmXdG8-7WU&#038;ref=devopscube.com\">Brendan Gregg, Senior Performance Engineer, Netflix Performance and OS Team, explores the past, present and future of BPF, and describes use cases.<\/a><\/p>\n<p>[4]. <a href=\"https:\/\/lwn.net\/Articles\/747551\/?ref=devopscube.com\">BPF Comes to Firewall<\/a><\/p>\n<p>[5]. <a href=\"https:\/\/www.youtube.com\/watch?v=f-oTe-dmfyI&#038;ref=devopscube.com\">How companies like Facebook and Google use BPF to patch 0-day exploits<\/a><\/p>\n<p>[6] <a href=\"https:\/\/blog.cloudflare.com\/tubular-fixing-the-socket-api-with-ebpf\/?ref=devopscube.com\">Cloudflare Production ready eBPF<\/a><\/p>\n<p>[7]. <a href=\"https:\/\/www.youtube.com\/watch?v=lrP7hk-EW4U&#038;ref=devopscube.com\">Replacing iptables with eBPF in Kubernetes with Cilium<\/a><\/p>\n<p>[8]. <a href=\"https:\/\/github.com\/cilium\/cilium?ref=devopscube.com\">Cilium Kubernetes Network Plugin<\/a><\/p>\n<p>[9]. <a href=\"https:\/\/www.youtube.com\/watch?v=3LoWZMxKaA0&#038;ref=devopscube.com\">eBPF: exploring use case of BPF kernel infrastructure<\/a><\/p>\n<p>[10]. <a href=\"https:\/\/blog.cloudflare.com\/bpf-the-forgotten-bytecode\/?ref=devopscube.com\">BPF &#8211; the forgotten bytecode<\/a><\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/ebpf\/\" target=\"_blank\" rel=\"noopener noreferrer\">What is eBPF? \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/ebpf\/<\/p>\n","protected":false},"author":1,"featured_media":477,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=476"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/476\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/477"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}