mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
2224edf85ef96e419199fa959b11ddebbc990490
In addition to RTTs, also aggregate no. packets and bytes transmitted and received for each IP-prefix. If both the src and dst IP address of a packet is within the same IP-prefix, it will be counted as both sent to and received by that prefix. The packet stats are added for all successfully parsed packets (i.e. packets that contain a valid identifier of some sort), regardless of if the packet actually produces a valid RTT sample. This means some IP-prefixes may only have packet stats, and no RTT stats, so only output the packet stats in those instances. From a performance perspective, it also means each BPF program needs to perform two lookups of the aggregation map (one for src IP and one for dst IP) for every packet that is successfully parsed. This is a substantial increase from only having to perform a single lookup on the subset of packets that produce an RTT sample. Packets that are not successfully parsed (i.e. they don't contain a valid identifier, e.g. UDP traffic) are still ignored to minimize overhead, and will therefore not be included in the aggregated packet stats. This means the aggregated packet stats may not include all traffic for an IP-prefix. Future commits may add some counters to also account for traffic that is not fully parsed. Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Practical BPF examples
This git repository contains a diverse set of practical BPF examples that solve (or demonstrate) a specific use-case using BPF.
It is meant to ease doing rapid prototyping and development, writing C-code BPF programs using libbpf. The goal is to make it easier for developers to get started coding.
Many developers struggle to get a working BPF build environment. The repo enviroment makes it easy to build/compile BPF programs by doing the necessary libbpf setup transparently and detect missing compile dependencies (via the configure script). It is a declared goal to make BPF programming more consumable by detecting and reporting issues (when possible).
Description
Languages
C
93.6%
Shell
4.7%
Makefile
1.6%