Blame src/iperf3.1

Packit e18f3a
.TH IPERF3 1 "March 2018" ESnet "User Manuals"
Packit e18f3a
.SH NAME
Packit e18f3a
iperf3 \- perform network throughput tests
Packit e18f3a
.SH SYNOPSIS
Packit e18f3a
.B iperf3 -s [
Packit e18f3a
.I options
Packit e18f3a
.B ]
Packit e18f3a
.br
Packit e18f3a
.B iperf3 -c 
Packit e18f3a
.I server
Packit e18f3a
.B [
Packit e18f3a
.I options
Packit e18f3a
.B ]
Packit e18f3a
Packit e18f3a
.SH DESCRIPTION
Packit e18f3a
iperf3 is a tool for performing network throughput measurements.
Packit e18f3a
It can test TCP, UDP, or SCTP throughput.
Packit e18f3a
To perform an iperf3 test the user must establish both a server and a
Packit e18f3a
client.
Packit e18f3a
.PP
Packit e18f3a
The iperf3 executable contains both client and server functionality.
Packit e18f3a
An iperf3 server can be started using either of the -s or
Packit e18f3a
--server command-line parameters, for example:
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -s\fR
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 --server \fR
Packit e18f3a
.PP
Packit e18f3a
Note that many iperf3 parameters have both short (-s) and long
Packit e18f3a
(--server) forms.
Packit e18f3a
In this section we will generally use the short form of command-line
Packit e18f3a
flags, unless only the long form of a flag is available.
Packit e18f3a
.PP
Packit e18f3a
By default, the iperf3 server listens on TCP port 5201 for connections
Packit e18f3a
from an iperf3 client.
Packit e18f3a
A custom port can be specified by using the -p flag, for
Packit e18f3a
example:
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -s -p 5002\fR
Packit e18f3a
.PP
Packit e18f3a
After the server is started, it will listen for connections from
Packit e18f3a
iperf3 clients (in other words, the iperf3 program run in client
Packit e18f3a
mode).
Packit e18f3a
The client mode can be started using the -c command-line option,
Packit e18f3a
which also requires a host to which iperf3 should connect.
Packit e18f3a
The host can by specified by hostname, IPv4 literal, or IPv6 literal:
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -c iperf3.example.com\fR
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -c 192.0.2.1\fR
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -c 2001:db8::1\fR
Packit e18f3a
.PP
Packit e18f3a
If the iperf3 server is running on a non-default TCP port, that port
Packit e18f3a
number needs to be specified on the client as well:
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -c iperf3.example.com -p 5002\fR
Packit e18f3a
.PP
Packit e18f3a
The initial TCP connection is used to exchange test parameters,
Packit e18f3a
control the start and end of the test, and to exchange test results.
Packit e18f3a
This is sometimes referred to as the "control connection".
Packit e18f3a
The actual test data is sent over a separate TCP connection, as a
Packit e18f3a
separate flow of UDP packets, or as an independent SCTP connection,
Packit e18f3a
depending on what protocol was specified by the client.
Packit e18f3a
.PP
Packit e18f3a
Normally, the test data is sent from the client to the server, and
Packit e18f3a
measures the upload speed of the client.
Packit e18f3a
Measuring the download speed from the server can be done by specifying
Packit e18f3a
the -R flag on the client.
Packit e18f3a
This causes data to be sent from the server to the client.
Packit e18f3a
.IP
Packit e18f3a
\fCiperf3 -c iperf3.example.com -p 5202 -R
Packit e18f3a
.PP
Packit e18f3a
Results are displayed on both the client and server.
Packit e18f3a
There will be at least one line of output per measurement interval (by
Packit e18f3a
default a measurement interval lasts for one second, but this can be
Packit e18f3a
changed by the -i option).
Packit e18f3a
Each line of output includes (at least) the time since the start of
Packit e18f3a
the test, amount of data transferred during the interval, and the
Packit e18f3a
average bitrate over that interval.
Packit e18f3a
Note that the values for each measurement interval are taken from the
Packit e18f3a
point of view of the endpoint process emitting that output (in other
Packit e18f3a
words, the output on the client shows the measurement interval data for
Packit e18f3a
the client.
Packit e18f3a
.PP
Packit e18f3a
At the end of the test is a set of statistics that shows (at
Packit e18f3a
least as much as possible) a summary of the test as seen by both the
Packit e18f3a
sender and the receiver, with lines tagged accordingly.
Packit e18f3a
Recall that by default the client is the sender and the server is the
Packit e18f3a
receiver, although as indicated above, use of the \fC-R\fR flag will
Packit e18f3a
reverse these roles.
Packit e18f3a
.PP
Packit e18f3a
The client can be made to retrieve the server-side output for a given
Packit e18f3a
test by specifying the --get-server-output flag.
Packit e18f3a
.PP
Packit e18f3a
Either the client or the server can produce its output in a JSON
Packit e18f3a
structure, useful for integration with other programs, by passing it
Packit e18f3a
the -J flag.
Packit e18f3a
Because the contents of the JSON structure are only competely known
Packit e18f3a
after the test has finished, no JSON output will be emitted until the
Packit e18f3a
end of the test.
Packit e18f3a
.PP
Packit e18f3a
iperf3 has a (overly) large set of command-line options that can be
Packit e18f3a
used to set the parameters of a test.
Packit e18f3a
They are given in the "GENERAL OPTIONS" section of the manual page
Packit e18f3a
below, as well as summarized in iperf3's help output, which can be
Packit e18f3a
viewed by running iperf3 with the -h flag.
Packit e18f3a
.SH "GENERAL OPTIONS"
Packit e18f3a
.TP
Packit e18f3a
.BR -p ", " --port " \fIn\fR"
Packit e18f3a
set server port to listen on/connect to to \fIn\fR (default 5201)
Packit e18f3a
.TP
Packit e18f3a
.BR -f ", " --format " "
Packit e18f3a
[kmgtKMGT]   format to report: Kbits/Mbits/Gbits/Tbits
Packit e18f3a
.TP
Packit e18f3a
.BR -i ", " --interval " \fIn\fR"
Packit e18f3a
pause \fIn\fR seconds between periodic throughput reports;
Packit e18f3a
default is 1, use 0 to disable
Packit e18f3a
.TP
Packit e18f3a
.BR -F ", " --file " \fIname\fR"
Packit e18f3a
Use a file as the source (on the sender) or sink (on the receiver) of
Packit e18f3a
data, rather than just generating random data or throwing it away.
Packit e18f3a
This feature is used for finding whether or not the storage subsystem
Packit e18f3a
is the bottleneck for file transfers.
Packit e18f3a
It does not turn iperf3 into a file transfer tool.
Packit e18f3a
The length, attributes, and in some cases contents of the received
Packit e18f3a
file may not match those of the original file.
Packit e18f3a
.TP
Packit e18f3a
.BR -A ", " --affinity " \fIn/n,m\fR"
Packit e18f3a
Set the CPU affinity, if possible (Linux, FreeBSD, and Windows only).
Packit e18f3a
On both the client and server you can set the local affinity by using
Packit e18f3a
the \fIn\fR form of this argument (where \fIn\fR is a CPU number).
Packit e18f3a
In addition, on the client side you can override the server's
Packit e18f3a
affinity for just that one test, using the \fIn,m\fR form of
Packit e18f3a
argument.
Packit e18f3a
Note that when using this feature, a process will only be bound
Packit e18f3a
to a single CPU (as opposed to a set containing potentialy multiple
Packit e18f3a
CPUs).
Packit e18f3a
.TP
Packit e18f3a
.BR -B ", " --bind " \fIhost\fR"
Packit e18f3a
bind to the specific interface associated with address \fIhost\fR.
Packit e18f3a
If the host has multiple interfaces, it will use the first interface
Packit e18f3a
by default.
Packit e18f3a
.TP
Packit e18f3a
.BR -V ", " --verbose " "
Packit e18f3a
give more detailed output 
Packit e18f3a
.TP
Packit e18f3a
.BR -J ", " --json " "
Packit e18f3a
output in JSON format
Packit e18f3a
.TP
Packit e18f3a
.BR --logfile " \fIfile\fR"
Packit e18f3a
send output to a log file.
Packit e18f3a
.TP
Packit e18f3a
.BR --forceflush " "
Packit e18f3a
force flushing output at every interval.
Packit e18f3a
Used to avoid buffering when sending output to pipe.
Packit e18f3a
.TP
Packit e18f3a
.BR -d ", " --debug " "
Packit e18f3a
emit debugging output.
Packit e18f3a
Primarily (perhaps exclusively) of use to developers.
Packit e18f3a
.TP
Packit e18f3a
.BR -v ", " --version " "
Packit e18f3a
show version information and quit
Packit e18f3a
.TP
Packit e18f3a
.BR -h ", " --help " "
Packit e18f3a
show a help synopsis
Packit e18f3a
Packit e18f3a
.SH "SERVER SPECIFIC OPTIONS"
Packit e18f3a
.TP
Packit e18f3a
.BR -s ", " --server " "
Packit e18f3a
run in server mode
Packit e18f3a
.TP
Packit e18f3a
.BR -D ", " --daemon " "
Packit e18f3a
run the server in background as a daemon
Packit e18f3a
.TP
Packit e18f3a
.BR -I ", " --pidfile " \fIfile\fR"
Packit e18f3a
write a file with the process ID, most useful when running as a daemon.
Packit e18f3a
.TP
Packit e18f3a
.BR -1 ", " --one-off
Packit e18f3a
handle one client connection, then exit.
Packit e18f3a
.TP
Packit e18f3a
.BR --rsa-private-key-path " \fIfile\fR"
Packit e18f3a
path to the RSA private key (not password-protected) used to decrypt 
Packit e18f3a
authentication credentials from the client (if built with OpenSSL
Packit e18f3a
support).
Packit e18f3a
.TP          
Packit e18f3a
.BR --authorized-users-path " \fIfile\fR"
Packit e18f3a
path to the configuration file containing authorized users credentials to run 
Packit e18f3a
iperf tests (if built with OpenSSL support).
Packit e18f3a
The file is a comma separated list of usernames and password hashes;
Packit e18f3a
more information on the structure of the file can be found in the
Packit e18f3a
EXAMPLES section.
Packit e18f3a
.SH "CLIENT SPECIFIC OPTIONS"
Packit e18f3a
.TP
Packit e18f3a
.BR -c ", " --client " \fIhost\fR"
Packit e18f3a
run in client mode, connecting to the specified server.
Packit e18f3a
By default, a test consists of sending data from the client to the
Packit e18f3a
server, unless the \-R flag is specified.
Packit e18f3a
.TP
Packit e18f3a
.BR --sctp
Packit e18f3a
use SCTP rather than TCP (FreeBSD and Linux)
Packit e18f3a
.TP
Packit e18f3a
.BR -u ", " --udp
Packit e18f3a
use UDP rather than TCP
Packit e18f3a
.TP
Packit e18f3a
.BR --connect-timeout " \fIn\fR"
Packit e18f3a
set timeout for establishing the initial control connection to the
Packit e18f3a
server, in milliseconds.
Packit e18f3a
The default behavior is the operating system's timeout for TCP
Packit e18f3a
connection establishment.
Packit e18f3a
Providing a shorter value may speed up detection of a down iperf3
Packit e18f3a
server.
Packit e18f3a
.TP
Packit e18f3a
.BR -b ", " --bitrate " \fIn\fR[KM]"
Packit e18f3a
set target bitrate to \fIn\fR bits/sec (default 1 Mbit/sec for UDP,
Packit e18f3a
unlimited for TCP/SCTP).
Packit e18f3a
If there are multiple streams (\-P flag), the throughput limit is applied
Packit e18f3a
separately to each stream.
Packit e18f3a
You can also add a '/' and a number to the bitrate specifier.
Packit e18f3a
This is called "burst mode".
Packit e18f3a
It will send the given number of packets without pausing, even if that
Packit e18f3a
temporarily exceeds the specified throughput limit.
Packit e18f3a
Setting the target bitrate to 0 will disable bitrate limits
Packit e18f3a
(particularly useful for UDP tests).
Packit e18f3a
This throughput limit is implemented internally inside iperf3, and is
Packit e18f3a
available on all platforms.
Packit e18f3a
Compare with the \--fq-rate flag.
Packit e18f3a
This option replaces the \--bandwidth flag, which is now deprecated
Packit e18f3a
but (at least for now) still accepted.
Packit e18f3a
.TP
Packit e18f3a
.BR --pacing-timer " \fIn\fR[KMG]"
Packit e18f3a
set pacing timer interval in microseconds (default 1000 microseconds,
Packit e18f3a
or 1 ms).
Packit e18f3a
This controls iperf3's internal pacing timer for the \-b/\--bitrate
Packit e18f3a
option.
Packit e18f3a
The timer fires at the interval set by this parameter.
Packit e18f3a
Smaller values of the pacing timer parameter smooth out the traffic
Packit e18f3a
emitted by iperf3, but potentially at the cost of performance due to
Packit e18f3a
more frequent timer processing.
Packit e18f3a
.TP
Packit e18f3a
.BR --fq-rate " \fIn\fR[KM]"
Packit e18f3a
Set a rate to be used with fair-queueing based socket-level pacing,
Packit e18f3a
in bits per second.
Packit e18f3a
This pacing (if specified) will be in addition to any pacing due to
Packit e18f3a
iperf3's internal throughput pacing (\-b/\--bitrate flag), and both can be
Packit e18f3a
specified for the same test.
Packit e18f3a
Only available on platforms supporting the
Packit e18f3a
\fCSO_MAX_PACING_RATE\fR socket option (currently only Linux).
Packit e18f3a
The default is no fair-queueing based pacing.
Packit e18f3a
.TP
Packit e18f3a
.BR --no-fq-socket-pacing
Packit e18f3a
This option is deprecated and will be removed.
Packit e18f3a
It is equivalent to specifying --fq-rate=0.
Packit e18f3a
.TP
Packit e18f3a
.BR -t ", " --time " \fIn\fR"
Packit e18f3a
time in seconds to transmit for (default 10 secs)
Packit e18f3a
.TP
Packit e18f3a
.BR -n ", " --bytes " \fIn\fR[KM]"
Packit e18f3a
number of bytes to transmit (instead of \-t)
Packit e18f3a
.TP
Packit e18f3a
.BR -k ", " --blockcount " \fIn\fR[KM]"
Packit e18f3a
number of blocks (packets) to transmit (instead of \-t or \-n)
Packit e18f3a
.TP
Packit e18f3a
.BR -l ", " --length " \fIn\fR[KM]"
Packit e18f3a
length of buffer to read or write.  For TCP tests, the default value
Packit e18f3a
is 128KB.
Packit e18f3a
In the case of UDP, iperf3 tries to dynamically determine a reasonable
Packit e18f3a
sending size based on the path MTU; if that cannot be determined it
Packit e18f3a
uses 1460 bytes as a sending size.
Packit e18f3a
For SCTP tests, the default size is 64KB.
Packit e18f3a
.TP
Packit e18f3a
.BR --cport " \fIport\fR"
Packit e18f3a
bind data streams to a specific client port (for TCP and UDP only,
Packit e18f3a
default is to use an ephemeral port)
Packit e18f3a
.TP
Packit e18f3a
.BR -P ", " --parallel " \fIn\fR"
Packit e18f3a
number of parallel client streams to run. Note that iperf3 is single threaded, so if you are CPU bound, this will not yield higher throughput.
Packit e18f3a
.TP
Packit e18f3a
.BR -R ", " --reverse
Packit e18f3a
reverse the direction of a test, so that the server sends data to the
Packit e18f3a
client
Packit e18f3a
.TP
Packit e18f3a
.BR -w ", " --window " \fIn\fR[KM]"
Packit e18f3a
window size / socket buffer size (this gets sent to the server and used on that side too)
Packit e18f3a
.TP
Packit e18f3a
.BR -M ", " --set-mss " \fIn\fR"
Packit e18f3a
set TCP/SCTP maximum segment size (MTU - 40 bytes)
Packit e18f3a
.TP
Packit e18f3a
.BR -N ", " --no-delay " "
Packit e18f3a
set TCP/SCTP no delay, disabling Nagle's Algorithm
Packit e18f3a
.TP
Packit e18f3a
.BR -4 ", " --version4 " "
Packit e18f3a
only use IPv4
Packit e18f3a
.TP
Packit e18f3a
.BR -6 ", " --version6 " "
Packit e18f3a
only use IPv6
Packit e18f3a
.TP
Packit e18f3a
.BR -S ", " --tos " \fIn\fR"
Packit e18f3a
set the IP type of service. The usual prefixes for octal and hex can be used,
Packit e18f3a
i.e. 52, 064 and 0x34 all specify the same value.
Packit e18f3a
.TP
Packit e18f3a
.BR "--dscp " \fIdscp\fR
Packit e18f3a
set the IP DSCP bits.  Both numeric and symbolic values are accepted. Numeric
Packit e18f3a
values can be specified in decimal, octal and hex (see --tos above).
Packit e18f3a
.TP
Packit e18f3a
.BR -L ", " --flowlabel " \fIn\fR"
Packit e18f3a
set the IPv6 flow label (currently only supported on Linux)
Packit e18f3a
.TP
Packit e18f3a
.BR -X ", " --xbind " \fIname\fR"
Packit e18f3a
Bind SCTP associations to a specific subset of links using sctp_bindx(3).
Packit e18f3a
The \fB--B\fR flag will be ignored if this flag is specified.
Packit e18f3a
Normally SCTP will include the protocol addresses of all active links
Packit e18f3a
on the local host when setting up an association. Specifying at least
Packit e18f3a
one \fB--X\fR name will disable this behaviour.
Packit e18f3a
This flag must be specified for each link to be included in the
Packit e18f3a
association, and is supported for both iperf servers and clients
Packit e18f3a
(the latter are supported by passing the first \fB--X\fR argument to bind(2)).
Packit e18f3a
Hostnames are accepted as arguments and are resolved using
Packit e18f3a
getaddrinfo(3).
Packit e18f3a
If the \fB--4\fR or \fB--6\fR flags are specified, names
Packit e18f3a
which do not resolve to addresses within the
Packit e18f3a
specified protocol family will be ignored.
Packit e18f3a
.TP
Packit e18f3a
.BR --nstreams " \fIn\fR"
Packit e18f3a
Set number of SCTP streams.
Packit e18f3a
.TP
Packit e18f3a
.BR -Z ", " --zerocopy " "
Packit e18f3a
Use a "zero copy" method of sending data, such as sendfile(2),
Packit e18f3a
instead of the usual write(2).
Packit e18f3a
.TP
Packit e18f3a
.BR -O ", " --omit " \fIn\fR"
Packit e18f3a
Omit the first n seconds of the test, to skip past the TCP slow-start
Packit e18f3a
period.
Packit e18f3a
.TP
Packit e18f3a
.BR -T ", " --title " \fIstr\fR"
Packit e18f3a
Prefix every output line with this string.
Packit e18f3a
.TP
Packit e18f3a
.BR -C ", " --congestion " \fIalgo\fR"
Packit e18f3a
Set the congestion control algorithm (Linux and FreeBSD only).  An
Packit e18f3a
older
Packit e18f3a
.B --linux-congestion
Packit e18f3a
synonym for this flag is accepted but is deprecated.
Packit e18f3a
.TP
Packit e18f3a
.BR "--get-server-output"
Packit e18f3a
Get the output from the server.
Packit e18f3a
The output format is determined by the server (in particular, if the
Packit e18f3a
server was invoked with the \fB--json\fR flag, the output will be in
Packit e18f3a
JSON format, otherwise it will be in human-readable format).
Packit e18f3a
If the client is run with \fB--json\fR, the server output is included
Packit e18f3a
in a JSON object; otherwise it is appended at the bottom of the
Packit e18f3a
human-readable output.
Packit e18f3a
.TP
rpm-build f3caa7
.BR --udp-counters-64bit
rpm-build f3caa7
Use 64-bit counters in UDP test packets.
rpm-build f3caa7
The use of this option can help prevent counter overflows during long
rpm-build f3caa7
or high-bitrate UDP tests.  Both client and server need to be running
rpm-build f3caa7
at least version 3.1 for this option to work.  It may become the
rpm-build f3caa7
default behavior at some point in the future.
rpm-build f3caa7
.TP
Packit e18f3a
.BR --username " \fIusername\fR" 
Packit e18f3a
username to use for authentication to the iperf server (if built with
Packit e18f3a
OpenSSL support).
Packit e18f3a
The password will be prompted for interactively when the test is run.
Packit e18f3a
.TP
Packit e18f3a
.BR --rsa-public-key-path " \fIfile\fR" 
Packit e18f3a
path to the RSA public key used to encrypt authentication credentials
Packit e18f3a
(if built with OpenSSL support)
Packit e18f3a
Packit e18f3a
.SH EXAMPLES
Packit e18f3a
.SS "Authentication - RSA Keypair"
Packit e18f3a
The authentication feature of requires an RSA public keypair.
Packit e18f3a
The public key is used to encrypt the authentication token containing the 
Packit e18f3a
user credentials, while the private key is used to decrypt the authentication token.
Packit e18f3a
An example of a set of UNIX/Linux commands to generate correct keypair follows:
Packit e18f3a
.sp 1 
Packit e18f3a
.in +.5i
Packit e18f3a
> openssl genrsa -des3 -out private.pem 2048
Packit e18f3a
.sp 0
Packit e18f3a
> openssl rsa -in private.pem -outform PEM -pubout -out public.pem
Packit e18f3a
.sp 0
Packit e18f3a
> openssl rsa -in private.pem -out private_not_protected.pem -outform PEM  
Packit e18f3a
.in -.5i
Packit e18f3a
.sp 1
Packit e18f3a
After these commands, the public key will be contained in the file
Packit e18f3a
public.pem and the private key will be contained in the file
Packit e18f3a
private_not_protected.pem.
Packit e18f3a
.SS "Authentication - Authorized users configuration file"
Packit e18f3a
A simple plaintext file must be provided to the iperf3 server in order to specify 
Packit e18f3a
the authorized user credentials.
Packit e18f3a
The file is a simple list of comma-separated pairs of a username and a
Packit e18f3a
corresponding password hash.
Packit e18f3a
The password hash is a SHA256 hash of the string "{$user}$password".
Packit e18f3a
The file can also contain commented lines (starting with the \fC#\fR
Packit e18f3a
character).
Packit e18f3a
An example of commands to generate the password hash on a UNIX/Linux system
Packit e18f3a
is given below:
Packit e18f3a
.sp 1 
Packit e18f3a
.in +.5i
Packit e18f3a
> S_USER=mario S_PASSWD=rossi
Packit e18f3a
.sp 0
Packit e18f3a
> echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
Packit e18f3a
.in -.5i
Packit e18f3a
.sp 1
Packit e18f3a
An example of a password file (with an entry corresponding to the
Packit e18f3a
above username and password) is given below:
Packit e18f3a
.sp 0
Packit e18f3a
.in +.5i
Packit e18f3a
> cat credentials.csv
Packit e18f3a
.sp 0
Packit e18f3a
# file format: username,sha256
Packit e18f3a
.sp 0
Packit e18f3a
mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
Packit e18f3a
.in -.5i
Packit e18f3a
.sp 1
Packit e18f3a
Packit e18f3a
.SH AUTHORS
Packit e18f3a
A list of the contributors to iperf3 can be found within the
Packit e18f3a
documentation located at
Packit e18f3a
\fChttp://software.es.net/iperf/dev.html#authors\fR.
Packit e18f3a
Packit e18f3a
.SH "SEE ALSO"
Packit e18f3a
libiperf(3),
Packit e18f3a
http://software.es.net/iperf