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.

  • 1
    Take a look here, multiple solutions are described : http://serverfault.com/questions/146362/generate-a-limited-amount-of-random-network-traffic-between-2-hosts
    – Snorky35
    Sep 28, 2016 at 11:54
  • 1
    sudo ping -f -s 65507 <IP> #(65507 is limit of icmp packet size, more than that is ping of death ) Sep 28, 2016 at 13:07
  • 1
    This would be helpful :askubuntu.com/q/7976/497359 Sep 28, 2016 at 13:08
  • @SeverusTux thank you. That had something like I remember. "You can do pretty much the same thing with plain old nc (netcat) if you're that way inclined. On the server machine nc -vvlnp 12345 >/dev/null And the client can pipe a gigabyte of zeros through dd over the nc tunnel. dd if=/dev/zero bs=1M count=1K | nc -vvn 12345" I have used /dev/urandom before as a source too.
    – TafT
    Sep 28, 2016 at 14:00

2 Answers 2


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

dd if=/dev/zero bs=1M count=1K | nc -vvn 12345

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.