iPerf3 UDP Testing: Bandwidth, Jitter, and Packet Loss

UDP mode measures what TCP hides: loss, jitter, and reordering. Real lab captures show a clean test, a 29% loss over-drive, and how to find the loss knee on any path.

iPerf3 UDP lab diagram: client 192.0.2.10 sends UDP through UDP-R1 to server 198.51.100.10; a 20 Mbit/s policer starts dropping between 18 and 20 Mbit/s, a 20 Mbit/s shaper raises jitter to 1

To run an iPerf3 UDP test, start iperf3 -s on the far host and run iperf3 -c <server> -u -b 20M on the near one. Then read the receiver line. Lost/Total Datagrams is your packet loss and Jitter is how unevenly the packets arrived. Leave out -b and iPerf3 sends just 1 Mbit/sec, which proves almost nothing.

TCP slows down when the network drops packets, so a TCP test tells you how fast the path is. UDP keeps sending at the rate you set, the way voice and video do. That makes it the test for loss, jitter and real-time capacity. Every output block below is real, from iperf 3.20 across a Cisco IOS XE 17.18.2 router built in my home lab. The router ran a 20 Mbit/s policer, then a 20 Mbit/s shaper, then a link failure. This article is part of our complete iPerf guide.

Lab Setup

One routed hop between two Linux hosts, so every change in loss or jitter has exactly one place to come from: interface Ethernet0/2 on the router, facing the server.

iPerf3 UDP lab diagram: client 192.0.2.10 sends UDP through UDP-R1 to server 198.51.100.10; a 20 Mbit/s policer starts dropping between 18 and 20 Mbit/s, a 20 Mbit/s shaper raises jitter to 11.773 ms, and a 10.8 s link outage cost 11,025 datagrams
Built in my home lab: the policer's exceeded counter (4,386) matched iPerf3's lost datagrams exactly, the shaper traded loss for jitter, and the outage shows up as 0/0 intervals followed by one burst of loss.
RoleAddressSoftware
Client192.0.2.10/24, gateway 192.0.2.1Linux, iperf 3.20
Router UDP-R1Et0/1 192.0.2.1, Et0/2 198.51.100.1Cisco IOS XE 17.18.2
Server198.51.100.10/24, gateway 198.51.100.1Linux, iperf 3.20

Ping RTT across the router was 1.29 ms on average. The base router config is two routed interfaces:

hostname UDP-R1
!
interface Ethernet0/1
 description TO-IPERF-CLIENT
 ip address 192.0.2.1 255.255.255.0
 no shutdown
!
interface Ethernet0/2
 description TO-IPERF-SERVER
 ip address 198.51.100.1 255.255.255.0
 no shutdown

The two Linux hosts, and the server started as a daemon with a log file. That log matters later, because only the server sees loss as it happens:

# client
sudo ip addr add 192.0.2.10/24 dev eth1
sudo ip route add 198.51.100.0/24 via 192.0.2.1

# server
sudo ip addr add 198.51.100.10/24 dev eth1
sudo ip route add 192.0.2.0/24 via 198.51.100.1
iperf3 -s -D --logfile /tmp/srv.log

With no QoS on the path, TCP reached 109 Mbits/sec. That is the ceiling of this router, and the number to stay well under when you want a clean UDP baseline.

How iPerf3 UDP Mode Works

The client first opens a TCP control connection to port 5201. Then it sends UDP datagrams at a steady rate, each one stamped with a sequence number and a send time. The server counts gaps in the sequence numbers to work out loss. For jitter, it compares send and arrival spacing using the smoothed RTP formula from RFC 3550, so the two clocks do not need to agree.

The important part is who measures what. The client only knows what it sent. Only the server knows what arrived. At the end of the test the server sends its numbers back, and the client prints them on the receiver line.

Step 1: The Default Rate Trap

Here is -u with no rate set:

client:~$ iperf3 -c 198.51.100.10 -u
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.000 ms  0/906 (0%)  sender
[  5]   0.00-10.00  sec  1.25 MBytes  1.05 Mbits/sec  0.043 ms  0/906 (0%)  receiver

iperf Done.

1.05 Mbits/sec, 906 datagrams, zero loss. It looks like a clean result, but on a path that carries 109 Mbits/sec of TCP you have tested one percent of it. Always set -b.

Step 2: A Clean UDP Test and How to Read It

client:~$ iperf3 -c 198.51.100.10 -u -b 10M
Connecting to host 198.51.100.10, port 5201
[  5] local 192.0.2.10 port 34169 connected to 198.51.100.10 port 5201
[ ID] Interval           Transfer     Bitrate         Total Datagrams
[  5]   0.00-1.00   sec  1.19 MBytes  10.0 Mbits/sec  865  
[  5]   1.00-2.00   sec  1.19 MBytes  10.0 Mbits/sec  863  
[  5]   2.00-3.00   sec  1.19 MBytes  9.99 Mbits/sec  863  
[  5]   3.00-4.00   sec  1.19 MBytes  10.0 Mbits/sec  864  
[  5]   4.00-5.00   sec  1.19 MBytes  9.98 Mbits/sec  862  
[  5]   5.00-6.00   sec  1.19 MBytes  10.0 Mbits/sec  864  
[  5]   6.00-7.00   sec  1.19 MBytes  10.0 Mbits/sec  863  
[  5]   7.00-8.00   sec  1.19 MBytes  10.0 Mbits/sec  864  
[  5]   8.00-9.00   sec  1.19 MBytes  10.0 Mbits/sec  863  
[  5]   9.00-10.00  sec  1.19 MBytes  9.99 Mbits/sec  862  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  11.9 MBytes  10.0 Mbits/sec  0.000 ms  0/8633 (0%)  sender
[  5]   0.00-10.00  sec  11.9 MBytes  10.0 Mbits/sec  0.021 ms  0/8633 (0%)  receiver

iperf Done.

How to read it:

  • Total Datagrams in the interval lines is what the client sent each second: about 863 datagrams of 1,448 bytes for 10 Mbits/sec. You will use that packets-per-second figure later to turn lost datagrams into seconds of outage.
  • The sender line always shows 0 ms jitter and 0% loss. The client cannot measure either, so treat it as a statement of intent.
  • The receiver line is the measurement: 0 of 8,633 lost and 0.021 ms jitter. This path carries 10 Mbit/sec of real-time traffic cleanly.

Step 3: Find the Loss Knee Under a Policer

Now the router polices traffic toward the server to 20 Mbit/s, the way a provider enforces a contracted rate:

policy-map POLICE-20M
 class class-default
  police cir 20000000 conform-action transmit exceed-action drop
!
interface Ethernet0/2
 service-policy output POLICE-20M

Then step the UDP rate up, 10 seconds per run, and record the receiver line each time:

OfferedReceivedJitterLost / TotalLoss
-b 10M10.0 Mbit/s0.043 ms0 / 8,6330%
-b 15M15.0 Mbit/s0.036 ms0 / 12,9510%
-b 18M18.0 Mbit/s0.048 ms0 / 15,5400%
-b 20M19.9 Mbit/s0.049 ms70 / 17,2660.41%
-b 22M19.9 Mbit/s0.060 ms1,795 / 18,9929.5%
-b 25M19.9 Mbit/s0.042 ms4,386 / 21,58320%
-b 30M19.9 Mbit/s0.072 ms8,701 / 25,89834%

Loss is zero up to 18 Mbit/s, starts at 20 (0.41%), and climbs fast after that. Received bandwidth flattens at 19.9 Mbit/s no matter how hard you push. That flat line is the signature of a policer. The knee sits between 18 and 20 Mbit/s, so on this path the usable real-time capacity is about 18 Mbit/s, not the 20 written in the contract.

You can prove the router caused the loss. Here are the policer counters straight after the 25 Mbit/s run:

show policy-map interface Ethernet0/2
 Ethernet0/2 

  Service-policy output: POLICE-20M

    Class-map: class-default (match-any)  
      21604 packets, 32162283 bytes
      5 minute offered rate 144000 bps, drop rate 16000 bps
      Match: any 
      police:
          cir 20000000 bps, bc 625000 bytes
        conformed 17213 packets, 25626492 bytes; actions:
          transmit 
        exceeded 4386 packets, 6535140 bytes; actions:
          drop 
        conformed 129000 bps, exceeded 16000 bps

The line to read is exceeded 4386 packets ... drop. iPerf3 reported 4386/21584 lost on that run. The numbers match to the packet, so every lost datagram was a policer drop and none were lost anywhere else.

What Happens When You Ask for Too Much

client:~$ iperf3 -c 198.51.100.10 -u -b 100M
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec   119 MBytes   100 Mbits/sec  0.000 ms  0/86336 (0%)  sender
[  5]   0.00-10.00  sec  23.7 MBytes  19.9 Mbits/sec  0.033 ms  69134/86331 (80%)  receiver

iperf Done.

The sender line says 100 Mbits/sec and 0% loss. The receiver line says 80% of the datagrams never arrived and only 19.9 Mbits/sec got through. This is the most misread iPerf3 output there is: glance at the wrong line and an over-driven test looks perfect. In UDP mode, quote the receiver line, always.

Test Both Directions with -R

The policer sits on the router's output toward the server, so it only touches client-to-server traffic. Reverse the test and the server sends to the client:

client:~$ iperf3 -c 198.51.100.10 -u -b 30M -R
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  35.8 MBytes  30.0 Mbits/sec  0.000 ms  0/25903 (0%)  sender
[  5]   0.00-10.00  sec  35.8 MBytes  30.0 Mbits/sec  0.044 ms  0/25900 (0%)  receiver

iperf Done.

30 Mbit/s with zero loss, while the forward direction lost 34% at the same rate. Loss on real links is often one-way: an upload policer, a congested uplink, a duplex problem on one side. A single-direction test can miss it completely.

Jitter: Policer vs Shaper

Jitter is the variation in packet spacing. Packets that leave every 1.16 ms and arrive every 1.16 ms have zero jitter, however long the trip. To see what creates it, the policer was replaced with a shaper at the same rate:

policy-map SHAPE-20M
 class class-default
  shape average 20000000
!
interface Ethernet0/2
 no service-policy output POLICE-20M
 service-policy output SHAPE-20M
OfferedPolicer: jitter / lossShaper: jitter / lossShaper receiver interval
-b 18M0.048 ms / 0%0.049 ms / 0.019%10.00 s
-b 20M0.049 ms / 0.41%11.773 ms / 2.4%10.42 s
-b 22M0.060 ms / 9.5%12.465 ms / 11%10.42 s
-b 30M0.072 ms / 34%11.770 ms / 35%10.42 s
client:~$ iperf3 -c 198.51.100.10 -u -b 20M     # shaper applied
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  5]   0.00-10.00  sec  23.8 MBytes  20.0 Mbits/sec  0.000 ms  0/17268 (0%)  sender
[  5]   0.00-10.42  sec  23.3 MBytes  18.7 Mbits/sec  11.773 ms  413/17268 (2.4%)  receiver

iperf Done.

Under the policer, jitter stayed between 0.04 and 0.07 ms. Excess packets were dropped on the spot and everything else went straight through. The shaper queues excess packets instead, so at 20 Mbit/s and above jitter jumped to between 11.8 and 12.5 ms. The receiver interval stretched to 10.42 seconds while the queue drained after the client stopped. Loss still appeared once the 64-packet queue filled: show policy-map interface showed queue limit 64 packets and 11,584 total drops across the four runs.

Rule of thumb: high loss with low jitter points to a policer or a hard limit. Rising jitter with modest loss points to a queue, which is a QoS design question more than a capacity one. As a rough guide, voice wants jitter under 30 ms, and anything under a few milliseconds is excellent. Our QoS guide covers where those queues live.

Failure and Recovery: Measuring an Outage with UDP

With QoS removed, a 25-second test ran at 10 Mbit/s. About 7 seconds in, Ethernet0/2 was shut down. It was brought back about 10 seconds later. The router log has the timeline:

*Nov 14 17:59:42.986: %LINK-5-CHANGED: Interface Ethernet0/2, changed state to administratively down
*Nov 14 17:59:43.986: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to down
*Nov 14 17:59:52.751: %LINK-3-UPDOWN: Interface Ethernet0/2, changed state to up
*Nov 14 17:59:53.751: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to up

The client output looked healthy the whole time, because the client only reports what it sent. The server log tells the real story:

server:~$ cat /tmp/srv.log   (excerpt)
[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams
[  6]   6.00-7.00   sec  1.19 MBytes  10.0 Mbits/sec  0.037 ms  0/863 (0%)  
[  6]   7.00-8.00   sec   414 KBytes  3.39 Mbits/sec  0.040 ms  0/293 (0%)  
[  6]   8.00-9.00   sec  0.00 Bytes  0.00 bits/sec  0.040 ms  0/0 (0%)  
[  6]   9.00-10.00  sec  0.00 Bytes  0.00 bits/sec  0.040 ms  0/0 (0%)  
...
[  6]  19.00-20.00  sec  0.00 Bytes  0.00 bits/sec  0.040 ms  0/0 (0%)  
[  6]  20.00-21.00  sec  1.06 MBytes  8.90 Mbits/sec  0.025 ms  11025/11793 (93%)  
[  6]  21.00-22.00  sec  1.19 MBytes  10.0 Mbits/sec  0.026 ms  0/863 (0%)  
- - - - - - - - - - - - - - - - - - - - - - - - -
[  6]   0.00-25.00  sec  14.6 MBytes  4.89 Mbits/sec  0.030 ms  11025/21583 (51%)  receiver

Read it carefully, because it is easy to get wrong:

  • From 8 to 20 seconds the server shows 0/0 (0%). That is not zero loss. Nothing arrived, so there were no sequence numbers to compare.
  • The whole outage is booked in one line, at 20 to 21 seconds: 11025/11793 (93%). The server counts lost datagrams when traffic returns and it sees the gap.
  • Turn loss into time: 11,025 lost datagrams at 863 per second is 12.8 seconds without forwarding.

The router log shows the interface down for 10.8 seconds, from administratively down at 17:59:42.986 to link up at 17:59:52.751. The stream was dark for about 2 seconds longer than that. Line protocol came up a second after the link, and the router then had to re-resolve the server's MAC address before forwarding. That gap is the number your users feel, and a UDP stream at a known packet rate measures it with no extra tools.

Finding Loss That TCP Hides

Next, 2% random loss was added on the client NIC with Linux netem (tc qdisc add dev eth1 root netem loss 2%). The router was clean, so this is pure path loss:

client:~$ iperf3 -c 198.51.100.10 -u -b 20M
[  5]   0.00-10.00  sec  23.8 MBytes  20.0 Mbits/sec  0.000 ms  0/17267 (0%)  sender
[  5]   0.00-10.21  sec  23.4 MBytes  19.2 Mbits/sec  0.050 ms  319/17267 (1.8%)  receiver

iperf Done.

client:~$ iperf3 -c 198.51.100.10
[  5]   0.00-10.00  sec  63.1 MBytes  52.9 Mbits/sec  1311            sender
[  5]   0.00-10.00  sec  63.0 MBytes  52.8 Mbits/sec                  receiver

iperf Done.

UDP reported 1.8% loss, close to the 2% configured. TCP never mentions loss at all. It just dropped from 109 to 52.9 Mbits/sec, with 1,311 retransmits in the Retr column. When a TCP test is mysteriously slow, a moderate UDP test like this one separates "the path is losing packets" from "something else is limiting TCP". We walk that decision tree in troubleshooting slow throughput.

Datagram Size: How Fragmentation Multiplies Loss

Same 2% netem loss, same 20 Mbit/s, three datagram sizes set with -l:

DatagramIP packets eachSentCounted by receiverReported lossReceived
-l 1400117,85917,8592%19.6 Mbit/s
-l 400036,2516,2515.7%18.9 Mbit/s
-l 800063,1262,16111%12.4 Mbit/s
client:~$ iperf3 -c 198.51.100.10 -u -b 20M -l 8000
warning: UDP block size 8000 exceeds TCP MSS 1448, may result in fragmentation / drops

A datagram larger than the MTU is split into fragments, and losing any one fragment loses the whole datagram. With three fragments, 2% packet loss became 5.7% datagram loss. With six it became 11%, which is what 1 − 0.98⁶ predicts. The 8,000-byte run is worse than its loss column admits. The client sent 3,126 datagrams, the receiver only counted 2,161, and goodput fell to 12.4 Mbit/s. When the sender and receiver totals disagree, trust the bitrate. With netem removed, the same 8,000-byte test ran clean (0/3126), so fragmentation only hurts when the path is already losing packets. Keep -l under the path MTU unless fragmentation is what you are testing.

Gotchas

⚠️
0/906 (0%) at 1.05 Mbits/sec is not a pass. Without -b, UDP mode sends 1 Mbit/sec. Set the rate you actually need to prove.
⚠️
0/0 (0%) in the server log means no data, not no loss. During a full outage the server has nothing to count. The loss appears in one interval when traffic returns.
⚠️
warning: UDP block size 8000 exceeds TCP MSS 1448, may result in fragmentation / drops iPerf3 is telling you each datagram will be fragmented. On a lossy path that multiplies the loss rate.
⚠️
unable to connect to server - server may have stopped running or use a different port, firewall issue, etc.: Connection refused UDP tests still need TCP 5201 for the control connection. A firewall that permits only UDP 5201 breaks the test before any UDP is sent.

Slow Network Throughput: A Troubleshooting Workbook

Included with PingLabz Pro · 14 pages · US Letter PDF

Choose the next test from the evidence you have. Measured Linux cases, a diagnostic decision table, practice exercises, and before/after incident worksheets.

Get Pro to download

UDP Flags That Matter

-u -b 20MUDP at a fixed 20 Mbit/sec. The default without -b is 1 Mbit/sec.
-l 1400Datagram size in bytes. Keep it under the path MTU so one datagram is one packet. The default here was 1,448 bytes.
-RServer sends, client receives. Loss is often one-way, so test both directions.
-t 60Run longer. A 10-second burst can miss intermittent loss.
-P 4 -b 5MFour parallel streams, each paced at 5 Mbit/sec. -b applies per stream, so this offers 20 Mbit/sec in total.
--timestampsPrefix every line with the wall-clock time, so you can line results up against router logs.
--logfile /tmp/srv.logOn the server, keep the per-interval receiver lines. That is where outages show up.
-JJSON output. The end.sum section carries jitter_ms, lost_packets and lost_percent for scripts.

A Practical UDP Test Recipe

  1. Run a TCP test first to find the ceiling: iperf3 -c <server>.
  2. Run UDP well under it for 30 seconds: iperf3 -c <server> -u -b 10M -t 30. You want zero loss and sub-millisecond jitter as a baseline.
  3. Step up in small increments (15, 18, 20, 22M) and note where loss starts. That knee is your usable real-time capacity.
  4. Repeat with -R. Check router policer or shaper counters if the knee lands near a round number.
  5. For an outage or failover test, run a long stream at a known rate with the server logging, then convert lost datagrams to seconds.

FAQ

What is a good packet loss and jitter result in iPerf3 UDP?

On a healthy LAN or a provisioned WAN, 0% loss and jitter well under 1 ms at your target rate. Voice tolerates roughly 1% loss and 30 ms jitter before quality drops. Here a clean 10 Mbit/s run showed 0 of 8,633 lost and 0.021 ms.

Why does the iPerf3 sender show 0% loss?

The client cannot see loss. It only knows what it sent. Loss and jitter come from the server and appear on the receiver line.

What is the default bandwidth for iPerf3 UDP?

1 Mbit/sec. In this lab, -u with no -b sent 1.05 Mbits/sec. Always set -b.

How do I test UDP in both directions?

Add -R to make the server send, or use --bidir to run both at once. A one-way policer here dropped 34% at 30 Mbit/s forward and 0% in reverse.

Why does my UDP test show high jitter but little loss?

Packets are waiting in a queue of varying depth, usually a shaper or a congested interface. A 20 Mbit/s shaper raised jitter from 0.05 to 11.8 ms here, while a policer at the same rate kept it under 0.1 ms.

Scope: IPv4 over one routed hop. Loss on the netem tests was added on the client NIC, not on the router.

Key Takeaways

  • Set -b and read the receiver line. The sender line said 0% while 80% of an over-driven test was dropped.
  • Step the rate to find the knee. A 20 Mbit/s policer was clean at 18 and lost 9.5% at 22, and its drop counter matched iPerf3's loss to the packet.
  • Loss with low jitter means a policer or hard limit. Jitter rising to 11.8 ms means a queue.
  • For outages, use the server log: 0/0 during the gap, then lost datagrams divided by packet rate gives the outage time (12.8 seconds here).

Next in the series: iPerf3 parallel streams and TCP window size, for when TCP is the slow one. For everything else iPerf can do, go back to the iPerf complete guide.

Read next