iperf3 is a free open-source, cross-platform command-line utility designed for real-time network throughput measurements. It ranks among the most effective tools for assessing maximum achievable bandwidth in IP networks (supporting both IPv4 and IPv6).
[ You might also like: 17 Useful Bandwidth Monitoring Tools for Linux ]
With iperf, users can adjust various parameters related to timing, buffers, and protocols such as TCP, UDP, and SCTP. This makes it particularly useful during network performance optimization tasks.
To achieve enhanced or maximum network performance, it's essential to improve both the throughput and latency of your network’s sending and receiving capabilities.
However, before proceeding with tuning, you should conduct tests to gather comprehensive network performance statistics that will guide your optimization strategy.
The results from iperf include time intervals in seconds, data transferred, bandwidth (transfer rate), loss, and other relevant network performance metrics. Its primary purpose is to aid in tuning TCP connections across a specific path, which is the focus of this article.
Prerequisites:
- Two networked systems with iperf3 installed on both.
How to Install iPerf3 on Linux Systems
Before utilizing iperf3, install it on both machines intended for benchmarking. Since iperf3 is available in the official repositories of most major Linux distributions, installation is straightforward using the appropriate package manager as shown below.
<code>$ sudo apt install iperf3 [On <strong>Debian, Ubuntu and Mint</strong>] $ sudo yum install iperf3 [On <strong>RHEL/CentOS/Fedora</strong> and <strong>Rocky/AlmaLinux</strong>] $ sudo emerge -a net-misc/iperf [On <strong>Gentoo Linux</strong>] $ sudo apk add iperf3 [On <strong>Alpine Linux</strong>] $ sudo pacman -S iperf3 [On <strong>Arch Linux</strong>] $ sudo zypper install iperf3 [On <strong>OpenSUSE</strong>] </code>
Once iperf3 is installed on both systems, you're ready to begin testing network throughput.
How to Test Network Speed Between Two Linux Servers
Begin by connecting to the remote machine that will act as the server, and start iperf3 in server mode using the -s
option. By default, it listens on port 5201.
You may specify the format (k, m, g for Kbits, Mbits, Gbits or K, M, G for KBytes, Mbytes, Gbytes) for output using the -f
parameter as shown.
<code>$ iperf3 -s -f K </code>
If port 5201 is already occupied by another process on the server, you can choose an alternate port (e.g., 3000) using the -p
switch.
<code>$ iperf3 -s -p 3000</code>
Optionally, run the server as a background process using the -D
flag and redirect messages to a log file.
<code>$ iperf3 -s -D > iperf3log </code>
Now, on your local machine, treated as the client (where the actual benchmarking occurs), launch iperf3 in client mode using the -c
option and provide the hostname, domain name, or IP address of the server.
<code>$ iperf3 -c 192.168.10.1 -f K</code>
After approximately 18–20 seconds, the client will finish running and display results showing the average throughput, as illustrated in the screenshot below.
As seen in the above screenshot, there may be differences between values reported by the server and the client. However, always rely on the results from the iperf client when analyzing test outcomes.
How to Conduct Advanced Network Throughput Testing in Linux
There are several advanced options specific to the client for more detailed tests, explained below.
One key factor influencing the amount of data present on the network at any given time is the TCP window size – crucial in optimizing TCP connections. You can adjust this using the -w
parameter as shown.
<code>$ iperf3 -c 192.168.10.1 -f K -w 500K </code>
To perform a test in reverse mode, where the server sends and the client receives, use the -R
flag.
<code>$ iperf3 -c 192.168.10.1 -f K -w 500K -R </code>
For a bi-directional test, measuring bandwidth in both directions simultaneously, apply the -d
option.
<code>$ iperf3 -c 192.168.10.1 -f K -w 500K -d</code>
If you wish to include server-side results in the client output, use the --get-server-output
parameter.
<code>$ iperf3 -c 192.168.10.1 -f K -w 500K -R --get-server-output</code>
Additionally, you can define the number of simultaneous parallel streams (e.g., two) using the -P
option.
<code>$ iperf3 -c 192.168.10.1 -f K -w 500K -P 2</code>
For more information, refer to the iperf3 manual page.
<code>$ man iperf3</code>
That concludes this guide! Always remember to conduct network performance tests before proceeding with actual tuning. iperf3 is a robust tool ideal for evaluating network throughput.
Do you have questions or thoughts to share? Use the comment section below.
The above is the detailed content of How to Test Network Speed Using iPerf3 Tool in Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

There are three ways to create empty files in the command line: First, the simplest and safest use of the touch command, which is suitable for debugging scripts or placeholder files; Second, it is quickly created through > redirection but will clear existing content, which is suitable for initializing log files; Third, use echo"> file name to create a file with an empty string, or use echo-n""> file name to avoid line breaks. These three methods have their own applicable scenarios, and choosing the right method can help you complete the task more efficiently.

Are you looking for good software to write mathematical equations? If so, this article provides the top 5 equation editors that you can easily install on your favorite Linux distribution.In addition to being compatible with different types of mathema

Eclipse is a free integrated development environment (IDE) that programmers around the world use to write software, primarily in Java, but also in other major programming languages using Eclipse plugins.The latest release of Eclipse IDE 2023?06 does

Linux administrators should be familiar with the command-line environment. Since GUI (Graphical User Interface) mode in Linux servers is not commonly installed.SSH may be the most popular protocol to enable Linux administrators to manage the servers

Linux has a rich collection of commands, and while many of them are powerful and useful for various tasks, there are also some funny and whimsical commands that you can try out for amusement. 1. sl Command (Steam Locomotive) You might be aware of the

LXD is described as the next-generation container and virtual machine manager that offers an immersive for Linux systems running inside containers or as virtual machines. It provides images for an inordinate number of Linux distributions with support

PPA is an important tool for Ubuntu users to expand their software sources. 1. When searching for PPA, you should visit Launchpad.net, confirm the official PPA in the project official website or document, and read the description and user comments to ensure its security and maintenance status; 2. Add PPA to use the terminal command sudoadd-apt-repositoryppa:/, and then run sudoaptupdate to update the package list; 3. Manage PPAs to view the added list through the grep command, use the --remove parameter to remove or manually delete the .list file to avoid problems caused by incompatibility or stopping updates; 4. Use PPA to weigh the necessity and prioritize the situations that the official does not provide or require a new version of the software.

Gogo is a remarkable tool to bookmark directories inside your Linux shell. It helps you create shortcuts for long and complex paths in Linux. This way, you no longer need to type or memorize lengthy paths on Linux.For example, if there's a directory
