Email WhatsApp
WeChat
WeChat QR

Table of Contents

iperf3 Reverse on Linux

iperf3 sends TCP data from the client to the server by default. Add -R to the client command and the server sends the data back to the client, with the client still starting the test.

That gives you two numbers to work with when a little Linux box is fast one way and slow the other. On a KiwiPi 5 Pro there are two 2.5GbE jacks, so write down which one you plugged in. Run both tests through that jack before you move the cable or change anything on the switch.

KiwiPi 5 Pro board and two Ethernet arrows on the cover of an iperf3 reverse mode guide
The same KiwiPi 5 Pro port is used for both TCP runs.

Set up a wired test

Put the board and a second machine on the same wired LAN. If you’re trying to measure a 2.5GbE link, you’ll need a peer and, if there’s a switch in the middle, switch ports that can negotiate at 2.5 Gb/s too. A gigabit port anywhere in that path sets a gigabit line-rate limit. That still gives you a useful comparison if both directions go through it.

The Ethernet ports on different KiwiPi boards can have different limits, as the KiwiPi board comparison shows. And a link can come up at a lower rate than the one on the box. The first command below asks Linux which interface it would use to reach the peer. Use the interface printed after dev in the second command, and check the corresponding port on the other machine as well.

ip route get 192.168.50.20
ethtool eth0

Look for Speed, Duplex and Link detected. Replace the example address and eth0 with your peer’s LAN address and your actual interface name. The guide to Gigabit Ethernet PHYs explains where negotiation happens. If the route goes through Wi-Fi or another port, sort that out before recording any numbers. On a board with two jacks, unplugging the unused cable is often the simplest way to remove that variable.

Diagram with arrows from the KiwiPi client to the LAN peer by default and back to the client with the -R flag
The client starts both runs. The -R flag changes which machine sends the bulk TCP data.

Run the forward and reverse tests

Start the server on the peer

Install iperf3 on both machines from your distribution’s package repository. The peer in this example has the wired address 192.168.50.20. Binding the listener to that address helps when the peer also has Wi-Fi up. Allow TCP port 5201 from the test machine if a local firewall blocks it, and stop the server with Ctrl+C when you’re done.

iperf3 -s -B 192.168.50.20

Run both commands on the board

Leave the server running and type these on the board. Both tests run for 20 seconds, with one TCP stream each. The client still connects to the peer when you add -R. Only the direction of the bulk data changes, so there’s no need to move the listener or open a second listening port on the board.

iperf3 -c 192.168.50.20 -t 20
iperf3 -c 192.168.50.20 -t 20 -R
Command on the board Bulk TCP data Where to look for received throughput
iperf3 -c 192.168.50.20 -t 20 Board to peer receiver summary, measured by the peer
iperf3 -c 192.168.50.20 -t 20 -R Peer to board receiver summary, measured by the board

Read the two results

Compare the receiver totals

Take the receiver bitrate from each end-of-test summary. The row labeled sender describes the sending endpoint, which switches from the board to the peer in the reverse test. If you record these as just “client speed” and “server speed,” the notes get hard to read pretty quickly. Mark them “board sends” and “board receives,” along with the negotiated speeds and the two iperf3 versions.

If one direction keeps coming back slower, look at TCP retransmissions in the sender summary and check interface counters on both machines before and after the run. One handy starting point is ip -s link show dev eth0 (substitute each machine’s wired interface). Counters cover everything on the interface, so a change during the run is easier to interpret when the rest of the link is quiet. A low result on its own won’t tell you which endpoint or part of the path held it back.

And if a single stream sits well below the line rate while a CPU core is busy, try the same direction once more with -P 4. Starting with iperf3 3.16, parallel streams run in separate threads. A better aggregate with four streams gives you a second data point. Keep it labeled separately so it doesn’t get mistaken for the speed a single TCP connection can sustain.

There’s a practical use for this when you set up a single-board server. If both iperf3 runs look healthy for the negotiated link and a file copy is still crawling, repeat the copy and check disk use and CPU load on both ends. SMB or SSH can add work that the TCP test doesn’t do.

FAQ

Does reverse mode make the board the server?

The board remains the client and opens the connection. With -R it receives the test data, and the peer listening on port 5201 sends it.

Can I measure both directions at once?

Use --bidir if your installed iperf3 supports it. Both endpoints then send and receive at the same time. Save that run separately so you can see what changes under simultaneous load.

The link rate includes capacity used by Ethernet framing and protocol overhead. TCP payload throughput also depends on the path and what both machines can sustain. Use the negotiated link rate as a ceiling when reading the result.

Sources

Related Products

Kiwipi-5Pro

KiwiPi 5 Pro

KiwiPi 5 Pro is powered by Rockchip RK3588 8-core 64-bit processor with 4 Cortex-A76 (2.2GHz), 4 Cortex-A55(1.8GHz), and an independent NEON coprocessor.

Get in Touch about Your Needs

Contact Us