Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

Bandwidth

Vocabulary

Mbps, Gbps (connection) vs MBps, GBps (download) are different! a 1Mbps connection will only give about 100KB/s a download speed. This is normal and is only because the two measurements are measuring the same thing by different names. Understand bit vs byte!

iperf

You can measure actual bandwidth by generating traffic with a tool like iperf. Not all servers will have it, but it is a standard testing application in the linux world. It runs by default on port 5001 but you can set your server to any port. Then you go to your client and spew traffic. It generates a report when it’s done. In it’s simplest form:

server# iperf -s
client# iperf -t 60 -c serverip

iptraf-ng

Other tools are not standard but very useful. A common one is ntop and another is iptraf.

iptraf-ng can show break down by port, bandwidth, ip and other statistics.

curl

https://www.thinkbroadband.com/download pick a file to download.

curl http://ipv4.download.thinkbroadband.com/100MB.zip > /dev/null

or if you have a proxy ( not tested)

curl -x http://yourproxy:3128 -L http://ipv4.download.thinkbroadband.com/100MB.zip > /dev/null

another test site and curl method:

james@a5:~$ curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.0M  100 11.0M    0     0  9078k      0  0:00:01  0:00:01 --:--:-- 9078k

wget

wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip
--2021-10-02 10:31:22--  http://speedtest.wdc01.softlayer.com/downloads/test10.zip
Resolving speedtest.wdc01.softlayer.com (speedtest.wdc01.softlayer.com)... 158.85.230.20, 2607:f0d0:3006:6c::4
Connecting to speedtest.wdc01.softlayer.com (speedtest.wdc01.softlayer.com)|158.85.230.20|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11536384 (11M) [application/zip]
Saving to: ‘/dev/null’

/dev/null                 100%[=====================================>]  11.00M  10.0MB/s    in 1.1s

2021-10-02 10:31:23 (10.0 MB/s) - ‘/dev/null’ saved [11536384/11536384]