Note:

Use iPerf to Test the Throughput inside an OCI Hub and Spoke VCN Routing Architecture

Introduction

In today’s rapidly evolving cloud environments, ensuring optimal network performance is crucial for seamless operations. Oracle Cloud Infrastructure (OCI) provides robust networking capabilities, including the Hub and Spoke Virtual Cloud Network (VCN) routing architecture, to facilitate efficient communication and resource management. One essential aspect of maintaining this architecture is regularly testing the network throughput to identify potential bottlenecks and optimize performance.

In this tutorial, we will use iPerf, a powerful network testing tool, to measure and analyze the throughput within an OCI Hub and Spoke VCN routing architecture. By the end of this tutorial, you will be equipped with the knowledge to effectively assess and enhance your OCI network performance, ensuring your applications and services run smoothly.

image

Note: The test results obtained using iPerf depend highly on various factors, including network conditions, hardware configurations, and software settings specific to your environment. As such, these results may differ significantly from those in other environments. Do not use these results to make any definitive conclusions about the expected performance of your network or equipment. They should be considered as indicative rather than absolute measures of performance.

iPerf Versions

iPerf, iPerf2, and iPerf3 are tools used to measure network bandwidth, performance, and throughput between two endpoints. However, they have some key differences in terms of features, performance, and development status.

Overview:

Key Differences:

Feature iPerf iPerf2 iPerf3
Development Discontinued Actively Maintained Actively Maintained
TCP and UDP Tests Yes Yes Yes
Multithreading Support No Yes No
UDP Multicast No Yes No
IPv6 Support No Yes Yes
JSON Output No No Yes
Reverse Mode No Yes Yes

Note: We will use iPerf2 where possible in this tutorial.

Best for High Throughput?

For high-throughput environments, iPerf2 is often the best choice due to its multithreading capabilities, which can take full advantage of multiple CPU cores. This is especially important if you are working with network interfaces capable of handling multiple gigabits per second (Gbps) of traffic.

If multithreading is not crucial, iPerf3 is a good choice for simpler setups or modern networks with features like QoS and congestion control. However, in very high-throughput environments, its single-threaded nature might become a bottleneck.

Why is Maximum Segment Size (MSS) Clamping used?

Note: When traffic is flowing through an Internet Protocol Security (IPSec) tunnel through the pfSense Firewall MSS is something to pay attention to.

MSS clamping refers to Maximum Segment Size Clamping, which is a technique used in network communication, particularly in TCP/IP networks, to adjust the MSS of a TCP packet during the connection set up process. The MSS defines the largest amount of data that a device can handle in a single TCP segment, and it is typically negotiated between the communicating devices during the TCP handshake.

MSS clamping is often employed by network devices such as routers, firewalls, or VPNs to avoid issues related to packet fragmentation. Here is how it works:

Example of MSS clamping: If a client device sends an MSS value of 1460 bytes during the TCP handshake but the network’s MTU is limited to 1400 bytes due to VPN encapsulation, the network device can clamp the MSS to 1360 bytes (allowing for the extra overhead) to avoid fragmentation issues.

Important Parameters

Instance Network Speeds

Within OCI the speed of the network adapter (vNIC) or your instance is bound to the instance shape and the amount of CPUs you have assigned to that shape.

In this tutorial, we will use E4.Flex shapes with an Oracle Linux 8 Image with 1 OCPU. This means we will get a (maximum) network bandwidth of 1 Gbps for all iPerf test results.

  1. The shape is E4.Flex.
  2. The OCPU count is 1.
  3. The network bandwidth is 1 Gbps.

image

Note: It is possible to increase the network bandwidth by choosing another shape and increasing the amount of OCPUs.

Objectives

Task 1: Review the OCI Hub and Spoke VCN Routing Architecture

We will use the following architecture for all the iPerf throughput tests in this tutorial.

image

This is a full hub and spoke routing architecture with on-premises connected with an IPSec VPN tunnel. To recreate this routing topology, see:

Task 2: Install iPerf3 on the Hub Instances

Note: In this task, we will install iPerf3, and we will install iPerf2 in the next task.

Task 2.1: Install iPerf3 on Hub Step-stone

The hub step-stone is a Windows server instance. There are different iPerf distributions available for Windows here: windows. For this tutorial, we will download from here: Directory Lister.

image

Task 2.2: Install iPerf3 on a pfSense Firewall

Task 3: Install iPerf3 on the Spoke Instances

Install iPerf3 on the Linux Instances inside OCI in our architecture.

Task 3.1: Install iPerf3 on Spoke Instance A1 and Instance A2

Task 3.2: Install iPerf3 on Spoke Instance B

  1. Connect to instance B.
  2. Run the sudo dnf install iPerf3 command to install iPerf 3. If iPerf3 is already available, you will get a message that iPerf is already installed.

image

Task 3.3: Install iPerf3 on Spoke Instance C

  1. Connect to instance C.
  2. Run the sudo dnf install iPerf3 command to install iPerf 3. If iPerf3 is already available, you will get a message that iPerf is already installed.

image

Task 3.4: Install iPerf3 on Instance D

  1. Connect to instance D.
  2. Run the sudo dnf install iPerf3 command to install iPerf 3. If iPerf3 is already available, you will get a message that iPerf is already installed.

image

Task 4: Install iPerf3 on the On-Premises Instances

Install iPerf3 on the on-premises Linux Instances in our architecture.

Task 4.1: Install iPerf3 on Oracle Linux Client

  1. Connect to the on-premises Linux client instance.
  2. Run the sudo dnf install iPerf3 command to install iPerf 3. If iPerf3 is already available, you will get a message that iPerf is already installed.

image

Task 4.2: Install iPerf3 on Oracle Linux Client CPE

  1. Connect to the on-premises Linux CPE instance.
  2. Run the sudo dnf install iPerf3 command to install iPerf 3. If iPerf3 is already available, you will get a message that iPerf is already installed.

image

Task 5: Install iPerf2 on all Linux Instances

We have installed iPerf3, now we are going to install iPerf2 on all the Linux instances throughout the architecture.

We are using Oracle Linux 8 so we will need the following iPerf2 package: Oracle Linux 8 (x86_64) EPEL. If you are using Oracle Linux 9, use this package: Oracle Linux 9 (x86_64) EPEL or for another OS or Linux distribution use a package that is compiled for that OS.

Task 6: Define the iPerf Tests and Prepare the iPerf Commands

In this task, we will provide some iPerf commands with the additional flags and explain what they mean. For more information, see Network Performance.

Task 7: Perform iPerf Tests within the Same VCN in the Same Subnet

In this task, we are going to perform an iPerf2 throughput test within the same VCN and the same subnet. The following image shows the paths with the arrows between two endpoints where we are going to perform the throughput tests.

image

Task 7.1: From instance-A1 to instance-A2

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.1.50
IP of the iPerf client 172.16.1.93
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.1.50 -b 9G -P 5
Tested Bandwidth (SUM) 1.05 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 7.2: From instance-A2 to instance-A1

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.1.93
IP of the iPerf client 172.16.1.50
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.1.93 -b 9G -P 5
Tested Bandwidth (SUM) 1.05 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 8: Perform iPerf Tests Within the Same VCN Across Different Subnets

In this task, we are going to perform an iPerf3 throughput test within the same VCN but two different subnets. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 8.1: From pfSense Firewall to Hub Step-Stone

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.0.252
IP of the iPerf client 172.16.0.20
iPerf command on the server iPerf3 -s
iPerf command on the client iPerf3 -c 172.16.0.252
Tested Bandwidth (SUM) 958 Mbytes/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

image

Task 8.2: From Hub Step-Stone to pfSense Firewall

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.0.20
IP of the iPerf client 172.16.0.252
iPerf command on the server iPerf3 -s
iPerf command on the client iPerf3 -c 172.16.0.20
Tested Bandwidth (SUM) 1.01 Gbit/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

image

Task 9: Perform iPerf Tests Between two Different VCNs

In this task, we are going to perform an iPerf2 throughput test between two different VCNs and two different subnets. Note that the test will go through a firewall that is located in the hub VCN. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 9.1: From Instance-A1 to Instance-B

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.2.88
IP of the iPerf client 172.16.1.93
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.2.88 -b 9G -P 5
Tested Bandwidth (SUM) 1.02 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 9.2: From Instance-B to Instance-A1

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.1.93
IP of the iPerf client 172.16.2.99
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.1.93 -b 9G -P 5
Tested Bandwidth (SUM) 1.02 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 10: Perform iPerf Tests Between Different VCNs Bypassing the pfSense Firewall

In this task, we are going to perform an iPerf2 throughput test between two different VCNs and two different subnets. Note that the test will bypass the firewall that is located in the hub VCN. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 10.1: From Instance-C to Instance-D

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.4.14
IP of the iPerf client 172.16.3.63
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.4.14 -b 9G -P 5
Tested Bandwidth (SUM) 1.04 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 10.2: From Instance-D to Instance-C

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.3.63
IP of the iPerf client 172.16.4.14
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.3.63 -b 9G -P 5
Tested Bandwidth (SUM) 1.05 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 11: Perform iPerf Tests Between On-Premises and OCI Hub VCN

In this task, we are going to perform an iPerf2 throughput test between on-premises and OCI using a Site-to-Site IPSec VPN tunnel. Note that the test will go through the firewall that is located in the hub VCN. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Note:

Maximum Segment Size Clamping

In this tutorial, the on-premises side had an MTU of 9000 sending a packet with the MSS value of 1500 + IPSec overhead.

The pfSense interface MTU is 1500 … causing fragmentation issues.

By setting the interface MSS to 1300 it changes the size on the fly and this technique is called Maximum Segment Size Clamping.

MSS Change on the pfSense

image

image

image

image

image

Task 11.1: From VPN Client Instance (On-Premises) to Hub Step-Stone

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.0.252
IP of the iPerf client 10.222.10.19
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.0.252 -b 9G -P 5
Tested Bandwidth (SUM) 581 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 11.2: From Hub Step-Stone to VPN Client Instance (On-Premises)

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 10.222.10.19
IP of the iPerf client 172.16.0.252
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 10.222.10.19 -b 9G -P 5
Tested Bandwidth (SUM) 732 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 12: Perform iPerf Tests Between On-Premises and OCI Spoke VCN

In this task, we are going to perform an iPerf2 throughput test between on-premises and OCI using a Site-to-Site IPSec VPN tunnel. Note that the test will go through the firewall that is located in the hub VCN. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 12.1: From VPN Client Instance (On-Premises) to Instance-A1

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.1.93
IP of the iPerf client 10.222.10.19
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.1.93 -b 9G -P 5
Tested Bandwidth (SUM) 501 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

New Tests with MSS in iPerf Command:

Note: With iPerf you can tweak the packet stream so that the packets are sent with a specific MSS, you can use the following commands if you are not able to change the MSS settings on the devices in the path between your source or destination.

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.1.93
IP of the iPerf client 10.222.10.19
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.1.93 -b 9G -P 5 -M 1200
Tested Bandwidth (SUM) 580 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 12.2: From Instance-A1 to VPN Client Instance (On-Premises)

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 10.222.10.19
IP of the iPerf client 172.16.1.93
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 10.222.10.19 -b 9G -P 5
Tested Bandwidth (SUM) 620 Mbits/sec

In the next screenshots, you will also find the full testing outputs of the iPerf tests.

image

image

image

New Tests with MSS in iPerf Command:

Note: With iPerf you can tweak the packet stream so that the packets are sent with a specific MSS, you can use the following commands if you are not able to change the MSS settings on the devices in the path between your source or destination.

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 10.222.10.19
IP of the iPerf client 172.16.1.93
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 10.222.10.19 -b 9G -P 5 -M 1200
Tested Bandwidth (SUM) 805 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 13: Perform iPerf Tests Between On-Premises and OCI Spoke VCN bypassing the pfSense Firewall

In this task, we are going to perform an iPerf2 throughput test between on-premises and OCI using a Site-to-Site IPSec VPN tunnel. Note that the test will bypass the firewall that is located in the hub VCN. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 13.1: From VPN Client Instance (On-Premises) to Instance-D

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 172.16.4.14
IP of the iPerf client 10.222.10.19
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 172.16.4.14 -b 9G -P 5
Tested Bandwidth (SUM) 580 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 13.2: From Instance-D to VPN Client Instance (On-Premises)

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 10.222.10.19
IP of the iPerf client 172.16.4.14
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 10.222.10.19 -b 9G -P 5
Tested Bandwidth (SUM) 891 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 14: Perform iPerf Tests Between the Internet and the OCI Hub VCN

In this task, we are going to perform an iPerf2 throughput test between a client on the internet and OCI using the internet. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 14.1: From Internet to Hub Step-Stone

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server xxx.xxx.xxx.178
IP of the iPerf client xxx.xxx.xxx.152
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c xxx.xxx.xxx.178 -b 9G -P 5
Tested Bandwidth (SUM) 251 Mbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 15: Preform iPerf Tests within the Same Subnet On-Premises

In this task, we are going to perform an iPerf2 throughput test between two on-premises instances. The following image shows the paths with the arrows between what two endpoints where we are going to perform the throughput tests.

image

Task 15.1: From VPN Client Instance (On-Premises) to StrongSwan CPE Instance (On-Premises)

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 10.222.10.70
IP of the iPerf client 10.222.10.19
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 10.222.10.70 -b 9G -P 5
Tested Bandwidth (SUM) 1.05 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Task 15.2: From StrongSwan CPE Instance (On-Premises) to VPN Client Instance (On-Premises)

In the following table, you will find the IP address of the client and the server (used in this test), and the commands used to perform the iPerf test with the test results.

   
IP of the iPerf server 10.222.10.19
IP of the iPerf client 10.222.10.70
iPerf command on the server iPerf -s
iPerf command on the client iPerf -c 10.222.10.19 -b 9G -P 5
Tested Bandwidth (SUM) 1.05 Gbits/sec

The following images illustrate the commands and full testing output of the iPerf test.

image

image

image

Results

In this tutorial, we have performed different types of throughput tests using iPerf2 and iPerf3. The tests were performed on various different sources and destinations in the full network architecture with different paths.

In the following table you can see a summary of of the test results that we collected.

Test Type Bandwidth Result  
Task 7.1: Perform iPerf tests within the same VCN in the same subnet (From Instance-A1 to Instance-A2) 1.05 Gbits/sec OCI internal
Task 7.2: Perform iPerf tests within the same VCN in the same subnet (From Instance-A2 to Instance-A1) 1.05 Gbits/sec OCI internal
Task 8.1: Perform iPerf tests within the same VCN across different subnets (From pfSense Firewall to hub Stepstone) 958 Mbytes/sec OCI internal
Task 8.2: Perform iPerf tests within the same VCN across different subnets (From hub Stepstone to pfSense Firewall) 1.01 Gbit/sec OCI internal
Task 9.1: Perform iPerf tests between to different VCNs (From Instance-A1 to Instance-B) 1.02 Gbits/sec OCI internal
Task 9.2: Perform iPerf tests between to different VCNs (From Instance B to Instance A1) 1.02 Gbits/sec OCI internal
Task 10.1: Perform iPerf tests between different VCNs (bypassing the pfSense Firewall) (From Instance-C to Instance-D 1.04 Gbits/sec OCI internal
Task 10.2: Perform iPerf tests between different VCNs (bypassing the pfSense Firewall) (From Instance-D to Instance-C) 1.05 Gbits/sec OCI internal
Task 11.1: Perform iPerf tests between on-premises and OCI Hub VCN (From VPN Client Instance (on-premises) to Hub Stepstone) 581 Mbits/sec On-premises to OCI through firewall
Task 11.2: Perform iPerf tests between on-premises and OCI Hub VCN (From Hub Stepstone to VPN Client Instance (on-premises)) 732 Mbits/sec On-premises to OCI through firewall
Task 12.1: Perform iPerf tests between on-premises and OCI Spoke VCN (From VPN Client Instance (on-premises) to Instance-A1) 501Mbits/sec On-premises to OCI through firewall
Task 12.2: Perform iPerf tests between on-premises and OCI Spoke VCN (From Instance-A1 to VPN Client Instance (on-premises)) 620 Mbits/sec On-premises to OCI through firewall
Task 13.1: Perform iPerf tests between on-premises and OCI Spoke VCN (bypassing the pfSense Firewall) (From VPN Client Instance (on-premises) to Instance-D) 580 Mbits/sec On-premises to OCI firewall bypass
Task 13.2: Perform iPerf tests between on-premises and OCI Spoke VCN (bypassing the pfSense Firewall) (From Instance-D to VPN Client Instance (on-premises)) 891 Mbits/sec On-premises to OCI firewall bypass
Task 14: Perform iPerf tests between the INTERNET and the OCI Hub VCN (From Internet to Hub Stepstone) 251 Mbits/sec Internet to OCI
Task 15.1: Perform iPerf tests within the same subnet on-premises (From VPN Client Instance (on-premises) to StrongSwan CPE Instance (on-premises)) 1.05 Gbits/sec On-premises to on-premises
Task 15.2: Perform iPerf tests within the same subnet on-premises (From StrongSwan CPE Instance (on-premises) to VPN Client Instance (on-premises)) 1.05 Gbits/sec On-premises to on-premises

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.