skip to content

transport protocols · lesson 4 of 8 · sources checked 2026-11-20

http/1.1, http/2, and http/3 on the wire

This lesson shows how a client and a site agree on an HTTP version, and which HTTP/2 frames a TLS endpoint can read.

status of this lesson: from a public source

purpose

The HTTP library of the client, not the page, decides the HTTP version and the first HTTP/2 messages. The client offers its versions with ALPN, and the library sends its first messages in its own order and with its own values. Thus a site can compare them with the claimed client before any page script runs.

objectives

  1. Explain how ALPN selects HTTP/1.1 or HTTP/2 on a TLS connection.
  2. Explain how a client finds HTTP/3 from the Alt-Svc header or from the HTTPS record in DNS.
  3. Describe the HTTP/2 connection preface: the SETTINGS frame, WINDOW_UPDATE, PRIORITY data, and pseudo-headers.
  4. Identify a version mismatch between a client and a site, and the layer that it comes from.

new terms

HTTP/2 frame
One unit of data of an HTTP/2 connection, with a type, for example SETTINGS or HEADERS.
pseudo-header
An HTTP/2 or HTTP/3 header field that starts with a colon, for example `:method` or `:path`.
QUIC
A transport protocol over UDP that carries HTTP/3.

how it works

The version decision has three paths:

pathwhere the client learns ittransport
HTTP/1.1The default of a TLS connectionTCP
HTTP/2The ALPN value h2 in the TLS handshakeTCP
HTTP/3The Alt-Svc header, or the HTTPS record in DNSQUIC on UDP

the version decision on tls

ALPN is a TLS extension. It lets the two sides agree on the application protocol inside the TLS handshake, when one port serves more than one protocol RFC Editor, source 1.

The client puts its list in the ClientHello, and the server selects one value. For example, a browser offers h2 and http/1.1. HTTP/2 over TLS has the identifier h2 RFC Editor, source 2.

The ClientHello is in cleartext, so a device on the path can read the offer. The TLS endpoint also sees the result: the version of each request that follows.

the http/2 connection preface

After the server selects h2, the client sends a fixed preface of 24 octets: PRI * HTTP/2.0, then SM, with line ends. A SETTINGS frame must follow the preface, and it can be empty. Each side applies the SETTINGS of the other side, and then sends a SETTINGS frame with the ACK flag RFC Editor, source 2.

The other parts of the preface come from the same document:

  • WINDOW_UPDATE: the first flow-control window of a stream and of the connection is 65,535 octets. A client can make the window larger with a WINDOW_UPDATE frame.
  • PRIORITY data: RFC 9113 deprecates the priority scheme of the older HTTP/2 document. It keeps the fields, so an old client can still send them.
  • Pseudo-headers: a pseudo-header starts with a colon. The request fields are :method, :scheme, :authority, and :path. All pseudo-headers come before the regular fields.

what the preface shows to a defender

The values of the preface are defaults of the HTTP library, not choices of the page. A TLS endpoint can join them into one string: the SETTINGS values in their order, the window increment, the PRIORITY data, and the pseudo-header order.

example Two clients send the same ClientHello. Client A sends three SETTINGS values and the pseudo-header order :method, :authority, :scheme, :path. Client B sends six SETTINGS values and the order :method, :path, :authority, :scheme. The TLS values collide, but the HTTP/2 string separates the two libraries.

In my model, the HTTP/2 string is a second fingerprint beside the TLS fingerprint. It names the HTTP library family. It does not name the device.

http/3 on quic

status of this section: estimate, not measured

HTTP/3 does not use the TCP connection. It runs on QUIC, a transport on UDP RFC Editor, source 3.

A client learns of HTTP/3 in one of two ways:

  • From a response header on an earlier connection, for example Alt-Svc: h3=":443". The client can then try a QUIC connection to that port. In the QUIC handshake, the ALPN value is h3. When UDP is blocked, the document gives the client a rule: use a TCP version of HTTP RFC Editor, source 4.
  • From the HTTPS record in DNS, for example alpn=h3. The client knows the HTTP/3 offer before its first HTTP connection RFC Editor, source 5.

No measurement of this course tests HTTP/3 or QUIC. Thus the use of HTTP/3 as a signal is an estimate. A site that offers h3 can see that a client never comes back on QUIC. The cause can be the client, or a network path that blocks UDP.

a version mismatch

A mismatch is a difference between the version that a client claims and the version that its HTTP library uses. For example, a request claims a current browser, but it offers only http/1.1 to a site that serves h2. In my model, this difference is a coarse transport signal.

A page script can read the version of its own fetch. The nextHopProtocol value gives the ALPN identifier, for example h2 or h3. Behind a tunnel, it gives the protocol inside the tunnel MDN, source 6.

A failed negotiation is also a fact for the defender. RFC 7301 states that a server that has none of the protocols of the list must send the fatal alert no_application_protocol RFC Editor, source 1.

In my model, a server that does not use ALPN sends no ALPN value, and the client then stays on HTTP/1.1. Each of these results points to the HTTP library, not to the page.

the two sides

automation sidedetection side
An HTTP library that offers only http/1.1 to a site that serves h2 shows a coarse transport difference. The client library decides the order of the HTTP/2 frames and the SETTINGS values. A setting in the page does not change them.The SETTINGS values, the WINDOW_UPDATE size, PRIORITY data, and the pseudo-header order can separate HTTP libraries when the TLS values collide. A site that offers h3 can see which clients come back on QUIC.

design decisions

optiongaincostwhen it is correct
Log the selected ALPN value at the TLS endpointEach request has its HTTP version as a fact.One more field for each log line.Each site that compares the claimed client with its transport
Join the preface values into one HTTP/2 stringThe string separates libraries that send the same ClientHello.The string changes when a library changes its defaults.A defender that already reads the TLS fingerprint
Use the HTTP/3 return as a signalA client that never uses QUIC is visible.A network that blocks UDP gives the same result.Only together with other signals, until a lab measures it
Read nextHopProtocol in your own lab pageYou see the version of each fetch from the page.A cross-origin fetch can give an empty value.A lab check of your own client

diagram

how a client and a site agree on http/1.1, http/2, or http/3

A client can find HTTP/3 before the first HTTP response, from DNS, or after it, from a response header.source: My model of the version decision, from RFC 7301, RFC 9114, and RFC 9460

the http/2 connection preface after the tls handshake selects h2

Each side must acknowledge the SETTINGS of the other side before it can rely on them.source: My model of the HTTP/2 connection preface, from RFC 9113

failure modes

problemcausecorrection
The log shows HTTP/1.1 for a client that claims a current browser.The HTTP library of the client offers no h2 in ALPN.Compare the ALPN list in the ClientHello with the claimed client before you trust the claim.
Two clients with the same TLS fingerprint get one result.The defender reads only the TLS layer.Add the HTTP/2 string of the preface as a second input.
The HTTP/2 string of one client changes after an update.The library changed its SETTINGS defaults.Keep a version for each known string, and review the list after each library release.
A site counts each client with no QUIC return as automation.A network on the path blocks UDP.Use the QUIC return only with other signals.
nextHopProtocol is empty in a lab page.The fetch is cross-origin, and the response has no Timing-Allow-Origin header.Read the value of a same-origin fetch, or add the header on your lab server.

check questions

  1. Explain how ALPN selects HTTP/1.1 or HTTP/2 on a TLS connection.

    sample answer

    The client puts a list of protocols in the ClientHello, for example h2 and http/1.1. The server selects one value of the list. With h2, the connection uses HTTP/2. With http/1.1 or with no ALPN value, it uses HTTP/1.1.

  2. Explain the two ways in which a client can find HTTP/3 for a site.

    sample answer

    The client can read an Alt-Svc header with h3 in a response on an earlier connection. Or it can read an HTTPS record in DNS with alpn=h3 before its first HTTP connection. Then it tries a QUIC connection on UDP.

  3. Which part must come directly after the fixed preface of an HTTP/2 client?

    1. A HEADERS frame with the pseudo-headers
    2. A SETTINGS frame, which can be empty
    3. A PRIORITY frame
    4. A WINDOW_UPDATE frame
    answer

    b. A SETTINGS frame, which can be empty

    RFC 9113 says that a SETTINGS frame must follow the preface. It can be empty. A WINDOW_UPDATE frame is optional.

  4. Describe the rule for the order of pseudo-headers in an HTTP/2 request.

    sample answer

    A pseudo-header starts with a colon. The request fields are :method, :scheme, :authority, and :path. All pseudo-headers come before the regular fields. The order inside the pseudo-headers comes from the HTTP library of the client.

  5. A request claims a current browser, but the TLS endpoint logs HTTP/1.1 on a site that serves h2. Where does the difference show?

    1. The page script
    2. The DNS resolver
    3. The ALPN list of the HTTP library in the ClientHello
    4. The cookie store
    answer

    c. The ALPN list of the HTTP library in the ClientHello

    The HTTP library of the client offers its versions in the ClientHello. The page does not change this list.

exercise

exercise Do this task in your own lab only. Use a lab server that you control and that serves HTTP/2 and HTTP/1.1 on TLS.

  1. Open a page of your lab server in a browser.
  2. In the console of the browser, read performance.getEntriesByType("navigation")[0].nextHopProtocol.
  3. Record the value.
  4. Send one request to the same page with an HTTP client that offers only HTTP/1.1.
  5. Read the HTTP version of each request in the log of your lab server.
  6. Write the layer that shows the difference.
sample answer

The answer uses a lab server that serves h2 and http/1.1.

The browser gives h2, and the log of the server shows HTTP/2 for its request. The second client gives HTTP/1.1 in the log. The difference comes from the ALPN list in the ClientHello, thus from the HTTP library of the client. The page and its script do not cause it.

sources

  1. RFC 7301: ALPN, RFC Editor, standard, read 2026-11-20
  2. RFC 9113: HTTP/2, RFC Editor, standard, read 2026-11-20
  3. RFC 9000: QUIC, RFC Editor, standard, read 2026-11-20
  4. RFC 9114: HTTP/3, RFC Editor, standard, read 2026-11-20
  5. RFC 9460: SVCB and HTTPS records, RFC Editor, standard, read 2026-11-20
  6. PerformanceResourceTiming: nextHopProtocol property, MDN, documentation, read 2026-11-20
  7. My model of the version decision and of the HTTP/2 preface as a signal, 2026-11 (not public).