Visual walkthrough — TCP reliability — seq - ack numbers, retransmission, cumulative ACK
Before we start, three words we will keep using. Read these once:
Step 1 — Lay the bytes out as a numbered strip
WHAT. Picture the whole data stream as a long strip of little boxes in a row. Give each box a number: this box is byte , the next is , and so on. That number is the box's permanent address — it never changes, no matter how the boxes are grouped into envelopes.
WHY. If we numbered envelopes instead of boxes, then re-sending the same data in a differently-sized envelope would confuse everyone about "which data is this?". Numbering the boxes themselves means every byte has exactly one identity forever. This is the whole reason TCP counts bytes and not packets.
PICTURE. The blue strip below is the stream. Each cell is one byte; the number under it is its address. Notice numbering starts at , not — that starting value is the ISN (Initial Sequence Number), chosen randomly during the TCP three-way handshake so old stray packets from a past connection can't be mistaken for new data.

Step 2 — Group the boxes into segments
WHAT. The sender doesn't mail one box at a time; it packs runs of contiguous boxes into segments. Below, three segments A, B, C each carry boxes.
WHY. Sending one byte per packet would drown the network in overhead. But the addresses stay the same — segment B is still "the boxes numbered to ", whichever envelope it rides in. The grouping is bookkeeping; the addresses are truth.
PICTURE. Watch how each segment's SEQ is simply the address of its leftmost box, and where it covers is read straight off the strip.

| Segment | SEQ = first box | Covers |
|---|---|---|
| A | ||
| B | ||
| C |
Notice the pattern: the next segment starts exactly where the previous one stopped — . No gaps, no overlaps.
Step 3 — The receiver's ruler: "how far is the wall solid?"
WHAT. The receiver keeps a strip too, but starts empty. As boxes arrive, it fills them in from the left. The one thing it cares about is: from the start, how far is the wall of boxes solid with no holes? Call the address of the last solid box .
WHY. The app on top wants bytes in order. It can only be handed a box once every box before it is present. So the receiver must track the highest contiguous byte — the far edge of the solid wall. Anything past a hole is stuck, unusable, no matter how much arrived.
PICTURE. Green boxes are received-and-solid; the red line marks the edge of the solid wall at address . Everything right of it is "not yet deliverable".

Step 4 — Derive the ACK formula by pointing at the gap
WHAT. Now the receiver must tell the sender how it's doing — in one number. The rule TCP chooses: send the address of the first box it still wants, i.e. the box just past the wall.
WHY this exact choice? Because that one number does double duty. Saying "send me box next" simultaneously confirms "I already have everything up to " (otherwise I wouldn't be asking for ). One number, two facts. That is the whole genius, and it drops straight out of the picture: the box immediately right of the green wall is at address .
PICTURE. The orange arrow points at the very first empty cell — its address is . That arrow is the ACK.

Step 5 — Edge case: a box is lost (the wall stops, the arrow freezes)
WHAT. Now let B vanish in transit, but C arrives anyway. C's boxes (–) are sitting in the receiver's buffer — but a hole (–) yawns before them.
WHY the ACK freezes. The solid wall still ends at (A's last box). C being buffered does not move the wall, because the wall must be contiguous from the start. So again — the exact same number as before. This repeat is called a duplicate ACK.
PICTURE. Green = solid wall (only A). Gray = C, buffered but stranded past the red hole. The orange arrow is stuck at , pinned by the hole — not by anything about C.

Step 6 — Repairing the hole (the arrow leaps)
WHAT. Repeated duplicate ACKs of are a shout: "I'm stuck waiting for box !" After 3 duplicate ACKs, the sender doesn't wait for its timer — it does fast retransmit: resend B immediately. (If no duplicates come at all, a timeout / RTO — see RTT estimation / Jacobson's algorithm — resends it instead.)
WHY the ACK then jumps far. The moment B lands, the hole closes. Now the wall can flow across B and the already-buffered C in one motion. If C, D were both waiting, the wall races to the end of D. One filled hole reconnects the whole buffered tail — so the ACK leaps.
PICTURE. Left: the frozen state. Right: B slots in (blue), the wall sweeps across B and buffered C, D (green), and the orange arrow jumps from all the way to .

Step 7 — Degenerate cases (so nothing surprises you)
WHAT. Two boundary situations that the picture handles without new rules.
WHY. A rule you can only apply to the "nice" case is a rule you don't understand. Check the ends.
PICTURE. Top: nothing received yet — wall is empty, so is the byte just before the first data byte, and the ACK equals the ISN's next value (this is exactly the SYN case: SYN eats one address, so ACK of ISN is ). Bottom: everything received — wall reaches the last box, ACK points one past the end, meaning "I want nothing more, all delivered".

The one-picture summary
This single figure is the whole page: strip → segments → wall → arrow at → hole freezes the arrow → filled hole makes it leap. If you can redraw this from memory, you own cumulative ACK.

Recall Feynman retelling — the whole walkthrough in plain words
Lay the message out as a long row of numbered boxes (Step 1). The sender mails them in bunches called segments, but the numbers on the boxes never change (Step 2). Your friend fills boxes in from the left and watches how far the solid wall of boxes reaches — call that last solid box (Step 3). To report progress with one word, your friend points at the first empty box, which sits at , and shouts that number — that shout is the ACK, and it secretly confirms everything behind it too (Step 4). If a box goes missing, the wall stops at the hole, so your friend keeps shouting the same number even though later boxes are piling up on the desk (Step 5). Hearing that shout three times, you re-mail the missing box; the instant it arrives the wall sweeps across it and all the desk boxes at once, and the shouted number suddenly leaps far ahead (Step 6). At the very start the wall is empty so the number is just the first address; at the very end the wall reaches the last box so the number points one past everything (Step 7). One number, pointing at the first empty box — that's cumulative ACK.