Skip to content

Iperf – Reference

cpx May 26, 2026 4 min read IPERF/5201

Version: iperf 3.x (not backward-compatible with iperf 2.x)

Purpose: Network bandwidth measurement — TCP, UDP, SCTP

Model: Client → Server (server must be running first)

Default port: 5201 (iperf3) / 5001 (iperf2)


Quick Start

# Server
iperf3 -s

# Client (basic TCP test)
iperf3 -c <server_ip>

# UDP test
iperf3 -c <server_ip> -u

# Reverse mode (server sends, client receives)
iperf3 -c <server_ip> -R

# Bidirectional
iperf3 -c <server_ip> --bidir

Server Options

ShortLongDefaultDescription
-s--serverRun in server mode
-D--daemonoffRun as daemon
-I--pidfile=FILEWrite PID to file
-1--one-offoffHandle one client, then exit
-p--port=N5201Listen on port N
-B--bind=ADDRallBind to specific IP/interface
--idle-timeout=NSeconds idle before server exits

Client Options

Connection

ShortLongDefaultDescription
-c--client=HOSTConnect to HOST
-p--port=N5201Server port
-B--bind=ADDRautoBind to local IP
--cport=NautoBind to local port
--connect-timeout=MSConnection timeout (ms)
-4--version4Force IPv4
-6--version6Force IPv6
-S--tos=N0Set IP TOS / DSCP field

Test Parameters

ShortLongDefaultDescription
-t--time=N10Duration in seconds
-n--bytes=NBytes to transmit (overrides -t)
-k--blockcount=NBlocks to transmit (overrides -t, -n)
-l--length=N128K (TCP) / 1460 (UDP)Read/write buffer length
-P--parallel=N1Number of parallel streams
-R--reverseoffReverse mode (server → client)
--bidiroffBidirectional test
-w--window=NautoTCP window / socket buffer size
-M--set-mss=NautoSet TCP maximum segment size
-N--no-delayoffDisable Nagle (low-latency)
-i--interval=N1Report interval (seconds, 0 = disable)

Protocol

ShortLongDescription
(default)TCP test
-u--udpUDP test
--sctpSCTP test

Bandwidth Control

ShortLongDefaultDescription
-b--bitrate=N[KMG]0 (TCP) / 1M (UDP)Target bitrate
--pacing-timer=N1000 µsPacing timer for -b
--fq-rate=N[KMG]0Fair-queue rate (Linux)

Suffixes: K = Kbits/s · M = Mbits/s · G = Gbits/s. Append / for bytes: 10M/ = 10 MB/s

Output Control

ShortLongDefaultDescription
-f--format=[kmgtKMGT]autok/m/g/t (bits) · K/M/G/T (bytes)
-V--verboseoffDetailed output
-J--jsonoffJSON output
--logfile=FILELog to file
--timestamps[=FMT]offAdd timestamps
--get-server-outputoffInclude server-side results

Advanced

ShortLongDefaultDescription
-Z--zerocopyoffZero-copy (sendfile) — reduces CPU
-O--omit=N0Omit first N seconds (TCP warmup)
-T--title=STRPrefix output with title
-C--congestion=ALGOsystem defaultTCP congestion algorithm
-A--affinity=NSet CPU affinity

UDP-Specific Metrics

MetricDescription
BitrateActual throughput
JitterPacket delay variation (ms)
Lost/TotalPackets lost vs. sent
Loss %Packet loss percentage
Out-of-OrderPackets received out of order

Output Columns

ColumnDescription
IntervalTime window
TransferData transferred
BitrateThroughput
RetrTCP retransmissions
CwndTCP congestion window size
JitterPacket delay variation (UDP)
Lost/TotalPacket loss (UDP)

JSON Output

iperf3 -c server -J | jq '.end.sum_sent.bits_per_second'
PathDescription
.start.connected[0]Connection info
.intervals[N].sumPer-interval summary
.end.sum_sentTotal sender stats
.end.sum_receivedTotal receiver stats
.end.cpu_utilization_percentCPU usage
.end.sender_tcp_congestionCongestion algorithm

TCP Congestion Algorithms (-C)

AlgorithmDescription
cubicDefault on Linux — good for most networks
bbrGoogle BBR — optimized for high BDP paths
renoClassic loss-based
htcpHigh-speed variant
vegasDelay-based
dctcpData Center TCP (ECN-based)

List available: sysctl net.ipv4.tcp_available_congestion_control


Common Recipes

# === Basic Tests ===

# TCP throughput (10s default)
iperf3 -c server

# TCP 60s, omit 5s warmup
iperf3 -c server -t 60 -O 5

# UDP at 500 Mbps
iperf3 -c server -u -b 500M

# UDP jitter/loss at 10 Mbps for 30s
iperf3 -c server -u -b 10M -t 30

# === Parallel & Bidirectional ===

# 4 parallel streams (saturate link)
iperf3 -c server -P 4

# Bidirectional simultaneous
iperf3 -c server --bidir

# Reverse (measure download)
iperf3 -c server -R

# === Window & Buffer Tuning ===

# TCP window 4MB (high-latency path)
iperf3 -c server -w 4M

# Jumbo frame MSS
iperf3 -c server -M 8960

# === Performance ===

# Zero-copy (reduce CPU)
iperf3 -c server -Z

# Set CPU affinity
iperf3 -c server -A 0

# Compare congestion algorithms
iperf3 -c server -C cubic -t 30 -T "CUBIC"
iperf3 -c server -C bbr -t 30 -T "BBR"

# === Specific Scenarios ===

# Verify Gigabit link (~940 Mbps)
iperf3 -c server -t 30 -P 4 -O 3

# Test 10G link
iperf3 -c server -P 8 -Z -t 30 -O 5

# Test WiFi download
iperf3 -c server -R -t 30

# Test VPN throughput
iperf3 -c vpn-server -t 60 -P 2 -O 5

# Test jumbo frames (MTU 9000)
iperf3 -c server -u -b 1G -l 8972

# Simulate WAN bandwidth
iperf3 -c server -b 50M -t 30

# === Output ===

# JSON output
iperf3 -c server -J > results.json

# JSON + server output
iperf3 -c server -J --get-server-output > results.json

# Format as Megabytes
iperf3 -c server -f M

# Log to file
iperf3 -c server --logfile /tmp/iperf.log

# Quick health check (JSON, extract Mbps)
iperf3 -c server -t 5 -J | jq '.end.sum_received.bits_per_second / 1000000 | round'

# === Multiple Ports (parallel server instances) ===

iperf3 -s -p 5201 &
iperf3 -s -p 5202 &
iperf3 -s -p 5203 &

iperf3 vs iperf2

Featureiperf3iperf2
Default port52015001
JSON outputYes (-J)No
BidirectionalYes (--bidir)Yes (-d)
ReverseYes (-R)No
Multi-client serverNo (single client)Yes
SCTPYesNo
Zero-copyYes (-Z)No
Congestion algoYes (-C)No
MulticastNoYes
Omit warmupYes (-O)No
Protocol compatibleNoNo

Key: iperf3 handles one client at a time. For concurrent tests, run multiple server instances on different ports.


Troubleshooting

SymptomCauseFix
unable to connectServer not running / firewallCheck process, open port 5201
Very low TCP throughputSmall window / high RTTIncrease -w window
High retransmissionsCongestion / packet lossCheck cable/switch, try -C bbr
UDP loss > 1%Exceeds link capacityReduce -b bitrate
busy errorAnother client connectedWait or use different -p port
CPU-boundSoftware overheadUse -Z zero-copy, -A affinity
Inconsistent resultsTCP warmupUse -O 3 to omit warmup

Firewall Rules

# Linux (firewalld)
firewall-cmd --add-port=5201/tcp --permanent
firewall-cmd --add-port=5201/udp --permanent
firewall-cmd --reload

# Windows
netsh advfirewall firewall add rule name="iperf3" dir=in action=allow protocol=tcp localport=5201
netsh advfirewall firewall add rule name="iperf3-udp" dir=in action=allow protocol=udp localport=5201

Size Suffixes

SuffixMeaning (bitrate -b)Meaning (size -w, -l, -n)
KKbits/s (1000)KBytes (1024)
MMbits/s (1000²)MBytes (1024²)
GGbits/s (1000³)GBytes (1024³)

Append / to -b for bytes: -b 10M/ = 10 MB/s = 80 Mbps


Source: man iperf3(1) · iperf.fr · github.com/esnet/iperf

0 0 votes
Article Rating
guest

0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x