INHow the Internet Works · Lesson 4 of 7
TCP & UDP — Reliable vs Fast
IP delivers packets 'best effort' — they can vanish, duplicate, or arrive shuffled. TCP builds reliability on top of that chaos. UDP skips the ceremony for speed. Every connection chooses one.
Ports let one machine hold many conversations: a connection is the 4-tuple (source IP, source port, destination IP, destination port). Servers listen on well-known ports — 443 HTTPS, 80 HTTP, 22 SSH, 53 DNS — while your side uses a random high port per connection. A 'connection refused' means the machine answered but nothing was listening on that port.
◆ Note
HTTP/3 runs on QUIC — reliability rebuilt on top of UDP, with encryption baked in and the handshake merged into TLS's. Why abandon TCP? Head-of-line blocking: one lost TCP packet stalls every request sharing the connection. QUIC keeps streams independent, so one loss delays only its own stream. About a third of web traffic already rides it.
HTTP/3 runs on QUIC — reliability rebuilt on top of UDP, with encryption baked in and the handshake merged into TLS's. Why abandon TCP? Head-of-line blocking: one lost TCP packet stalls every request sharing the connection. QUIC keeps streams independent, so one loss delays only its own stream. About a third of web traffic already rides it.