How do I troubleshoot low bandwidth issues on my VPN connection?

3 minute read
0

I'm experiencing low bandwidth on my VPN connection. What tests can I run to verify that the issue isn't occurring inside my Amazon Virtual Private Cloud (Amazon VPC)?

Resolution

To troubleshoot low bandwidth issues, use iPerf3 on two Linux-based EC2 instances.

Prerequisite: Before you test network performance, consider the following:

  • If you perform network testing between instances that aren't co-located in the same placement group or that don't support jumbo frames, then check and set the MTU on your Linux instance.
  • 5201 is the default port to test TCP performance.

Launch two Linux-based EC2 instances

To create Linux-based EC2 instances, complete the following steps:

  1. Launch Amazon Elastic Compute Cloud (Amazon EC2) Linux instances in two different Availability Zones in the same AWS Virtual Private Cloud (VPC).
  2. Verify that the instances support root I/O virtualization (SR-IOV).
  3. Verify that you can connect to the instances through SSH.
  4. Use -p to configure the security groups used by your instances to allow communication over the port used by iPerf3.

Install the iPerf3 network benchmark tool on both instances

iPerf3 measures bandwidth on networks. For more information, see iperf on the GitHub website. To install iPerf3, complete the following steps:

  1. Use a terminal session to connect to your Linux instances.

  2. Use the command that corresponds with your use case to install iPerf3:

    RHEL-based Linux

    $ sudo yum install iperf3

    Debian/Ubuntu

    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt-get install git gcc make
    $ git clone https://github.com/esnet/iperf3
    $ cd iperf3
    $ ./configure
    $ sudo make
    $ sudo make install
    # optionally run "make clean" to free up disk space
    # by removing artifacts in the build tree.
    $ sudo make clean
    $ sudo ldconfig
  3. Configure one instance as a server to listen on the default port:

    $ sudo iperf3 -s -V

Use iPerf3 to run network tests

Configure your on-premises host as a client. Then, to benchmark the network throughput on your VPN connection, run the iPerf3 tests between the private IP addresses of your EC2 instances and on-premises hosts bidirectionally. To benchmark throughput over the internet, run these tests between your instances' two public IP addresses. For more information, see iPerf 3 user documentation on the iPerf website.

Run the following commands. The outputs display the results of 20 parallel streams with increasing window size per TCP connection. Replace example_IP with the private or public IP address of your instance:

sudo iperf3 -c example_IP -P 20 -w 128K -V
sudo iperf3 -c example_IP -P 20 -w 512K -V
sudo iperf3 -c example_IP -P 20 -w 1024K -V

Run the following commands. The outputs display the results of increasing bandwidth capacity and a time frame of 30 seconds per UDP connection. Replace example_ec2_IP with the private or public IP address of your EC2 instance:

iperf3 -c example_ec2_IP -u -b 200M -t 30
iperf3 -c example_ec2_IP -u -b 500M -t 30
iperf3 -c example_ec2_IP -u -b 1G -t 30

Note: -w denotes the window size.

The window size must be lower than the net.core.rmem_max and net.core.wmem_max kernel parameters on both sides. Based on your system build, rmem_max or wmem_max might be lower than 512KB by default. If it's lower than 512KB by default, then increase rmem_max and wmem_max on both sides before you run the iPerf test. For more information, see Tuning Your Cloud: Improve Global Network Performance for Applications on YouTube.

AWS OFFICIAL
AWS OFFICIALUpdated a month ago