Benchmarking Network Throughput
Utilize tools and methodologies to accurately measure and analyze network performance in various scenarios.
Benchmarking Network Throughput is a free Linux Networking & TCP/IP for Developers lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Linux Networking & TCP/IP for Developers learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why Benchmark Network Speed?
Ever wonder if your internet connection is truly delivering what it promises? Or if your local network is a bottleneck?
Network benchmarking helps you measure and understand your network's actual performance. It's crucial for diagnosing slowdowns, verifying upgrades, or planning system deployments.
Key Throughput Metrics
When we talk about network performance, we often focus on these key metrics:
- Throughput (Bandwidth): The amount of data transferred successfully per unit of time, usually measured in bits per second (bps) or bytes per second (Bps).
- Latency: The time it takes for a data packet to travel from one point to another.
- Jitter: The variation in latency over time.
- Packet Loss: The percentage of data packets that fail to reach their destination.
For benchmarking, throughput is often the primary focus.
Introducing iperf3 for Throughput
iperf3 is a powerful command-line tool specifically designed for measuring maximum network throughput between two hosts.
It's widely used because it can test both TCP and UDP connections, show detailed statistics, and is available on almost all platforms, including Linux.
Setting Up iperf3 Server
To test network throughput with iperf3, you need two machines: one acting as a server and one as a client.
First, on one of your Linux machines (the 'server'), start iperf3 in server mode. It will listen for incoming connections.
iperf3 -sRunning a Basic iperf3 Client Test
Now, on your second Linux machine (the 'client'), run iperf3 in client mode, pointing it to the server's IP address.
This command will perform a default 10-second TCP test, sending data from the client to the server.
iperf3 -c <server_ip_address>Interpreting iperf3 Output
After the test, both the client and server will display results. Look for the 'Bandwidth' column, which shows the throughput.
Key metrics in the output:
- Interval: Time segments of the test.
- Transfer: Total data sent/received in that interval.
- Bandwidth: The average data rate for that interval.
- Retr: Number of retransmitted packets (for TCP), indicating network issues.
Testing UDP Throughput and Loss
iperf3 can also test UDP performance, which is useful for applications like video streaming or VoIP where packet loss is more critical than retransmissions.
Use the -u flag on the client to switch to UDP mode. You can also specify a target bandwidth with -b.
iperf3 -c <server_ip_address> -u -b 100MMaximizing Throughput with Parallel Streams
Sometimes, a single TCP stream might not fully utilize your network's capacity due to TCP windowing or latency.
You can use the -P flag to run multiple parallel streams simultaneously, which can reveal the true maximum throughput of your link.
iperf3 -c <server_ip_address> -P 4Other iperf3 Options
iperf3 offers many other options for fine-tuning your tests:
-R: Reverse mode (server sends, client receives).-t: Set test duration.-i: Set interval for reporting.-J: Output results in JSON format for scripting.
Always check iperf3 --help for a full list of options!
Quick Check on iperf3
You've run an iperf3 TCP test from a client to a server. The client output shows a 'Retr' count of 150. What does this indicate?
Recap: Benchmarking Throughput
In this lesson, we explored network throughput benchmarking. We learned:
- Why benchmarking is essential for understanding network performance.
- Key metrics like throughput, latency, jitter, and packet loss.
- How to use
iperf3in both server and client modes. - Interpreting
iperf3results, including bandwidth and retransmissions. - Testing UDP performance and using parallel streams for maximum throughput.
Mastering iperf3 is a vital skill for any network professional or developer!
Frequently asked questions
Is the “Benchmarking Network Throughput” lesson free?
Yes — the full text of “Benchmarking Network Throughput” is free to read here on the web, and the Linux Networking & TCP/IP for Developers course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Linux Networking & TCP/IP for Developers course, upgrade to CoddyKit PRO.
What will I learn in “Benchmarking Network Throughput”?
Utilize tools and methodologies to accurately measure and analyze network performance in various scenarios. You practise Linux Networking & TCP/IP for Developers with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Linux Networking & TCP/IP for Developers?
No prior experience is required. Linux Networking & TCP/IP for Developers on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Benchmarking Network Throughput” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Linux Networking & TCP/IP for Developers lesson?
Yes. Every Linux Networking & TCP/IP for Developers lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Kernel Network Parameters
- NIC Tuning & Optimization
- Benchmarking Network Throughput
- TCP Congestion Control Tuning