FullStack AI Hub
Studio
Networking & Security · 01. Transport & Internet Routing
11 min
6 steps
Intermediate

TCP Congestion Control & QUIC

Trace TCP slow start, congestion windows, HTTP/2 head-of-line blocking, and QUIC/HTTP3 multiplexed UDP streams.

Networking & Security01. Transport & Internet RoutingLesson 1 of 2
11 minIntermediate6 steps

TCP Congestion Control & QUIC

Trace TCP slow start, congestion windows, HTTP/2 head-of-line blocking, and QUIC/HTTP3 multiplexed UDP streams.

TTFB
163 ms
HANDSHAKE
2-RTT
HoL STALLED
0 streams
QUEUE DELAY
29 ms (CUBIC)
TCP Congestion & QUIC 0-RTT Packet Timeline Lab
RTT 65 ms · TTFB 163 ms
TCP + TLS 1.3 requires 2 full RTTs before application bytes flow. Click "Stream 1 · HTML" below to drop it and trigger HoL blocking!Same Wi-Fi IP
Packet Sequence Diagram (Click Stream 1 or Stream 2 packet to inject/clear loss)Complete: 187 ms · Handshake: 2-RTT
CLIENT (Browser)EDGE SERVER0ms33msTCP SYN33ms65msSYN-ACK65ms98msTLS 1.3 ClientHello98ms130msServerHello + Cert134ms167msStream 1 · HTML (click)144ms177msStream 2 · CSS (click)154ms187msStream 3 · API JSON
Congestion Window (cwnd) & Router Bufferbloat Queue Delay
Optimal BDP (42 MSS)R1R2R3R4R5R6R7R8R9R10R11R12— cwnd (MSS)-- Router Queue Delay (43 ms avg)Est. Goodput: 5.6 Mbps
In This LessonStep 1 of 6
What You Will Master
  • ✓Measure how TCP + TLS 1.3 handshakes inflate cold TTFB compared to QUIC 1-RTT / 0-RTT
  • ✓Explain why a single dropped TCP packet stalls every multiplexed HTTP/2 stream
  • ✓See how QUIC isolates per-stream recovery over UDP and survives Wi-Fi-to-5G roaming via Connection IDs
  • ✓Tune congestion control (CUBIC vs BBR) and enforce HTTP 425 replay guards on 0-RTT writes

Architectural Trade-Off Comparison Matrix

PatternBest ForKey Trade-Off
TCP + TLS 1.3 (HTTP/2)Universal enterprise compatibility & long-lived data-center links2–3 RTT cold setup and connection-level head-of-line blocking on loss
TCP BBR Congestion ControlHigh-BDP WAN links and video/API delivery over cellular networksModels bottleneck bandwidth to avoid bufferbloat; can compete with CUBIC
QUIC / HTTP/3 (UDP)Mobile users, lossy last-mile networks, and seamless IP roamingHigher user-space CPU per packet and occasional corporate UDP-443 blocks
QUIC 0-RTT ResumptionRepeat idempotent GET/HEAD requests to warm edge PoPsReplayable by on-path attackers; must reject non-idempotent POSTs with 425

Step-by-Step Architectural Breakdown (6 Steps)

Full architectural walkthrough transcript and state transitions for TCP Congestion Control & QUIC.

STEP 01 · SETUPJump to step →

Cold TCP + TLS Handshake Latency

A fresh HTTPS connection over TCP pays 1 RTT for `SYN / SYN-ACK / ACK` plus 1 RTT for TLS 1.3 key exchange before sending its first HTTP byte. On a 65 ms cellular link, that burns 130+ ms before the server can stream application payloads.

Switch between **TCP + TLS 1.3 (2-RTT)**, **QUIC 1-RTT**, and **QUIC 0-RTT** directly on the packet ladder to compare cold TTFB live.

idea:Every extra round trip multiplies physical distance latency before application payload transfer begins.

TCP 3-Way HandshakeTLS 1.3Cold TTFBRTT
STEP 02 · PROBLEMJump to step →

Slow Start, Congestion Window & Bufferbloat (CUBIC vs BBR)

TCP starts with a small congestion window (`cwnd ≈ 10 MSS`) and ramps until a bottleneck router buffer fills and drops packets. Loss-based **CUBIC** fills router queues before backing off—causing latency spikes known as **bufferbloat**.

watch:Toggle CUBIC vs BBR in the congestion chart below the packet ladder to see how BBR paces at optimal BDP and slashes router queue delay.

Slow StartcwndCUBICBufferbloat
STEP 03 · PROBLEMJump to step →

HTTP/2 Head-of-Line Blocking Over TCP

HTTP/2 multiplexes HTML, CSS, and API JSON over one TCP socket. Because the OS kernel enforces one strictly ordered byte stream, dropping a single **Stream 1 · HTML** packet freezes **Stream 2 · CSS** and **Stream 3 · API** in the kernel reorder buffer until Stream 1 retransmits!

watch:Click any Stream 1 or Stream 2 packet on the sequence diagram to drop/restore it live and observe the amber HoL stall penalty on TCP.

Head-of-Line BlockingHTTP/2 MultiplexingRetransmissionTCP Receive Buffer
STEP 04 · SOLUTIONJump to step →

QUIC: Independent Encrypted Streams Over UDP

QUIC combines transport + TLS 1.3 into **1 RTT** over UDP and tracks byte ordering **independently per stream** in user space. Even with Stream 1 dropped, Stream 2 (CSS) and Stream 3 (API JSON) deliver immediately with **0 HoL stalls**.

good:QUIC eliminates transport-layer head-of-line blocking and halves cold connection setup time compared to TCP + TLS 1.3.

QUICHTTP/3Independent StreamsUDP
STEP 05 · TECHNIQUEJump to step →

Zero-Drop Connection Migration (Wi-Fi → 5G)

TCP binds sessions to `(srcIP, srcPort, dstIP, dstPort)`, so stepping out of Wi-Fi range onto 5G resets every socket. QUIC stamps an opaque 64-bit **Connection ID (CID)** in packet headers so edge L4 load balancers route migrated 5G packets straight to the same session.

idea:Switch protocol from QUIC 1-RTT back to TCP + TLS 1.3 while Wi-Fi → 5G Migrate is ON to see the instant TCP RST + 2-RTT reconnect penalty!

Connection IDIP MigrationPath ValidationL4 CID Routing
STEP 06 · RECAPJump to step →

BBR Pacing & Safe QUIC 0-RTT Resumption

Modern edges pair **BBR congestion control** (pacing packets at optimal BDP to keep queues near empty) with **QUIC 0-RTT resumption** for returning clients—while strictly blocking 0-RTT on non-idempotent POST endpoints with `HTTP 425 Too Early` to prevent replay attacks.

good:Allow 0-RTT only on idempotent GET/HEAD routes; enforce 1-RTT on payments and mutations.

BBR Pacing0-RTT Early DataReplay AttackHTTP 425 Too Early

Related Production Deep-Dives & Simulators

Related Systems Course
Free · Verifiable Credential

FS-201Production LLM Engineer

Design an observable full-stack LLM product from capability validation through interfaces retrieval evaluation security and operations.

37 concepts~35h self-paced
Start Free Course
Weekly Engineering Dispatch

Get the weekly systems teardown

One technical note per week covering inference bottlenecks, retrieval harnesses, and commit-pinned teardowns.