SkillPilotAI

Bandwidth, throughput, latency, jitter and packet loss

Five numbers decide the quality of every network: bandwidth, throughput, latency, jitter and packet loss. Knowing what each one means, plus bufferbloat (latency rising under load), tells you whether a slow call is a speed problem or something else.

183.1 Why is it used?

  • Example: you pay for a 100 Mbps plan, the speed test shows 62 Mbps, and your video call breaks up whenever someone uploads a big file.
  • Is it speed or something else? Only these five separate metrics can answer that.
  • Every SLA, speed test and troubleshooting ticket talks in these terms.

183.2 What each metric means

MetricMeaningUnitMeasured with
BandwidthWidth of the pipe: max data the link can carry per second (your plan's 100 Mbps)bits/sPlan / link speed
ThroughputWater actually flowing: data really delivered per secondbits/siperf3
LatencyTime a packet takes source -> destination; ping shows RTT (round trip)msping, mtr
JitterVariation in latency between packetsmsiperf3 -u, ping mdev
Packet lossPacket never reached the destination%iperf3 -u, ping, mtr
  • Throughput is always <= bandwidth: Wi-Fi signal, protocol overhead and other traffic eat into it, so 62 of 100 Mbps is normal.
  • Latency comes from distance, processing in each router and waiting in queues.
  • Jitter: a call sends one voice packet every 20 ms; if they arrive at 40, 40, 75 ms the voice gets robotic until the app's jitter buffer re-times them.
  • Loss: full router queue, weak Wi-Fi or a faulty cable drops packets. TCP retransmits (download slows); UDP voice just loses that audio. Even 1% loss can cut TCP throughput a lot.
Latency: a packet's round trip
  1. 1.Laptop 192.168.1.10 sends a ping

  2. 2.Home router 192.168.1.1

  3. 3.ISP + internet (about 8 routers): distance, processing, queues

  4. 4.Server 8.8.8.8 replies

  5. 5.Reply travels back the same way

  6. 6.ping prints the whole journey as RTT in ms

183.3 Bufferbloat

  • A home router has a big buffer (queue). A backup upload fills the upload link and packets queue up.
  • Your video call's small packet waits behind that line: ping goes from 15 ms idle to over 200 ms under load.
  • Fix: smart queue management such as fq_codel or CAKE (covered with QoS in the next video).
Bufferbloat under load
  1. 1.Backup PC 192.168.1.11 starts a big upload

  2. 2.ISP upload link (10 Mbps) fills up

  3. 3.Home router's big buffer queues the packets

  4. 4.Video call packet from 192.168.1.10 waits at the back

  5. 5.Ping: 15 ms idle -> 200+ ms under load

Fix with fq_codel / CAKE, not with more bandwidth

183.4 How to measure

WhatTool
Throughput, jitter, lossiperf3 (TCP and UDP)
Latency, jitterping: avg and mdev
Loss and latency per hopmtr
Bufferbloatping during load, networkQuality responsiveness (macOS)

183.5 iperf3 TCP throughput

Lab: Docker server 192.168.203.10 and client 192.168.203.20 on the same bridge. Numbers are in Gbits because both containers are on one machine with no real cable.

Terminal
# server 192.168.203.10iperf3 -s# client 192.168.203.20iperf3 -c 192.168.203.10 -t 5iperf3 -c 192.168.203.10 -t 5 -Riperf3 -c 192.168.203.10 -t 5 -P 4iperf3 -c 192.168.203.10 -t 5 -b 10M
Output
$ iperf3 -c 192.168.203.10 -t 5Connecting to host 192.168.203.10, port 5201[ ID] Interval           Transfer     Bitrate         Retr  Cwnd[  5]   0.00-1.00   sec   364 MBytes  3.05 Gbits/sec  1120   1.50 MBytes[  5]   3.00-4.00   sec   516 MBytes  4.33 Gbits/sec    0   1.24 MBytes[  5]   0.00-5.01   sec  2.18 GBytes  3.74 Gbits/sec  2994             sender[  5]   0.00-5.01   sec  2.18 GBytes  3.74 Gbits/sec                  receiver
Output
$ iperf3 -c 192.168.203.10 -t 5 -P 4[ ID] Interval           Transfer     Bitrate         Retr[  5]   0.00-5.02   sec  1.86 GBytes  3.18 Gbits/sec                  receiver[  7]   0.00-5.02   sec  1.73 GBytes  2.96 Gbits/sec                  receiver[  9]   0.00-5.02   sec  2.04 GBytes  3.49 Gbits/sec                  receiver[ 11]   0.00-5.02   sec  1.88 GBytes  3.21 Gbits/sec                  receiver[SUM]   0.00-5.02   sec  7.51 GBytes  12.8 Gbits/sec                  receiver
Output
$ iperf3 -c 192.168.203.10 -t 5 -b 10M[ ID] Interval           Transfer     Bitrate         Retr  Cwnd[  5]   0.00-1.00   sec  1.25 MBytes  10.5 Mbits/sec    0    337 KBytes[  5]   1.00-2.00   sec  1.12 MBytes  9.44 Mbits/sec    0    337 KBytes[  5]   2.00-3.00   sec  1.12 MBytes  9.44 Mbits/sec    0    337 KBytes[  5]   0.00-5.01   sec  6.00 MBytes  10.0 Mbits/sec    0             sender[  5]   0.00-5.01   sec  6.00 MBytes  10.0 Mbits/sec                  receiver
RunResultLesson
-t 53.74 Gbits/sec, Retr 2994Retr column = TCP retransmissions
-R3.48 Gbits/secReverse: server sends, tests download
-P 4SUM 12.8 Gbits/secParallel streams fill the pipe better (speed tests do this)
-b 10M10.0 Mbits/sec, Retr 0Capped like an ISP plan: capacity is Gbits, throughput is the limit

183.6 iperf3 UDP: jitter and loss

Terminal
iperf3 -c 192.168.203.10 -t 5 -u -b 50Miperf3 -c 192.168.203.10 -t 5 -u -b 2G
Output
$ iperf3 -c 192.168.203.10 -t 5 -u -b 50M[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams[  5]   0.00-5.02   sec  29.6 MBytes  49.4 Mbits/sec  0.000 ms  0/21413 (0%)  sender[  5]   0.00-5.02   sec  27.1 MBytes  45.3 Mbits/sec  1.146 ms  1801/21413 (8.4%)  receiver
Output
$ iperf3 -c 192.168.203.10 -t 5 -u -b 2G[ ID] Interval           Transfer     Bitrate         Jitter    Lost/Total Datagrams[  5]   0.00-5.00   sec  34.4 MBytes  57.6 Mbits/sec  0.000 ms  0/24890 (0%)  sender[  5]   0.00-5.02   sec  28.3 MBytes  47.3 Mbits/sec  2.498 ms  4420/24890 (18%)  receiver
  • Read jitter and loss on the receiver line: 1.146 ms and 8.4% at 50M.
  • Loss here came from the 128 MB containers: the receiver could not read fast enough and its buffer overflowed.
  • Asking for 2G, the sender only managed 57.6 Mbits (CPU became the bottleneck); loss rose to 18% and jitter to 2.5 ms: under overload, loss and jitter grow together.

183.7 ping: latency, mdev and load

Terminal
ping -c 10 192.168.203.10iperf3 -c 192.168.203.10 -t 8 > /tmp/load.txt &ping -c 10 192.168.203.10
Output
$ ping -c 10 192.168.203.1064 bytes from 192.168.203.10: icmp_seq=1 ttl=64 time=3.66 ms64 bytes from 192.168.203.10: icmp_seq=10 ttl=64 time=0.103 ms--- 192.168.203.10 ping statistics ---10 packets transmitted, 10 received, 0% packet loss, time 9168msrtt min/avg/max/mdev = 0.102/0.480/3.664/1.061 ms
Output
$ iperf3 -c 192.168.203.10 -t 8 > /tmp/load.txt &$ ping -c 10 192.168.203.1064 bytes from 192.168.203.10: icmp_seq=1 ttl=64 time=0.110 ms64 bytes from 192.168.203.10: icmp_seq=10 ttl=64 time=0.231 ms10 packets transmitted, 10 received, 0% packet loss, time 9239msrtt min/avg/max/mdev = 0.069/0.109/0.231/0.044 ms--- background iperf3 result:[  5]   0.00-8.01   sec  3.62 GBytes  3.88 Gbits/sec  7420             sender[  5]   0.00-8.01   sec  3.62 GBytes  3.88 Gbits/sec                  receiver
  • mdev is a jitter-like number: one slow first reply (3.66 ms) pushed it to 1.061.
  • Under load the lab stayed at avg 0.109 ms because there is no slow link for a queue to build; on a small home upload link, a bloated router would clearly push ping up.

183.8 Common mistakes

  • Believing more bandwidth = fast: 200 Mbps + 100 ms feels slower for gaming/browsing than 50 Mbps + 10 ms.
  • Calling a 62 of 100 Mbps speed test "stolen" bandwidth: throughput is always lower.
  • Upgrading the plan to fix lag during uploads: that is bufferbloat, check ping during the upload.
  • Reading UDP loss on the sender line instead of the receiver line.

183.9 Interview tips

  • Bandwidth = max capacity of the link (bits/s); throughput = actual delivered rate, measured with iperf3; throughput <= bandwidth because of latency, loss, overhead and congestion.
  • Latency = journey time (ping shows RTT); jitter = variation in latency; loss = packet never arrived.
  • Bufferbloat = full queue raises latency under load; fix with fq_codel/CAKE.
  • Lag during an upload on a fast plan: diagnose with ping during the upload.