Computer Networks · Module 6 — Transport Layer
How TCP stays reliable
Recall Module 4: the data link layer detects a damaged frame and silently drops it. Nobody is told. Recall Module 5: IP forwards packets and makes no promise they arrive. A router with a full queue simply discards them.
Sign in to track your score
The internet loses packets constantly. Right now, somewhere on Aisha's path, one just vanished. She will never notice.
Why & what
Why reliability has to live here. Recall Module 4: the data link layer detects a damaged frame and silently drops it. Nobody is told. Recall Module 5: IP forwards packets and makes no promise they arrive. A router with a full queue simply discards them.
So by the time data reaches the transport layer, loss has already happened and nobody below has done anything about it. TCP is the first layer that notices and reacts.
What the three tools are.
- Sequence numbers. Every byte TCP sends is numbered. The receiver can spot gaps and put out-of-order pieces back in order.
- Acknowledgements. The receiver sends back the number of the next byte it expects. ACK=3 means "I have everything before 3, send me 3."
- Retransmission timer. The sender starts a timer for each segment. No acknowledgement before the timer expires means the segment is assumed lost and sent again.
TCP acknowledgements are cumulative: ACK=5 confirms everything up to byte 4, not just byte 4.
How it works
- The server sends segments seq=1, seq=2, seq=3, seq=4. Each starts a timer.
- Segments 1 and 2 arrive. Aisha's laptop replies ACK=3 — I have 1 and 2, send me 3.
- Segment 3 is dropped by a busy router. Segment 4 arrives anyway.
- Aisha's laptop cannot acknowledge 4, because 3 is still missing. It repeats ACK=3.
- The server's timer for segment 3 expires, or it sees the repeated ACKs, and resends segment 3. Once it arrives, Aisha's laptop jumps straight to ACK=5.
Three duplicate ACKs in a row triggers an immediate resend without waiting for the timer. That is fast retransmit.

Common confusion
Students think the receiver sends a message saying which segment was lost. Actually, the receiver only ever says what it is waiting for next.
There is no "please resend segment 3" message in TCP. The receiver keeps answering ACK=3, and the sender works out the rest. This is a small design choice with a big effect: the receiver stays simple, and even if some ACKs are lost themselves, the next one still carries the full picture, because ACKs are cumulative.
Interview angle
Asked as: "How does TCP guarantee reliable delivery?" Say all three tools, not just retransmission.
Model answer:
TCP numbers every byte it sends with a sequence number, so the receiver can reorder segments that arrive out of order and detect gaps. The receiver acknowledges data by sending back the sequence number of the next byte it expects. Acknowledgements are cumulative, so one ACK confirms everything before that number. The sender keeps a timer for unacknowledged data. If it expires, the segment is retransmitted. If the sender receives three duplicate ACKs, it retransmits immediately without waiting — that is fast retransmit. The receiver never names the missing segment. It just keeps repeating the number it is waiting for, and the sender infers the loss.
- 1.
What does ACK=7 mean?
- 2.
Segments 1, 2 and 4 arrive but 3 is lost. What does the receiver send?
- 3.
What triggers fast retransmit?
- 4.
Why does reliability sit at the transport layer rather than the data link layer?