20110116 measuring bandwidth with iperf - plembo/onemoretech GitHub Wiki
title: measuring bandwidth with iperf link: https://onemoretech.wordpress.com/2011/01/16/measuring-bandwidth-with-iperf/ author: lembobro description: post_id: 77 created: 2011/01/16 19:11:02 created_gmt: 2011/01/16 19:11:02 comment_status: open post_name: measuring-bandwidth-with-iperf status: publish post_type: post
One tool for measuring bandwidth on a home network is iperf. Available for Windows as well as Linux, iperf was developed by NLANR. A Windows version can be found here. For Linux you can either download the source from here or install a package from your distribution’s repository (e.g. from EPEL for RHEL/CentOS systems). There are a number of good articles on its proper use, cited after the jump.
Basic usage is simple, and requires a machine at either end of the network connection you want to test. One machine is set up as the “server” and the other as “client”.
On the server machine you would execute
iperf -s
and on the client machine
iperf -c [server IP]
.
More examples can be found in Measuring Network Performance with iperf and this Cisco technical note.
Here’s the output of iperf -h:
Usage: iperf [-s|-c host] [options]
iperf [-h|--help] [-v|--version]
Client/Server:
-f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes
-i, --interval # seconds between periodic bandwidth reports
-l, --len #[KM] length of buffer to read or write (default 8 KB)
-m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)
-o, --output <filename> output the report or error message to this specified file
-p, --port # server port to listen on/connect to
-u, --udp use UDP rather than TCP
-w, --window #[KM] TCP window size (socket buffer size)
-B, --bind <host> bind to <host>, an interface or multicast address
-C, --compatibility for use with older versions does not sent extra msgs
-M, --mss # set TCP maximum segment size (MTU - 40 bytes)
-N, --nodelay set TCP no delay, disabling Nagle's Algorithm
-V, --IPv6Version Set the domain to IPv6
Server specific:
-s, --server run in server mode
-U, --single_udp run in single threaded UDP mode
-D, --daemon run the server as a daemon
Client specific:
-b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec
(default 1 Mbit/sec, implies -u)
-c, --client <host> run in client mode, connecting to <host>
-d, --dualtest Do a bidirectional test simultaneously
-n, --num #[KM] number of bytes to transmit (instead of -t)
-r, --tradeoff Do a bidirectional test individually
-t, --time # time in seconds to transmit for (default 10 secs)
-F, --fileinput <name> input the data to be transmitted from a file
-I, --stdin input the data to be transmitted from stdin
-L, --listenport # port to receive bidirectional tests back on
-P, --parallel # number of parallel client threads to run
-T, --ttl # time-to-live, for multicast (default 1)
-Z, --linux-congestion <algo> set TCP congestion control algorithm (Linux only)
Miscellaneous:
-x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports
-y, --reportstyle C report as a Comma-Separated Values
-h, --help print this message and quit
-v, --version print version information and quit
[KM] Indicates options that support a K or M suffix for kilo- or mega-
The TCP window size option can be set by the environment variable
TCP_WINDOW_SIZE. Most other options can be set by an environment variable
IPERF_<long option name>, such as IPERF_BANDWIDTH.
Copyright 2004-2019 Phil Lembo