Thanks a lot! Installation succeeded and at ~110 KB this is lighter than I feared:
root@turris:~$ ls -all /usr/sbin/hping3
-rwxr-xr-x 1 root root 102543 Dec 8 01:01 /usr/sbin/hping3
root@turris:~$ ls -all /usr/bin/ping
-rwsr-xr-x 1 root root 33067 Nov 1 10:16 /usr/bin/ping
root@turris:~$ ls -all /usr/bin/ping6
-rwsr-xr-x 1 root root 28895 Nov 1 10:16 /usr/bin/ping6
root@turris:~$ ls -all /usr/bin/nping
-rwxr-xr-x 1 root root 362555 Nov 1 10:16 /usr/bin/nping
larger than both pings (I believe for newer iputils there is only a single ping binary for both IP4 and IP6), but considerably smaller than nping and considerably faster at execution:
root@turris:~$ time hping3 9.9.9.9 --icmp --icmp-ts -c 1
HPING 9.9.9.9 (pppoe-wan 9.9.9.9): icmp mode set, 28 headers + 0 data bytes
len=40 ip=9.9.9.9 ttl=60 id=3284 icmp_seq=0 rtt=19.7 ms
ICMP timestamp: Originate=36988061 Receive=36990206 Transmit=36990206
ICMP timestamp RTT tsrtt=19
--- 9.9.9.9 hping statistic ---
1 packets tramitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 19.7/19.7/19.7 ms
real 0m 0.24s
user 0m 0.00s
sys 0m 0.00s
root@turris:~$ time nping --icmp-type 13 9.9.9.9 -c 1 --icmp-orig-time now
Starting Nping 0.7.70 ( https://nmap.org/nping ) at 2021-12-08 11:16 CET
SENT (0.1489s) ICMP [77.6.135.184 > 9.9.9.9 Timestamp request (type=13/code=0) id=59080 seq=1 orig=37001000 recv=0 trans=0] IP [ttl=64 id=55460 iplen=40 ]
RCVD (0.3070s) ICMP [9.9.9.9 > 77.6.135.184 Timestamp reply (type=14/code=0) id=59080 seq=1 orig=37001000 recv=37003318 trans=37003318] IP [ttl=60 id=9913 iplen=40 ]
Max rtt: 157.947ms | Min rtt: 157.947ms | Avg rtt: 157.947ms
Raw packets sent: 1 (40B) | Rcvd: 1 (40B) | Lost: 0 (0.00%)
Nping done: 1 IP address pinged in 1.23 seconds
real 0m 1.24s
user 0m 0.01s
sys 0m 0.00s
And as I just noticed nping truncates the originate timestamp to full seconds.... so many thanks to you , @Lochnair, and @_FailSafe for charting a path how to get hping3 into OpenWrt (again).
seem so easy to work with. Just noticed that's a big offset between originate and receive, no?
I cannot so easily test since I am using RT3200 + snapshot and it doesn't seem to work in the WSL2 environment in Windows:
lynx@DESKTOP:~$ hping3 9.9.9.9 --icmp --icmp-ts -c 1
[open_sockraw] socket(): Operation not permitted
[main] can't open raw socket
lynx@DESKTOP:~$ sudo hping3 9.9.9.9 --icmp --icmp-ts -c 1
HPING 9.9.9.9 (eth0 9.9.9.9): icmp mode set, 28 headers + 0 data bytes
--- 9.9.9.9 hping statistic ---
1 packets transmitted, 0 packets received, 100% packet loss
round-trip min/avg/max = 0.0/0.0/0.0 ms
@Lochnair are we in a position for pull request to get adopted as official OpenWrt package? I confess I am not familiar with this process so 100% reliant on your Jedi skills here.
I guess time to make sure that my network time is properly synced again.... But that is also the reason why we should not work with the raw differences...
Ah yes. What is default OpenWrt ntp behaviour I wonder? I think my router loses time every reboot, so presumably the time shifting will give effects as discussed above. Would it help to force an ntpupdate on script initialization?
No idea. My issue is that I added a GPS-disciplined NTP server to my internal network but only did a half-assed job at making sure all devices get their high-quality time from there. Now, I was under the impression that I had fixed the router, but apparently I did not (the router has a battery backed real time clock, so does not suffer from your specific concern).
Not sure, I would opt for just letting the normal auto-baseline adjustment code deal with that....
You build your image or use a pre-built? If you build your own, itβs very straightforward to add the hping3 package @Lochnair has in his repo from our tweaking and testing yesterday.
I would be willing to also cross-compile the binary for you if that would help your immediate testing.
Presently just pre-built using attended sysupgrade. But can switch over.
Do you know if I can build using SDK from git feed? So far it looks like this utility is a clear winner. Next week I am off work for Christmas and with the benefit of way more free time then I plan to modify the script to work with the timestamps from this utility, and once the script logic is settled spend time optimising the script as much as possible for performance and robustness.
Assuming everyone is positive about this utility it seems an important goal is to try to get it made an official OpenWrt package.
I'm not sure I follow, but if you already have an OpenWrt build environment you can just create a new sub-directory for the hping3 package. I created mine as package/network/utils/hping3 and put @Lochnair's Makefile in that directory.
Next, run a make menuconfig and add the hping3 utility from the Network category. Save and build!
My offer stands to build the hping3 for your platform to get it in your hands quicker, @Lynx, if you'd like. Just reply with your ARCH from cat /etc/openwrt_release if you'd like me to do so!
Need to clean up my changes first at the very least. I don't really know this process either, but I think it's better to add my changes as patches the build systems applies at build time, so we can stay on the upstream repository.
My local version changed that to 3 and I think that we are fine with a single probe per reflector as long as we have say 5 reflectors. But I read this as extracting the reported min field of the ping summary line so that should be minimum of minimums, no?
We then should calculate the DL_dOWD (download delta one-way-delay) and the UL_dOWD per reflector and take the minimum of each over the 5 reflectors.
Since OWD reflectors might be picky, maybe we should still also still run the RTT code and in case we have no valid OWDs in a tick evaluate the RTTs instead?
will actually work with the average I think (sorry I may have been unclear earlier in this thread), but no matter for now anyway. Will try firstly working the minimums as you suggest. Shouldn't take long.
Ah, I guess I need to step through this procedure, but this is not really critical anyways, except that -i 0.00 is not a good idea this basically floods 10 ICMP packets into the link which for sufficiently slow links might already start to noticeably influence each others' delay. Sure pings are small packets, but that still adds up.
Agreed. Let's consider a little the psychophysics of the situation. How much delay is unbearable? We can certainly notice on VOIP if a buffer fails, typical jitter buffers are say 3 packets and that's 60ms. But this is the minimum noticeable delay. So if we can respond in 3 times that amount it should be sufficient. So 180ms. We certainly don't need 10 pings, so I suggest 3 pings spaced .06 seconds apart.
I'm still concerned about rolling this out at scale. If I were 9.9.9.9 and I started to see pings flood in I'd certainly just start dropping them above 20/s or so.
Can someone try a traceroute to 9.9.9.9 and then try hping to each step along the way, see what happens?
I'll do it from my network as well
So, results from my network, using hping3 from Debian.
9.9.9.9 responds with timestamps (yay).
Nothing else along the path responds at all when I request timestamps (boo, ??)
Everything else along the path responds fine with regular icmp pings without timestamps (yay).
Let's see what others report.
Also, my Debian based router responds with timestamps, but the response time is WAY longer than regular ping.
it responds to a regular ping in 0.23 ms, it responds to a timestamp request in about 4-12 ms
Also also, even though my desktop machine is synchronized to my router and my router is synchronized to several Stratum 1 time servers, there's a ~ 30-40 ms time difference between my desktop (which just woke from sleep a half hour ago) and the router.
In fact, real bufferbloat that we can mitigate will be persistent as long as:
bottleneck_rate < load_rate <= shaper_rate
And hence earlier latency measurements will be probably less helpful as more recent ones. So maybe just go for a single sample per reflector? Which will also take the least time, potentially allowing faster tick rates (which in turn might still be limited by how fast we can get ICMP timestamps).
Repeated measurement against 62.52.200.147 result in somewhat fluctuating rtt values, while against 9.9.9.9 are relatively flat, also I note 62.52.200.147 is having "funky time".
How about just regular pings against say 62.52.200.147 ?
how's the fluctuation in rtt?
For example, here's my first hop after the ISP router in my closet:
64 bytes from 162.207.92.1: icmp_seq=1 ttl=62 time=2.16 ms
64 bytes from 162.207.92.1: icmp_seq=2 ttl=62 time=1.98 ms
64 bytes from 162.207.92.1: icmp_seq=3 ttl=62 time=2.15 ms
64 bytes from 162.207.92.1: icmp_seq=4 ttl=62 time=2.13 ms
64 bytes from 162.207.92.1: icmp_seq=5 ttl=62 time=2.95 ms
64 bytes from 162.207.92.1: icmp_seq=6 ttl=62 time=2.10 ms
64 bytes from 162.207.92.1: icmp_seq=7 ttl=62 time=1.96 ms
64 bytes from 162.207.92.1: icmp_seq=8 ttl=62 time=3.03 ms
64 bytes from 162.207.92.1: icmp_seq=9 ttl=62 time=1.74 ms
64 bytes from 162.207.92.1: icmp_seq=10 ttl=62 time=2.06 ms
which seems to be a perfectly suitable reflector. To the extent that more people could use a close hop for basic RTT and then maybe when an issue is detected send a probe to 9.9.9.9 for each-way delay inspection, that could maybe lower the traffic across the internet and concentrated to 9.9.9.9 and others by several orders of magnitude
For fun, here's pings at 0.2 s intervals during a speed test:
dlakelan@tintin:~$ ping -i 0.2 162.207.92.1
PING 162.207.92.1 (162.207.92.1) 56(84) bytes of data.
64 bytes from 162.207.92.1: icmp_seq=1 ttl=62 time=2.06 ms
64 bytes from 162.207.92.1: icmp_seq=2 ttl=62 time=2.18 ms
64 bytes from 162.207.92.1: icmp_seq=3 ttl=62 time=2.50 ms
64 bytes from 162.207.92.1: icmp_seq=4 ttl=62 time=2.57 ms
64 bytes from 162.207.92.1: icmp_seq=5 ttl=62 time=1.81 ms
64 bytes from 162.207.92.1: icmp_seq=6 ttl=62 time=1.93 ms
64 bytes from 162.207.92.1: icmp_seq=7 ttl=62 time=1.83 ms
64 bytes from 162.207.92.1: icmp_seq=8 ttl=62 time=2.27 ms
64 bytes from 162.207.92.1: icmp_seq=9 ttl=62 time=1.76 ms
64 bytes from 162.207.92.1: icmp_seq=10 ttl=62 time=1.62 ms
64 bytes from 162.207.92.1: icmp_seq=11 ttl=62 time=1.59 ms
64 bytes from 162.207.92.1: icmp_seq=12 ttl=62 time=1.66 ms
64 bytes from 162.207.92.1: icmp_seq=13 ttl=62 time=1.47 ms
64 bytes from 162.207.92.1: icmp_seq=14 ttl=62 time=2.04 ms
64 bytes from 162.207.92.1: icmp_seq=15 ttl=62 time=1.62 ms
64 bytes from 162.207.92.1: icmp_seq=16 ttl=62 time=1.51 ms
64 bytes from 162.207.92.1: icmp_seq=17 ttl=62 time=1.52 ms
64 bytes from 162.207.92.1: icmp_seq=18 ttl=62 time=1.48 ms
64 bytes from 162.207.92.1: icmp_seq=19 ttl=62 time=1.70 ms
64 bytes from 162.207.92.1: icmp_seq=20 ttl=62 time=1.69 ms
64 bytes from 162.207.92.1: icmp_seq=21 ttl=62 time=2.22 ms
64 bytes from 162.207.92.1: icmp_seq=22 ttl=62 time=12.3 ms
64 bytes from 162.207.92.1: icmp_seq=23 ttl=62 time=1.66 ms
64 bytes from 162.207.92.1: icmp_seq=24 ttl=62 time=1.46 ms
64 bytes from 162.207.92.1: icmp_seq=25 ttl=62 time=2.13 ms
64 bytes from 162.207.92.1: icmp_seq=26 ttl=62 time=1.72 ms
64 bytes from 162.207.92.1: icmp_seq=27 ttl=62 time=1.68 ms
64 bytes from 162.207.92.1: icmp_seq=28 ttl=62 time=1.43 ms
64 bytes from 162.207.92.1: icmp_seq=29 ttl=62 time=1.66 ms
64 bytes from 162.207.92.1: icmp_seq=30 ttl=62 time=1.80 ms
64 bytes from 162.207.92.1: icmp_seq=31 ttl=62 time=1.50 ms
64 bytes from 162.207.92.1: icmp_seq=32 ttl=62 time=1.45 ms
64 bytes from 162.207.92.1: icmp_seq=33 ttl=62 time=3.85 ms
64 bytes from 162.207.92.1: icmp_seq=34 ttl=62 time=2.01 ms
64 bytes from 162.207.92.1: icmp_seq=35 ttl=62 time=1.79 ms
64 bytes from 162.207.92.1: icmp_seq=36 ttl=62 time=1.55 ms
64 bytes from 162.207.92.1: icmp_seq=37 ttl=62 time=1.33 ms
64 bytes from 162.207.92.1: icmp_seq=38 ttl=62 time=2.02 ms
64 bytes from 162.207.92.1: icmp_seq=39 ttl=62 time=1.63 ms
64 bytes from 162.207.92.1: icmp_seq=40 ttl=62 time=6.91 ms
64 bytes from 162.207.92.1: icmp_seq=41 ttl=62 time=2.16 ms
64 bytes from 162.207.92.1: icmp_seq=42 ttl=62 time=6.90 ms
64 bytes from 162.207.92.1: icmp_seq=43 ttl=62 time=1.60 ms
64 bytes from 162.207.92.1: icmp_seq=44 ttl=62 time=4.47 ms
64 bytes from 162.207.92.1: icmp_seq=46 ttl=62 time=7.67 ms
64 bytes from 162.207.92.1: icmp_seq=47 ttl=62 time=4.87 ms
64 bytes from 162.207.92.1: icmp_seq=48 ttl=62 time=14.4 ms
64 bytes from 162.207.92.1: icmp_seq=49 ttl=62 time=4.65 ms
64 bytes from 162.207.92.1: icmp_seq=50 ttl=62 time=6.36 ms
64 bytes from 162.207.92.1: icmp_seq=51 ttl=62 time=6.47 ms
64 bytes from 162.207.92.1: icmp_seq=52 ttl=62 time=9.54 ms
64 bytes from 162.207.92.1: icmp_seq=53 ttl=62 time=5.70 ms
64 bytes from 162.207.92.1: icmp_seq=54 ttl=62 time=4.62 ms
64 bytes from 162.207.92.1: icmp_seq=55 ttl=62 time=4.37 ms
64 bytes from 162.207.92.1: icmp_seq=56 ttl=62 time=7.26 ms
64 bytes from 162.207.92.1: icmp_seq=57 ttl=62 time=5.99 ms
64 bytes from 162.207.92.1: icmp_seq=58 ttl=62 time=4.67 ms
64 bytes from 162.207.92.1: icmp_seq=59 ttl=62 time=5.38 ms
64 bytes from 162.207.92.1: icmp_seq=60 ttl=62 time=4.94 ms
64 bytes from 162.207.92.1: icmp_seq=61 ttl=62 time=10.5 ms
64 bytes from 162.207.92.1: icmp_seq=62 ttl=62 time=3.34 ms
64 bytes from 162.207.92.1: icmp_seq=63 ttl=62 time=4.22 ms
64 bytes from 162.207.92.1: icmp_seq=64 ttl=62 time=5.56 ms
64 bytes from 162.207.92.1: icmp_seq=65 ttl=62 time=6.66 ms
64 bytes from 162.207.92.1: icmp_seq=66 ttl=62 time=6.96 ms
64 bytes from 162.207.92.1: icmp_seq=67 ttl=62 time=4.23 ms
64 bytes from 162.207.92.1: icmp_seq=68 ttl=62 time=4.07 ms
64 bytes from 162.207.92.1: icmp_seq=69 ttl=62 time=7.58 ms
64 bytes from 162.207.92.1: icmp_seq=70 ttl=62 time=5.71 ms
64 bytes from 162.207.92.1: icmp_seq=71 ttl=62 time=12.4 ms
64 bytes from 162.207.92.1: icmp_seq=72 ttl=62 time=8.01 ms
64 bytes from 162.207.92.1: icmp_seq=73 ttl=62 time=10.2 ms
64 bytes from 162.207.92.1: icmp_seq=74 ttl=62 time=3.70 ms
64 bytes from 162.207.92.1: icmp_seq=75 ttl=62 time=10.7 ms
64 bytes from 162.207.92.1: icmp_seq=76 ttl=62 time=2.09 ms
64 bytes from 162.207.92.1: icmp_seq=77 ttl=62 time=11.7 ms
64 bytes from 162.207.92.1: icmp_seq=78 ttl=62 time=2.18 ms
64 bytes from 162.207.92.1: icmp_seq=79 ttl=62 time=1.70 ms
64 bytes from 162.207.92.1: icmp_seq=80 ttl=62 time=1.55 ms
64 bytes from 162.207.92.1: icmp_seq=81 ttl=62 time=1.38 ms
64 bytes from 162.207.92.1: icmp_seq=82 ttl=62 time=1.55 ms
64 bytes from 162.207.92.1: icmp_seq=83 ttl=62 time=1.67 ms
64 bytes from 162.207.92.1: icmp_seq=84 ttl=62 time=1.62 ms
64 bytes from 162.207.92.1: icmp_seq=85 ttl=62 time=1.62 ms
64 bytes from 162.207.92.1: icmp_seq=86 ttl=62 time=1.47 ms
64 bytes from 162.207.92.1: icmp_seq=87 ttl=62 time=1.69 ms
64 bytes from 162.207.92.1: icmp_seq=88 ttl=62 time=1.57 ms
64 bytes from 162.207.92.1: icmp_seq=89 ttl=62 time=1.95 ms
64 bytes from 162.207.92.1: icmp_seq=90 ttl=62 time=2.04 ms
64 bytes from 162.207.92.1: icmp_seq=91 ttl=62 time=1.60 ms
64 bytes from 162.207.92.1: icmp_seq=92 ttl=62 time=1.45 ms
64 bytes from 162.207.92.1: icmp_seq=93 ttl=62 time=1.69 ms
64 bytes from 162.207.92.1: icmp_seq=94 ttl=62 time=1.69 ms
64 bytes from 162.207.92.1: icmp_seq=95 ttl=62 time=1.65 ms
64 bytes from 162.207.92.1: icmp_seq=96 ttl=62 time=1.46 ms
64 bytes from 162.207.92.1: icmp_seq=97 ttl=62 time=1.57 ms
64 bytes from 162.207.92.1: icmp_seq=98 ttl=62 time=1.95 ms
64 bytes from 162.207.92.1: icmp_seq=99 ttl=62 time=1.52 ms
64 bytes from 162.207.92.1: icmp_seq=100 ttl=62 time=1.55 ms
But the whole point of timestamps is to offer directionality information about bufferbloat to know whether to reduce upload rate, download rate, or both. And 'funky time' described above had a good reason relating to the way the nodes handle ping requests in terms of hardcore fast processors or weak processors, or something along these lines?