Sie sind auf Seite 1von 15

10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

iPerf - The ultimate speed test tool for TCP, UDP and
SCTP
Test the limits of your network + Internet neutrality test

 Home  Download iPerf binaries

 Public iPerf3 servers  iPerf user docs

 French iPerf forum  Contact

Table of contents :

1. Change between iPerf 2.0, iPerf 3.0 and iPerf 3.1


2. iPerf 3 user documentation
3. Change between iPerf 2.0.6, iPerf 2.0.7 and iPerf 2.0.8
4. iPerf 2 user documentation

Change between iPerf 2.0, iPerf 3.0 and iPerf 3.1


iPerf2 features currently supported by iPerf3 :
TCP and UDP tests
Set port (-p)
Setting TCP options: No delay, MSS, etc.
Setting UDP bandwidth (-b)
Setting socket buffer size (-w)
Reporting intervals (-i)
Setting the iPerf buffer (-l)
Bind to speci c interfaces (-B)
IPv6 tests (-6)
Number of bytes to transmit (-n)
Length of test (-t)
Parallel streams (-P)
Setting DSCP/TOS bit vectors (-S)
Change number output format (-f)

New Features in iPerf 3.0 :


Dynamic server (client/server parameter exchange) – Most server options from iPerf2 can now
be dynamically set by the client
Client/server results exchange
A iPerf3 server accepts a single client simultaneously (multiple clients simultaneously for
iPerf2)
iPerf API (libiperf) – Provides an easy way to use, customize and extend iPerf functionality
-R, Reverse test mode – Server sends, client receives

https://iperf.fr/iperf-doc.php#tuningudp 1/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

-O, --omit N : omit the rst n seconds (to ignore TCP slowstart)
-b, --bandwidth n[KM] for TCP (only UDP for IPERF 2): Set target bandwidth to n bits/sec
(default 1 Mbit/sec for UDP, unlimited for TCP).
-V, --verbose : more detailed output than before
-J, --json : output in JSON format
-Z, --zerocopy : use a 'zero copy' send le() method of sending data. This uses much less CPU.
-T, --title str : pre x every output line with this string
-F, -- le name : xmit/recv the speci ed le
-A, --af nity n/n,m : set CPU af nity (cores are numbered from 0 - Linux and FreeBSD only)
-k, --blockcount #[KMG] : number of blocks (packets) to transmit (instead of -t or -n)
-4, --version4 : only use IPv4
-6, --version6 : only use IPv6
-L, -- owlabel : set IPv6 ow label (Linux only)
-C, --linux-congestion : set congestion control algorithm (Linux and FreeBSD only) (-Z in iPerf2)
-d, --debug : emit debugging output. Primarily (perhaps exclusively) of use to developers.
-s, --server : iPerf2 can handle multiple client requests. iPerf3 will only allow one iperf
connection at a time.

New Features in iPerf 3.1 :


-I, --pid le le write a le with the process ID, most useful when running as a daemon.
--cport : Specify the client-side port.
--sctp use SCTP rather than TCP (Linux, FreeBSD and Solaris).
--udp-counters-64bit : Support very long-running UDP tests, which could cause a counter to
over ow
--log le le : send output to a log le.

iPerf2 Features Not Supported by iPerf3 :


Bidirectional testing (-d / -r)
Data transmitted from stdin (-I)
TTL : time-to-live, for multicast (-T)
Exclude C(connection) D(data) M(multicast) S(settings) V(server) reports (-x)
Report as a Comma-Separated Values (-y)
Compatibility mode allows for use with older version of iPerf (-C)

iPerf 3 user documentation


GENERAL OPTIONS
Command
Description
line option
-p, --port n The server port for the server to listen on and the client to connect to. This should be the same
in both client and server. Default is 5201.
--cport n Option to specify the client-side port. (new in iPerf 3.1)
-f, --format A letter specifying the format to print bandwidth numbers in. Supported formats are 
[kmKM]
'k' = Kbits/sec 'K' = KBytes/sec
'm' = Mbits/sec 'M' = MBytes/sec

The adaptive formats choose between kilo- and mega- as appropriate.


-i, -- Sets the interval time in seconds between periodic bandwidth, jitter, and loss reports. If non-
interval n zero, a report is made every interval seconds of the bandwidth since the last report. If zero, no
periodic reports are printed. Default is zero.
-F, -- le client-side: read from the le and write to the network, instead of using random data;
name server-side: read from the network and write to the le, instead of throwing the data away.
-A, -- Set the CPU af nity, if possible (Linux and FreeBSD only). On both the client and server you can
https://iperf.fr/iperf-doc.php#tuningudp 2/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

af nity set the local af nity by using the n form of this argument (where n is a CPU number). In addition,
n/n,m-F on the client side you can override the server’s af nity for just that one test, using the n,m form
of argument. Note that when using this feature, a process will only be bound to a single CPU (as
opposed to a set containing potentialy multiple CPUs).
-B, --bind Bind to host, one of this machine's addresses. For the client this sets the outbound interface. For
host a server this sets the incoming interface. This is only useful on multihomed hosts, which have
multiple network interfaces.
-V, -- give more detailed output
verbose
-J, --json output in JSON format
--log le send output to a log le. (new in iPerf 3.1)
le
--d, -- emit debugging output. Primarily (perhaps exclusively) of use to developers.
debug
-v, -- Show version information and quit.
version
-h, --help Show a help synopsis and quit.

SERVER SPECIFIC OPTIONS


Command
Description
line option
-s, --server Run iPerf in server mode. (This will only allow one iperf connection at a time)
-D, -- Run the server in background as a daemon.
daemon
-I, -- write a le with the process ID, most useful when running as a daemon. (new in iPerf 3.1)
pid le le

CLIENT SPECIFIC OPTIONS


Command
Description
line option
-c, --client Run iPerf in client mode, connecting to an iPerf server running on host.
host
--sctp Use SCTP rather than TCP (Linux, FreeBSD and Solaris). (new in iPerf 3.1)
-u, --udp Use UDP rather than TCP. See also the -b option.
-b, -- Set target bandwidth to n bits/sec (default 1 Mbit/sec for UDP, unlimited for TCP). If there are
bandwidth multiple streams (-P ag), the bandwidth limit is applied separately to each stream. You can also
n[KM] add a ’/’ and a number to the bandwidth speci er. This is called "burst mode". It will send the
given number of packets without pausing, even if that temporarily exceeds the speci ed
bandwidth limit.
-t, --time n The time in seconds to transmit for. iPerf normally works by repeatedly sending an array of len
bytes for time seconds. Default is 10 seconds. See also the -l, -k and -n options.
-n, --num The number of buffers to transmit. Normally, iPerf sends for 10 seconds. The -n option
n[KM] overrides this and sends an array of len bytes num times, no matter how long that takes. See
also the -l, -k and -t options.
-k, -- The number of blocks (packets) to transmit. (instead of -t or -n) See also the -t, -l and -n options.
blockcount
n[KM]
-l, --length The length of buffers to read or write. iPerf works by writing an array of len bytes a number of
n[KM] times. Default is 128 KB for TCP, 8 KB for UDP. See also the -n, -k and -t options.
-P, -- The number of simultaneous connections to make to the server. Default is 1.
parallel n
-R, -- Run in reverse mode (server sends, client receives).
reverse
-w, -- Sets the socket buffer sizes to the speci ed value. For TCP, this sets the TCP window size. (this
https://iperf.fr/iperf-doc.php#tuningudp 3/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

window gets sent to the server and used on that side too)
n[KM]
-M, --set- Attempt to set the TCP maximum segment size (MSS). The MSS is usually the MTU - 40 bytes
mss n for the TCP/IP header. For ethernet, the MSS is 1460 bytes (1500 byte MTU).
-N, --no- Set the TCP no delay option, disabling Nagle's algorithm. Normally this is only disabled for
delay interactive applications like telnet.
-4, -- only use IPv4.
version4
-6, -- only use IPv6.
version4
-S, --tos n The type-of-service for outgoing packets. (Many routers ignore the TOS eld.) You may specify
the value in hex with a '0x' pre x, in octal with a '0' pre x, or in decimal. For example, '0x10' hex
= '020' octal = '16' decimal. The TOS numbers speci ed in RFC 1349 are: 

IPTOS_LOWDELAY minimize delay 0x10


IPTOS_THROUGHPUT maximize throughput 0x08
IPTOS_RELIABILITY maximize reliability 0x04
IPTOS_LOWCOST minimize cost 0x02

-L, -- Set the IPv6 ow label (currently only supported on Linux).


owlabel n
-Z, -- Use a "zero copy" method of sending data, such as send le(2), instead of the usual write(2). This
zerocopy uses much less CPU.
-O, --omit Omit the rst n seconds of the test, to skip past the TCP TCP slowstart period.
n
-T, --title Pre x every output line with this string.
str
-C, --linux- Set the congestion control algorithm (Linux only for iPerf 3.0, Linux and FreeBSD for iPerf 3.1).
congestion
algo

See also https://github.com/esnet/iperf

Change between iPerf 2.0.6, iPerf 2.0.7 and iPerf 2.0.8


2.0.6 change set (rjmcmahon@rjmcmahon.com) March 2014 :
Increase the shared memory for report headers reducing mutex contention. Needed to increase
performance. Minor code change that should be platform/os independent

2.0.7 change set (rjmcmahon@rjmcmahon.com) August 2014 :


Linux only version which supports end/end latency (assumes clocks synched)
Support for smaller report interval (5 milliseconds or greater)
End/end latency with UDP (mean/min/max), display in milliseconds with resolution of
microseconds
Socket read timeouts (server only) so iperf reports occur regardless of no received packets
Report timestamps now display millisecond resolution
Local bind supports port value using colon as delimeter (-B 10.10.10.1:60001)
Use linux realtime scheduler and packet level timestamps for improved latency accuracy
Suggest PTP on client and server to synch clocks to microsecond
Suggest a quality reference for the PTP grandmaster such as a GPS disciplined oscillator from
companies like Spectracom

2.0.8 change set (as of 12 january 2015) :


Fix portability, compile and test with Linux, Win10, Win7, WinXP, MacOS and Android
https://iperf.fr/iperf-doc.php#tuningudp 4/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

Client now requires -u for UDP (no longer defaults to UDP with -b)
Maintain legacy report formats
Support for -e to get enhanced reports
Support TCP rate limited streams (via the -b) using token bucket
Support packets per second (UDP) via pps as units, (e.g. -b 1000pps)
Display PPS in both client and server reports (UDP)
Support realtime scheduler as a command line option (--realtime or -z)
Improve client tx code path so actual tx offerred rate will converge to the -b value
Improve accuracy of microsecond delay calls (in platform independent manner)
(Use of Kalman lter to predict delay errors and adjust delays per predicted error)
Display target loop time in initial client header (UDP)
Fix nal latency report sent from server to client (UDP)
Include standard deviation in latency output
Suppress unrealistic latency output (-/-/-/-)
Support SO_SNDTIMEO on send so socket write won't block beyond -t (TCP)
Use clock_gettime if available (preferred over gettimeofday())
TCP write and error counts (TCP retries and CWND for linux)
TCP read count, TCP read histogram (8 bins)
Server will close the socket after -t seconds of no traf c

See also https://sourceforge.net/projects/iperf2/

iPerf 2 user documentation


Tuning a TCP connection

Tuning a UDP connection

Running multicast servers and


clients

IPv6 Mode

Representative Streams

Running iPerf as a daemon

Running iPerf as a Windows


Service

Adaptive Window Sizes

Compiling

GENERAL OPTIONS
Command Environment variable
Description
line option option
-f, --format $IPERF_FORMAT A letter specifying the format to print bandwidth numbers in.
[bkmaBKMA] Supported formats are 

'b' = bits/sec 'B' = Bytes/sec


'k' = Kbits/sec 'K' = KBytes/sec
'm' = Mbits/sec 'M' = MBytes/sec

https://iperf.fr/iperf-doc.php#tuningudp 5/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

'g' = Gbits/sec 'G' = GBytes/sec


'a' = adaptive bits/sec 'A' = adaptive Bytes/sec

The adaptive formats choose between kilo- and mega- as


appropriate. Fields other than bandwidth always print bytes, but
otherwise follow the requested format. Default is 'a'. 
NOTE: here Kilo = 1024, Mega = 1024^2 and Giga = 1024^3 when
dealing with bytes. Commonly in networking, Kilo = 1000, Mega =
1000^2, and Giga = 1000^3 so we use this when dealing with bits. If
this really bothers you, use -f b and do the math.
-i, --interval # $IPERF_INTERVAL Sets the interval time in seconds between periodic bandwidth, jitter,
and loss reports. If non-zero, a report is made every interval seconds
of the bandwidth since the last report. If zero, no periodic reports are
printed. Default is zero.
-l, --len #[KM] $IPERF_LEN The length of buffers to read or write. iPerf works by writing an array
of len bytes a number of times. Default is 8 KB for TCP, 1470 bytes
for UDP. Note for UDP, this is the datagram size and needs to be
lowered when using IPv6 addressing to 1450 or less to avoid
fragmentation. See also the -n and -t options.
-m, -- $IPERF_PRINT_MSS Print the reported TCP MSS size (via the TCP_MAXSEG option) and
print_mss the observed read sizes which often correlate with the MSS. The MSS
is usually the MTU - 40 bytes for the TCP/IP header. Often a slightly
smaller MSS is reported because of extra header space from IP
options. The interface type corresponding to the MTU is also printed
(ethernet, FDDI, etc.). This option is not implemented on many OSes,
but the read sizes may still indicate the MSS.
-p, --port # $IPERF_PORT The server port for the server to listen on and the client to connect
to. This should be the same in both client and server. Default is 5001,
the same as ttcp.
-u, --udp $IPERF_UDP Use UDP rather than TCP. See also the -b option.
-w, --window $TCP_WINDOW_SIZE Sets the socket buffer sizes to the speci ed value. For TCP, this sets
#[KM] the TCP window size. For UDP it is just the buffer which datagrams
are received in, and so limits the largest receivable datagram size.
-B, --bind $IPERF_BIND Bind to host, one of this machine's addresses. For the client this sets
host the outbound interface. For a server this sets the incoming interface.
This is only useful on multihomed hosts, which have multiple network
interfaces. 

For iPerf in UDP server mode, this is also used to bind and join to a
multicast group. Use addresses in the range 224.0.0.0 to
239.255.255.255 for multicast. See also the -T option.

-C, -- $IPERF_COMPAT Compatibility mode allows for use with older version of iPerf. This
compatibility mode is not required for interoperability but it is highly
recommended. In some cases when using representative streaming
you could cause a 1.7 server to crash or cause undesired connection
attempts.
-M, --mss # $IPERF_MSS Attempt to set the TCP maximum segment size (MSS) via the
[KM} TCP_MAXSEG option. The MSS is usually the MTU - 40 bytes for the
TCP/IP header. For ethernet, the MSS is 1460 bytes (1500 byte
MTU). This option is not implemented on many OSes.
-N, --nodelay $IPERF_NODELAY Set the TCP no delay option, disabling Nagle's algorithm. Normally
this is only disabled for interactive applications like telnet.
-V (from v1.6 . Bind to an IPv6 address
or higher) Server side:
$ iperf -s -V 

https://iperf.fr/iperf-doc.php#tuningudp 6/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

Client side:
$ iperf -c <Server IPv6 Address> -V
 

Note: On version 1.6.3 and later a speci c IPv6 Address does not
need to be bound with the -B option, previous 1.6 versions do. Also
on most OSes using this option will also respond to IPv4 clients using
IPv4 mapped addresses.
-h, --help   Print out a summary of commands and quit.
-v, --version   Print version information and quit. Prints 'pthreads' if compiled with
POSIX threads, 'win32 threads' if compiled with Microsoft Win32
threads, or 'single threaded' if compiled without threads.

SERVER SPECIFIC OPTIONS


Command Environment variable
Description
line option option
-s, --server $IPERF_SERVER Run iPerf in server mode. (iPerf2 can handle multiple client requests)
-D (from v1.2 . Run the server as a daemon (Unix platforms)
or higher) On Win32 platforms where services are available, iPerf will start
running as a service.
-R (only for . Remove the iPerf service (if it's running). 
Windows,
from v1.2 or
higher)
-o (only for . Redirect output to given le. 
Windows,
from v1.2 or
higher)
-c, --client $IPERF_CLIENT If iPerf is in server mode, then specifying a host with -c will limit the
host connections that iPerf will accept to the host speci ed. Does not
work well for UDP.
-P, --parallel # $IPERF_PARALLEL The number of connections to handle by the server before closing.
Default is 0 (which means to accept connections forever).

CLIENT SPECIFIC OPTIONS


Command Environment variable
Description
line option option
-b, -- $IPERF_BANDWIDTH The UDP bandwidth to send at, in bits/sec. This implies the -u option.
bandwidth # Default is 1 Mbit/sec.
[KM]
-c, --client $IPERF_CLIENT Run iPerf in client mode, connecting to an iPerf server running on
host host.
-d, --dualtest $IPERF_DUALTEST Run iPerf in dual testing mode. This will cause the server to connect
back to the client on the port speci ed in the -L option (or defaults to
the port the client connected to the server on). This is done
immediately therefore running the tests simultaneously. If you want
an alternating test try -r.
-n, --num # $IPERF_NUM The number of buffers to transmit. Normally, iPerf sends for 10
[KM] seconds. The -n option overrides this and sends an array of len bytes
num times, no matter how long that takes. See also the -l and -t
options.
-r, --tradeoff $IPERF_TRADEOFF Run iPerf in tradeoff testing mode. This will cause the server to
connect back to the client on the port speci ed in the -L option (or
defaults to the port the client connected to the server on). This is

https://iperf.fr/iperf-doc.php#tuningudp 7/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

done following the client connection termination, therefore running


the tests alternating. If you want an simultaneous test try -d.
-t, --time # $IPERF_TIME The time in seconds to transmit for. iPerf normally works by
repeatedly sending an array of len bytes for time seconds. Default is
10 seconds. See also the -l and -n options.
-L, -- $IPERF_LISTENPORT This speci es the port that the server will connect back to the client
listenport # on. It defaults to the port used to connect to the server from the
client.
-P, --parallel # $IPERF_PARALLEL The number of simultaneous connections to make to the server.
Default is 1. Requires thread support on both the client and server.
-S, --tos # $IPERF_TOS The type-of-service for outgoing packets. (Many routers ignore the
TOS eld.) You may specify the value in hex with a '0x' pre x, in octal
with a '0' pre x, or in decimal. For example, '0x10' hex = '020' octal =
'16' decimal. The TOS numbers speci ed in RFC 1349 are: 

IPTOS_LOWDELAY minimize delay 0x10


IPTOS_THROUGHPUT maximize throughput 0x08
IPTOS_RELIABILITY maximize reliability 0x04
IPTOS_LOWCOST minimize cost 0x02

-T, --ttl # $IPERF_TTL The time-to-live for outgoing multicast packets. This is essentially the
number of router hops to go through, and is also used for scoping.
Default is 1, link-local.
-F (from v1.2 . Use a representative stream to measure bandwidth, e.g. :- 
or higher) $ iperf -c <server address> -F < le-name>
-I (from v1.2 . Same as -F, input from stdin.
or higher)

Tuning a TCP connection


The primary goal of iPerf is to help in tuning TCP connections over a particular path. The most fundamental
tuning issue for TCP is the TCP window size, which controls how much data can be in the network at any one
point. If it is too small, the sender will be idle at times and get poor performance. The theoretical value to use
for the TCP window size is the bandwidth delay product,

bottleneck bandwidth * round trip time

In the below modi4/cyclops example, the bottleneck link is a 45 Mbit/sec DS3 link and the round trip time
measured with ping is 42 ms. The bandwidth delay product is

45 Mbit/sec * 42 ms
= (45e6) * (42e-3)
= 1890000 bits
= 230 KByte

That is a starting point for guring the best window size; setting it higher or lower may produce better
results. In our example, buffer sizes over 130K did not improve the performance, despite the bandwidth
delay product of 230K.

Note that many OSes and hosts have upper limits on the TCP window size. These may be as low as 64 KB, or
as high as several MB. iPerf tries to detect when these occur and give a warning that the actual and
requested window sizes are not equal (as below, though that is due to rounding in IRIX). For more
information on TCP window sizes, see the LaFibre.info. Here is an example session, between node1 in Illinois
and node2 in North Carolina. These are connected via the vBNS backbone and a 45 Mbit/sec DS3 link.

https://iperf.fr/iperf-doc.php#tuningudp 8/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

Notice we improve bandwidth performance by a factor of 3 using proper TCP window sizes. Use the
adaptive window sizes feature on platforms which allow setting window sizes in the granularity of bytes.

node2> iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 60.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 2357
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 6.5 MBytes 5.2 Mbits/sec

node1> iperf -c node2


------------------------------------------------------------
Client connecting to node1, TCP port 5001
TCP window size: 59.9 KByte (default)
------------------------------------------------------------
[ 3] local <IP Addr node1> port 2357 connected with <IP Addr node2> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 6.5 MBytes 5.2 Mbits/sec

node2> iperf -s -w 130k


------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 130 KByte
------------------------------------------------------------
[ 4] local <IP Addr node 2> port 5001 connected with <IP Addr node 1> port 2530
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 19.7 MBytes 15.7 Mbits/sec

node1> iperf -c node2 -w 130k


------------------------------------------------------------
Client connecting to node2, TCP port 5001
TCP window size: 129 KByte (WARNING: requested 130 KByte)
------------------------------------------------------------
[ 3] local <IP Addr node1> port 2530 connected with <IP Addr node2> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 19.7 MBytes 15.8 Mbits/sec

Another test to do is run parallel TCP streams. If the total aggregate bandwidth is more than what an
individual stream gets, something is wrong. Either the TCP window size is too small, or the OS's TCP
implementation has bugs, or the network itself has de ciencies. See above for TCP window sizes; otherwise
diagnosing which is somewhat dif cult. If iPerf is compiled with pthreads, a single client and server can test
this, otherwise setup multiple clients and servers on different ports. Here's an example where a single
stream gets 16.5 Mbit/sec, but two parallel streams together get 16.7 + 9.4 = 26.1 Mbit/sec, even when
using large TCP window sizes:

node2> iperf -s -w 300k


------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 300 KByte
------------------------------------------------------------
[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 6902
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.2 sec 20.9 MBytes 16.5 Mbits/sec

[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 6911

https://iperf.fr/iperf-doc.php#tuningudp 9/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

[ 5] local <IP Addr node2> port 5001 connected with <IP Addr node2> port 6912
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.1 sec 21.0 MBytes 16.7 Mbits/sec
[ 4] 0.0-10.3 sec 12.0 MBytes 9.4 Mbits/sec

node1> ./iperf -c node2 -w 300k


------------------------------------------------------------
Client connecting to node2, TCP port 5001
TCP window size: 299 KByte (WARNING: requested 300 KByte)
------------------------------------------------------------
[ 3] local <IP Addr node2> port 6902 connected with <IP Addr node1> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.2 sec 20.9 MBytes 16.4 Mbits/sec

node1> iperf -c node2 -w 300k -P 2


------------------------------------------------------------
Client connecting to node2, TCP port 5001
TCP window size: 299 KByte (WARNING: requested 300 KByte)
------------------------------------------------------------
[ 4] local <IP Addr node2> port 6912 connected with <IP Addr node1> port 5001
[ 3] local <IP Addr node2> port 6911 connected with <IP Addr node1> port 5001
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 21.0 MBytes 16.6 Mbits/sec
[ 3] 0.0-10.2 sec 12.0 MBytes 9.4 Mbits/sec

A secondary tuning issue for TCP is the maximum transmission unit (MTU). To be most effective, both hosts
should support Path MTU Discovery. Hosts without Path MTU Discovery often use 536 as the MSS, which
wastes bandwidth and processing time. Use the -m option to display what MSS is being used, and see if this
matches what you expect. Often it is around 1460 bytes for ethernet.

node3> iperf -s -m
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 60.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node3> port 5001 connected with <IP Addr node4> port 1096
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 2.0 sec 1.8 MBytes 6.9 Mbits/sec
[ 4] MSS size 1448 bytes (MTU 1500 bytes, ethernet)
[ 4] Read lengths occurring in more than 5% of reads:
[ 4] 952 bytes read 219 times (16.2%)
[ 4] 1448 bytes read 1128 times (83.6%)

Here is a host that doesn't support Path MTU Discovery. It will only send and receive small 576 byte
packets.

node4> iperf -s -m
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 32.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node4> port 5001 connected with <IP Addr node3> port 13914
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 2.3 sec 632 KBytes 2.1 Mbits/sec
WARNING: Path MTU Discovery may not be enabled.
[ 4] MSS size 536 bytes (MTU 576 bytes, minimum)
[ 4] Read lengths occurring in more than 5% of reads:
[ 4] 536 bytes read 308 times (58.4%)

https://iperf.fr/iperf-doc.php#tuningudp 10/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

[ 4] 1072 bytes read 91 times (17.3%)


[ 4] 1608 bytes read 29 times (5.5%)

iPerf supports other tuning options, which were added for exceptional network situations like HIPPI-to-
HIPPI over ATM.

Tuning a UDP connection


iPerf creates a constant bit rate UDP stream. This is a very arti cial stream, similar to voice communication
but not much else.

You will want to adjust the datagram size (-l) to the size your application uses.

The server detects UDP datagram loss by ID numbers in the datagrams. Usually a UDP datagram becomes
several IP packets. Losing a single IP packet will lose the entire datagram. To measure packet loss instead of
datagram loss, make the datagrams small enough to t into a single packet, using the -l option. The default
size of 1470 bytes works for ethernet. Out-of-order packets are also detected. (Out-of-order packets cause
some ambiguity in the lost packet count; iPerf assumes they are not duplicate packets, so they are excluded
from the lost packet count.) Since TCP does not report loss to the user, I nd UDP tests helpful to see packet
loss along a path.

Jitter calculations are continuously computed by the server, as speci ed by RTP in RFC 1889. The client
records a 64 bit second/microsecond timestamp in the packet. The server computes the relative transit time
as (server's receive time - client's send time). The client's and server's clocks do not need to be synchronized;
any difference is subtracted out in the jitter calculation. Jitter is the smoothed mean of differences between
consecutive transit times.

node2> iperf -s -u -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 60.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 9726
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 4] 0.0- 1.0 sec 1.3 MBytes 10.0 Mbits/sec 0.209 ms 1/ 894 (0.11%)
[ 4] 1.0- 2.0 sec 1.3 MBytes 10.0 Mbits/sec 0.221 ms 0/ 892 (0%)
[ 4] 2.0- 3.0 sec 1.3 MBytes 10.0 Mbits/sec 0.277 ms 0/ 892 (0%)
[ 4] 3.0- 4.0 sec 1.3 MBytes 10.0 Mbits/sec 0.359 ms 0/ 893 (0%)
[ 4] 4.0- 5.0 sec 1.3 MBytes 10.0 Mbits/sec 0.251 ms 0/ 892 (0%)
[ 4] 5.0- 6.0 sec 1.3 MBytes 10.0 Mbits/sec 0.215 ms 0/ 892 (0%)
[ 4] 6.0- 7.0 sec 1.3 MBytes 10.0 Mbits/sec 0.325 ms 0/ 892 (0%)
[ 4] 7.0- 8.0 sec 1.3 MBytes 10.0 Mbits/sec 0.254 ms 0/ 892 (0%)
[ 4] 8.0- 9.0 sec 1.3 MBytes 10.0 Mbits/sec 0.282 ms 0/ 892 (0%)
[ 4] 0.0-10.0 sec 12.5 MBytes 10.0 Mbits/sec 0.243 ms 1/ 8922 (0.011%)

node1> iperf -c node2 -u -b 10m


------------------------------------------------------------
Client connecting to node2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 60.0 KByte (default)
------------------------------------------------------------
[ 3] local <IP Addr node1> port 9726 connected with <IP Addr node2> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 12.5 MBytes 10.0 Mbits/sec
[ 3] Sent 8922 datagrams

https://iperf.fr/iperf-doc.php#tuningudp 11/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

Notice the higher jitter due to datagram reassembly when using larger 32 KB datagrams, each split into 23
packets of 1500 bytes. The higher datagram loss seen here may be due to the burstiness of the traf c, which
is 23 back-to-back packets and then a long pause, rather than evenly spaced individual packets.

node2> iperf -s -u -l 32k -w 128k -i 1


------------------------------------------------------------
Server listening on UDP port 5001
Receiving 32768 byte datagrams
UDP buffer size: 128 KByte
------------------------------------------------------------
[ 3] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 11303
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 1.3 MBytes 10.0 Mbits/sec 0.430 ms 0/ 41 (0%)
[ 3] 1.0- 2.0 sec 1.1 MBytes 8.5 Mbits/sec 5.996 ms 6/ 40 (15%)
[ 3] 2.0- 3.0 sec 1.2 MBytes 9.7 Mbits/sec 0.796 ms 1/ 40 (2.5%)
[ 3] 3.0- 4.0 sec 1.2 MBytes 10.0 Mbits/sec 0.403 ms 0/ 40 (0%)
[ 3] 4.0- 5.0 sec 1.2 MBytes 10.0 Mbits/sec 0.448 ms 0/ 40 (0%)
[ 3] 5.0- 6.0 sec 1.2 MBytes 10.0 Mbits/sec 0.464 ms 0/ 40 (0%)
[ 3] 6.0- 7.0 sec 1.2 MBytes 10.0 Mbits/sec 0.442 ms 0/ 40 (0%)
[ 3] 7.0- 8.0 sec 1.2 MBytes 10.0 Mbits/sec 0.342 ms 0/ 40 (0%)
[ 3] 8.0- 9.0 sec 1.2 MBytes 10.0 Mbits/sec 0.431 ms 0/ 40 (0%)
[ 3] 9.0-10.0 sec 1.2 MBytes 10.0 Mbits/sec 0.407 ms 0/ 40 (0%)
[ 3] 0.0-10.0 sec 12.3 MBytes 9.8 Mbits/sec 0.407 ms 7/ 401 (1.7%)

node1> iperf -c node2 -b 10m -l 32k -w 128k


------------------------------------------------------------
Client connecting to node2, UDP port 5001
Sending 32768 byte datagrams
UDP buffer size: 128 KByte
------------------------------------------------------------
[ 3] local <IP Addr node2> port 11303 connected with <IP Addr node1> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 12.5 MBytes 10.0 Mbits/sec
[ 3] Sent 401 datagrams

Multicast
To test multicast, run several servers with the bind option (-B, --bind) set to the multicast group address. Run
the client, connecting to the multicast group address and setting the TTL (-T, --ttl) as needed. Unlike normal
TCP and UDP tests, multicast servers may be started after the client. In that case, datagrams sent before the
server started show up as losses in the rst periodic report (61 datagrams on arno below).

node5> iperf -c 224.0.67.67 -u --ttl 5 -t 5


------------------------------------------------------------
Client connecting to 224.0.67.67, UDP port 5001
Sending 1470 byte datagrams
Setting multicast TTL to 5
UDP buffer size: 32.0 KByte (default)
------------------------------------------------------------
[ 3] local <IP Addr node5> port 1025 connected with 224.0.67.67 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0- 5.0 sec 642 KBytes 1.0 Mbits/sec
[ 3] Sent 447 datagrams

node5> iperf -s -u -B 224.0.67.67 -i 1


https://iperf.fr/iperf-doc.php#tuningudp 12/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 224.0.67.67
Joining multicast group 224.0.67.67
Receiving 1470 byte datagrams
UDP buffer size: 32.0 KByte (default)
------------------------------------------------------------
[ 3] local 224.0.67.67 port 5001 connected with <IP Addr node5> port 1025
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 131 KBytes 1.0 Mbits/sec 0.007 ms 0/ 91 (0%)
[ 3] 1.0- 2.0 sec 128 KBytes 1.0 Mbits/sec 0.008 ms 0/ 89 (0%)
[ 3] 2.0- 3.0 sec 128 KBytes 1.0 Mbits/sec 0.010 ms 0/ 89 (0%)
[ 3] 3.0- 4.0 sec 128 KBytes 1.0 Mbits/sec 0.013 ms 0/ 89 (0%)
[ 3] 4.0- 5.0 sec 128 KBytes 1.0 Mbits/sec 0.008 ms 0/ 89 (0%)
[ 3] 0.0- 5.0 sec 642 KBytes 1.0 Mbits/sec 0.008 ms 0/ 447 (0%)

node6> iperf -s -u -B 224.0.67.67 -i 1


------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 224.0.67.67
Joining multicast group 224.0.67.67
Receiving 1470 byte datagrams
UDP buffer size: 60.0 KByte (default)
------------------------------------------------------------
[ 3] local 224.0.67.67 port 5001 connected with <IP Addr node5> port 1025
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 3] 0.0- 1.0 sec 129 KBytes 1.0 Mbits/sec 0.778 ms 61/ 151 (40%)
[ 3] 1.0- 2.0 sec 128 KBytes 1.0 Mbits/sec 0.236 ms 0/ 89 (0%)
[ 3] 2.0- 3.0 sec 128 KBytes 1.0 Mbits/sec 0.264 ms 0/ 89 (0%)
[ 3] 3.0- 4.0 sec 128 KBytes 1.0 Mbits/sec 0.248 ms 0/ 89 (0%)
[ 3] 0.0- 4.3 sec 554 KBytes 1.0 Mbits/sec 0.298 ms 61/ 447 (14%)

Start multiple clients or servers as explained above, sending data to the same multicast server. (If you have
multiple servers listening on the multicast address, each of the servers will be getting the data)

IPv6 Mode
Get the IPv6 address of the node using the 'ifcon g' command.
Use the -V option to indicate that you are using an IPv6 address Please note that we need to explicitly
bind the server address also.

Server side:
$ iperf -s -V

Client side:
$ iperf -c <Server IPv6 Address> -V>

Note: iPerf version 1.6.2 and eariler require a IPv6 address to be explicitly bound with the -B option
for the server.

Using Representative Streams to measure bandwidth

https://iperf.fr/iperf-doc.php#tuningudp 13/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

Use the -F or -I option. If you want to test how your network performs with compressed /
uncompressed streams, just create representative streams and use the -F option to test it. This is
usually due to the link layer compressing data.

The -F option is for le input.


The -I option is for input from stdin.

E.g.
Client: $ iperf -c <server address> -F < le-name>

Client: $ iperf -c <server address> -I

Running the server as a daemon


Use the -D command line option to run the server as a daemon. Redirect the output to a le.
E.g. iperf -s -D > iper og. This will have the iPerf Server running as a daemon and the server messages
will be logged in the le iperfLog.

Using iPerf as a Service under Win32


There are three options for Win32:

-o output lename
output the messages into the speci ed le
-s -D
install iPerf as a service and run it
-s -R
uninstall the iPerf service

Examples:

iperf -s -D -o iper og.txt


will install the iPerf service and run it. Messages will be reported into
"%windir%\system32\iper og.txt"
iperf -s -R
will uninstall the iPerf service if it is installed.

Note: If you stop want to restart the iPerf service after having killed it with the Microsoft
Management Console or the Windows Task Manager, make sure to use the proper OPTION in the
service properties dialog.

Adaptive window sizes (under development)


Use the -W option on the client to run the client with the adaptive window size. Ensure that the server
window size is fairly big for this option.
E.g.. If the server TCP window size is 8KB, it does not help having a client TCP window size of 256KB.
256KB Server TCP Window Size should suf ce for most high bandwidth networks.

Client changes the TCP window size using a binary exponential algorithm. This means that you may
notice that TCP window size suggested may vary according to the traf c in the network, iPerf will
https://iperf.fr/iperf-doc.php#tuningudp 14/15
10/08/2018 iPerf - iPerf3 and iPerf2 user documentation

suggest the best window size for the current network scenario.

Compiling
Once you have the distribution, on UNIX, unpack it using gzip and tar. That will create a new directory 'iperf-
<version#>' with the source les and documentation.

iPerf compiles cleanly on many systems including Linux, SGI IRIX, HP-UX, Solaris, AIX, and Cray UNICOS.
Use 'make' to con gure for your OS and compile the source code.

gunzip -c iperf-<version>.tar.gz | tar -xvf -


cd iperf-<version>
./configure
make

To install iPerf, use 'make install', which will ask you where to install it. To recompile, the easiest way is to
start over. Do 'make distclean' then './con gure; make'. See the Make le for more options.

https://iperf.fr/iperf-doc.php#tuningudp 15/15

Das könnte Ihnen auch gefallen