Like a lot of people, I have a home LAN with multiple computers, sharing the internet through a NAT router. If I just had a single machine connected directly to a DSL or cable modem, network performance would be a moot point, because all but the slowest network cards are faster than all but the fastest internet connections. But with a LAN, it can be useful to know what kind of connection speeds you are getting between systems that share files or play local games.
Wired networking is pretty reliable in this regard. It will be close to the speed of your NIC and switch, minus some network overhead. Wireless networking can be less clear, particularly in Linux. The farther you are from the access point, the slower your transfers will be. In addition, some hardware manufacturers are notorious for either releasing Linux drivers/info slowly, or refusing to cooperate with the open source community at all. I have a Linksys WPC600N network card (Broadcom 43xx based), which falls into the former camp. There are open source drivers that had to be reverse engineered, and there are closed source drivers that aren’t really complete. Either way, the connection speed reported by NetworkManager and iwconfig are clearly incorrect. It’s a wireless-N card, but frequently claims to be getting 2Mb/s throughput, and never reports more than 53Mb/s.
I was really going to be annoyed if I had shelled out for a new NIC only to get the old performance. That’s where iperf comes in. It’s a simple, lightweight, open-source utility for measuring data throughput between two computers. It even has a java graphical front end – JPerf. Source is available for download from the link above, or you can install it on Ubuntu through the repositories. The only Windows binaries I found were very out of date (1.70), but I believe it will compile just fine.
Using iperf is pretty simple. You pick one machine to be the test server, and the other to be the client. Both machines must have iperf installed.
On the server, start iperf with the command:
On the client machine, you run the test with this command:
You should end up with results on both machines that look like this:
Client connecting to 10.0.13.68, TCP port 5001
TCP window size: 8.00 KByte (default)
 local (your IP) port 1500 connected with 10.0.13.68 port 5001
[ ID] Interval Transfer Bandwidth
 0.0-10.0 sec 111 MBytes 92.9 Mbits/sec
If you run it a few times, you will notice some fluctuation in the throughput, but the average should be just about right. This is what I consider a practical benchmark. It doesn’t take into account any network or protocol overhead. The rate reported is the real amount of data you can move from point to point. My “2Mb/s” connection turned out to really be getting closer to 80Mb/s.