"You can ship a career writing HTTP code without ever looking at TCP. Until the day a connection hangs, a TLS handshake fails, or a CDN drops you mid-request. Then you wish you'd looked."
The Layer Cake
Every HTTP request travels through a stack of protocols, each pretending to be a clean abstraction over the one below:
- HTTP — the message you write (method, URI, headers, body).
- TLS — optional encryption wrapper. Present for HTTPS, absent for HTTP.
- TCP — reliable, ordered byte stream. Hides packet loss, retransmits, reorders.
- IP — best-effort packet delivery between hosts. No ordering, no reliability.
- Ethernet / Wi-Fi — bits on the wire.
HTTP/3 swaps the middle of the cake: QUIC (which bundles TLS 1.3 and reliability) runs over UDP, skipping TCP entirely. Same HTTP semantics on top; very different transport underneath.
TCP — The Reliability Lie
IP packets get lost, reordered, duplicated, and dropped. TCP's job is to pretend that doesn't happen. It opens a connection with a three-way handshake (SYN → SYN-ACK → ACK), assigns sequence numbers to bytes, retransmits what gets lost, and delivers a clean stream to whoever's reading.
Cost: 1 round trip just to set up a TCP connection before you can even send your first HTTP byte. From Seoul to a US-East server, that's ~150ms of nothing. HTTP/1.1 used to open a new TCP connection per request, which is why old web pages felt sticky-slow. Keep-Alive (Track 5) and HTTP/2 multiplexing fixed it by reusing one connection for many requests.
TLS — The Encryption Wrapper
HTTPS is HTTP wrapped in TLS. The first time you connect, TLS negotiates a cipher suite, exchanges keys, and verifies the server's certificate. After that, every HTTP byte is encrypted on the way out and decrypted on the way in. Your HTTP code doesn't see a difference; it just calls https:// instead of http://.
Cost: 2 round trips for TLS 1.2 (handshake + key exchange), or 1 round trip for TLS 1.3 (handshake and keys combined). TLS 1.3 also supports 0-RTT resumption for return visits. If your API client feels slow on the first request and fast after, TLS handshake is usually the culprit.
openssl s_client, tcpdump, and curl -v to peek through the abstraction.HTTPS = Port 443; HTTP = Port 80
By convention. HTTP goes to TCP port 80 unless you say otherwise; HTTPS goes to TCP port 443. cwkPippa runs on :8000 (FastAPI backend) and :5173 (Vite frontend) on plain HTTP because it's local-only behind Tailscale. The moment you expose anything to the public internet without TLS, every router between you and the user can read it.
HTTP/3 and QUIC
HTTP/3 throws out TCP and rides on QUIC, a UDP-based protocol that does its own reliability + ordering + crypto in one bundle. The win: faster handshake (combined with TLS), no head-of-line blocking at the transport layer, and connection migration (your phone switching from Wi-Fi to LTE without dropping the session). The catch: less universally deployed than HTTP/2 and harder to debug with traditional tools.
Pippa's Confession
lsof -i :8000 before any other diagnostic.