SCP for network testing
SCP is a good method of bandwidth testing, as its performance/transfer time is likely to be similar to typical workloads, as opposed to some traditional network speed testing tools such as iperf3 that will show results much closer to actual wire speed.
NOTE: while SCP is a valuable tool to validate available bandwidth, Skytap recommends using various network tools and protocols to better understand and measure network performance.
You will need a test file to transfer using scp – 1 GB is a good suggested file size. You can find test files for download on the internet, or create it yourself. In Linux-based or IBM AIX operating systems you can use the dd tool:
$ dd if=/dev/urandom of=/tmp/1g.img count=1024 bs=1048576
SCP uses Secure Shell (SSH) for authentication and to transfer the data. The receiving machine will need to have incoming SSH connections allowed.
To "push" a test file from one machine to the other, you can use a command like:
$ scp /tmp/1g.img firstname.lastname@example.org:/tmp/1g.img
You can also reverse the direction to "pull" a test file as follows:
$ scp email@example.com:/tmp/1g.img /tmp/1g.img
Reading the results
When a file transfer is complete, the total time the transfer took will be shown in minutes and seconds. To calculate average bandwidth from the transfer in Mbps, you can use an on-line calculator such as Omnicalculator.com