Skip to content

Try “polymorphism”, “TCP handshake” or “git rebase”.

    Computer Basics / Networking 3: DNS, HTTP and HTTPS

    HTTP Versions: 1.1, 2 and 3

    A shop with one checkout lane:

    Chapter 9 of 133 min read

    The Plain Picture#

    A shop with one checkout lane:

    • HTTP/1.1: one customer at a time per lane. Want to buy 50 things fast? Open 6 lanes (the browser opens up to 6 connections per site).

    • HTTP/2: one lane, but the cashier scans items from many customers interleaved. Much more efficient — but if one item's barcode won't scan, the whole lane stops (TCP head-of-line blocking).

    • HTTP/3: several independent lanes inside one checkout — one stuck barcode only stops its own lane.

    The Real Names and What Changed#

    HTTP/1.1 (1997)HTTP/2 (2015)HTTP/3 (2022)
    Runs onTCPTCPQUIC over UDP (Networking 2: TCP, UDP and Ports Ch 9)
    Formatplain textbinary framesbinary frames
    Requests per connectionone at a timemany at once (multiplexing)many at once
    Header compressionnoneyes (HPACK)yes (QPACK)
    Head-of-line blockingper connectionat TCP level (one loss stalls all)none across streams
    Connection setupTCP + TLS (2 RTT)TCP + TLS (2 RTT)1 RTT combined, 0 on repeat visits
    • Multiplexing = many requests and responses interleaved over one connection, each tagged with a stream number.

    • Your code usually doesn't change: methods, status codes and headers mean exactly the same in all three versions. The difference is how the bytes are packed and carried.

    • The real curl -I https://example.com from Bangalore replied HTTP/2 200 — HTTP/2 is now the normal case for HTTPS sites.

    Gotchas

    • HTTP/2 made some old tricks harmful. With 1.1, sites bundled everything into one giant file and spread assets over many domains to get more connections. With HTTP/2, many small files over one connection is fine.

    • HTTP/3 needs UDP port 443 open. Some corporate firewalls block it; browsers then quietly fall back to HTTP/2.

    Check yourself

    3 questions
    1

    What is multiplexing in HTTP/2?

    Show answer

    Sending many requests/responses at the same time over one connection, interleaved as tagged frames.

    2

    What problem remained in HTTP/2 that HTTP/3 fixes, and how?

    Show answer

    TCP head-of-line blocking — one lost packet stalls all streams. HTTP/3 runs on QUIC, whose streams are independent.

    3

    Do HTTP methods and status codes change between versions?

    Show answer

    No — only how messages are encoded and transported.