Transport Layer

The network layer gets a packet to the destination host. Delivering it to the host is not the same as handing it to the right application, and it says nothing about whether the packet was lost or arrived out of order. The transport layer provides end-to-end communication between processes — it is the first layer where the idea of a “connection” appears.

The core of this chapter is the trade-off between UDP and TCP. UDP does multiplexing and nothing else: it makes no reliability guarantee, and it costs very little. TCP achieves reliable delivery with acknowledgements and retransmission, sequence numbers, and a sliding window. The choice does not depend on which one is “better”, but on whether the application can tolerate loss and reordering — DNS lookups use UDP, file transfers use TCP, and that is exactly the logic at work.

Then there are the two central mechanisms of TCP. Connection management: why the handshake takes three segments rather than two, and why the teardown takes four rather than three — these look like facts to memorise, but every segment defends against a specific failure mode. Flow control and congestion control: the first keeps the receiver from being overwhelmed and is adjusted through the receive window; the second keeps the network from being filled up and is adjusted through the congestion window together with slow start and congestion avoidance. The difference between the two is the easiest thing to confuse in this chapter and the one most worth confirming repeatedly.

After this chapter you should be able to explain: why is TCP a “byte stream” rather than a “message stream”? What is each of slow start and congestion avoidance designed to prevent?

Chapters

Found an issue with this content?

Tell us what could be improved.