@@ -6,27 +6,34 @@ TC-BPF (on egress) for the packet capture logic.
66## Simple description
77Passive Ping (PPing) is a simple tool for passively measuring per-flow RTTs. It
88can be used on endhosts as well as any (BPF-capable Linux) device which can see
9- both directions of the traffic (ex router or middlebox). Currently it only works
10- for TCP traffic which uses the TCP timestamp option, but could be extended to
11- also work with for example TCP seq/ACK numbers, the QUIC spinbit and ICMP
12- echo-reply messages . See the [ TODO-list] ( ./TODO.md ) for more potential features
13- (which may or may not ever get implemented).
9+ both directions of the traffic (ex router or middlebox). Currently it works for
10+ TCP traffic which uses the TCP timestamp option and ICMP echo messages, but
11+ could be extended to also work with for example TCP seq/ACK numbers, the QUIC
12+ spinbit and DNS queries . See the [ TODO-list] ( ./TODO.md ) for more potential
13+ features (which may or may not ever get implemented).
1414
1515The fundamental logic of pping is to timestamp a pseudo-unique identifier for
1616outgoing packets, and then look for matches in the incoming packets. If a match
1717is found, the RTT is simply calculated as the time difference between the
1818current time and the stored timestamp.
1919
2020This tool, just as Kathie's original pping implementation, uses TCP timestamps
21- as identifiers. For outgoing packets, the TSval (which is a timestamp in and off
22- itself) is timestamped. Incoming packets are then parsed for the TSecr, which
23- are the echoed TSval values from the receiver. The TCP timestamps are not
24- necessarily unique for every packet (they have a limited update frequency,
25- appears to be 1000 Hz for modern Linux systems), so only the first instance of
26- an identifier is timestamped, and matched against the first incoming packet with
27- the identifier. The mechanism to ensure only the first packet is timestamped and
28- matched differs from the one in Kathie's pping, and is further described in
29- [ SAMPLING_DESIGN] ( ./SAMPLING_DESIGN.md ) .
21+ as identifiers for TCP traffic. For outgoing packets, the TSval (which is a
22+ timestamp in and off itself) is timestamped. Incoming packets are then parsed
23+ for the TSecr, which are the echoed TSval values from the receiver. The TCP
24+ timestamps are not necessarily unique for every packet (they have a limited
25+ update frequency, appears to be 1000 Hz for modern Linux systems), so only the
26+ first instance of an identifier is timestamped, and matched against the first
27+ incoming packet with the identifier. The mechanism to ensure only the first
28+ packet is timestamped and matched differs from the one in Kathie's pping, and is
29+ further described in [ SAMPLING_DESIGN] ( ./SAMPLING_DESIGN.md ) .
30+
31+ For ICMP echo, it uses the echo identifier as port numbers, and echo sequence
32+ number as identifer to match against. Linux systems will typically use different
33+ echo identifers for different instances of ping, and thus each ping instance
34+ will be recongnized as a separate flow. Windows systems typically use a static
35+ echo identifer, and thus all instaces of ping originating from a particular
36+ Windows host and the same target host will be considered a single flow.
3037
3138## Output formats
3239pping currently supports 3 different formats, * standard* , * ppviz* and * json* . In
@@ -41,12 +48,12 @@ single line per event.
4148
4249An example of the format is provided below:
4350``` shell
44- 16:00:46.142279766 10.11.1.1:5201+10.11.1.2:59528 opening due to SYN-ACK from src
45- 16:00:46.147705205 5.425439 ms 5.425439 ms 10.11.1.1:5201+10.11.1.2:59528
46- 16:00:47.148905125 5.261430 ms 5.261430 ms 10.11.1.1:5201+10.11.1.2:59528
47- 16:00:48.151666385 5.972284 ms 5.261430 ms 10.11.1.1:5201+10.11.1.2:59528
48- 16:00:49.152489316 6.017589 ms 5.261430 ms 10.11.1.1:5201+10.11.1.2:59528
49- 16:00:49.878508114 10.11.1.1:5201+10.11.1.2:59528 closing due to RST from dest
51+ 16:00:46.142279766 TCP 10.11.1.1:5201+10.11.1.2:59528 opening due to SYN-ACK from src
52+ 16:00:46.147705205 5.425439 ms 5.425439 ms TCP 10.11.1.1:5201+10.11.1.2:59528
53+ 16:00:47.148905125 5.261430 ms 5.261430 ms TCP 10.11.1.1:5201+10.11.1.2:59528
54+ 16:00:48.151666385 5.972284 ms 5.261430 ms TCP 10.11.1.1:5201+10.11.1.2:59528
55+ 16:00:49.152489316 6.017589 ms 5.261430 ms TCP 10.11.1.1:5201+10.11.1.2:59528
56+ 16:00:49.878508114 TCP 10.11.1.1:5201+10.11.1.2:59528 closing due to RST from dest
5057```
5158
5259### ppviz format
@@ -196,8 +203,8 @@ these identifiers.
196203
197204This issue could be avoided entirely by requiring that new-id > old-id instead
198205of simply checking that new-id != old-id, as TCP timestamps should monotonically
199- increase. That may however not be a suitable solution if/when we add support for
200- other types of identifiers.
206+ increase. That may however not be a suitable solution for other types of
207+ identifiers.
201208
202209#### Rate-limiting new timestamps
203210In the tc/egress program packets to timestamp are sampled by using a per-flow
0 commit comments