CallMeter Docs

Average Packet Spacing

Average time between consecutive RTP packets in a 2-second window — validates consistent pacing and reveals systematic timing offsets.

Average Packet Spacing

PropertyValue
Keyavg_packet_spacing
UnitMilliseconds (ms)
TypeGauge
DirectionReceive

What It Measures

Average Packet Spacing calculates the mean time gap between consecutive RTP packets within a 2-second measurement window. For a well-behaved audio stream with 20ms packetization, the average should be very close to 20ms. Deviations from the expected value indicate systematic timing issues.

While Max Packet Spacing and Min Packet Spacing show the extremes, average spacing shows the typical behavior. Think of it as the "normal" gap between packets, smoothing out the occasional outlier.

Why It Matters

Average packet spacing is the most straightforward validation that the media stream is paced correctly:

  • Codec validation — The average spacing should match the codec's packetization interval. A G.711 stream at 20ms ptime should show approximately 20ms average spacing. If it shows 40ms, the ptime is wrong or packets are being dropped.
  • Stream health indicator — A stable average spacing near the expected value confirms that the sender is transmitting at the right rate and the network is delivering consistently.
  • Systematic offset detection — If average spacing is consistently 22ms instead of 20ms for a 20ms codec, the sender's clock may be slightly slow, or there is a systematic delay being added in the network.
  • Packet loss impact — When packets are lost, the receiver sees a larger gap for the lost packet and a normal gap for the next received packet. High loss rates pull the average spacing upward.

How CallMeter Measures It

CallMeter measures the arrival time of every RTP packet and calculates the inter-packet spacing for each consecutive pair. The average of all spacings within each 2-second measurement window is reported as the gauge value.

Thresholds

Expected average spacing should be close to the codec's packetization interval:

CodecPtimeExpected Avg Spacing
G.711 (20ms ptime)20ms19-21ms
Opus (20ms ptime)20ms19-21ms
Opus (40ms ptime)40ms39-41ms
DeviationInterpretation
Within 5% of ptimeNormal
5-15% above ptimePacket loss inflating the average
15%+ above ptimeSignificant loss or wrong ptime
Below ptimePackets bunching; duplicates may be present

What Causes Unexpected Average Spacing

  • Average higher than expected — Packet loss removes packets from the stream, increasing the apparent spacing. Also possible: the sender is using a larger ptime than configured.
  • Average lower than expected — Duplicate packets or FEC packets arriving between regular packets reduce the apparent spacing.
  • Average drifts over time — Clock drift between sender and receiver causes the effective packet rate to slowly diverge from the expected rate.
  • Average is exactly double the expected value — Every other packet is being lost, or the sender is running at half the expected rate.

How to Fix It

  1. Compare against expected ptime. If average spacing matches the configured packetization interval, the stream is healthy. If not, investigate.
  2. Check for loss. If average spacing is higher than expected, calculate how much loss would explain the increase. Compare with Packet Loss Rate.
  3. Verify codec configuration. If average spacing is exactly double or half the expected value, the packetization interval may be misconfigured.
  4. Monitor stability. A stable average spacing that slowly drifts may indicate Clock Drift between sender and receiver.

The Three Spacings Together

Average, min, and max spacing together tell the complete pacing story. If all three are near the expected ptime, the stream is perfectly paced. If average is normal but min and max are far apart, the stream has high jitter but averages out. If all three are offset from the expected ptime, there is a systematic issue.

On this page