Build it: the page that gets through (stop-and-wait, then a window)

The postcard and the phone call. TCP builds the call out of postcards that may vanish. This lesson builds a small call of its own, on a road that loses and delays postcards on purpose, and watches what each design costs.
Before you start. The page that never arrived (TCP reliable delivery) told the idea: number every page, answer with “got it”, resend after a timeout, and keep several pages on the road at once with a window. Here you write that, in about 40 lines each, and measure it. TCP vs UDP, and the 3-way handshake gave the picture underneath: the network only carries postcards, and TCP is a phone call made from them. A later lesson, Build it: only the lost page (selective repeat, loss and reordering), finishes the job with selective repeat. You need Python 3 and nothing else.