this script is for cront-job regular measurement of the available (download) bandwidth, by downloading a 100MByte dd crated (https://dwaves.de/testfile) testfile

created like this (creditz):

head -c 100m /dev/zero | openssl enc -aes-128-cbc -pass pass:"$(head -c 20 /dev/urandom | base64)"  > testfile

(full of random data (so compression will not speed up the download much) and the result is more realistic for e.g. content that does not compress well like images)

sha512sum of the test file: testfile.sha512sum.txt

HINT! for some reason vim won’t display the line breaks of curl correctly, use cat to view the log file!

use this to display the file in human readable form:

cat bench_inet_bandwidth.log | grep -B 3 -A 2 Average

testing bandwidth: bench_inet_bandwidth.sh

# requirements: curl
su - root;
apt update;
apt install curl;

# now the script:
#!/bin/bash
LOGFILE=bench_inet_bandwidth.log
ISP=StarLink

# tidy up
rm -rf testfile

echo "=== $ISP inet benchmark (downloading 100MByte of random data) started on: $(date '+%Y-%m-%d-%H:%M:%S') ===" >> $LOGFILE;
curl -o testfile https://dwaves.de/testfile 2>&1 | tee -a ${LOGFILE}; 

# output results
cat $LOGFILE;


# manual testing of file integrity
wget https://dwaves.de/testfile.sha512sum.txt
sha512sum -c testfile.sha512sum.txt


# a crontab was used to run this bench every 3hours on StarLink's Dishy
su - root
crontab -e
0 */3 * * * /scripts/bench_inet_bandwidth.sh

# example output:
cat bench_inet_bandwidth.log | grep -B 3 -A 2 Average

# please note that Average Dload is in MBYTES (x8 and get MBITS)
# so on Average Dload speed was 20MBytes/sec which equals x8 = 160MBit/sec
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-11-12:05:17 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.2M      0  0:00:05  0:00:05 --:--:-- 23.3M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-11-12:05:36 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  18.5M      0  0:00:05  0:00:05 --:--:-- 21.2M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-11-15:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  21.9M      0  0:00:04  0:00:04 --:--:-- 23.7M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-11-18:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  15.9M      0  0:00:06  0:00:06 --:--:-- 19.3M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-11-21:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  16.8M      0  0:00:05  0:00:05 --:--:-- 22.6M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-00:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  16.5M      0  0:00:06  0:00:06 --:--:-- 21.1M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-03:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  23.5M      0  0:00:04  0:00:04 --:--:-- 23.6M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-06:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  20.4M      0  0:00:04  0:00:04 --:--:-- 23.4M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-09:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  28.4M      0  0:00:03  0:00:03 --:--:-- 28.4M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-12:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  24.8M      0  0:00:04  0:00:04 --:--:-- 24.8M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-15:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  12.5M      0  0:00:07  0:00:07 --:--:-- 6890k
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-18:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  20.2M      0  0:00:04  0:00:04 --:--:-- 20.2M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-12-21:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  24.6M      0  0:00:04  0:00:04 --:--:-- 24.6M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-00:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  22.7M      0  0:00:04  0:00:04 --:--:-- 24.4M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-03:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  15.8M      0  0:00:06  0:00:06 --:--:-- 18.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-06:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.4M      0  0:00:05  0:00:05 --:--:-- 22.4M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-09:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  22.6M      0  0:00:04  0:00:04 --:--:-- 24.6M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-12:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  16.2M      0  0:00:06  0:00:06 --:--:-- 21.0M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-15:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.4M      0  0:00:05  0:00:05 --:--:-- 22.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-18:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  20.5M      0  0:00:04  0:00:04 --:--:-- 23.0M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-13-21:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  22.6M      0  0:00:04  0:00:04 --:--:-- 24.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-00:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  17.4M      0  0:00:05  0:00:05 --:--:-- 21.8M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-03:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  16.9M      0  0:00:05  0:00:05 --:--:-- 21.2M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-06:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  27.0M      0  0:00:03  0:00:03 --:--:-- 27.0M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-09:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  18.5M      0  0:00:05  0:00:05 --:--:-- 22.5M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-12:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  18.2M      0  0:00:05  0:00:05 --:--:-- 20.2M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-15:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  21.6M      0  0:00:04  0:00:04 --:--:-- 21.6M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-18:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  21.9M      0  0:00:04  0:00:04 --:--:-- 21.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-14-21:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.0M      0  0:00:05  0:00:05 --:--:-- 22.8M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-00:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  17.2M      0  0:00:05  0:00:05 --:--:-- 21.3M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-03:00:02 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  17.1M      0  0:00:05  0:00:05 --:--:-- 20.8M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-06:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  16.5M      0  0:00:06  0:00:06 --:--:-- 18.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-09:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.8M      0  0:00:05  0:00:05 --:--:-- 22.6M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-12:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  12.9M      0  0:00:07  0:00:07 --:--:-- 17.0M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-15:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  17.8M      0  0:00:05  0:00:05 --:--:-- 21.0M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-18:00:02 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  6871k      0  0:00:14  0:00:14 --:--:-- 18.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-15-21:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.5M      0  0:00:05  0:00:05 --:--:-- 23.7M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-16-00:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.6M      0  0:00:05  0:00:05 --:--:-- 21.8M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-16-03:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  19.9M      0  0:00:05  0:00:05 --:--:-- 23.9M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-16-06:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  21.8M      0  0:00:04  0:00:04 --:--:-- 21.8M
=== StarLink inet benchmark (downloading 100MByte of random data) started on: 2021-05-16-09:00:01 ===
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 99.9M  100 99.9M    0     0  12.8M      0  0:00:07  0:00:07 --:--:-- 17.8M

testing long term reliability: bench_inet_reliability.sh

this script is intended for long term testing of reliability of network connection/connectivity

it should quit after 24hours and thus not spamming the logs


#!/bin/bash
# $1 = ip to test
# $2 = how many hours to test

LOGFILE="test_connection_$1.log"

HOURS=$2

MINUTES=$(($2*60))

MIN_CURRENT=0

echo "====== connection test for $1 started on : $(date '+%Y-%m-%d-%H-%M')" > $LOGFILE;
echo "script is set to run for $HOURS h (= $MINUTES min)" >> $LOGFILE;

time for MIN_CURRENT in $(seq 1 $MINUTES);
do
	ping -c 60 $1 >> $LOGFILE; # will ping every second thus one loop is 1 min
	printf "\n--- MIN_CURRENT $MIN_CURRENT of $MINUTES --- timestamp: $(date '+%Y-%m-%d %H:%M:%S') \n" >> $LOGFILE;
done;

usage example:

# ping-test connection for 24hours and log it to file
/scripts/test_connection.sh 192.168.0.223 24

# how to view progress?
# open up a new terminal (Ctrl+Shift+N in GNU Debian Linux MATE)
tail -f test_connection_192.168.0.223.log

# how to generate nice summary, if any packet got lost
cat test_connection_192.168.0.223.log |grep -e "MIN_CURRENT" -e "packet loss"

60 packets transmitted, 60 received, 0% packet loss, time 137ms
--- MIN_CURRENT 1 of 1440 --- timestamp: 2021-01-21 11:35:57 
60 packets transmitted, 60 received, 0% packet loss, time 142ms
--- MIN_CURRENT 2 of 1440 --- timestamp: 2021-01-21 11:36:56 
60 packets transmitted, 60 received, 0% packet loss, time 142ms
--- MIN_CURRENT 3 of 1440 --- timestamp: 2021-01-21 11:37:55 

# to terminate the script
kill -SIGTERM $(pgrep test_connection)

possible improvements:

alternatively the log could be compressed afterwards to save disk space

tar fcvz $LOGFILE.tar.gz $LOGFILE;


liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin