Quiz Entry - updated: 2026.07.05
How does TCP provide reliability through sequencing and retransmission?
TCP numbers each byte with sequence numbers (for reordering), the receiver ACKs the next byte expected, and unacknowledged data is retransmitted after a timeout; SACK lets the receiver name exactly which bytes are missing so only those are resent.
TCP Reliability Mechanisms:
1. Sequence Numbers:
- Each byte of data is assigned a sequence number
- Segments carry the sequence number of the first byte they contain
- Receiver uses sequence numbers to reassemble data in correct order
2. Acknowledgment:
- Receiver sends ACK with the next expected sequence number
- ACK of 101 means "I received up to 100, send me 101 next"
3. Retransmission:
- If ACK not received within timeout, segment is retransmitted
- Selective Acknowledgment (SACK): Modern TCP feature
- Receiver specifies exactly which bytes were received
- Only missing segments are retransmitted
- Reduces unnecessary retransmissions
Example without SACK: Lost segment 5 → Retransmit segments 5, 6, 7, 8, 9, 10
Example with SACK: Lost segment 5 → Retransmit only segment 5
Key insight: SACK is negotiated during the three-way handshake.
Go deeper:
RFC 2018 — TCP Selective Acknowledgment Options — defines SACK so only the truly missing bytes are retransmitted.
TCP — Reliable transmission — how sequence numbers and cumulative ACKs detect and recover loss.
Retransmission (data networks) — the ARQ/timeout principle behind TCP's resend logic.