iPerf Notes

iPerf Notes

On this post I have added various notes related to iperf (iperf3 ) tool collected from various sources.

iPerf can be used to automate network performance measurement task (example) Automation: create traffic load generation Python package to send TCP/UDP traffic using iperf3, and graph results using Jenkins Plots plugin for measuring throughput, packet-loss, retransmitted packets. 

About IPerf3

  • iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks.
  • It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6).
  • For each test it reports the bandwidth, loss, and other parameters. 

Traffic Generators iPerf3

Many things can limit TCP throughput • Loss • Congestion • Buffer Starvation • Out of order delivery

iperf3 is a new implementation from scratch, with the goal of a smaller, simpler code base, and a library version of the functionality that can be used in other programs. Some new features in iperf3 include:

• reports the number of TCP packets that were retransmitted and Congestion Window

• reports the average CPU utilisation of the client and server (-V flag)

• support for zero copy TCP (-Z flag) • JSON output format (-J flag)

• “omit” flag: ignore the first N seconds in the results

 

Iperf3

Iperf3 is a kernel based network benchmark tool for active measurements of the maximum achievable bandwidth on IP networks. The tool works in a traditional client-server model where the server opens a socket and the client generates packets. We will use this tool create a TCP stream from one container to another to measure the maximum reachable TCP throughput without any network performance tweaking

References :

iperf3 is a tool that can be used to test the network bandwidth between two EC2 instances. This guide will show you the installation process and basic usage to get you started.

https://linuxacademy.com/howtoguides/posts/show/topic/14441-using-iperf3-to-test-ec2-bandwidth

UDP provides greater transparency We can directly measure some things TCP hides • Loss • Jitter • Out of order delivery

https://www.es.net/assets/Uploads/201007-JTIperf.pdf

https://iperf.fr/

Throughput Testing and Troubleshooting

https://support.cumulusnetworks.com/hc/en-us/articles/216509388-Throughput-Testing-and-Troubleshooting

iperf3 Man Page

https://www.mankier.com/1/iperf3

Reference Tutorial Style Videos :

Iperf3 throughput Test 

 

Iperf2 vs iPerf3

 

iperf3 Command List

 

eSumit@Sumits-MacBook-Pro:~$ iperf3 -h
Usage: iperf3 [-s|-c host] [options]
 iperf3 [-h|--help] [-v|--version]

Server or Client:
 -p, --port # server port to listen on/connect to
 -f, --format [kmgtKMGT] format to report: Kbits, Mbits, Gbits, Tbits
 -i, --interval # seconds between periodic throughput reports
 -F, --file name xmit/recv the specified file
 -B, --bind <host> bind to a specific interface
 -V, --verbose more detailed output
 -J, --json output in JSON format
 --logfile f send output to a log file
 --forceflush force flushing output at every interval
 -d, --debug emit debugging output
 -v, --version show version information and quit
 -h, --help show this message and quit
Server specific:
 -s, --server run in server mode
 -D, --daemon run the server as a daemon
 -I, --pidfile file write PID file
 -1, --one-off handle one client connection then exit
 --rsa-private-key-path path to the RSA private key used to decrypt
 authentication credentials
 --authorized-users-path path to the configuration file containing user
 credentials
Client specific:
 -c, --client <host> run in client mode, connecting to <host>
 -u, --udp use UDP rather than TCP
 --connect-timeout # timeout for control connection setup (ms)
 -b, --bitrate #[KMG][/#] target bitrate in bits/sec (0 for unlimited)
 (default 1 Mbit/sec for UDP, unlimited for TCP)
 (optional slash and packet count for burst mode)
 --pacing-timer #[KMG] set the timing for pacing, in microseconds (default 1000)
 -t, --time # time in seconds to transmit for (default 10 secs)
 -n, --bytes #[KMG] number of bytes to transmit (instead of -t)
 -k, --blockcount #[KMG] number of blocks (packets) to transmit (instead of -t or -n)
 -l, --len #[KMG] length of buffer to read or write
 (default 128 KB for TCP, dynamic or 1 for UDP)
 --cport <port> bind to a specific client port (TCP and UDP, default: ephemeral port)
 -P, --parallel # number of parallel client streams to run
 -R, --reverse run in reverse mode (server sends, client receives)
 -w, --window #[KMG] set window size / socket buffer size
 -M, --set-mss # set TCP/SCTP maximum segment size (MTU - 40 bytes)
 -N, --no-delay set TCP/SCTP no delay, disabling Nagle's Algorithm
 -4, --version4 only use IPv4
 -6, --version6 only use IPv6
 -S, --tos N set the IP type of service, 0-255
 --dscp N or --dscp val set the IP dscp value, either 0-63 or symbolic
 -Z, --zerocopy use a 'zero copy' method of sending data
 -O, --omit N omit the first n seconds
 -T, --title str prefix every output line with this string
 --get-server-output get results from server
 --udp-counters-64bit use 64-bit counters in UDP test packets
 --username username for authentication
 --rsa-public-key-path path to the RSA public key used to encrypt
 authentication credentials

[KMG] indicates options that support a K/M/G suffix for kilo-, mega-, or giga-

iperf3 homepage at: http://software.es.net/iperf/
Report bugs to: https://github.com/esnet/iperf
eSumit@Sumits-MacBook-Pro:~$

install iperf3 on Mac

eSumit@Sumits-MacBook-Pro:~$ brew install iperf3

==> Installing dependencies for iperf3: openssl
==> Installing iperf3 dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2m.sierra.bottl
######################################################################## 100.0%
==> Pouring openssl-1.0.2m.sierra.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
 /usr/local/etc/openssl/certs

and run
 /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
 echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
 LDFLAGS: -L/usr/local/opt/openssl/lib
 CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
 PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2m: 1,792 files, 12.3MB
==> Installing iperf3
==> Downloading https://homebrew.bintray.com/bottles/iperf3-3.3.sierra.bottle.ta
######################################################################## 100.0%
==> Pouring iperf3-3.3.sierra.bottle.tar.gz
🍺 /usr/local/Cellar/iperf3/3.3: 11 files, 361KB
eSumit@Sumits-MacBook-Pro:~$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
^Ciperf3: interrupt - the server has terminated
eSumit@Sumits-MacBook-Pro:~$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s