Search

Search papers and lessons

Network Latency

Level 1 · 11 min read

Network latency is how long a message takes to get from sender to receiver, made of distance, sending time, processing and waiting in queues.

On this page

  • Colour = topic mix
  • Algorithms
  • Networking
  • ReadReady to readNot yet

TL;DR

Network latency is the time a message takes to travel from sender to receiver. It is measured in time, not in how much data can move per second. A message's latency adds up four parts: the time the signal spends travelling the distance, the time needed to push the message onto each link, the time routers spend handling it, and the time it waits in queues behind other traffic. Latency is what a person feels as lag, and a round trip, such as a request and its reply, costs about twice the one-way figure.

Builds on: Queue · Leads to: Transmission Control Protocol, Congestion Control

Where it's used

Video calls and voice. A phone conversation feels natural only when each side hears the other quickly. Telephone planning guidance has long cited about 150 milliseconds of one-way delay as the point where talk starts to feel strained, so calling software tries to keep its delay well below that.

Online games. A game client sends the player's moves to a server and waits for the result to come back. The round-trip latency sets how soon the player sees their own action confirmed, so a few tens of extra milliseconds can be felt.

Financial trading. Firms that trade on electronic exchanges place their computers physically close to the exchange's servers. Shortening the distance is the only way to cut the propagation part of latency, which is why the work is measured in microseconds.

Satellite links. A satellite in geostationary orbit is about 35,786 kilometres above the equator. A signal going up to it and back down to another place on Earth covers about 71,572 kilometres, which takes at least about 240 milliseconds one way before any processing or queueing. That is why satellite internet has a noticeable delay, even when its data rate is high.

How it works

Follow one 1,000-byte message from a sender to a receiver across three links. The sender and receiver are connected through two routers, R1 and R2, so the path is sender to R1, R1 to R2, and R2 to receiver. Each link is a 500-kilometre optical fibre. Light in fibre travels at about 200,000 kilometres per second, which is slower than in a vacuum. Each link moves 1,000,000 bytes per second. Each router takes 0.5 milliseconds to process a message. Suppose a message waits 4 milliseconds in R1's Queue behind other traffic, and nothing waits at R2.

  1. Send the message across the first link. The message is 1,000 bytes and the link moves 1,000,000 bytes per second, so sending takes 1,000÷1,000,000=0.0011{,}000 \div 1{,}000{,}000 = 0.001 seconds, or 1 millisecond. The signal then travels 500 kilometres, which takes 500÷200,000=0.0025500 \div 200{,}000 = 0.0025 seconds, or 2.5 milliseconds. Check: the first link costs 3.5 milliseconds in total.

  2. Process at R1 and wait in its queue. R1 spends 0.5 milliseconds handling the message and then waits 4 milliseconds behind other messages. Check: R1 adds 4.5 milliseconds.

  3. Send across the second link. Sending takes another 1 millisecond, and the signal takes another 2.5 milliseconds. Check: the second link costs 3.5 milliseconds, the same as the first, because the distance and the link speed are the same.

  4. Process at R2. R2 spends 0.5 milliseconds and has no queue. Check: R2 adds 0.5 milliseconds.

  5. Send across the third link. Another 3.5 milliseconds. Check: the three links together cost 3×3.5=10.53 \times 3.5 = 10.5 milliseconds.

  6. Add the parts. The one-way latency is 10.5+4.5+0.5=15.510.5 + 4.5 + 0.5 = 15.5 milliseconds. Of that, 7.5 milliseconds is travel through fibre, 3 milliseconds is sending onto the links, 1 millisecond is router processing and 4 milliseconds is queueing. Check: 7.5+3+1+4=15.57.5 + 3 + 1 + 4 = 15.5.

  7. Find the round trip. If the reply is short and returns the same way with no queue, its one-way time is 3+7.5+1=11.53 + 7.5 + 1 = 11.5 milliseconds, so the round trip is 15.5+11.5=2715.5 + 11.5 = 27 milliseconds. Check: the round trip is not simply twice 15.5, because the reply here has no queue.

flowchart LR
    S["Sender"] -->|"500 km, 1 ms to send"| R1["Router R1, 4 ms queue"]
    R1 -->|"500 km, 1 ms to send"| R2["Router R2"]
    R2 -->|"500 km, 1 ms to send"| D["Receiver"]

The math

Let did_i be the length of link ii, ss the speed of the signal in that medium, LL the message size, RiR_i the rate of link ii, pjp_j the processing time at router jj and qjq_j its queueing time. The one-way latency is

D=∑i(dis+LRi)+∑j(pj+qj).D = \sum_{i} \left( \frac{d_i}{s} + \frac{L}{R_i} \right) + \sum_{j} \left( p_j + q_j \right).
Definition: One-way network latency

The one-way latency DD is the sum, over every link on a path, of the propagation time di/sd_i / s and the transmission time L/RiL / R_i, plus the processing and queueing time at every router on the path. A round trip is the one-way latency in each direction added together, Dforward+DbackD_{\text{forward}} + D_{\text{back}}.

Step 1 in symbols: propagation

The propagation time of one link is di/sd_i / s. With di=500d_i = 500 kilometres and s=200,000s = 200{,}000 kilometres per second, it is 500÷200,000=0.0025500 \div 200{,}000 = 0.0025 seconds. It does not depend on the message size, and no amount of extra bandwidth changes it.

Step 2 in symbols: transmission

The transmission time of one link is L/RiL / R_i. With L=1,000L = 1{,}000 bytes and Ri=1,000,000R_i = 1{,}000{,}000 bytes per second, it is 0.0010.001 seconds. A router that stores a whole message before forwarding it pays this cost once per link, which is why the sum in the formula runs over all links. (The store-and-forward idea is described in Packet Switching.)

Step 3 in symbols: the sum

With three links, ∑i(di/s+L/Ri)=3×(0.0025+0.001)=0.0105\sum_i (d_i/s + L/R_i) = 3 \times (0.0025 + 0.001) = 0.0105 seconds. The routers contribute ∑j(pj+qj)=(0.0005+0.004)+0.0005=0.005\sum_j (p_j + q_j) = (0.0005 + 0.004) + 0.0005 = 0.005 seconds. The total is 0.0105+0.005=0.01550.0105 + 0.005 = 0.0155 seconds, or 15.5 milliseconds, as in the walkthrough.

Worked examples

Example
1. A tiny case: one link, no queue

A 500-byte message crosses one 200-kilometre fibre at a link rate of 500,000 bytes per second, with no routers.

  1. Propagation: 200÷200,000=0.001200 \div 200{,}000 = 0.001 seconds, which is 1 millisecond.
  2. Transmission: 500÷500,000=0.001500 \div 500{,}000 = 0.001 seconds, which is 1 millisecond.
  3. Total one-way latency: 1+1=21 + 1 = 2 milliseconds.
  4. Interpretation: on a short path, both parts are small and about equal. Doubling the link rate would cut the transmission part to 0.5 milliseconds and leave the propagation at 1 millisecond.
Example
2. The standard case: the three-link trace (standard)

This is the path from "How it works": three links of 500 kilometres each, a 1,000-byte message, a link rate of 1,000,000 bytes per second, two routers with 0.5 milliseconds of processing each, and 4 milliseconds of queueing at R1.

  1. Transmission: three links at 1 millisecond each give 3 milliseconds.
  2. Propagation: three links at 2.5 milliseconds each give 7.5 milliseconds.
  3. Processing: two routers at 0.5 milliseconds each give 1 millisecond.
  4. Queueing: 4 milliseconds at R1.
  5. One-way total: 3+7.5+1+4=15.53 + 7.5 + 1 + 4 = 15.5 milliseconds.
  6. Interpretation: the largest single part is propagation, which no router setting can change. The queue is the only part that depends on traffic, and it can grow much larger than 4 milliseconds under load.
Example
3. A realistic case: a satellite hop

A message goes from a ground station to a geostationary satellite and down to a second ground station, a total of about 71,572 kilometres of radio path. Radio waves, a kind of electromagnetic wave, travel at about 300,000 kilometres per second.

  1. Propagation: 71,572÷300,000≈0.23971{,}572 \div 300{,}000 \approx 0.239 seconds, which is about 240 milliseconds.
  2. The round trip, with the reply taking the same path, is about 2×240=4802 \times 240 = 480 milliseconds before any processing or queueing.
  3. Interpretation: a satellite link can have a very high data rate and still feel slow, because the signal must cover tens of thousands of kilometres twice for each exchange.

Try it: a fibre link is 6,000 kilometres long and the signal moves at 200,000 kilometres per second. What is the one-way propagation time, and what is the round trip?

Answer: 6,000÷200,000=0.036{,}000 \div 200{,}000 = 0.03 seconds, so the one-way propagation is 30 milliseconds and the round trip is 60 milliseconds, ignoring processing and queues.

Common mistakes and tradeoffs

It is tempting to think that more bandwidth means less latency. In fact bandwidth only shortens the transmission part, L/RiL / R_i. The propagation part depends on distance and the speed of the signal, so a very fast link over a long distance still has a long delay.

It is tempting to think latency is just distance. In fact the queue can dominate. A link that is nearly full makes every message wait behind the ones ahead, so the same path can take much longer at a busy hour. That is why measuring latency only when the network is quiet gives a misleading picture.

It is tempting to think that a round trip is always twice the one-way time. In fact that holds only when both directions have the same path and the same waiting. Here the forward trip took 15.5 milliseconds and the return 11.5 milliseconds, so the round trip was 27 milliseconds, not 31.

When to care: interactive work such as calls, games, remote desktops and trading, where each exchange waits for the one before. When it matters less: bulk transfers such as a large file download, where what counts is how many bytes per second the path can carry once the flow is running.

Tradeoffs. Keeping servers close to users cuts propagation, but it costs more machines and more copies of the data. Larger router buffers prevent packet loss, but they let queues grow and add latency. The sender controls how much it sends at once through Congestion Control, so a sender that floods the network raises the queue for everyone.

History

Telegraph and telephone engineers knew about delay long before computer networks. In a telephone call the delay came from the line and the switching equipment, and it was small enough that people adapted to it. Packet switching, described in Packet Switching, introduced a new source of delay, the time a packet spends in a router's queue, which grows with traffic and does not come from distance at all. Engineers in the 1970s and 1980s worked on controlling that queueing, and the protocols in Transmission Control Protocol include methods for slowing senders when queues fill.

The speed of light, which sets the propagation floor, has not changed. What changed is how much of the delay engineers could remove. Lower propagation now mostly means moving data closer to users, not making the signal faster.

Recap

  • Latency is the time from sending to receiving, and it has four parts: propagation, transmission, processing and queueing.
  • Propagation depends on distance and the speed of the signal, so bandwidth does not reduce it.
  • Transmission is the message size divided by the link rate, and it is paid once per link when routers store and forward.
  • Queueing is the part that grows with traffic, and it can be the largest part on a busy network.
  • A round trip is the forward and return one-way times added together, and the two can differ.
  • Read next: Packet Switching for how messages are split and forwarded, Transmission Control Protocol for how senders wait for acknowledgements, and Congestion Control for how senders avoid filling queues.

Check yourself

QuestionName the four parts of network latency and say which one depends on how fast the link is.Show answer
The four parts are propagation, transmission, processing and queueing. Transmission depends on the link rate, since it is the message size divided by that rate. Propagation depends on distance and the signal speed, processing on the router's work, and queueing on the traffic already waiting.
QuestionA 2,000-byte message is sent over one link that moves 10,000 bytes per second. The link is 300 kilometres long and the signal moves at 200,000 kilometres per second. There are no routers. What is the one-way latency?Show answer
Transmission takes 2,000÷10,000=0.22{,}000 \div 10{,}000 = 0.2 seconds. Propagation takes 300÷200,000=0.0015300 \div 200{,}000 = 0.0015 seconds. The total is 0.2+0.0015=0.20150.2 + 0.0015 = 0.2015 seconds, or 201.5 milliseconds. Check: transmission is the larger part here, so a faster link would help more than a shorter cable.
QuestionWhy can doubling a link's bandwidth fail to halve a video call's delay?Show answer
Bandwidth only reduces the transmission part of latency. If propagation over a long distance is the largest part, or if the queue is full, doubling the bandwidth leaves most of the delay in place. A call over a long path can still feel slow even on a very fast link.
QuestionA video call is smooth at night and stutters every evening. The path and the link speed have not changed. What is the most likely cause, and what determines how bad it gets?Show answer
The most likely cause is queueing. In the evening more traffic arrives at a shared link than it can carry, so messages wait longer in the router's queue, and the wait grows as the queue fills. How bad it gets depends on how much traffic arrives relative to the link's capacity, and on how large the buffers are, since large buffers let the queue grow before packets are dropped.

Sources