MiniNet -- use iperf tool to test bandwidth

Use iperf The tool tests the bandwidth between H1 and H2 for basic performance evaluation.
Experimental environment:
CentOS7 minimize installation, Mininet 2.2.2
Ubuntu or CentOS with a graphical desktop is recommended for viewing output
Steps:
1. To install the iperf command, please refer to Install Iperf under CentOS 7
We use quick install here

# wget -O /usr/bin/iperf https://iperf.fr/download/ubuntu/iperf_2.0.9
# chmod +x /usr/bin/iperf

After installation, start mininet to generate a default topology.

# mn --topo=minimal

#If you use a graphical interface, you can use xterm to open windows for h1 and h2

mininet> xterm h1 h2

Because of the character interface used here, it is omitted.

mininet> h1 iperf -s -p 5566 -i 1 &
\\Appoint h1 by iperf Server (-s),Set port(-p),Monitor results every second(-i),And run in the background(&)
\\If running in the foreground, after the client executes the command, H1 The following information will be printed out
------------------------------------------------------------
Server listening on TCP port 5566
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.0.0.1 port 5566 connected with 10.0.0.2 port 34358
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  2.40 GBytes  20.7 Gbits/sec
[  4]  1.0- 2.0 sec  2.40 GBytes  20.6 Gbits/sec
[  4]  2.0- 3.0 sec  2.45 GBytes  21.0 Gbits/sec
[  4]  3.0- 4.0 sec  2.56 GBytes  22.0 Gbits/sec
[  4]  4.0- 5.0 sec  2.40 GBytes  20.6 Gbits/sec
[  4]  5.0- 6.0 sec  2.49 GBytes  21.4 Gbits/sec
[  4]  6.0- 7.0 sec  2.43 GBytes  20.8 Gbits/sec
[  4]  7.0- 8.0 sec  2.56 GBytes  22.0 Gbits/sec
[  4]  8.0- 9.0 sec  2.53 GBytes  21.7 Gbits/sec
[  4]  9.0-10.0 sec  2.58 GBytes  22.2 Gbits/sec
[  4] 10.0-11.0 sec  2.60 GBytes  22.3 Gbits/sec
[  4] 11.0-12.0 sec  2.60 GBytes  22.4 Gbits/sec
[  4] 12.0-13.0 sec  2.60 GBytes  22.4 Gbits/sec
[  4] 13.0-14.0 sec  2.33 GBytes  20.0 Gbits/sec
[  4] 14.0-15.0 sec  2.46 GBytes  21.1 Gbits/sec
[  4]  0.0-15.0 sec  37.4 GBytes  21.4 Gbits/sec
mininet> h2 iperf -c 10.0.0.1 -p 5566 -t 15
\\Appoint h2 by TCP Client side (-c),Specify server address and port(-p),Set transmission duration(-t)
------------------------------------------------------------
Client connecting to 10.0.0.1, TCP port 5566
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  3] local 10.0.0.2 port 34358 connected with 10.0.0.1 port 5566
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-15.0 sec  37.4 GBytes  21.4 Gbits/sec
mininet>

Result:
h2: in 0-15 seconds, the average throughput is 21.4Gbits/sec
h1: shows throughput per second

Simple usage:

mininet> iperf h1 h2

Appendix: for more information about the use of iperf command, please refer to iperf command usage

Blog: LIMEXC

Keywords: Ubuntu CentOS Windows

Added by hailam on Mon, 23 Dec 2019 17:30:47 +0200