Computer Networking Fundamentals: TCP/IP, BGP, TLS 1.3, and HTTP/3 (QUIC)
Every cloud microservice call, streaming LLM token SSE response, database query, and global web page traverses layered networking protocols engineered by Vint Cerf, Bob Kahn, and the Internet Engineering Task Force (IETF). Understanding how unreliable physical fiber/wireless frames become reliable ordered byte streams—and why modern web and AI APIs increasingly run TLS 1.3 and HTTP/3 over UDP-based QUIC—equips engineers to diagnose tail-latency spikes, packet loss stalls, and connection exhaustion.
Key Highlights
- Internet Protocol (`IPv4` / `IPv6`) provides best-effort packet routing across autonomous networks glued together globally by Border Gateway Protocol (`BGP`), while `DNS` maps domain names to IP addresses.
- `TCP` guarantees ordered, lossless delivery via 3-way SYN/SYN-ACK/ACK handshakes, sequence ACKs, and congestion control (`CUBIC` or Google `BBR`), whereas `UDP` sends stateless datagrams with zero handshake or retransmission delay.
- In `HTTP/2` over a single TCP socket, one dropped packet stalls EVERY multiplexed stream waiting for kernel retransmission ("TCP Head-of-Line Blocking").
- `QUIC` (`HTTP/3`) implements independent encrypted streams + `TLS 1.3` inside user-space UDP—establishing connections in 1-RTT (or 0-RTT resumption), surviving Wi-Fi-to-5G IP changes seamlessly, and isolating packet loss to the single affected stream.
TCP, UDP, BBR Congestion Control, and Why HTTP/3 Uses QUIC
Speed-of-light propagation in glass optical fiber (~200,000 km/s, or ~5 microseconds per kilometer) sets an unbreakable physical floor on round-trip time (RTT): New York to London is ~70 ms minimum. Opening a legacy HTTP connection required 1 RTT for TCP SYN-ACK plus 2 RTTs for TLS 1.2 before sending byte one—wasting over 200 ms on intercontinental links! TLS 1.3 cut encryption negotiation to 1 RTT, and QUIC merges transport + TLS 1.3 into a single 1-RTT (or 0-RTT) handshake.
For streaming real-time Voice AI, WebRTC uses encrypted UDP (`SRTP`) because playing a voice frame 300 ms late is worse than interpolating a 10 ms audio glitch; for text LLM token streaming, Server-Sent Events (SSE) over persistent HTTP/2 or HTTP/3 connections with `BBR` congestion control maintain smooth token flow even on lossy mobile links.
| Protocol | Handshake RTTs (Cold) | Multiplexed Loss Behavior | Best Application Workload |
|---|---|---|---|
| TCP + TLS 1.3 + HTTP/2 | 2 RTTs (1 TCP + 1 TLS) | 1 lost packet stalls ALL streams on socket | Internal data-center RPC (gRPC), database pools |
| QUIC + HTTP/3 (over UDP) | 1 RTT (0-RTT on resume) | Independent streams—only affected stream waits | Global web CDNs, mobile apps, edge APIs, roaming 5G |
| WebRTC (UDP SRTP / Data) | ICE/DTLS negotiation | Unreliable/partial-reliable real-time frames | Sub-300ms conversational Voice/Video AI & cloud gaming |
Connection Pooling, Reverse-Proxy Buffering, and DNS Hygiene
Opening a fresh TCP+TLS handshake on every outbound LLM API or database request burns CPU on elliptic-curve handshakes and exhausts ephemeral source ports (`TIME_WAIT`). Persistent HTTP keep-alive connection pools (`httpx.AsyncClient` / Go `http.Transport` / `PgBouncer`) reuse warm sockets across thousands of requests.
- Disable Nginx/proxy response buffering (`X-Accel-Buffering: no`) on Server-Sent Event (`/v1/chat/completions?stream=true`) endpoints—otherwise users stare at a blank screen until the entire response finishes!
- Enable dual-stack `IPv6` + `IPv4` and Anycast CDN edge termination so TLS handshakes complete at the nearest city PoP (~5–15 ms) rather than across oceans.
- Set explicit connect, read, and total deadlines with jittered exponential backoff on every network client.
References & Sources
- Kurose, James F.; Ross, Keith W. — Computer Networking: A Top-Down Approach (8th ed.), Pearson.
- Iyengar, Jana; Thomson, Martin (2021) — QUIC: A UDP-Based Multiplexed and Secure Transport, IETF RFC 9000.
- Rescorla, Eric (2018) — The Transport Layer Security (TLS) Protocol Version 1.3, IETF RFC 8446.