Skip to content

Commit

Permalink
attempt to describe TCP hol with some images
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Nov 24, 2018
1 parent 3417b0e commit 59d4bb1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions en/why-tcphol.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@

HTTP/2 is done over TCP and with much fewer TCP connections than when using
earlier HTTP versions. TCP is a protocol for reliable transfers and you can
basically think of it as an imaginary string between two machines. What is
basically think of it as an imaginary chain between two machines. What is
being put out on the network in one end will end up in the other end, in the
same order - eventually. (Or the connection breaks.)

![a TCP chain between two computers](../images/tcp-chain.png)

With HTTP/2, typical browsers do tens or hundreds of parallel transfers over
that single TCP connection.

If a single packet is dropped, lost, in the network somewhere between two
endpoints that speak HTTP/2, it means the entire TCP connection is brought to
a halt while the lost packet needs to be re-transmitted and find its way to the
destination. Since TCP is this "string", it means everything that would come
after the lost packet needs to wait.
a halt while the lost packet needs to be re-transmitted and find its way to
the destination. Since TCP is this "chain", it means that if one link is
suddenly missing, everything that would come after the lost link needs to
wait.

An illustration using the chain metaphor when sending two streams over this
connection. A red stream and a green stream:

![the chain showing links in different colors](../images/tcp-chain-streams.png)

It becomes a TCP-based head of line block!

Expand All @@ -24,3 +32,20 @@ connections up to distribute the lost packet over so for each lost packet the
other connections without loss can still continue.

Fixing this issue is not easy, if at all possible, to do with TCP.

## Independent streams avoids the block

With QUIC there's still a connection setup between the two end-points that
makes the connection secure and the data delivery reliable.

![a QUIC chain between two computers](../images/tcp-chain.png)

But when setting up two different streams over this connection, they are
treated independently so that if any link goes missing for one of the streams,
only that stream, that particular chain, has to pause and wait for the missing
link to get retransmitted.

Illustrated here with one yellow and one blue stream sent between two
end-points.

![two QUIC streams between two computers](../images/quic-chain-streams.png)
Binary file added images/quic-chain-streams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tcp-chain-streams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tcp-chain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59d4bb1

Please sign in to comment.