Skip to content

carbonvibes/eBPF_Materials

Repository files navigation

Introduction to eBPF

Welcome to the Introduction to eBPF repository! This repository is a curated collection of resources, examples, and tools to help you dive into the powerful world of eBPF (extended Berkeley Packet Filter). Whether you’re a beginner or an advanced user, this repository provides theory, practical knowledge, and interactive labs to enhance your understanding of eBPF.


What is eBPF?

eBPF is a revolutionary technology that allows you to run custom programs in the Linux kernel safely and efficiently without modifying kernel source code. It’s used for:

  • Observability and performance monitoring.
  • Networking and security.
  • Debugging and tracing applications.

eBPF programs are JIT-compiled and run in a sandboxed environment, offering minimal overhead with maximum flexibility.


Note to Zahraa, How eBPF can be used here for your project:

eBPF (extended Berkeley Packet Filter) revolutionizes network data handling by allowing custom, high-performance code to run safely inside the Linux kernel, enabling deep packet inspection, real-time filtering (like DDoS defense), advanced load balancing, and granular observability (network/security monitoring) without modifying apps or the kernel. It works by attaching small programs to kernel "hooks" (network events) that analyze packet headers (IP, TCP/UDP), metadata, and even application data, using maps for efficient communication with user-space tools, offering huge gains in security and performance for cloud-native environments.

Resources

Books

  1. Learning eBPF by Liz Rice
    (Theory Knowledge) – A great introduction to the concepts and architecture of eBPF.
  2. BPF Performance Tools by Brendan Gregg
    (Practical Knowledge) – A comprehensive guide to leveraging eBPF for performance analysis.

Interactive Labs

  1. Interactive eBPF Lab 1
    A beginner-friendly interactive lab to understand eBPF fundamentals.
  2. Interactive eBPF Lab 2
    Dive deeper into writing eBPF programs with this hands-on tutorial.

YouTube Tutorials

  1. Tutorial: Getting Started with eBPF - Liz Rice, Isovalent
    A beginner's introduction to eBPF, covering key concepts and workflows.
  2. A Beginner's Guide to eBPF Programming with Go • Liz Rice • GOTO 2021
    For those who want to learn eBPF using the native Go library.
  3. What is eBPF eBPF explained in 120 seconds.

Official Website

  • eBPF.io
    Stay updated with the latest eBPF developments, projects, and documentation.

My Previous Work


Ways to Write eBPF Programs

  1. Libbpf:

    • Difficulty: Hard
    • Write eBPF programs using BPF CO-RE (Compile Once, Run Everywhere) in pure C.
    • Highly customizable with full control over your programs.
  2. BCC Tools (Python Wrappers):

    • Difficulty: Mid-Hard
    • Simplify eBPF programming using higher-level APIs with Python wrappers.
    • Note: BCC Tools supports Lua & Python but does not support Go.
    • GitHub Repository: BCC Tools
  3. Native Go Library:

    • Difficulty: Mid-Hard
    • Write eBPF programs directly in Go using its native support for eBPF.
    • Useful Repository: Cilium eBPF Library for Go
    • Ideal for Go developers, offering flexibility and direct kernel interaction.
  4. BPFtrace:

    • Difficulty: Easy-Mid
    • Write eBPF scripts using a high-level scripting language.
    • GitHub Repository: BPFtrace
    • Perfect for quick prototyping and observability tasks.

Example Tracing Programs

Explore example programs written with popular eBPF tools to trace system events and gain insights into kernel behavior.

  1. Using BPFtrace:

    • GitHub Repository: BPFtrace Tools Examples
    • Examples include simple tracing programs for file operations, system calls, and performance monitoring.
  2. Using BCC Tools (Python Wrapper):

    • GitHub Repository: BCC Tools Examples
    • Examples include Python-based tools for tracing TCP connections, disk I/O, and process-level events.

eBPF for Windows

eBPF is being adapted for the Windows platform, offering similar capabilities to its Linux counterpart.

Key Notes:

  • This project is currently under development.
  • The documentation and resources available for eBPF on Windows are not yet vast but are growing steadily.

To be Continued...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages