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.

  • 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 '16 at 11:54
  • 1
    sudo ping -f -s 65507 <IP> #(65507 is limit of icmp packet size, more than that is ping of death ) – Severus Tux Sep 28 '16 at 13:07
  • 1
    This would be helpful :askubuntu.com/q/7976/497359 – Severus Tux Sep 28 '16 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 10.10.0.2 12345" I have used /dev/urandom before as a source too. – TafT Sep 28 '16 at 14:00
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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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