November 18, 2009

Network Throughput & Performance Testing

Iperf is a a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics and reports bandwidth, delay jitter and datagram (packet) loss. Ports of iperf are available for almost every OS. Iperf can be downloaded here.

Alternatively, using Netcat (NC) and a piping content to /dev/urandom (or /dev/zero) on a *nix box can create a testing environment.

Listen and pipe to /dev/null on one machine:

nc –l –p 777 | /dev/null

Connect and pipe 1 gig of random data on the other:

dd if=/dev/urandom bs=1M count=1024 | nc 192.168.1.5 777 –q 10

For real time stats use pipeviewer:

dd if=/dev/urandom bs=1M count=1024 | pv | nc 192.168.1.5 777 -q 10

The only bottleneck in this case would be /dev/urandom. Although a data source which is hard to compress makes sense when testing an unknown path, a less-expensive random number generator should be considered.