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.
-
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 seconds, or 1 millisecond. The signal then travels 500 kilometres, which takes seconds, or 2.5 milliseconds. Check: the first link costs 3.5 milliseconds in total.
-
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.
-
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.
-
Process at R2. R2 spends 0.5 milliseconds and has no queue. Check: R2 adds 0.5 milliseconds.
-
Send across the third link. Another 3.5 milliseconds. Check: the three links together cost milliseconds.
-
Add the parts. The one-way latency is 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: .
-
Find the round trip. If the reply is short and returns the same way with no queue, its one-way time is milliseconds, so the round trip is 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 be the length of link , the speed of the signal in that medium, the message size, the rate of link , the processing time at router and its queueing time. The one-way latency is
The one-way latency is the sum, over every link on a path, of the propagation time and the transmission time , 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, .
Step 1 in symbols: propagation
The propagation time of one link is . With kilometres and kilometres per second, it is 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 . With bytes and bytes per second, it is 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, seconds. The routers contribute seconds. The total is seconds, or 15.5 milliseconds, as in the walkthrough.
Worked examples
A 500-byte message crosses one 200-kilometre fibre at a link rate of 500,000 bytes per second, with no routers.
- Propagation: seconds, which is 1 millisecond.
- Transmission: seconds, which is 1 millisecond.
- Total one-way latency: milliseconds.
- 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.
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.
- Transmission: three links at 1 millisecond each give 3 milliseconds.
- Propagation: three links at 2.5 milliseconds each give 7.5 milliseconds.
- Processing: two routers at 0.5 milliseconds each give 1 millisecond.
- Queueing: 4 milliseconds at R1.
- One-way total: milliseconds.
- 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.
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.
- Propagation: seconds, which is about 240 milliseconds.
- The round trip, with the reply taking the same path, is about milliseconds before any processing or queueing.
- 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: 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, . 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.