The Runtime Theory
easyReference#latency#rtt#delay-components

Calculate Network Latency from Component Delays

Given propagation, transmission, processing, and queuing delays, calculate the total one-way delay and round-trip time.

The Runtime Theory Team1 min read
Solve it

Solving happens on the judge — come back and mark it done

Sample cases

inpropagation=15ms, transmission=2ms, processing=1ms, queuing=3ms

out~21ms one-way, ~42ms RTT

inpropagation=80ms, transmission=0.5ms, processing=0.1ms, queuing=1ms

out~81.6ms one-way, ~163.2ms RTT

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

DelayWhat it isExample
PropagationTime for a bit to travel across the physical medium15ms (within a data center) to 80ms (across an ocean)
TransmissionTime to push all bits of the packet onto the wire2ms for a 1500-byte packet at 6 Mbps
ProcessingTime for routers to inspect and forward the packet~1ms per hop
QueuingTime spent waiting in router buffers when the network is congested3ms to 100ms+ under load

Formula

plaintext
one_way_delay = propagation + transmission + processing + queuing
round_trip_time = 2 × one_way_delay

Practice 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

Read: What Is a Network?

More practice in this topic

One dispatch a week

The trace behind each problem, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save