mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
Perform various fixes and tweaks: - Rename several defines to make them more informative - Remove unrolling of loop in BPF programs - Reuse defines for program sections between userspace and kernel space programs - Perform fork+exec to run bpf_egress_loader script instead of system() - Add comment to copied scripts indicating I've modified them - Add pping.h and pping_helpers.h as dependencies in Makefile Also, add a brief description of what PPing is and how it works to README Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
20 lines
1.2 KiB
Markdown
20 lines
1.2 KiB
Markdown
# PPing using XDP and TC-BPF
|
|
An implementation of the passive ping ([pping](https://github.com/pollere/pping)) utility based on XDP (for ingress) and TC-BPF (for egress)
|
|
|
|
## Simple description
|
|
Passive Ping (PPing) makes use of the TCP Timestamp option to calculate the RTT for TCP traffic passing through.
|
|
PPing can be used on measure RTTs on end hosts or any device which sees both directions of the TCP flow.
|
|
|
|
For outgoing packets, it checks for TCP timestamp TSval in the TCP header. If it finds one it creates a timestamp
|
|
for when it saw that TSval in a particular flow. On incomming packets it parses the TCP timestamp TSecr (which
|
|
is the TSval echoed by the receiving host) and checks it has seen any previous outgoing packets with that TCP
|
|
timestamp. If it has, an RTT is calculated as the difference in time between when it saw an outgoing packet
|
|
with a TSval, and when it received an incomming packet from the reverse flow with a matching TSecr.
|
|
|
|
Note that TCP timestamps may not be unique for every packet in a flow, therefore it only matches the first
|
|
outgoing packet with a particular TSval with the first incomming packet with a matching TSecr. Duplicate
|
|
TSval/TSecr are ignored.
|
|
|
|
## Planned design
|
|

|