Course overviewTopic 16 / 31
Computer Networks • Deep Lesson 16 min Transport Layer: TCP & UDP

TCP Reliability: Sequence Numbers, ACKs & Retransmission

TCP turns an unreliable packet network into a reliable, ordered byte stream. It uses sequence numbers to identify byte positions, acknowledgements to communicate received progress, timers and duplicate acknowledgements to detect loss, and retransmission to recover missing data. TCP does not guarantee that the physical network never loses packets; it detects and repairs the effects at the transport layer.

LEARNING LOOPWatch→Read→Inspect→Retrieve→Teach back
TCP Reliability: Sequence Numbers, ACKs & Retransmission
Week 3–4 · Topic 16 / 31
Visual model

Watch the structure first. Then read the technical details.

SEQ bytes
ACK progress
Loss signal
Retransmit
Ordered stream
Article companion· Week 3–4

TCP turns an unreliable packet network into a reliable, ordered byte stream. It uses sequence numbers to identify byte positions, acknowledgements to communicate received progress, timers and duplicate acknowledgements to detect loss, and retransmission to recover missing data. TCP does not guarantee that the physical network never loses packets; it detects and repairs the effects at the transport layer.

01

Byte-oriented sequence numbers

TCP sequence numbers identify byte positions in the stream, not packet counts. An ACK normally indicates the next byte the receiver expects.

02

Cumulative acknowledgement

A cumulative ACK such as ACK 5000 communicates that bytes before 5000 have been received in order; later bytes may have arrived out of order but the precise semantics depend on options such as SACK.

03

Loss recovery

TCP can retransmit after a retransmission timeout. Duplicate ACK patterns can trigger faster recovery mechanisms, and Selective Acknowledgement can tell the sender which blocks arrived.

DUAL CODING

See the mechanism before you memorize it

One diagram, one causal story, one reconstruction task.

VISUAL RECONSTRUCTION

TCP deep dive: handshake, sequence numbers, ACKs, retransmission — causal map

4 stages
01

Send

Sender transmits a segment carrying a sequence-numbered range of bytes.

02

Receive

Receiver validates and buffers bytes.

03

ACK

Receiver acknowledges the next expected byte position.

04

Detect loss

Timer or duplicate-ACK evidence suggests a missing segment.

Trace the mechanism from left to right. On smaller screens, follow the numbered sequence. Then redraw the same flow without looking.
ACTIVE RECONSTRUCTION

Draw the idea yourself

Rebuild the core flow on a real canvas before moving to the worked walkthrough.

SKETCHFLOW

TCP deep dive: handshake, sequence numbers, ACKs, retransmission — practice canvas

Sketch the TCP deep dive: handshake, sequence numbers, ACKs, retransmission mechanism from memory. Label the input, transformation, observation, and transfer.

Practice canvas ready

The canvas loads when you reach this section.

Draw first. Compare second.Touch + mouse friendly
STEP BY STEP

Walk the system

01

Send

Sender transmits a segment carrying a sequence-numbered range of bytes.

02

Receive

Receiver validates and buffers bytes.

03

ACK

Receiver acknowledges the next expected byte position.

04

Detect loss

Timer or duplicate-ACK evidence suggests a missing segment.

05

Recover

Sender retransmits and continues the stream.

CONCRETE ARTIFACT

Sequence math

The ACK is about byte positions. This single idea prevents many off-by-one misunderstandings in packet captures and interview questions.

textcopy → rebuild → modify
Segment: SEQ=1000, LEN=500
Receiver ACK → 1500
Meaning: next expected byte is 1500
MISCONCEPTIONS

What usually goes wrong

Say TCP sends an ACK for every packet and nothing else.

Treat a segment's sequence number as its segment index rather than its byte position.

Assume retransmission makes TCP loss-free without any latency cost.

RETRIEVAL PRACTICE

Close the tab. Rebuild it from memory.

Read the question, answer aloud, then reveal.

What does ACK=1500 mean in the simple example?Reveal answer

The receiver is cumulatively acknowledging all bytes before 1500 and expects byte 1500 next.

Why use sequence numbers?Reveal answer

To order the byte stream, detect gaps and match acknowledgements and retransmissions to positions in the stream.

What is SACK for?Reveal answer

Selective Acknowledgement allows the receiver to report non-contiguous blocks that arrived, helping the sender retransmit only missing ranges.

FEYNMAN

Teach it back in plain English

Draw five segments, delete one in the middle, and compute the ACK values before and after the gap. Then explain how the sender discovers the missing data.

EXAM / INTERVIEW

What a strong answer sounds like

Expect sequence/ACK arithmetic, retransmission concepts, SACK, timeout and duplicate-ACK questions.

NEXT CONNECTION

Make this idea travel.

Connect it next to: tcp-handshake • tcp-flow-congestion • tcp-packet-analysis.

COURSE CONTENTS

TCP deep dive: handshake, sequence numbers, ACKs, retransmission

01How the Internet Works + OSI ModelWeek 1 · 4 topics0/4
02Physical & Data Link LayersWeek 1–2 · 5 topics0/5
03Network Layer: IP & RoutingWeek 2–3 · 6 topics0/6
04Transport Layer: TCP & UDPWeek 3–4 · 5 topics0/5
05Application Layer: HTTP, DNS & FriendsWeek 4–5 · 6 topics0/6
06Security & Troubleshooting ToolkitWeek 5 · 5 topics0/5