Although not an Opewrt directly related question, it has to do with bufferbloat, where Openwrt shines, so...
I would like feedback from you guys to see if I'm going in the right direction.
What I want?
To plot periodic and continuous bufferbloat measurements (in my case, I'll do it in Cacti).
The core functionality lies in a script that will run periodically in cron.
Here it is:
#!/bin/sh wget -q https://releases.ubuntu.com/20.04.4/ubuntu-20.04.4-desktop-amd64.iso & echo $! > pid.txt & ping -qc 20 22.214.171.124 > bufferbloat.txt; kill $(cat pid.txt); rm ubuntu-20.04*
The idea is to start a download (in this case, Ubuntu ISO) and, in parallel, to ping twenty times some IP address (in this case, 126.96.36.199) and redirect the ping output to a file named bufferbloat.txt. As a side note, the script also manages to interrupt the wget command after ping ends, and also deletes the data that has already been downloaded.
The content of bufferbloat.txt will look like this:
gustavo@srv2:~/bin$ cat bufferbloat.txt PING 188.8.131.52 (184.108.40.206) 56(84) bytes of data. --- 220.127.116.11 ping statistics --- 20 packets transmitted, 19 received, 5% packet loss, time 19030ms rtt min/avg/max/mdev = 11.237/56.486/143.167/36.687 ms
If I got it right, the average rtt (avg) could be thought as a bufferbloat "measurement", and then it's just a matter of classifying it according to this standard:
Less than 5ms (average of down bloat and up bloat) - A+ Less than 30ms - A Less than 60ms - B Less than 200ms - C Less than 400ms - D 400ms+ - F
Am I going in the right direction?
(Something I noticed now while writing this post is that the bufferbloat classification is the the download AND UPLOAD timings, so I guess I have to add to the script the upload part then get the average of the download avg and upload avg ...)
NOTE: Plotting is TBD, after getting the script right
Any advise will be welcome!