Sie sind auf Seite 1von 8

Iperf Commands for Network Troubleshooting

! May 30, 2011 (

" Sam Kear ( # Networking

( is a very useful utility

for network troubleshooting. In this post
Ill share my list of Iperf commands that I
have found useful.
What is Iperf?
Iperf is a network performance utility that
can generate both TCP and UDP trac
for testing bandwidth, latency, and packet
loss. Iperf is very powerful and can easily
generate enough trac to saturate a
1Gb, or 10Gb connection. Iperf is included with
most Linux distributions but you can compile
Iperf for windows
( if
In order to use Iperf youll need to setup an Iperf
server, Iperf clients can then connect to the
server in order to run tests. By default Iperf is
uni-directional and sends data from the client to
the server.
In my examples Im using as the
address of my Iperf server.
Running iperf -s will setup a basic Iperf server, you can also run Iperf in daemon mode by
running iperf -D.

Basic TCP Unicast Test

The simplest test you can do with Iperf is a basic TCP test. By default the server will use a TCP
window size of 85.3KB. The client will connect to the server on port 5001 using a TCP window
size of 16KB. The -t option instructs the client to run the test for 30 seconds instead of the
default of 10 seconds.
[Server] iperf -s -i 1
[Client] iperf -c -t 30
Parallel TCP connections
Parallel connections can be useful if you need to saturate the bandwidth of a link. The
bandwidth of a single TCP session can be greatly aected by the size of the receive window
and the latency of the link.
To enable parallel connections add the -P ag to the Iperf client parameters followed by the
number of connections you want. Make sure to use a capital P, lowercase p will specify a
dierent port number to connect on.
[Server] iperf -s -i 1
[Client] iperf -c -t 30 -P 10


UDP Mode
Testing with UDP packets requires the -u ag on both the client and server. The cool thing
about UDP mode is that you dont have to use a server. Instead you can use the interface
counters on your switches. You can also specify the destination address to be a multicast
group, the default TTL for multicast is 1 (be careful). To set a dierent TTL use the -T option on
the client.
If you want to test for jitter and packet loss then you should use UDP mode.
[Server] iperf -s -i 1
[Client] iperf -c -t 30 -u
In UDP mode iperf defaults to 1Mb/s, you can tell it to use more bandwidth by using the -b ag
followed by the number of bits/sec to send. For example, iperf -c -u -b 100000000
would send at a rate of 100Mb/s.

Bidirectional testing
If you want to test throughput both to
and from the server at the same time you
can use the -d option to run a
bidirectional test. This will send data to
the server, and receive data from the
server simultaneously.
[Server] iperf -s -i 1
[Client] iperf -c -t 30 -d
Bandwidth limiting
If you need to test for packet loss or
other problems at a specic rate of bandwidth you can use the -b ag to specify the maximum
throughput in bits/second.
[Server] iperf -s -i 1
[Client] iperf -c -t 30 -b 100000
Transfer 1GB of data then stop
Instead of running the test for a specic period of you can instruct Iperf to stop running after
trasfering a certain amound of data. The example below will send 1GB (1024) of data to the
server and then stop
[Server] iperf -s -i 1
[Client] iperf -c -n 1073741824
Stop the iPerf server
To kill the iperf server just press CTRL+C in your terminal and it will interrupt the process.
If you are running iPerf in daemon mode youll need to nd the process ID rst
ps -ef | grep iperf


1 0 22:00 ?

00:00:00 iperf -s -D

Then kill it
kill 16186
Useful References
Energy Sciences Network Host Tuning Guide (
Using Iperf Guide by Jon Dugan

Share this:

Facebook (

Twitter (

Reddit (


Sam graduated from the University of Missouri - Kansas City with a bachelors
degree in Information Technology. Currently he works as a network analyst for an
algorithmic trading rm. Sam enjoys the challenge of troubleshooting complex
problems and is constantly experimenting with new technologies.

6 thoughts on Iperf Commands for Network

July 4, 2011 at 11:04 am (

Thanks for the eort of the 2 iperf blogs. I will spend some time reading and
testing them out.

July 4, 2011 at 10:38 pm (

Thanks for your comment! I hope that you nd iperf to be as useful of a tool as I

June 22, 2015 at 10:22 pm (

hi my name raj i having a problem with iperf.actualy i using 10gb copper cable
to testing that bandwidth but i cannot getif i type 100m i get 100mb
bandwidth but when i type 10000 i get 562mb bandwidth it wont go more than
that so can u help me..i trying this two days but still like that.tq

April 2, 2014 at 10:16 am (

I have ran parallel TCP streams to saturate my switch. How can I nd if the switch is
saturated or not?


April 3, 2014 at 9:04 am (

If you have a managed switch you can check the interface counters to view the
port utilization and also check for queue drops.
For example on Cisco switches you can run show interface X, replacing x with the
port in question (Gi1/1, etc). You can also run show interface counters errors to
get a summary of errors and output discards across the switch. Turning on
Netow (if supported) can provide some great real time data on switch utilization.
If youre not running Cisco equipment but you still have a managed switch then
check the documentation for your specic model to see what commands are

October 15, 2015 at 5:17 am (

i am getting Connect failed : Connection timeout message as error in client

side. i am giving simple server side cmd as iperf -s and client cmd as iperf -c
i am using 2 PCs for this connection
can anybody help me how i can make it to connect plz?

Your email address will not be published. Required elds are marked *
Name *

Email *




Notify me of follow-up comments by email.

Notify me of new posts by email.

$ Installing FreeNAS on VirtualBox (

How to Make the Google Plus Button One Show Up % (



Sam Kear

3 Nov

#Bitcoin to be major reserve currency by 2030: Research

Show Summary
Sam Kear

23 Oct

Drug with rage-inducing >5,000% price-hike now has $1/pill competitor
Show Summary
Sam Kear

20 Oct

Federal agent gets six years in prison for extorting #bitcoin from Silk Road creator via @verge
Show Summary

Tweet to @SamKear

Fixing Palo Alto Firewall Support in RANCID Version 3.2
Building a Raspberry Pi ADS-B Ground Station (
Time Warners New Enhanced DVR the Arris DCX3600-M
How to Enable SPDY on Nginx Using Ubuntu 14.04

How to Control Power Outlets Wirelessly Using the Raspberry Pi



Will on How to Control Power Outlets Wirelessly Using the Raspberry Pi
Brad on How to Control Power Outlets Wirelessly Using the Raspberry Pi
Dan McGee ( on How to Control Power Outlets Wirelessly Using the
Raspberry Pi (
Brad on How to Control Power Outlets Wirelessly Using the Raspberry Pi
Dan McGee ( on How to Control Power Outlets Wirelessly Using the
Raspberry Pi (
Hardware (
FreeNAS (
Networking (

Sam Kear Dot Com ( All rights reserved. Theme by Colorlib ( Powered by
WordPress (