Systems and Networking · 16 min · free lesson

HTTP/1.1, 2, and 3

Each HTTP version fixed the blocking problem one layer lower.

Core idea

HTTP/2 shares TCP’s ordered byte delivery; QUIC separates delivery of different streams.

Lesson map: comments comparing h1, h2 and h3 above one client request, followed by the rule that HTTP/2 shares TCP’s ordered delivery while QUIC separates streams.
Protocol comparison and client API sketch; supply the client, URL, runtime and target-supported network transport.

Understand it

HTTP/1.1 can reuse connections, but response ordering and limited pipelining often led browsers to open multiple connections. HTTP/2 multiplexes streams over one TCP connection, which removes application-level blocking but not TCP's — a gap in TCP delivery can delay later bytes belonging to multiple streams. HTTP/3 moves onto QUIC over UDP, so delivery can proceed independently per stream; congestion control still applies to the connection. Its handshake integrates TLS.

HTTP/1.1 can reuse connections, but responses on a connection are generally constrained by request ordering in common deployments. Pipelining exists in the protocol but saw limited browser use; clients often opened several connections to avoid waiting behind one slow response. HTTP/2 multiplexes streams over one TCP connection and compresses headers, improving concurrent request handling. Because all streams still share that TCP connection, packet loss can cause transport-level head-of-line blocking even when the HTTP streams are logically separate.

HTTP/3 runs over QUIC, which uses UDP and implements independent streams and integrated TLS. Loss of data for one QUIC stream need not hold back application data on unaffected streams in the same way as TCP's ordered byte stream. A lost packet may carry frames for several streams, and congestion control can slow the whole connection. Connection setup, migration, proxies, and server support also matter in practice. Version numbers do not tell you whether a specific page will be faster without measuring its request pattern and network conditions.

For an interview, draw two requests where one response stalls. Explain which layer causes the delay in each version. Then mention compatibility and observability: TLS negotiation, middleboxes, fallback, and server configuration may determine what a client actually uses. Avoid a universal 'six connections' claim; browsers and workloads vary. The clean answer is about where multiplexing lives and which ordering constraint remains.

A page load can mix versions because the browser negotiates each connection with its origin and intermediaries. Inspect the actual protocol in developer tools before attributing a measured improvement to HTTP/3. A CDN, proxy, or server configuration can dominate the result even when the browser supports the newer protocol.

Interview follow-up: What does HTTP/3 remove at the transport-stream level, and which shared congestion or connection effects remain?

Read the code

// h1: persistent connections; pipelining exists but is uncommon
// h2: many streams, one TCP connection
// h3: many streams, QUIC over UDP
let response = client.get(url).send().await?;

Protocol comparison and client API sketch; supply the client, URL, runtime and target-supported network transport.

Practice starter

// Several HTTP/2 streams share one TCP byte stream.
// A gap prevents delivery of bytes after the missing TCP range.

Practise this code in Playground ↗

Try it

Explain what head-of-line blocking means at each layer.

What success looks like: You can say which version fixes which layer, and which one it does not.

Check your understanding

What can TCP packet loss delay for HTTP/2 streams on one connection?

Reveal the answer
  1. Only frames belonging to the HTTP/2 stream that first experienced the loss.
  2. New bytes after the TCP gap, even when they belong to other HTTP/2 streams.
  3. Already delivered application data must be withdrawn from every stream.

TCP delivers bytes in order. Work using already delivered bytes can continue; claiming every stream always stalls is too broad.

Go deeper

Common misconception: Already delivered application data must be withdrawn from every stream.

TCP never withdraws bytes it has delivered. A gap only holds back the bytes after it until retransmission fills it.

  1. Identify the contract: Each HTTP version fixed the blocking problem one layer lower.
  2. Trace the concrete example: Same request, three different blocking stories underneath.
  3. Test the changed constraint: What does HTTP/3 remove at the transport-stream level, and which shared congestion or connection effects remain?

Transfer challenge: What does HTTP/3 remove at the transport-stream level, and which shared congestion or connection effects remain?

Connections

  • TCP vs UDP: Streams, datagrams, and trade-offs
  • What TLS Guarantees: Identity, confidentiality, integrity
Learn this lesson with AI

Paste this into Claude, Codex, Cursor or another agent connected to Crabrix Academy. It contains only this lesson’s public details.

I'm learning Rust with Crabrix Academy. Teach me this lesson with the Crabrix Academy tools.
Lesson: HTTP/1.1, 2, and 3 (courseId "interview", lessonId "q-http-versions")
Link: https://crabrix.com/learn/interview/q-http-versions/
Goal: HTTP/2 shares TCP’s ordered byte delivery; QUIC separates delivery of different streams.
Practice: open the starter in the Crabrix Playground (https://crabrix.com/playground/?lesson=interview/q-http-versions) and I will write the code there.
Explain it step by step for my level, let me write the code myself, give hints before any solution, and do not mark anything as passed: only Crabrix checks do that.

In Claude Code, Codex or Cursor, paste it into a chat with Crabrix Academy connected. On a phone, the Claude and ChatGPT apps open the same links.