Iperf : A Tool for Network Testing
Iperf
Iperf or IP performance is a utility for testing network performance and its tuning. It is a cross-platform (windows, linux) tool which can provide standardized measurement results for any network (Wireline or Wireless). Iperf works with client and server functionality, and can create data streams to measure the throughput between the two network node in one or both directions. The Iperf output provides a time-stamped report of the amount of data transferred and the throughput measured.
The data streams can be either Transmission Control Protocol (TCP) or User Datagram Protocol (UDP):
- UDP: When testing UDP Throughput, Iperf tool allows tester to specify the datagram size and provides results for the throughput and packet loss
- TCP: When testing TCP Throughput, Iperf measures the throughput of the payload. Iperf uses 1024 × 1024 for mebibytes and 1000 × 1000 for megabytes.
Iperf Tool Characteristics
- Iperf is open-source software written in C
- It can runs on various platforms including Linux, Unix and Windows
- It can be used to measure network performance for both Wireless and Wireline networks
- It can be used for UDP and TCP throughput test
- It can send data in one direction (DL only, UL only) or both direction( DL + UL) at same time
- Iperf output provides a time-stamped report of the amount of data transferred and the throughput measured
- There are two version available for Iperf2 and Iperf3
- Iperf v3 was created with the goal of a smaller and simpler code base
- The two versions are incompatible with each other, and there are only a few differences in terms of the options and functionalities
Why we need Iperf Tool?
The peak throughputs supported by network is in order of 100s of Mbps to several Gbps e.g. 5G NR can support speed upto 20 Gbps in Downlink. The applications like video streaming or anything similar can not consume 20Gbps data pipe so we need a tool which can simulate some dummy data to fill the complete data pipe or bandwidth. The iperf application can simulate that dummy data form kbps to Gbps with a simple command.
Server Client Concept for Testing Iperf
- Server: The data receiving node is referred as Server
- Client: The data sending node is referred as Client
Following figure shows, server and client for downloads and uploads.
Testing UDP Throughput:
UDP is a transport layer protocol and does not requires any acknowledge of transmitting datagrams from receiving node. Tester needs to run two commands one at server node and other on client node and definition of server and client change as per above diagram based on Downlink and Uplink data transfer. Following is commands sequence.
Step:1 run following Command at receiving end (Server side)
-
- iperf –s – u –i 1 –p 5001 (Server side)
- -s : Server
- -u : UDP data protocol
- -i : statistics are displayed every second
- -p : port address, this must be the same at sending and receiving end
- iperf –s – u –i 1 –p 5001 (Server side)
Step:2 run following Command at sending end (Client side)
-
- iperf –B xx.xx.xx.xx –c xx.xx.xx.xx -u –i 1 -b 100m –l 1400 –p 5001 –t 99999 (Client Side)
-
-
- -B : Bind the sender IP address (in case the sender has multiple IP addresses interfaces)
- -c : Indicates the IP address of the receive end
- -u : UDP data protocol
- -b : defines bandwidth for test (In example, it is 100 Mbps)
- -l : defines the packet length or buffer length ( In example, it is 1400 bytes)
- -i : statistics are displayed every second
- -p : port address, this must be the same at sending and receiving end
- -t : command execution duration
-
Testing TCP Throughput:
TCP is a transport layer protocol and does requires any acknowledge of transmitting datagrams from receiving node. Most applications like file transfer, video download uses TCP protocols and using Iperf TCP data transfer we can simulate similar data profiles. For TCP test also, tester needs to run two commands one at server node and other on client node. Following is commands sequence.
Step:1 run following Command at receiving end (Server side)
-
- iperf -s –i 1 -w 4M -p 5001
- -s indicates that the server functions as the receive end.
- -i 1 one report per second
- -w 4M indicates the window size 4M, Unit is Byte B
- -p indicates the receive port
- iperf -s –i 1 -w 4M -p 5001
Step:2 run following Command at sending end (Client side)
-
- iperf –B xx.xx.xx.xx –c xx.xx.xx.xx –i 1 –w 4M –l 1400 –P 4 –p 5001 –t 99999 –N
-
-
- -B : Bind the sender IP address (in case the sender has multiple IP addresses interfaces)
- -c : Indicates the IP address of the receive end
- -l : defines the packet length or buffer length ( In example, it is 1400 bytes)
- -i : statistics are displayed every second
- -w : Send window 4M
- -P : Number of concurrent threads. It is recommended that the number of threads be less than or equal to 6.
- -p : port address, this must be the same at sending and receiving end
- -t : command execution duration
-
References
Related Post
- Linux Basic Commands
- 4G LTE Important QXDM Log Packets
- tcpdump for Linux System: A Tool for IP Packet Analysis