Jitter buffers use per-packet timestamps to reorder out-of-sequence audio packets
High jitter can cause a later packet to arrive before an earlier one (packet reordering). A simple queue-only buffer fails here because it would play packets in arrival order, corrupting the audio. The fix is timestamping: the sender tags every audio packet with its position in the stream (either a packet index or a sample timestamp plus length). When packets land in the buffer, they are inserted at the correct position according to timestamp, not arrival order. The buffer can then re-sequence them before playback. Two timestamping strategies are common: (1) whole-packet indexing (packet 0, 1, 2, …) — simple but requires fixed packet sizes; (2) sample-offset + length — more flexible, allows arbitrary-length packets and mid-packet extraction.
Examples
Packet 2 arrives before packet 1 due to a routing anomaly. A non-timestamped buffer plays packet 2 first (wrong order, audible glitch). A timestamp-aware buffer holds packet 2 until packet 1 arrives and inserts it at the correct position, producing clean playback.
Assessment
Explain what goes wrong if a jitter buffer plays packets strictly in arrival order when the network has high jitter. Then describe the two timestamping approaches and identify one trade-off of whole-packet indexing versus sample-offset indexing.