Using iPerf3 to Test the Bandwidth Availability of a Connection
Scenario
After a connection is established between your on-premises data center and the cloud, you need to test the connection performance to ensure that it can meet your service requirements.
This section describes how you can use iPerf3 to test the bandwidth of a connection.
Prerequisites
- The connection between your on-premises data center and Huawei Cloud has been established, and the routes have been configured.
- The following devices and resources are available:
- A network access device in the on-premises data center, which functions as the client or server in iPerf3 tests
Example IP address of the network access device: 192.168.0.1
- Six ECSs that can access the Internet, which function as the clients or servers in the iPerf3 tests. They establish control connections with the network access device in the on-premises data center to transmit test configuration information and test results.
In this example, the six ECSs use the flavor c7.large.2 and image CentOS 8.2 64bit (40 GB), and their IP addresses are from 172.16.0.2 to 172.16.0.7.
- A network access device in the on-premises data center, which functions as the client or server in iPerf3 tests
Setting Up the Test Environment
Install iPerf3 on the on-premises network access device and on the six ECSs. The following describes how to install iPerf3 on an ECS.
- Log in to the ECS.
- Install iPerf3.
- Download iPerf3.
yum install iperf3
- Check whether the installation is successful.
iperf3 -v
If the version information is displayed, the installation is successful.
- Download iPerf3.
Using IPerf3 to Test the Bandwidth of a Connection
IPerf3 Overview
iPerf3 is an open-source, lightweight, and cross-platform network performance test tool. It measures the bandwidth throughput, packet loss rate, delay jitter, and packets per second (PPS) over TCP and UDP. It is an industry-standard tool for testing the bandwidth of enterprise physical connections, Direct Connect connections, backbone networks, and private networks.
Client-server model: The server at one end starts listening, and the client at the other end connects to the server and sends test packets.
Table 1 describes the parameters related to iPerf3.
| Parameter | Description |
|---|---|
| -s | A server-specific parameter. It indicates that iPerf3 runs in server mode. |
| -c | A client-specific parameter. It indicates that iPerf3 runs in client mode. |
| -i | The interval between reports, in seconds. |
| -p |
|
| -u | UDP is used to send packets. If this parameter is not specified, TCP is used. |
| -l | The length of the read/write buffer. The recommended value is 1,400 for testing the bandwidth and 16 for testing the packet forwarding performance. |
| -b | The bandwidth (in bit/s) used if a UDP connection is established. |
| -t | The total transmission time, in seconds. It is the duration for iPerf3 to repeatedly send data packets of a specified length within a specified period. The default value is 10 seconds. |
| -A | CPU affinity. You can bind the iPerf3 process to the logical CPU with the corresponding number to prevent the iPerf3 process from being scheduled among different CPUs. |
Testing the Bandwidth of the On-premises Network Access Device That Functions As the Server
- Run the following commands on the on-premises network access device to start the iPerf3 process in server mode and specify different ports:
iperf3 -s -i 1 -p 16001 iperf3 -s -i 1 -p 16002 iperf3 -s -i 1 -p 16003 iperf3 -s -i 1 -p 16004 iperf3 -s -i 1 -p 16005 iperf3 -s -i 1 -p 16006
- Run the iperf3 -u -l 1400 -b 100m -t 120 -c server_ip -i 1 -p port command on each ECS to start the iPerf3 process in client mode and specify different ports of the on-premises network access device.
Example commands are as follows:
iperf3 -u -l 1400 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16001 #First ECS iperf3 -u -l 1400 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16002 #Second ECS iperf3 -u -l 1400 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16003 #Third ECS iperf3 -u -l 1400 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16004 #Fourth ECS iperf3 -u -l 1400 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16005 #Fifth ECS iperf3 -u -l 1400 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16006 #Sixth ECS
Testing the Bandwidth of the On-premises Network Access Device That Functions As the Client
- Run the iperf3 -s -i 1 -p 16001 command on each ECS to start the iPerf3 process in server mode and specify the port.
- Run the following commands on the on-premises network access device to start six iPerf3 processes in client mode:
iperf3 -u -l 1400 -b 100m -t 120 -c 172.16.0.2 -i 1 -p 16001 iperf3 -u -l 1400 -b 100m -t 120 -c 172.16.0.3 -i 1 -p 16001 iperf3 -u -l 1400 -b 100m -t 120 -c 172.16.0.4 -i 1 -p 16001 iperf3 -u -l 1400 -b 100m -t 120 -c 172.16.0.5 -i 1 -p 16001 iperf3 -u -l 1400 -b 100m -t 120 -c 172.16.0.6 -i 1 -p 16001 iperf3 -u -l 1400 -b 100m -t 120 -c 172.16.0.7 -i 1 -p 16001
Analyzing the Test Result
After the iPerf3 process on the client is executed, the following information is displayed. The packets per second (PPS) of the tested link can be calculated using the formula: PPS = Number of packets received by the peer end/Time.
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams [ 4] 0.00-10.00 sec 237 MBytes 199 Mbits/sec 0.027 ms 500/30352 (1.6%) [ 4] Sent 30352 datagrams
The following table describes the fields in the command output.
| Field | Description |
|---|---|
| Transfer | Transmitted data volume |
| Bandwidth | Bandwidth of the connection |
| Jitter | Jitter |
| Lost/Total Datagrams | Number of lost packets/Total number of packets (packet loss rate) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot