9 ms·
I tried fixing iputils ping back in 2010, but they never picked up my patch: https://www.spinics.net/lists/netdev/msg139985.html https://www.spinics.net/lists/n
by thomashabets2 3y ago
I tried fixing iputils ping back in 2010, but they never picked up my patch: https://www.spinics.net/lists/netdev/msg139985.html https://www.spinics.net/lists/netdev/msg139985.html
Glad it was fixed only 20 years later.
It's a shame that the timestamping interface uses wallclock time, also with libpcap, because gettimeofday should never be used to measure time: https://blog.habets.se/2010/09/gettimeofday-should-never-be-used-to-measure-time.html https://blog.habets.se/2010/09/gettimeofday-should-never-be-...
- majke 3y agoHey, yeah, they are using CLOCK_MONOTONIC for the event loop exactly for that. I think it might be possible to fix the SO_TIMESTAMP wall-clock problem by using it not to measure duration between ping send and ping receive, but to measure kernel-userspace latency only. That is: measure ping send/recv with MONOTONIC, and subtract the kernel-to-userspace delay from that measurement to reduce jitter. The kernel-to-userspace delay can be done using SO_TIMESTAMP + wall clock. With such algo only the time change in the very short window between kernel-to-userspace would impact the readings. Another semi-related issue https://github.com/iputils/iputils/issues/480 https://github.com/iputils/iputils/issues/480