Prerequisites: network layers. Outcome: calculate a delay budget and distinguish slow delivery from insufficient capacity. Allow: 25 minutes, including the calculation lab.

Four different measurements

Bandwidth often refers to link capacity. State whether a number describes capacity, measured throughput, or useful application throughput. Useful application throughput is also called goodput; it excludes protocol overhead and repeated data. A 100 Mbps connection can have high latency. An application that needs 2 Mbps can still perform poorly on it because packets wait in queues.

State the endpoints of every delay

Round-trip time, or RTT, measures a journey to a peer and back. One-way delay measures a journey in one direction. The two directions can use different paths and experience different queue delays. Do not assume that measured RTT divided by two gives an accurate one-way measurement. Glass-to-glass latency starts at camera capture and ends at display. It includes encoding, network transfer, buffering, decoding, and rendering. A transport RTT excludes many of these stages. Measure elapsed time within one process with a monotonic clock. A monotonic clock does not jump when the wall clock changes. Comparing timestamps from different hosts requires clock synchronization and an estimate of its error.

Work through a streaming budget

These numbers are a teaching example, not a TeleQuick benchmark. Assume each listed stage adds sequentially to one frame’s delay. For a 100 ms target, this example leaves 10 ms of headroom. If the viewer buffer grows from 25 ms to 70 ms, the total becomes 135 ms. Making the relay one millisecond faster cannot recover that increase. Measure the stage that changed before choosing an optimization.

Serialization and queues

Serialization delay is the time needed to place a packet’s bits on a link. For a simplified 1,200-byte packet on a 10 Mbps link:
This example excludes lower-layer overhead. If 100 such packets wait ahead of it, they add about 96 ms of queue delay at that service rate. The cable did not become longer; the packet waited longer before transmission. A larger queue can reduce immediate drops while increasing delay. For live media, old data can become useless while it waits. The application therefore needs a policy for stale data, not only a larger buffer.

Jitter buffers trade delay for continuity

A jitter buffer holds incoming media briefly to absorb variation in arrival time. A larger buffer can tolerate more variation but delays playback. A smaller buffer reduces waiting but increases the chance that a packet misses its playback deadline. Neither choice is correct for every application. A recorded lecture and a live conversation can justify different delay targets. State the target before changing the buffer.

Loss and deadlines

Reliable delivery does not guarantee delivery before a deadline. A retransmitted message can arrive correctly after it is useful. Conversely, some media data remains useful after a brief retransmission delay. Choose a delivery policy from dependencies and deadlines, not just from whether the data is audio or video. For robot commands, transport reliability alone does not establish safe behavior. The application also needs command expiry, acknowledgments where appropriate, and behavior for lost communication. The robotics lesson discusses that distinction.

Lab: calculate the budget

Save this standard-library script as latency_lab.py:
Run python3 latency_lab.py, or py -3 latency_lab.py on Windows. The expected output is:
The script sends no traffic and changes no system settings. Delete the file when you finish, or retain it for your own budget calculations.

Exercise

  1. The relay-to-viewer delay increases by 20 ms. What is the new baseline total?
  2. Why does increasing link capacity sometimes leave glass-to-glass latency unchanged?
  3. Can a 40 ms RTT establish a 20 ms one-way delay?
  4. A 20 ms audio frame arrives 100 ms after its playback deadline. What should the playback policy consider?
  1. The total becomes 110 ms. It exceeds the 100 ms target by 10 ms.
  2. The delay can come from encoding, buffering, or rendering instead of a capacity bottleneck.
  3. No. The directions can be asymmetric. Use a suitable measurement method and state its uncertainty.
  4. Consider discarding the stale frame and concealing the gap. Playing it late can disrupt timing and increase delay.
Completion check: explain the difference between a measured RTT and an assumed stage delay in the example. Next: network inspection lab.