Chapter 01 · Why TCP exists01 / 21

The network makes no promises

Alice is uploading photos to photos.example. Her laptop chops the data into packets and hands them to the network. They’re numbered here so you can follow them.

The internet underneath is IP, and IP is best effort: every router forwards packets as well as it can and promises nothing. Watch what arrives. A full router queue drops a packet, one takes the long route and arrives out of order, and one shows up twice.

Nobody tells Alice. If her app needs every byte, in order, something has to fix this.

Everything goes wrong at once here so you can see it. On real paths, loss is the everyday problem (full queues, flaky Wi-Fi); reordering and duplicates are rarer, but a reliable protocol has to survive all three.

terminalin the real world
$ ping -c 6 203.0.113.10
PING 203.0.113.10 (203.0.113.10): 56 data bytes
64 bytes from 203.0.113.10: icmp_seq=0 ttl=52 time=98.4 ms
64 bytes from 203.0.113.10: icmp_seq=1 ttl=52 time=97.9 ms
Request timeout for icmp_seq 2
64 bytes from 203.0.113.10: icmp_seq=3 ttl=52 time=131.2 ms
64 bytes from 203.0.113.10: icmp_seq=4 ttl=52 time=98.1 ms
64 bytes from 203.0.113.10: icmp_seq=5 ttl=52 time=97.6 ms
 
--- 203.0.113.10 ping statistics ---
6 packets transmitted, 5 packets received, 16.7% packet loss
round-trip min/avg/max/stddev = 97.6/104.6/131.2/13.3 ms

ping sends raw ICMP packets with no recovery: a lost one is simply gone, and the 131 ms one sat in a queue somewhere.