iperf compiles very cleanly from source without needing darwinports.

For convenience, here's a compiled iperf 2.0.5 Mac OS X 10.6 Snow Leopard binary. This package won't be updated, though, and lacks install scripts, so it's probably best to compile iperf yourself.

Compiling from source on OS X requires GCC. You'll need to have Xcode installed to get GCC.

Get the latest tarball from iperf's Sourceforge page, then:

$ tar xvfz iperf-*.tgz
$ cd iperf-*
$ ./configure
$ make

An iperf binary will now be in the src directory. You can place this manually on your path (for instance, in ~/bin/), or you can use:

$ sudo make install

which will install iperf and its manpage system wide.

Basic usage

iperf measures the available bandwidth between two machines by transferring as much data as possible during a 10 second test period. This is useful for checking internet connections, network links, and wifi performance.

You'll need to be able to connect to one of your test machines directly from the other.

On one machine, start iperf in server mode with:

$ iperf -s

On the other, connect to the first machine in client mode:

$ iperf -c machine1.example.com

Note that this only transfers data in one direction, so to test an asymmetric connection you'll need to reverse the machines' roles or use other iperf options.