Sunteți pe pagina 1din 3

Testing Network Performance with Iperf

Anuj Sehgal, Jrgen Schnwlder


School of Engineering and Science
Jacobs University Bremen, Germany
{s.anuj, j.schoenwaelder}@jacobs-university.de
September 20, 2010

Abstract
For some of the assignments in the Advanced Networking Lab you may
need to test the performance of your network connection. This document
explains how to use the iperf tool for performance testing.

1 Introduction
The iperf tool is a commonly used network testing tool that can create TCP
and UDP data streams and measure the throughput of a network that is carrying
them. iperf allows the user to set various parameters that can be used for
testing a network, or alternately for optimizing or tuning a network. iperf has
a client and server functionality, and can measure the throughput between the
two ends, either unidirectonally or bi-directionally. It allows you to also test the
performance of dierent TCP congestion control algorithms by picking dierent
ones while running it in client mode.
Please note that when used for testing TCP capacity, Iperf measures the
throughput of the payload. One thing to note is that Iperf uses 1024*1024 for
megabytes and 1000*1000 for megabits.

2 Installation
This document assumes that you are running an Ubuntu distribution, however,
any Debian based distribution should also work. In case you are not on a Debian
based distribution, please try to compile iperf from source.

2.1 Compiling From Source


iperf can be compiled to run on various platforms including Linux, MacOS and
Windows. To compile the tool from command line, please download it from the
following location:

1
http://sourceforge.net/projects/iperf/

Once your project downloads, using the terminal, navigate to the folder
where the file was downloaded. Assuming you downloaded iperf version 2.0.5,
issue the following commands:

localhost:Downloads user$ tar xvfz iperf-2.0.5.tar.gz


localhost:Downloads user$ cd iperf-2.0.5
localhost:Downloads user$ ./configure
localhost:Downloads user$ make
localhost:Downloads user$ sudo make install

Your iperf tool should now be installed.

2.2 Installing from a Repository


Assuming you are on a Debian based distribution, you can use apt-get to install
iperf using the following command:

sudo apt-get install iperf

On other distributions, you may use the package manager provided to you;
for example, on SuSe you can use yum.

3 Bandwidth Testing
iperf can be started in client or server mode. We have already setup three
servers for you to use in order to perform bandwidth tests. The server addresses
you can use are:

meat.eecs.jacobs-university.de
veggie.eecs.jacobs-university.de
cook.eecs.jacobs-university.de

For this tutorial, we will use meat.eecs.jacobs-university.de as our


iperf server. The simplest way to run a bandwidth test from your machine
to the server is as below (output follows the command):

localhost:Downloads user$ iperf -c meat.eecs.jacobs-university.de


------------------------------------------------------------
Client connecting to meat.eecs.jacobs-university.de, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 172.16.147.164 port 45354 connected with 212.201.49.188 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 6.02 MBytes 5.03 Mbits/sec

2
You may make the bandwidth testing more complex, as desired, by using
various command line switches to setup the iperf test. In the above example
-c switch is used to instruct iperf to start in client mode, in order to connect
to meat.eecs.jacobs-university.de. This test is unidirectional; in case you
wish to do a bi-directional test, you may use the -d switch as shown below:

localhost:Downloads user$ iperf -c meat.eecs.jacobs-university.de -d


------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 256 KByte (default)
------------------------------------------------------------
------------------------------------------------------------
Client connecting to meat.eecs.jacobs-university.de, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 5] local 172.16.147.164 port 45354 connected with 212.201.49.188 port 5001
[ 6] local 172.16.147.164 port 5001 connected with 212.201.49.188 port 60269
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.6 sec 896 KBytes 689 Kbits/sec
[ 6] 0.0-13.2 sec 6.06 MBytes 3.86 Mbits/sec

One of the most handy features of iperf is to test the performance of TCP
over a connection using dierent congestion control algorithms. Using the -Z
command line switch you can instruct iperf to use the specified congestion
control algorithm, rather than the kernel default:

localhost:Downloads user$ iperf -c meat.eecs.jacobs-university.de -Z reno


------------------------------------------------------------
Client connecting to meat.eecs.jacobs-university.de, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 3] local 172.16.147.164 port 45354 connected with 212.201.49.188 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 6.02 MBytes 5.03 Mbits/sec

The congestion control switch only applies to Linux and some options that
you may use on any distribution are, reno, yeah, highspeed, bic and vegas.

S-ar putea să vă placă și