Skip to content

Small test suite for eBPF programs running at the XDP level

Notifications You must be signed in to change notification settings

alexbradd/ebpf-xdp-test-suite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eBPF test suite

A small test suite of eBPF programs running at the XDP level for testing the basics of a XDP-capable driver.

This was written as part of the final project evaluation of the Advanced Operating Systems course at Politecnico di Milano, a.y. 2023/2024. The other part of the project is an initial implementation of XDP support for the OpenNIC driver, which can be found on my colleagues fork.

What is tested

  • Simple program loading
    • simple eBPF application
  • XDP_PASSing and XDP_DROPping packets
    • pass_drop eBPF application
  • Echoing back packets with XDP_TX
    • tx eBPF program
  • Redirecting packets with XDP_REDIRECT
    • redirect_iface eBPF program

Plus other helpers (udp_log and lib/helpers.bash).

Building and running

After you made sure that all submodules have been initialized, in the root of the project run make, run the program you need and check the output of the kernel debug trace/tcpdump/whatever you are using.

Topologies can be emulated by creating veth interfaces using the helper shell functions available in lib/helpers.bash.

All eBPF applications take at least one argument, the interface to attach to, and should be run as root.

Acknowledgments

Heavy inspiration taken from the eBPF laboratories of the Network Computing course (code here) and the project I did for the same course.

Ideas about what to test have been taken from this presentation from RedHat about adding XDP support to a driver.

About

Small test suite for eBPF programs running at the XDP level

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published