LightMySky
به انگلیسی

Reliable Delivery over an Unreliable Network

The network below may drop, duplicate, delay and reorder. A reliable transport rebuilds order and completeness on top of it using sequence numbers, acknowledgements, timeouts and retransmission, and a window so the sender need not wait for each reply.

No account needed. Progress saves in this browser.

What a learner can do afterwards

  • Trace a transfer where one segment is lost and say what triggers the resend
  • Explain what the sequence number does when segments arrive out of order
  • Say why a window raises throughput on a link with long delay

1 · Read

TCP chops a big message into smaller segments, and IP carries each one as a datagram from router to router toward its destination. The trip is messy. Segments can arrive out of order when two take different routes. Segments can get lost, since a busy router may drop one or a weak wifi signal can garble one. Segments can arrive twice, when a segment that looks lost shows up late after its replacement was already sent. And your computer may send several messages at once, so the receiver needs a way to tell which segments belong to which message. Something extra must rebuild order and completeness on top of IP.

Try it together

Watch TCP fix a jumbled delivery. Suppose three segments of your message arrive in the order 3, 1, 2. Every byte carries a sequence number, so the receiver can see exactly where each piece belongs. It slots them back into 1, 2, 3 and only then hands the whole message upward. The numbers turn a shuffled arrival into the original message, no matter which route each piece took.

segment 3 arrivessegment 1 arrivessegment 2 arrivesmessage rebuilt 1 2 3

Numbers alone are half the trick. The receiver also sends back short notes called acknowledgements that name the bytes now safely arrived. The sender runs a timer on each batch: if the note fails to arrive before the timer runs out, the sender assumes that piece was lost and sends it again. To avoid freezing after every single packet, the sender uses a window instead: it pushes a whole batch of packets into the network at once and keeps going while the replies travel back. On a slow link that batching keeps data flowing instead of idling. This pairing is so common that the whole stack is called TCP/IP.

Good to know

UDP is the lighter cousin, and it makes the opposite trade. It can spot corrupted data, but it never resends a lost packet, never reorders late arrivals, and never deletes duplicates. With no notes to wait for and no resends to manage, it moves very little extra data and stays fast. That suits live video calls and online games: a resent packet would arrive too late to matter, so skipping one small gap beats pausing the whole stream. Ask what the app values most. If every byte must arrive complete and in order, the answer is TCP. If speed matters more than perfection, UDP fits.

Sequence numbers restore order, acknowledgements plus timers trigger resends, and a window keeps the pipe full.

Reading adapted from academy:article:ap-computer-science-principles:x2325b13abd8680c9, x05740e35ebd03183, x873515749a220528 (null license).

2 · Watch

به انگلیسی

Take it off screen

Print a worksheetA4 with an answer key page for grown-ups. No screen, no internet.

Where it sits

Then practise

8 questions wait behind this lesson, each with its answer explained. Every answer feeds the sky: stars light as they are learned, and dim when it is time to come back.

Spotted a problem on this page? Tell us
Reliable Delivery over an Unreliable Network · Computing, ages 18 to 19 · LightMySky