1IPERF3(1)                        User Manuals                        IPERF3(1)
2
3
4

NAME

6       iperf3 - perform network throughput tests
7

SYNOPSIS

9       iperf3 -s [ options ]
10       iperf3 -c server [ options ]
11
12

DESCRIPTION

14       iperf3  is  a  tool for performing network throughput measurements.  It
15       can test TCP, UDP, or SCTP throughput.  To perform an iperf3  test  the
16       user must establish both a server and a client.
17
18       The  iperf3  executable  contains both client and server functionality.
19       An iperf3 server can be started using either of the -s or --server com‐
20       mand-line parameters, for example:
21
22              iperf3 -s
23
24              iperf3 --server
25
26       Note  that  many  iperf3  parameters  have  both  short  (-s)  and long
27       (--server) forms.  In this section we will generally use the short form
28       of  command-line  flags,  unless only the long form of a flag is avail‐
29       able.
30
31       By default, the iperf3 server listens on TCP port 5201 for  connections
32       from  an iperf3 client.  A custom port can be specified by using the -p
33       flag, for example:
34
35              iperf3 -s -p 5002
36
37       After the server is started, it will listen for connections from iperf3
38       clients  (in  other words, the iperf3 program run in client mode).  The
39       client mode can be started using the -c command-line option, which also
40       requires a host to which iperf3 should connect.  The host can by speci‐
41       fied by hostname, IPv4 literal, or IPv6 literal:
42
43              iperf3 -c iperf3.example.com
44
45              iperf3 -c 192.0.2.1
46
47              iperf3 -c 2001:db8::1
48
49       If the iperf3 server is running on a non-default TCP  port,  that  port
50       number needs to be specified on the client as well:
51
52              iperf3 -c iperf3.example.com -p 5002
53
54       The initial TCP connection is used to exchange test parameters, control
55       the start and end of the test, and to exchange test results.   This  is
56       sometimes  referred  to  as  the "control connection".  The actual test
57       data is sent over a separate TCP connection, as a separate flow of  UDP
58       packets, or as an independent SCTP connection, depending on what proto‐
59       col was specified by the client.
60
61       Normally, the test data is sent from the client to the server, and mea‐
62       sures  the  upload  speed  of the client.  Measuring the download speed
63       from the server can be done by specifying the -R flag  on  the  client.
64       This causes data to be sent from the server to the client.
65
66              iperf3 -c iperf3.example.com -p 5202 -R
67
68       Results  are displayed on both the client and server.  There will be at
69       least one line of output per measurement interval (by  default  a  mea‐
70       surement  interval lasts for one second, but this can be changed by the
71       -i option).  Each line of output includes (at least) the time since the
72       start  of the test, amount of data transferred during the interval, and
73       the average bitrate over that interval.  Note that the values for  each
74       measurement  interval  are taken from the point of view of the endpoint
75       process emitting that output (in other words, the output on the  client
76       shows the measurement interval data for the client.
77
78       At  the  end of the test is a set of statistics that shows (at least as
79       much as possible) a summary of the test as seen by both the sender  and
80       the  receiver,  with  lines tagged accordingly.  Recall that by default
81       the client is the sender and the server is the  receiver,  although  as
82       indicated above, use of the -R flag will reverse these roles.
83
84       The  client  can be made to retrieve the server-side output for a given
85       test by specifying the --get-server-output flag.
86
87       Either the client or the server can produce its output in a JSON struc‐
88       ture,  useful for integration with other programs, by passing it the -J
89       flag.  Because the contents of the JSON structure  are  only  competely
90       known after the test has finished, no JSON output will be emitted until
91       the end of the test.
92
93       iperf3 has a (overly) large set of command-line  options  that  can  be
94       used  to  set the parameters of a test.  They are given in the "GENERAL
95       OPTIONS" section of the manual page below, as  well  as  summarized  in
96       iperf3's help output, which can be viewed by running iperf3 with the -h
97       flag.
98

GENERAL OPTIONS

100       -p, --port n
101              set server port to listen on/connect to to n (default 5201)
102
103       -f, --format
104              [kmgtKMGT]   format to report: Kbits/Mbits/Gbits/Tbits
105
106       -i, --interval n
107              pause n seconds between periodic throughput reports; default  is
108              1, use 0 to disable
109
110       -F, --file name
111              Use  a  file  as  the  source  (on  the  sender) or sink (on the
112              receiver) of data, rather than just generating  random  data  or
113              throwing  it  away.  This feature is used for finding whether or
114              not the storage subsystem is the bottleneck for file  transfers.
115              It  does not turn iperf3 into a file transfer tool.  The length,
116              attributes, and in some cases contents of the received file  may
117              not match those of the original file.
118
119       -A, --affinity n/n,m
120              Set  the  CPU affinity, if possible (Linux, FreeBSD, and Windows
121              only).  On both the client and server  you  can  set  the  local
122              affinity  by using the n form of this argument (where n is a CPU
123              number).  In addition, on the client side you can  override  the
124              server's  affinity for just that one test, using the n,m form of
125              argument.  Note that when using this  feature,  a  process  will
126              only  be  bound  to a single CPU (as opposed to a set containing
127              potentialy multiple CPUs).
128
129       -B, --bind host
130              bind to the specific interface associated with address host.  If
131              the  host  has multiple interfaces, it will use the first inter‐
132              face by default.
133
134       -V, --verbose
135              give more detailed output
136
137       -J, --json
138              output in JSON format
139
140       --logfile file
141              send output to a log file.
142
143       --forceflush
144              force flushing output at every interval.  Used to avoid  buffer‐
145              ing when sending output to pipe.
146
147       -d, --debug
148              emit  debugging  output.  Primarily (perhaps exclusively) of use
149              to developers.
150
151       -v, --version
152              show version information and quit
153
154       -h, --help
155              show a help synopsis
156
157

SERVER SPECIFIC OPTIONS

159       -s, --server
160              run in server mode
161
162       -D, --daemon
163              run the server in background as a daemon
164
165       -I, --pidfile file
166              write a file with the process ID, most useful when running as  a
167              daemon.
168
169       -1, --one-off
170              handle one client connection, then exit.
171
172       --rsa-private-key-path file
173              path  to  the  RSA  private key (not password-protected) used to
174              decrypt authentication credentials from  the  client  (if  built
175              with OpenSSL support).
176
177       --authorized-users-path file
178              path  to the configuration file containing authorized users cre‐
179              dentials to run iperf tests (if  built  with  OpenSSL  support).
180              The  file  is  a  comma separated list of usernames and password
181              hashes; more information on the structure of  the  file  can  be
182              found in the EXAMPLES section.
183

CLIENT SPECIFIC OPTIONS

185       -c, --client host
186              run  in  client  mode,  connecting  to the specified server.  By
187              default, a test consists of sending data from the client to  the
188              server, unless the -R flag is specified.
189
190       --sctp use SCTP rather than TCP (FreeBSD and Linux)
191
192       -u, --udp
193              use UDP rather than TCP
194
195       --connect-timeout n
196              set  timeout  for establishing the initial control connection to
197              the server, in milliseconds.  The default behavior is the  oper‐
198              ating  system's  timeout for TCP connection establishment.  Pro‐
199              viding a shorter value may speed up detection of a  down  iperf3
200              server.
201
202       -b, --bitrate n[KM]
203              set  target  bitrate  to n bits/sec (default 1 Mbit/sec for UDP,
204              unlimited for TCP/SCTP).  If  there  are  multiple  streams  (-P
205              flag),  the  throughput  limit  is  applied  separately  to each
206              stream.  You can also add a '/' and  a  number  to  the  bitrate
207              specifier.  This is called "burst mode".  It will send the given
208              number of packets without  pausing,  even  if  that  temporarily
209              exceeds  the  specified  throughput  limit.   Setting the target
210              bitrate to 0 will disable bitrate  limits  (particularly  useful
211              for UDP tests).  This throughput limit is implemented internally
212              inside iperf3, and is available on all platforms.  Compare  with
213              the  --fq-rate flag.  This option replaces the --bandwidth flag,
214              which is now deprecated but (at least for now) still accepted.
215
216       --pacing-timer n[KMG]
217              set  pacing  timer  interval  in  microseconds   (default   1000
218              microseconds,  or 1 ms).  This controls iperf3's internal pacing
219              timer for the -b/--bitrate  option.   The  timer  fires  at  the
220              interval  set  by  this parameter.  Smaller values of the pacing
221              timer parameter smooth out the traffic emitted  by  iperf3,  but
222              potentially  at  the  cost  of  performance due to more frequent
223              timer processing.
224
225       --fq-rate n[KM]
226              Set a rate to be used with fair-queueing based socket-level pac‐
227              ing,  in bits per second.  This pacing (if specified) will be in
228              addition to any pacing due to iperf3's internal throughput  pac‐
229              ing  (-b/--bitrate flag), and both can be specified for the same
230              test.  Only available on platforms  supporting  the  SO_MAX_PAC‐
231              ING_RATE  socket  option (currently only Linux).  The default is
232              no fair-queueing based pacing.
233
234       --no-fq-socket-pacing
235              This option is deprecated and will be removed.  It is equivalent
236              to specifying --fq-rate=0.
237
238       -t, --time n
239              time in seconds to transmit for (default 10 secs)
240
241       -n, --bytes n[KM]
242              number of bytes to transmit (instead of -t)
243
244       -k, --blockcount n[KM]
245              number of blocks (packets) to transmit (instead of -t or -n)
246
247       -l, --length n[KM]
248              length  of  buffer to read or write.  For TCP tests, the default
249              value is 128KB.  In the case of UDP, iperf3 tries to dynamically
250              determine  a  reasonable  sending size based on the path MTU; if
251              that cannot be determined it uses 1460 bytes as a sending  size.
252              For SCTP tests, the default size is 64KB.
253
254       --cport port
255              bind  data  streams  to  a specific client port (for TCP and UDP
256              only, default is to use an ephemeral port)
257
258       -P, --parallel n
259              number of parallel client streams to run. Note  that  iperf3  is
260              single  threaded,  so  if you are CPU bound, this will not yield
261              higher throughput.
262
263       -R, --reverse
264              reverse the direction of a test, so that the server  sends  data
265              to the client
266
267       -w, --window n[KM]
268              window  size  / socket buffer size (this gets sent to the server
269              and used on that side too)
270
271       -M, --set-mss n
272              set TCP/SCTP maximum segment size (MTU - 40 bytes)
273
274       -N, --no-delay
275              set TCP/SCTP no delay, disabling Nagle's Algorithm
276
277       -4, --version4
278              only use IPv4
279
280       -6, --version6
281              only use IPv6
282
283       -S, --tos n
284              set the IP type of service. The usual prefixes for octal and hex
285              can be used, i.e. 52, 064 and 0x34 all specify the same value.
286
287       --dscp dscp
288              set  the  IP  DSCP  bits.   Both numeric and symbolic values are
289              accepted. Numeric values can be specified in decimal, octal  and
290              hex (see --tos above).
291
292       -L, --flowlabel n
293              set the IPv6 flow label (currently only supported on Linux)
294
295       -X, --xbind name
296              Bind  SCTP  associations  to  a  specific  subset of links using
297              sctp_bindx(3).  The --B flag will be ignored  if  this  flag  is
298              specified.  Normally SCTP will include the protocol addresses of
299              all active links on the local host when setting up  an  associa‐
300              tion.  Specifying at least one --X name will disable this behav‐
301              iour.  This flag must be specified for each link to be  included
302              in  the association, and is supported for both iperf servers and
303              clients (the latter are supported by passing the first --X argu‐
304              ment  to  bind(2)).  Hostnames are accepted as arguments and are
305              resolved using getaddrinfo(3).  If the  --4  or  --6  flags  are
306              specified,  names  which  do not resolve to addresses within the
307              specified protocol family will be ignored.
308
309       --nstreams n
310              Set number of SCTP streams.
311
312       -Z, --zerocopy
313              Use a "zero copy" method of sending data, such  as  sendfile(2),
314              instead of the usual write(2).
315
316       -O, --omit n
317              Omit the first n seconds of the test, to skip past the TCP slow-
318              start period.
319
320       -T, --title str
321              Prefix every output line with this string.
322
323       --extra-data str
324              Specify an extra data string field to be included in  JSON  out‐
325              put.
326
327       -C, --congestion algo
328              Set  the  congestion control algorithm (Linux and FreeBSD only).
329              An older --linux-congestion synonym for this  flag  is  accepted
330              but is deprecated.
331
332       --get-server-output
333              Get the output from the server.  The output format is determined
334              by the server (in particular, if the server was invoked with the
335              --json  flag,  the  output  will be in JSON format, otherwise it
336              will be in human-readable format).  If the client  is  run  with
337              --json,  the  server output is included in a JSON object; other‐
338              wise it is appended at the bottom of the human-readable output.
339
340       --repeating-payload
341              Use repeating pattern in payload, instead of random bytes.   The
342              same  payload  is  used  in iperf2 (ASCII '0..9' repeating).  It
343              might help to test and reveal problems in networking  gear  with
344              hardware  compression (including some WiFi access points), where
345              iperf2 and iperf3 perform differently,  just  based  on  payload
346              entropy.
347
348       --username username
349              username to use for authentication to the iperf server (if built
350              with OpenSSL support).  The password will be prompted for inter‐
351              actively when the test is run.
352
353       --rsa-public-key-path file
354              path  to  the RSA public key used to encrypt authentication cre‐
355              dentials (if built with OpenSSL support)
356
357

EXAMPLES

359   Authentication - RSA Keypair
360       The authentication feature of iperf3 requires an  RSA  public  keypair.
361       The  public  key is used to encrypt the authentication token containing
362       the user credentials, while the private key  is  used  to  decrypt  the
363       authentication  token.   An  example of a set of UNIX/Linux commands to
364       generate correct keypair follows:
365
366            > openssl genrsa -des3 -out private.pem 2048
367            > openssl rsa -in private.pem -outform PEM -pubout -out public.pem
368            > openssl rsa -in private.pem -out private_not_protected.pem -out‐
369            form PEM
370
371       After these commands, the public key will be contained in the file pub‐
372       lic.pem and the  private  key  will  be  contained  in  the  file  pri‐
373       vate_not_protected.pem.
374
375   Authentication - Authorized users configuration file
376       A  simple plaintext file must be provided to the iperf3 server in order
377       to specify the authorized user credentials.  The file is a simple  list
378       of  comma-separated  pairs  of  a username and a corresponding password
379       hash.  The password hash is a SHA256 hash of the string  "{$user}$pass‐
380       word".   The file can also contain commented lines (starting with the #
381       character).  An example of commands to generate the password hash on  a
382       UNIX/Linux system is given below:
383
384            > S_USER=mario S_PASSWD=rossi
385            > echo -n "{$S_USER}$S_PASSWD" | sha256sum | awk '{ print $1 }'
386
387       An example of a password file (with an entry corresponding to the above
388       username and password) is given below:
389            > cat credentials.csv
390            # file format: username,sha256
391            mario,bf7a49a846d44b454a5d11e7acfaf13d138bbe0b7483aa3e050879700572709b
392
393
394

AUTHORS

396       A list of the contributors to iperf3 can be found within the documenta‐
397       tion located at https://software.es.net/iperf/dev.html#authors.
398
399

SEE ALSO

401       libiperf(3), https://software.es.net/iperf
402
403
404
405ESnet                              June 2018                         IPERF3(1)
Impressum