Help Center/ Direct Connect/ User Guide/ Appendixes/ Connection Bandwidth Testing Methods
Updated on 2023-05-05 GMT+08:00

Connection Bandwidth Testing Methods

Scenarios

After your on-premises data center is connected to the cloud, you need to test the link performance to ensure that the connection can meet your service requirements. This section describes how you can use iPerf3 to test the bandwidth of a connection.

Prerequisites

  • Network connectivity between your on-premises data center and the cloud has been established, and the routes have been configured.
  • A network access device is available in the on-premises data center as the client or server in the iPerf3 tests.

    The IP address of the network access device is 192.168.0.1.

  • Six ECSs that can access the Internet are available as the clients or servers in the iPerf3 tests. The ECSs establish control connections with the on-premises network access device for transmitting test information and test results.

    In this example, the six ECSs use the c7.large.2 flavor and image CentOS 8.2 64bit (40 GB), and their IP addresses are from 172.16.0.2 to 172.16.0.7.

Procedure

  1. Install iPerf3 and set 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.

    1. Log in to the ECS.
    1. Install iPerf3.
      1. Download iPerf3.
        yum install iperf3
      2. Check whether the installation is successful.
        iperf3 -v

        The installation is successful when the system displays the following information:

  1. Use iPerf3 to test the bandwidth of a connection.

    Table 1 describes the parameters related to iPerf3.

    Table 1 iPerf3 parameter description

    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

    • Server: The listening port on the server. The default value is 5201. Both TCP and UDP are listened on.
    • Client: The port for the client to connect to the server. The default value is 5201. If the -u parameter also exists, the connection is initiated through UDP. Otherwise, a TCP connection is used by default.

    -u

    UDP is used to send packets. If this parameter is not specified, TCP is used.

    -l

    The length of the read/write buffer. It is recommended that you set this parameter to 16 when testing the packet forwarding performance and to 1400 when testing the bandwidth.

    -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.

    1. Test the bandwidth of the connection with the on-premises network access device functioning as the server.
      1. 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
      2. Run the iperf3 -u -l 16 -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 16 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16001 #First ECS
         iperf3 -u -l 16 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16002 #Second ECS
         iperf3 -u -l 16 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16003 #Third ECS
         iperf3 -u -l 16 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16004 #Fourth ECS
         iperf3 -u -l 16 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16005 #Fifth ECS
         iperf3 -u -l 16 -b 100m -t 120 -c 192.168.0.1 -i 1 -p 16006 #Sixth ECS
    2. Test the bandwidth of the connection with the on-premises network access device as a client.
      1. Run the iperf3 -s -i 1 -p 16001 command on each ECS to start the iPerf3 process in server mode and specify the port.
      2. Run the following commands on the on-premises network access device to start six iPerf3 processes in client mode:
         iperf3 -u -l 16 -b 100m -t 120 -c 172.16.0.2 -i 1 -p 16001
         iperf3 -u -l 16 -b 100m -t 120 -c 172.16.0.3 -i 1 -p 16001
         iperf3 -u -l 16 -b 100m -t 120 -c 172.16.0.4 -i 1 -p 16001
         iperf3 -u -l 16 -b 100m -t 120 -c 172.16.0.5 -i 1 -p 16001
         iperf3 -u -l 16 -b 100m -t 120 -c 172.16.0.6 -i 1 -p 16001
         iperf3 -u -l 16 -b 100m -t 120 -c 172.16.0.7 -i 1 -p 16001
    3. Analyze 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)