Iperf is a widely used tool for network performance measurement and tuning. It is significant as a cross-platform tool that can produce standardized performance measurements for any network. Iperf has client and server functionality, and can create data streams to measure the throughput between the two ends in one or both directions. Typical iperf output contains a time-stamped report of the amount of data transferred and the throughput measured.
UDP: When used for testing UDP capacity, iperf allows the user to specify the datagram size and provides results for the datagram throughput and the packet loss.
TCP: When used for testing TCP capacity, iperf measures the throughput of the payload. Iperf uses 1024 × 1024 for mebibytes and 1000 × 1000 for megabytes.
Step 1: Install the Iperf
Link : https://iperf.fr/iperf-download.php
Step 2: Take the high configuration machine for server and execute the given command in screenshot.
Now your node A is prepared for service.
iperf -s
Step 3: Now install the iperf on client and execute this command given on screenshot.
iperf -c Node A(Server IP)
That many OSes and hosts have upper limits on the TCP window size.
nodeA> iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 60.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 2357
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 6.5 MBytes 5.2 Mbits/sec
nodeB> iperf -c node2
------------------------------------------------------------
Client connecting to node1, TCP port 5001
TCP window size: 59.9 KByte (default)
------------------------------------------------------------
[ 3] local <IP Addr node1> port 2357 connected with <IP Addr node2> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 6.5 MBytes 5.2 Mbits/sec
-------------------------------------------------------------------------------------------------------------------------
nodeA> iperf -s -w 130k
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 130 KByte
------------------------------------------------------------
[ 4] local <IP Addr node 2> port 5001 connected with <IP Addr node 1> port 2530
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 19.7 MBytes 15.7 Mbits/sec
nodeB> iperf -c node2 -w 130k
------------------------------------------------------------
Client connecting to node2, TCP port 5001
TCP window size: 129 KByte (WARNING: requested 130 KByte)
------------------------------------------------------------
[ 3] local <IP Addr node1> port 2530 connected with <IP Addr node2> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 19.7 MBytes 15.8 Mbits/sec
--------------------------------------------------------------------------------------------------------------------------
Another test to do is run parallel TCP streams.
nodeA> iperf -s -w 300k
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 300 KByte
------------------------------------------------------------
[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 6902
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.2 sec 20.9 MBytes 16.5 Mbits/sec
[ 4] local <IP Addr node2> port 5001 connected with <IP Addr node1> port 6911
[ 5] local <IP Addr node2> port 5001 connected with <IP Addr node2> port 6912
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.1 sec 21.0 MBytes 16.7 Mbits/sec
[ 4] 0.0-10.3 sec 12.0 MBytes 9.4 Mbits/sec
nodeB> ./iperf -c node2 -w 300k
------------------------------------------------------------
Client connecting to node2, TCP port 5001
TCP window size: 299 KByte (WARNING: requested 300 KByte)
------------------------------------------------------------
[ 3] local <IP Addr node2> port 6902 connected with <IP Addr node1> port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.2 sec 20.9 MBytes 16.4 Mbits/sec
nodeB> iperf -c node2 -w 300k -P 2
------------------------------------------------------------
Client connecting to node2, TCP port 5001
TCP window size: 299 KByte (WARNING: requested 300 KByte)
------------------------------------------------------------
[ 4] local <IP Addr node2> port 6912 connected with <IP Addr node1> port 5001
[ 3] local <IP Addr node2> port 6911 connected with <IP Addr node1> port 5001
[ ID] Interval Transfer Bandwidth
[ 4] 0.0-10.1 sec 21.0 MBytes 16.6 Mbits/sec
[ 3] 0.0-10.2 sec 12.0 MBytes 9.4 Mbits/sec
---------------------------------------------------------------------------------------------------------------------------
A secondary tuning issue for TCP is the maximum transmission unit (MTU).
nodeA> iperf -s -m
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 60.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node3> port 5001 connected with <IP Addr node4> port 1096
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 2.0 sec 1.8 MBytes 6.9 Mbits/sec
[ 4] MSS size 1448 bytes (MTU 1500 bytes, ethernet)
[ 4] Read lengths occurring in more than 5% of reads:
[ 4] 952 bytes read 219 times (16.2%)
[ 4] 1448 bytes read 1128 times (83.6%)
Here is a host that doesn't support Path MTU Discovery. It will only send and receive small 576 byte packets.
nodeA> iperf -s -m
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 32.0 KByte (default)
------------------------------------------------------------
[ 4] local <IP Addr node4> port 5001 connected with <IP Addr node3> port 13914
[ ID] Interval Transfer Bandwidth
[ 4] 0.0- 2.3 sec 632 KBytes 2.1 Mbits/sec
WARNING: Path MTU Discovery may not be enabled.
[ 4] MSS size 536 bytes (MTU 576 bytes, minimum)
[ 4] Read lengths occurring in more than 5% of reads:
[ 4] 536 bytes read 308 times (58.4%)
[ 4] 1072 bytes read 91 times (17.3%)
[ 4] 1608 bytes read 29 times (5.5%)
--------------------------------------------------------------------------------------------------------------------------
iPerf creates a constant bit rate UDP stream.
nodeA> iperf -s -u -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 60.0 KByte (default)
------------------------------------------------------------
nodeB> iperf -c node2 -u -b 10m
------------------------------------------------------------
Client connecting to node2, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 60.0 KByte (default)
------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------
To test multicast, run several servers with the bind option (-B, --bind) set to the multicast group address.
nodeB> iperf -c 224.0.67.67 -u --ttl 5 -t 5
------------------------------------------------------------
Client connecting to 224.0.67.67, UDP port 5001
Sending 1470 byte datagrams
Setting multicast TTL to 5
UDP buffer size: 32.0 KByte (default)
------------------------------------------------------------
nodeA> iperf -s -u -B 224.0.67.67 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 224.0.67.67
Joining multicast group 224.0.67.67
Receiving 1470 byte datagrams
UDP buffer size: 32.0 KByte (default)
------------------------------------------------------------
nodeA> iperf -s -u -B 224.0.67.67 -i 1
------------------------------------------------------------
Server listening on UDP port 5001
Binding to local address 224.0.67.67
Joining multicast group 224.0.67.67
Receiving 1470 byte datagrams
UDP buffer size: 60.0 KByte (default)
------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------------
IPv6 Mode
Get the IPv6 address of the node using the 'ifconfig' command.
Server side:
$ iperf -s -V
Client side:
$ iperf -c <Server IPv6 Address> -V>
Using Representative Streams to measure bandwidth
Use the -F or -I option. If you want to test how your network performs with compressed / uncompressed streams, just create representative streams and use the -F option to test it.
The -F option is for file input.
The -I option is for input from stdin.
Client: $ iperf -c <server address> -F <file-name>
Client: $ iperf -c <server address> -I
Thanks
Himanshu
No comments:
Post a Comment