Use iperf to measure TCP and UDP throughput between two servers connected through a 10 GbE optical path on the COSMOS testbed, and verify multi-gigabit link performance.
COSMOS provides network interfaces operating at different speeds and link types. This tutorial demonstrates how to measure the network performance of a 10 Gigabit Ethernet optical path using iperf, a standard command-line bandwidth measurement tool.
The tutorial is set in the context of the COSMOS large-scale testbed optical network (see Context in the source), where a server (srv4-lg1) is connected via tengigabitethernet 1/34 joined to twentyFiveGigE 1/1/4 on VLAN 124, and a Calient Switch S320 provides a direct optical connection between ports 5.7.4 and 5.7.6. One server acts as the iperf server, the other as the client.
Both TCP and UDP throughput are measured. The results demonstrate ~9.4 Gbits/sec TCP and ~8.0 Gbits/sec UDP throughput across the 10G link.
Note: This tutorial depends on an optical network topology that must be pre-configured. Refer to the optical network tutorial for the switch and VLAN setup steps before running these measurements.
After completing this tutorial you will be able to:
iperf in server and client mode to measure TCP and UDP bandwidth.| Difficulty | Intermediate |
| Estimated time | 30 min |
| Domain / sandbox | Large-scale testbed (lg1 nodes) |
| Topic group | Networking |
| Last verified | Not re-tested (migrated 2026-06-20) |
Background knowledge
Account & access
Devices / nodes
| Resource | Role | Qty | Notes |
|---|---|---|---|
| srv1-lg1 | iperf server | 1 | IP address 192.168.1.1 on the optical path interface |
| srv4-lg1 | iperf client | 1 | IP address 192.168.1.4 on eno1; connected via tengigabitethernet 1/34 joined to twentyFiveGigE 1/1/4 on VLAN 124 |
| Calient Switch S320 | Optical switch | 1 | Direct optical connection ports 5.7.4 <--> 5.7.6 |
Disk images
| Image | Load onto | Provides |
|---|---|---|
| TODO: verify | srv1-lg1, srv4-lg1 | Linux with iperf installed |
Software components
| Component | Version | Source |
|---|---|---|
| iperf | TODO: verify (classic iperf / iperf3) | preinstalled or apt install iperf |
Spectrum / RF / special
Not applicable. This tutorial uses wired 10 GbE optical connections.
srv4-lg1 (192.168.1.4) connects via tengigabitethernet 1/34 into the switch fabric, joined with twentyFiveGigE 1/1/4 on VLAN 124. The Calient Switch S320 provides a direct optical circuit between ports 5.7.4 and 5.7.6, linking srv4-lg1 through to srv1-lg1 (192.168.1.1). Both servers run iperf across this path.
The binding of tengigabitethernet 1/32 with twentyFiveGigE 1/1/4 follows the same procedure described in the optical network tutorial.
Reserve the resources (see Prerequisites) and log into the console:
ssh <username>@console.<sandbox>.cosmos-lab.org
Ensure the optical network topology is already configured (Calient S320 optical connection 5.7.4 <--> 5.7.6, VLAN 124 binding) as described in the optical network tutorial.
Confirm IP connectivity between the two servers across the optical path:
ping -c 3 192.168.1.1 # run from srv4-lg1
Open an SSH session to srv1-lg1 (from the console) and start iperf in server mode:
native@srv1-lg1:~$ iperf -s
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
Leave this running. iperf will print connection statistics each time a client connects.
Open a second SSH session to srv4-lg1 and run iperf as a TCP client targeting srv1-lg1:
native@srv4-lg1:~$ iperf -c 192.168.1.1
------------------------------------------------------------
Client connecting to 192.168.1.1, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.4 port 35486 connected with 192.168.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 11.0 GBytes 9.42 Gbits/sec
This measurement shows that the optical path delivers 9.42 Gbits/sec of TCP bandwidth.
Stop the server on srv1-lg1 (Ctrl-C) and restart it in UDP mode:
Server side (srv1-lg1):
native@srv1-lg1:~$ iperf -s -u
------------------------------------------------------------
Server listening on UDP port 5001
Receiving 1470 byte datagrams
UDP buffer size: 208 KByte (default)
------------------------------------------------------------
Client side (srv4-lg1): send UDP traffic at a target bitrate of 9 Gbps using the -u flag and -b to specify the bitrate:
native@srv4-lg1:~$ iperf -c 192.168.1.1 -u -b 9gbps
------------------------------------------------------------
Client connecting to 192.168.1.1, UDP port 5001
Sending 1470 byte datagrams, IPG target: 1.31 us (kalman adjust)
UDP buffer size: 208 KByte (default)
------------------------------------------------------------
[ 3] local 192.168.1.4 port 33737 connected with 192.168.1.1 port 5001
[ ID] Interval Transfer Bandwidth
[ 3] 0.0-10.0 sec 9.77 GBytes 8.39 Gbits/sec
[ 3] Sent 7134255 datagrams
[ 3] Server Report:
[ 3] 0.0-10.0 sec 9.30 GBytes 7.99 Gbits/sec 0.000 ms 342498/7134255 (0%)
The server report shows 7.99 Gbits/sec received UDP throughput. The loss rate (342498/7134255) is approximately 4.8%, typical when pushing close to link capacity. The source notes this result may be improved with additional UDP and kernel tuning.
# Stop iperf on both srv1-lg1 and srv4-lg1 with Ctrl-C
No omf save is needed — the measurements do not modify the disk image.
If you reconfigured any switch or VLAN settings during the experiment, restore them to their original state as described in the optical network tutorial.
| Symptom | Likely cause | Fix |
|---|---|---|
iperf client cannot connect to 192.168.1.1 |
Optical path not established or VLAN not configured | Verify the Calient S320 circuit (5.7.4 <--> 5.7.6) and VLAN 124 binding as in the optical network tutorial |
| Bandwidth far below 9 Gbits/sec (TCP) | Link speed negotiation or MTU issue | Check interface speed with ethtool eno1; confirm the switch port is operating at 10G |
| UDP loss rate very high | Sending rate exceeds what the path can sustain | Lower -b value (e.g. -b 8gbps) and retry |
iperf: command not found |
iperf not installed on the node image | Install with apt-get install iperf or use iperf3 if available |
Author(s): COSMOS team (original: Artur Minakhmetov, Telecom Paris; Michael Sherman, Rutgers University) · Last verified: Not re-tested (migrated 2026-06-20) · Tested image/release: TODO: verify · Tags: networking, iperf, throughput, optical, 10gbe