1

I seem to have a network problem when one of my server machine moves a large amount of data over the network link it is on. I am sure that in the past I have been able to pipe random data to given IPv4 address or MAC address from the command line for a fixed amount of time. This is very simple way to test if traffic load on a spefici link is the cause of the problem.

I am not that worried about calculating the link speed, I would just like to try and saturate or at least heavily load (~100Mbps) the link. Being able to easily do it from a typical Ubuntu 16.04 command line with basic tools would allow me to easily ssh to a machine (set up a GNU Screen session) and target another machine. I could then work through links or hosts to work out which of them (if any) trigger my networking issue.

TafT
  • 159
  • 2
  • 12

2 Answers2

1

This can be achieved using iperf. More details can be found here https://www.freebsd.org/cgi/man.cgi?query=iperf&sektion=1&manpath=freebsd-release-ports. It is supported on multiple platforms including windows, so there shouldn't be any issues with varying platforms as well.

1

It is possible to do this using Netcat.

On the target machine (that will receive the data) set up netcat to receive data on a port (12345 in the example below) and pipe it to /dev/null. /dev/null is used as it should be the fastest place to send the data to, if you use a file on disk there is a chance it will slow the transfer.

nc -vvlnp 12345 >/dev/null

Now on the source machine (that will send the data) set up netcat to transmit a set of data to the target machine. This can be /dev/zero or /dev/random if you want to ensure no compression is taking place. In the example below 1M bit lumps of data are sent 1k times to the target at address 10.10.0.2.

dd if=/dev/zero bs=1M count=1K | nc -vvn 10.10.0.2 12345
TafT
  • 159
  • 2
  • 12