Calculate Network Latency
Network latency is the total time it takes for a packet to travel from the client to the server and back. It is the sum of four component delays:
The Four Delays
| Delay | What it is | Example |
|---|---|---|
| Propagation | Time for a bit to travel across the physical medium | 15ms (within a data center) to 80ms (across an ocean) |
| Transmission | Time to push all bits of the packet onto the wire | 2ms for a 1500-byte packet at 6 Mbps |
| Processing | Time for routers to inspect and forward the packet | ~1ms per hop |
| Queuing | Time spent waiting in router buffers when the network is congested | 3ms to 100ms+ under load |
Formula
one_way_delay = propagation + transmission + processing + queuing
round_trip_time = 2 × one_way_delayPractice Problem
A packet travels from New York to London and back. The link has a bandwidth of 1 Gbps. The packet is 1500 bytes. The propagation delay is 56ms each way. There are 5 router hops, each adding 0.5ms of processing and 2ms of queuing on average.
What is the round-trip time?
Solution:
- Transmission = 1500 × 8 / 1,000,000,000 = 0.012ms
- One-way = 56 + 0.012 + (5 × 0.5) + (5 × 2) = 56 + 0.012 + 2.5 + 10 = 68.5ms
- RTT = 2 × 68.5 = 137ms