Communication Networks · Visualized

Go-Back-N Sliding Window

Transport Reliability

TCP connections, retransmission timers and sliding windows that make lossy links behave.

6 interactive subtopics — each one animated, step-through and explained.

Go-Back-N Sliding Window

Transport Reliability

Go-Back-N lets the sender stream up to N unacknowledged frames, sliding the window forward as cumulative ACKs arrive. The receiver accepts only the exact next expected frame; if one is missing, every later arrival is discarded — so after a timeout the sender rewinds to the gap and resends the whole outstanding window.

How Go-Back-N Sliding Window Works

  1. Sender maintains base (oldest unacked) and nextSeq, transmitting while nextSeq < base + N.
  2. Receiver only honours rcv_base; anything else is dropped and rcv_base−1 is re-ACKed.
  3. Cumulative ACK n means “everything through n arrived”, sliding base past n.
  4. When frame k is lost, later frames still arrive — but are thrown away.
  5. Timeout on k rewinds the sender to k and resends k, k+1 … nextSeq−1.

Go-Back-N Sliding Window Worked Example

Try it: Play — the window slides across frames 0–7 until ACK 2 disappears; watch frames 3–5 get binned at the receiver, then the whole tail resent.

The strip shows sent/unacked/acked colours live. One loss costs four transmissions here — the price of a dumb-but-simple receiver with a 1-frame buffer.

sender sequence space01234567window [base=0 … base+3]receiver accepts ONLY its expected frame — anything else is discarded
ACKed sent, unACKed resent dropped at receiver
Stage 1 / 15
Window = 4. base = 0. Time to fill the pipe.

Go-Back-N Sliding Window: Key Facts to Remember

WindowN frames in flight — fills long pipes much better than stop-and-wait
Weaknessbandwidth wasted resending frames that did arrive
Used byclassic HDLC/LLC behaviour; TCP avoids this waste via Selective Repeat ideas

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses

See how packets really travel

Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.