eBPF stands for extended BPF. This is an extended version of Berkeley Packet Filter available in recent
Linux kernel versions.
It provides more advanced features with eBPF programs developed in C and able to use structured data shared
It provides more advanced features with eBPF programs developed in C and capability to use structured data shared
between kernel and userspace.
eBPF is used for three things in Suricata:
- eBPF filter: any BPF like filter can be developed. An example of filter accepting only packet for some VLANs is provided.
- eBPF filter: any BPF like filter can be developed. An example of filter accepting only packet for some VLANs is provided. A bypass implementation is also provided.
- eBPF load balancing: provide programmable load balancing. A simple ippair load balancing is provided.
- XDP programs: suricata can load XDP programs. A bypass program is provided.
@ -37,7 +37,7 @@ Requirements
You will need a kernel that supports XDP and, for real performance improvement, a network
card that support XDP in the driver.
Suricata XDP code has been tested with 4.13.10 but 4.15 or later is necessary to have all
Suricata XDP code has been tested with 4.13.10 but 4.15 or later is necessary to use all
features like the CPU redirect map.
If you are using an Intel netword card, you will need to stay with in tree kernel NIC drivers.
@ -71,16 +71,13 @@ Make sure you have clang (>=3.9) installed on the system ::
sudo apt-get install clang
The version 3.9 is recommended as it seems some more recent versions of clang
generate invalid eBPF code that fail to load.
BPF
~~~
libbpf
~~~~~~
Suricata uses libbpf to interact with eBPF and XDP. This library is available
in the Linux tree. Before Linux 4.16, a patched libbpf library is also needed::