Tip: type a SIP code like 488, or a problem like one-way audio. Use ↑ ↓ and Enter.

Call quality

Jitter, Latency and Packet Loss: How to Measure and Fix Them for VoIP

On this page
  1. What each one is, and the targets
  2. How to measure them
  3. Common causes and fixes
  4. Jitter buffers and packet loss concealment
  5. Symptoms, likely causes and fixes

For good VoIP calls, keep one-way mouth-to-ear delay under about 150 ms, jitter under 30 ms and packet loss under 1%. Delay makes people talk over each other, jitter and loss make speech choppy or robotic, and the most common cause of all three on business networks is a congested upload link.

What each one is, and the targets

MetricWhat it measuresTargetWhat users hear
Latency (one-way)Time from the speaker's mouth to the listener's ear< 150 msPauses, talking over each other, a walkie-talkie feel
JitterVariation in packet arrival times< 30 msChoppy, robotic or warbling speech
Packet lossPackets that never arrive, or arrive too late to play< 1%Missing syllables, clipped words, gaps

The 150 ms figure comes from ITU-T G.114, which says most applications are not significantly affected below that one-way delay and treats 400 ms as an upper limit for network planning. The jitter and loss thresholds are industry rules of thumb, not standards: what users tolerate depends on the codec, the jitter buffer and whether losses come singly or in bursts.

Latency is more than the network

Mouth-to-ear delay builds up along the whole chain, so the network's share is smaller than 150 ms suggests:

  • Packetisation: the phone collects 20 ms of audio before sending a packet, so 20 ms at the usual setting.
  • Codec delay: effectively zero for G.711, 15 ms for G.729 (a 10 ms frame plus 5 ms look-ahead).
  • Network transit: depends on distance and routing. A 120 ms ping means roughly 60 ms each way if the path is symmetric.
  • Jitter buffer: usually tens of milliseconds, more on unstable networks.
  • Endpoint processing: small on desk phones, often larger on softphones and Bluetooth headsets.

So a 120 ms round trip, 20 ms packetisation and a 40 ms buffer put you near 120 ms one way before the endpoints add anything.

Jitter

Phones send a packet every 20 ms. If they arrive 20, 22, 45, 3 and 20 ms apart, the variation is jitter. RTP endpoints calculate it as defined in RFC 3550: a running average of the change in transit time between consecutive packets, smoothed with a factor of 1/16. RTCP reports carry jitter in RTP timestamp units, so divide by 8 to get milliseconds for codecs with an 8 kHz RTP clock (G.711, G.729 and, because of a quirk in its definition, G.722), or by 48 for Opus.

Packet loss

Loss includes packets dropped in the network and packets that arrive after the jitter buffer has already played their slot. The second kind never appears in network monitoring, only in endpoint statistics, which is how a clean ping and a choppy call can coexist. Bursts hurt more than the same percentage spread evenly: concealment can hide a single missing 20 ms frame, but not five in a row.

How to measure them

ping: round-trip time and a rough jitter figure

ping -c 100 -i 0.2 sip.example.net    # Linux
ping -n 100 sip.example.net           # Windows

Ping measures round-trip time, not one-way delay; halving it is a fair estimate only when the path is symmetric, and true one-way measurement needs tightly synchronised clocks at both ends. Look at the spread as well as the average: Linux prints min/avg/max/mdev, and a wide min-to-max gap or a high mdev points to jitter. Routers often deprioritise ICMP, so treat ping as a hint, not a verdict.

mtr: where the loss starts

mtr -rwbc 200 sip.example.net

-r prints a report, -w uses wide output, -b shows both hostnames and IP addresses, and -c 200 sends 200 probes per hop. Add -u to probe with UDP if ICMP is filtered. Run it while calls are bad, and in both directions if you can (from a server near the PBX back to your office).

Read loss from the bottom up. Many routers rate-limit the ICMP replies they generate, so a middle hop can show 30% loss while every hop after it shows 0%. That is not real loss: traffic is clearly passing through that router. Real loss starts at a hop and continues all the way to the destination. The same applies to a latency spike on one middle hop that doesn't carry on to later hops.

iperf3: a voice-like UDP test

iperf3 -s                                                 # far-end server
iperf3 -c server.example.net -u -b 1M -l 200 -t 60        # upload test
iperf3 -c server.example.net -u -b 1M -l 200 -t 60 -R     # download test
  • -u uses UDP, like RTP. TCP retransmits lost packets, which hides exactly what you want to see.
  • -b 1M sets the target rate to 1 Mbps. Size it to your expected voice load.
  • -l 200 sends 200-byte datagrams, close to a G.711 RTP packet. At 1 Mbps that is 625 packets per second, about the packet rate of 12 simultaneous calls at 20 ms.
  • -t 60 runs for 60 seconds; -R reverses the direction so the server sends.

The summary shows jitter and lost/total datagrams measured at the receiver. You need an iperf3 server you control, ideally near your PBX or SIP provider, with TCP and UDP port 5201 open. The most revealing test is under load: start a large upload, repeat the UDP test, and compare.

Wireshark RTP stream analysis

Capture at the receiving end of the direction that sounds bad (see the capture guide). Open Telephony → RTP → RTP Streams, select a stream and click Analyze. Wireshark shows lost packets (from sequence number gaps), the maximum delta between packets, and mean and maximum jitter. If the capture has no SIP, enable the rtp_udp heuristic under Analyze → Enabled Protocols so Wireshark recognises the RTP.

Don't stop at average jitter: a maximum delta of 200 ms in a 20 ms stream is a fifth of a second of silence, even if the average looks fine.

Endpoint and PBX statistics

Phones, SBCs and PBXs exchange RTCP reports with loss, jitter and round-trip time for every call. Most desk phones show them during a call under a status or call-information screen, and on Asterisk pjsip show channelstats lists them for active calls. They are the most useful figures available, because they include late packets the jitter buffer discarded. Enter them in the MOS calculator to see which factor is costing the most quality.

Common causes and fixes

  • Uplink saturation. Backups, cloud sync and video uploads fill the upload queue. Fix it with QoS and shaping at the WAN edge, as described in VoIP QoS and DSCP explained.
  • Bufferbloat. Oversized buffers in modems and routers let a queue grow to hundreds of milliseconds instead of dropping packets early. Test by pinging during a large upload: if the round trip jumps from 15 ms to several hundred, you have it. Shape below the line rate with fq_codel or CAKE.
  • Wi-Fi. Interference, retransmissions, roaming and client power saving all add jitter and loss. Wire desk phones; for mobile users, prefer 5 GHz with WMM and strong coverage.
  • Cabling and duplex mismatch. A damaged patch lead, or a port forced to full duplex facing one on auto-negotiation (which then falls back to half duplex), causes errors that grow with load. Check interface counters for CRC errors and late collisions, and leave both ends on auto.
  • LTE and 5G. Cell load and radio scheduling make latency and jitter swing from minute to minute. Fine as a backup, ideally with Opus and FEC.
  • Distant servers. A PBX or SIP provider on another continent adds fixed delay no tuning removes. Choose a nearby point of presence and avoid hair-pinning media through a remote data centre or VPN.
  • Overloaded devices. A router, firewall or PBX near full CPU (VPN encryption, transcoding, deep packet inspection) adds jitter.

Jitter buffers and packet loss concealment

Every receiver holds incoming packets briefly in a jitter buffer, then plays them out at a steady pace. The trade-off is unavoidable: a deeper buffer absorbs more jitter but adds delay, and any packet that arrives after its play-out time is discarded and counted as loss.

  • Fixed buffers keep a constant depth, say 60 ms: predictable, but too shallow for a bad network and needlessly deep on a good one.
  • Adaptive buffers track jitter and grow or shrink, usually adjusting during silences so the change is not heard. Most modern phones and softphones use them, and many let you set limits.

When a packet is missing, packet loss concealment (PLC) fills the gap, typically by stretching or repeating the previous audio. G.711 Appendix I defines a PLC algorithm, and codecs such as G.729 and Opus have concealment built in. Opus can also carry in-band forward error correction (FEC), a low-bitrate copy of the previous frame, so an isolated lost packet can be rebuilt. PLC copes well with occasional single losses and poorly with bursts. It hides loss; it does not fix it. The codec comparison covers which codecs cope best.

Symptoms, likely causes and fixes

SymptomLikely causeFix
People talk over each other, long pausesHigh latency: distant server, VPN hair-pin, mobile data, oversized jitter bufferUse a nearer PoP, route media directly, cap the jitter buffer
Choppy or robotic speechJitter or loss, often a saturated uplinkQoS with shaping on the WAN edge; test with iperf3 under load
Words or syllables missingPacket loss, especially burstsFind where loss starts with mtr; check Wi-Fi and cabling
Fine off-peak, bad at busy timesCongestion on your link or in the ISPShaping and QoS; if loss starts beyond your router, escalate with mtr evidence
Quality drops when someone uploadsBufferbloatShape below line rate with fq_codel or CAKE
Only Wi-Fi users affectedInterference, roaming or power savingWire phones; 5 GHz, WMM, better coverage
Only one desk affectedBad cable, duplex mismatch, faulty portCheck port error counters, swap the patch lead
Echo of your own voiceAcoustic echo or a PSTN gateway, made obvious by delayReduce delay; check headsets, handsfree volume and gateway echo cancellation
One side hears nothing at allNot jitter or loss: NAT or firewallSee fixing one-way audio

Measure first, then fix the biggest factor. Packet loss usually does the most damage, so fix it before chasing a few milliseconds of latency.

Try the MOS Call Quality Estimator

Estimate MOS and R-factor from latency, jitter, packet loss and codec, with tips to fix bad calls.

Keep reading