mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
For the aggregated stats, report RX and TX from the perspective of the capture point, instead of the perspective of the subnet. Consider the following setup, consisting of subnet A, the capture point (CP) where we're running ePPing, and subnet B. A <-----> CP <-----> B Now consider that we have a TCP stream uploading data from A to B, so that we can capture RTTs between when the data packet from A reaches CP to when the ACK from B gets back to the CP, i.e. CP -> B -> CP. Previously, the RX stats for a subnet referred to packets received by the subnet, i.e. packets with dst address in the subnet. Likewise, TX packets were packets transmitted by the subnet, i.e. packets with src address in the subnet. So the data packet from A -> B would be reported as TX for subnet A and RX for subnet B. However, the RTTs are by default (can be changed by the --aggregate-reverse flag) aggregated from the perspective of the capture point, so that the RTT CP -> B -> CP would be reported as an RTT observed for subnet B. Make the TX and RX stats consistent with the RTT, so that all subnet stats are from the perspective of the CP. Make RX refer to packets the CP has received from the subnet, i.e. packets with src in A, and TX refer to packets the CP has transmitted to the subnet, i.e. packets with dst in the subnet. So report a data packet from A -> B as RX for subnet A and TX for subnet B. 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%