With tcpdump
, I dumped a trace of around 2800 outgoing packets and just as many corresponding incoming ICMP packets. Then, I computed the RTT for each outgoing packet with a simple subtraction.
It turns out that, even though there are no duplicates among my timestamps (outgoing, incoming, or even when merged together!), there are always a few hundred duplicates in my RTTs. I found this very odd.
Does it have to do with floating point precision? I tried with python's built-in float
and with numpy
, but I got the same result just described (I checked for duplicates with set
in Python).
EDIT: Here is an example of an RTT appearing 4 times with different timestamps
# a contains timestamps for outgoing packets
# b contains timestamps for incoming answers
# c contains corresponding RTTs (c[i]=b[i]-a[i])
OneRtt = 0.002665996551513672
>>> indices = [i for i, x in enumerate(c) if x == 0.002665996551513672]
>>> indices
[737, 1711, 2499, 2713]
>>> b[737]
1369237439.238884
>>> a[737]
1369237439.236218
>>> c[737]
0.002665996551513672
>>> b[1711]
1369237485.874826
>>> a[1711]
1369237485.87216
>>> c[1711]
0.002665996551513672
>>> b[2499]
1369237524.170485
>>> a[2499]
1369237524.167819
>>> c[2499]
0.002665996551513672
>>> b[2713]
1369237535.293074
>>> a[2713]
1369237535.290408
>>> c[2713]
0.002665996551513672