QUIC and HTTP/3, Decrypted: Chrome to Cloudflare, Packet by Packet
This walkthrough uses a public capture, chrome-cloudflare-quic-with-secrets.pcapng, shared on CloudShark. You can download it there and follow along in Wireshark. We decoded and annotated it with VisualEther, which turns a Wireshark PCAP into a sequence diagram with a plain-English caption on every message.
QUIC encrypts almost everything, so most QUIC captures show little more than Protected Payload on every packet. This one is different. It carries the browser's TLS secrets inside the file, so Wireshark decrypts every packet: the handshake, the HTTP/3 frames, the ACKs, all of it. That makes it a rare chance to read QUIC the way the endpoints see it.
The capture records Chrome 107 on macOS loading https://cloudflare-quic.com/ twice in November 2022. The first load goes over TCP, TLS 1.3, and HTTP/2. The response tells Chrome that HTTP/3 is available, so the reload five seconds later goes over QUIC. With both connections in one 83-frame file, you can compare the two stacks packet for packet.
We drew the whole capture as one annotated sequence diagram with two lanes, Chrome and Cloudflare. Each of the 59 messages is an arrow, numbered as in Wireshark and captioned with what the packet does and why it matters. The walkthrough below uses the same frame numbers. The diagram comes in three forms:
💡 Read the walkthrough and the diagram side by side: open the interactive diagram in a split-screen window, or open it in a new tab and snap the two windows side by side.
Overview
The capture tells a short story in four phases:
- The first visit, over TCP (frames 1–46). TCP handshake, TLS 1.3 handshake, then
GET /over HTTP/2. The response carries analt-svcheader advertising HTTP/3. - The QUIC handshake (frames 47–53). 5.4 seconds later Chrome reloads the page, this time over QUIC. One round trip sets up the connection and its encryption.
- HTTP/3 over the 1-RTT connection (frames 54–79). Both sides open their control and header-compression streams, Chrome sends
GET /, and Cloudflare returns the same page. Along the way, Cloudflare tests Chrome with a deliberately unknown stream type. - Teardown (frames 80–83). Chrome closes both connections at the same moment.
A primer on QUIC and HTTP/3
QUIC (RFC 9000) is a transport protocol that runs over UDP and does the jobs TCP and TLS used to do: reliable delivery, flow control, congestion control, and encryption. HTTP/3 (RFC 9114) is HTTP mapped onto QUIC. A few ideas make the frames easy to read:
- TLS inside QUIC. QUIC uses the TLS 1.3 handshake (RFC 9001), but not TLS records. The handshake messages ride in QUIC
CRYPTOframes, and QUIC encrypts its own packets with keys the handshake produces. - Packets and frames. A UDP datagram holds one or more QUIC packets. Each packet holds one or more frames:
CRYPTO,ACK,STREAM,PADDING,PING, and so on. Several packets in one datagram are called coalesced. - Long and short headers. Handshake-era packets (
Initial,Handshake) use a long header that carries the version and both connection IDs. Once the handshake is done, packets use a short header with just the destination connection ID and the packet number. These are the 1-RTT packets. - Three sets of keys.
Initialpackets use keys derived from a value on the wire, so anyone can decrypt them.Handshakepackets use keys from the TLS key exchange. 1-RTT packets use the final application keys. Without the TLS secrets, a capture shows only theInitialpackets in clear. - Connection IDs. Instead of the address-and-port pair TCP uses, each endpoint picks the connection IDs its peer must put on packets sent to it. A connection ID can be zero length.
- Packet number spaces.
Initial,Handshake, and 1-RTT packets each have their own packet numbers, and each space is acknowledged separately. Packet numbers never repeat in a space, even for a retransmission, so an ACK always names exactly one transmission. - Streams. A QUIC connection carries many independent streams. The two low bits of a stream ID say who opened it and whether it is bidirectional: client bidirectional 0, 4, 8…; client unidirectional 2, 6, 10…; server unidirectional 3, 7, 11, 15…. A lost packet delays only the streams whose data it carried.
- HTTP/3 streams. Each request and response uses one client bidirectional stream. Each side also opens three unidirectional streams: a control stream for
SETTINGSand other connection-wide frames, and the QPACK encoder and decoder streams for header compression (RFC 9204). - GREASE. Both Chrome and Cloudflare sprinkle reserved, meaningless values into the protocol: unknown settings, frame types, and stream types. The RFC requires receivers to ignore them, and sending them keeps implementations honest. Reserved codepoints have the form
0x1f × N + 0x21.
The three sets of keys map onto the handshake like this:
Phase 1 — The first visit, over TCP (frames 1–46)
On a first visit, Chrome has no evidence that cloudflare-quic.com speaks HTTP/3, so it starts with the stack every server supports: TCP, TLS, and HTTP/2. Its TLS Client Hello offers ALPN h2 and http/1.1, not h3, because HTTP/3 can't run over TCP.
Frames 1–3 — the TCP handshake. One round trip before any data can flow. The TCP sequence diagrams cover this handshake in detail.
Frames 4–10 — the TLS 1.3 handshake. A second round trip. Chrome's Client Hello lists 16 cipher suites, including TLS 1.2 suites for older servers and a GREASE value. It also sends a 32-byte legacy session ID, and both sides send a dummy Change Cipher Spec record. These two are TLS 1.3's middlebox compatibility mode: they make the handshake look like TLS 1.2 to old network boxes. Hold on to these details; the QUIC version of this handshake drops all of them.
Frames 11–16 — HTTP/2 setup and the request. Chrome sends the HTTP/2 preface, its SETTINGS, and GET / on stream 1, 45.7 ms after its first SYN.
Frame 19 — the hint. The 200 OK arrives at 79.2 ms and carries this header:
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
Alt-Svc (RFC 7838) tells Chrome the same site is available over HTTP/3 on UDP port 443, and that it can remember this for 86,400 seconds, one day. h3-29 names an earlier draft version for older clients.
Frames 23–46 — the body. About 10 KB of Brotli-compressed HTML, in HTTP/2 DATA frames of 4,226, 3,163, and 2,719 bytes, then an empty DATA frame with END_STREAM at 81.6 ms. The connection then sits idle until Chrome closes it in frame 80.
Phase 2 — The QUIC handshake (frames 47–53)
5.4 seconds later, Chrome loads the page again. The request headers include cache-control: no-cache, so this is a reload that skips the browser cache. This time Chrome remembers the alt-svc hint and goes straight to QUIC. The TCP connection from phase 1 is still open but stays silent.
Frame 47 — the Initial anyone can read
QUIC encrypts even the first packet, but the key is no secret. RFC 9001 derives the Initial keys from the Destination Connection ID in Chrome's packet, here the 8 random bytes 203f9e9f68698274, and a salt published in the RFC. Any observer can repeat the calculation, and Wireshark does so automatically. The protection stops off-path tampering and casual inspection, not decryption. So this Client Hello is readable even without the embedded secrets, and the rest of the handshake is not.
Compared with the TCP Client Hello in frame 4, the QUIC one is lean:
- ALPN offers only
h3. - Only the three TLS 1.3 cipher suites.
- An empty legacy session ID and no
Change Cipher Spec: RFC 9001 forbids clients from requesting compatibility mode. - A
quic_transport_parametersextension carries Chrome's QUIC settings: flow-control limits (15 MB for the connection, 6 MB per stream), up to 100 bidirectional streams, and a 30-second idle timeout.
Three more details are worth spotting:
- A zero-length source connection ID. Chrome's
Source Connection ID Lengthis 0. Chrome is telling Cloudflare to send its packets with no connection ID at all. Chrome then identifies the connection by its local UDP port instead. - A scrambled Client Hello. The 300-byte
Client Helloarrives as 9CRYPTOframes in shuffled order, offset 37 first, interleaved withPINGandPADDINGframes. Chrome's QUIC library does this on purpose; it calls the feature chaos protection. A network box that wants the SNI must reassemble the stream properly instead of reading a fixed offset. - A padded datagram. The UDP payload is 1,230 bytes. Clients must pad
Initialdatagrams to at least 1,200 bytes. Until a server has verified the client's address, it may send at most three times the bytes it received, so the padding gives Cloudflare room to reply, and a tiny spoofed packet can't trigger a large reply.
Frames 48–51 — Cloudflare's flight
Cloudflare answers 18.6 ms later with four datagrams:
- Frame 48, an
Initialpacket holding only anACKof Chrome's packet 1. Cloudflare pads this datagram to 1,200 bytes as well, with random bytes after the packet. - Frame 49, an
Initialpacket with theServer Hello: TLS 1.3,TLS_AES_128_GCM_SHA256, an x25519 key share. From here both sides can compute the handshake keys. - Frames 50–51, two
Handshakepackets withEncrypted Extensions, the certificate,Certificate Verify, andFinished. These are the first packets that need the embedded secrets to decrypt.
Encrypted Extensions confirms ALPN h3 and carries Cloudflare's transport parameters. One of them, original_destination_connection_id, echoes Chrome's 203f9e9f68698274, which proves no Retry packet was involved. QUIC version 1 was accepted on the first try, with no version negotiation. Cloudflare's idle timeout is 180 seconds, against Chrome's 30; the smaller one applies.
Connection IDs
Each side chose the connection ID its peer must use:
| Direction | Destination connection ID | Who chose it |
|---|---|---|
Chrome → Cloudflare, first Initial | 203f9e9f68698274 (8 bytes) | Chrome, at random |
| Cloudflare → Chrome | none (zero length) | Chrome, in frame 47 |
| Chrome → Cloudflare, from frame 52 on | 0130dfc5a047e6acd230b5c5e047ced9b0a6bbf0 (20 bytes) | Cloudflare, in frame 48 |
Chrome's random first ID matters only for the first round trip and for deriving the Initial keys. From frame 52 on, Chrome uses the 20-byte ID Cloudflare chose. Cloudflare's 1-RTT packets carry no connection ID at all; Wireshark shows them with just a packet number.
Frames 52–53 — Chrome finishes
Chrome acknowledges the Handshake packets and sends its own Finished 24.0 ms after its first packet. That completes the handshake in one round trip. Over TCP, the equivalent point, frame 10, came at 45.4 ms, after two round trips.
Packet number spaces, side by side
The packet numbers show the three spaces at work:
| Space | Chrome's packets | Cloudflare's packets |
|---|---|---|
Initial | 1 (frame 47) | 0, 1 (frames 48–49) |
Handshake | 2, 3 (frames 52–53) | 0, 1, 2 (frames 50, 51, 56) |
| 1-RTT | 4 to 14 (frames 54–81) | 0 to 15 (frames 56–78) |
Cloudflare restarts at 0 in each space, as RFC 9000 describes. Chrome's numbers run 1, then 2–3, then 4–14, as if drawn from a single counter. RFC 9000 says each space starts at packet number 0. Receivers depend only on numbers increasing within a space, so the gaps do no harm, and Cloudflare's ACKs simply name the numbers Chrome used.
Phase 3 — HTTP/3 over the 1-RTT connection (frames 54–79)
Frames 54–55 — Chrome opens its streams and sends the request
Right after its Finished, Chrome switches to short-header 1-RTT packets.
Frame 54 opens Chrome's control stream, unidirectional stream 2, with stream type 0x00 and a SETTINGS frame: a QPACK dynamic table of up to 65,536 bytes, header sections up to 262,144 bytes, and up to 100 streams allowed to wait on the table. Chrome also slips in a reserved GREASE setting and an empty GREASE frame.
Frame 55 carries GET / on bidirectional stream 0, the first client request stream, with the FIN bit set because a GET has no body. The same packet adds a PRIORITY_UPDATE frame on the control stream (RFC 9218) that gives stream 0 urgency u=0, the highest.
The request leaves 24.2 ms after Chrome's first QUIC packet. Over TCP it took 45.7 ms.
Here is frame 55 as Wireshark decodes it with the secrets loaded. The QUIC layer shows the short header and two STREAM frames; the HTTP/3 layers below show the PRIORITY_UPDATE and the full decoded request headers. Without the secrets, all of this is a single Protected Payload field.
frame : Frame 55: Packet, 540 bytes on wire (4320 bits), 540 bytes captured (4320 bits) on interface eth0, id 0
Interface id : 0 (eth0)
Packet flags : 0x00000000
eth : Ethernet II, Src: f0:18:98:e8:7a:f3, Dst: 00:03:2d:87:59:70
Destination : 00:03:2d:87:59:70
Source : f0:18:98:e8:7a:f3
ipv6 : Internet Protocol Version 6, Src: 2001:db8:1::1, Dst: 2606:4700:10::6816:826
.... 0000 0000 .... .... .... .... .... = Traffic Class : 0x00 (DSCP: CS0, ECN: Not-ECT)
Source Address : 2001:db8:1::1
Special-Purpose Allocation : Documentation
Source or Destination Address : 2001:db8:1::1
Special-Purpose Allocation : Documentation
Destination Address : 2606:4700:10::6816:826
Source or Destination Address : 2606:4700:10::6816:826
udp : User Datagram Protocol, Src Port: 50280, Dst Port: 443
Timestamps
quic : QUIC IETF
QUIC Connection information
QUIC Short Header DCID=0130dfc5a047e6acd230b5c5e047ced9b0a6bbf0 PKN=5
STREAM id=2 fin=0 off=41 len=9 dir=Unidirectional origin=Client-initiated
Frame Type : STREAM (0x000000000000000e)
Stream ID : 2
STREAM id=0 fin=1 off=0 len=425 dir=Bidirectional origin=Client-initiated
Frame Type : STREAM (0x0000000000000009)
Stream ID : 0
http3 : Hypertext Transfer Protocol Version 3
Uni Stream
PRIORITY_UPDATE len=4
http3 : Hypertext Transfer Protocol Version 3
Request Stream
HEADERS len=422
Header : :method: GET
Header : :authority: cloudflare-quic.com
Header : :scheme: https
Header : :path: /
Header : pragma: no-cache
Header : cache-control: no-cache
Header : sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"
Header : sec-ch-ua-mobile: ?0
Header : sec-ch-ua-platform: "macOS"
Header : upgrade-insecure-requests: 1
Header : user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Header : accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Header : sec-fetch-site: none
Header : sec-fetch-mode: navigate
Header : sec-fetch-user: ?1
Header : sec-fetch-dest: document
Header : accept-encoding: gzip, deflate, br
Header : accept-language: en-US,en;q=0.9
Frame 55, Chrome's HTTP/3 request, decrypted. Open the QUIC layer for the short header (destination connection ID and packet number 5) and the STREAM frames for streams 2 and 0. The HTTP/3 layers hold the PRIORITY_UPDATE and the HEADERS frame with :method GET and the rest of the request.
Frame 56 — handshake confirmed, and Cloudflare's control stream
Frame 56 is one UDP datagram with two coalesced QUIC packets:
- A
Handshakepacket that acknowledges Chrome'sHandshakepackets 2–3. - A 1-RTT packet, Cloudflare's packet 0, carrying:
- an
ACKof Chrome's 1-RTT packets 4–5; HANDSHAKE_DONE, which tells Chrome the handshake is confirmed;- two TLS
NewSessionTicketmessages. Theirearly_dataextension tells Chrome it may send 0-RTT data when it next resumes a session. This capture contains no 0-RTT; - Cloudflare's control stream, stream 3, with its
SETTINGS: header sections up to 65,536 bytes, plus a GREASE setting.
- an
Frames 57–59 — the QPACK streams
HTTP/3 compresses headers with QPACK, which can keep a dynamic table of recently used headers. Updates to that table travel on two dedicated unidirectional streams, separate from the requests. Cloudflare opens its encoder stream (stream 7, type 0x02) and decoder stream (stream 11, type 0x03), and sends nothing on them beyond the stream type.
The table stays empty in both directions. Cloudflare doesn't use the 65,536-byte table Chrome offered. Chrome can't use one toward Cloudflare: Cloudflare's SETTINGS advertise no table capacity, so the default of 0 applies. Both header blocks in this connection use only QPACK's static table and literal header fields. Chrome never opens its own QPACK streams in this capture.
Frames 60, 61, and 68 — the GREASE stream test
Frame 60. Cloudflare opens a fourth unidirectional stream, 15, with stream type 0x1cd3763bdc59087d. That value has the reserved form 0x1f × N + 0x21: it is GREASE, a stream type that no implementation understands. Cloudflare sends 26 bytes and closes its side.
Frame 61. Chrome passes the test. It sends STOP_SENDING for stream 15 with error code 0x103, H3_STREAM_CREATION_ERROR. RFC 9114 says a receiver must abort or discard a stream of unknown type, preferably with that code, and must never treat it as a connection error.
Frame 68. Cloudflare answers with RESET_STREAM for stream 15, echoing error 0x103, with a final size of 26 bytes. RFC 9000 requires an endpoint that receives STOP_SENDING to send RESET_STREAM, and recommends copying the error code. The GREASE stream is now closed in both directions, and the rest of the connection is unaffected.
Frames 62–78 — the response
Frame 62. The 200 OK arrives 56.6 ms after Chrome's first QUIC packet; over TCP it took 79.2 ms. Stream 0 starts with two more GREASE frames, one carrying the ASCII text GREASE is the word, then the HEADERS frame. The response repeats the alt-svc header, renewing the HTTP/3 hint for another day.
Frames 63–78. The body follows as HTTP/3 DATA frames of 4,226, 2,147, 1,019, 2,718, and 1 bytes. HTTP/3 frames don't line up with packets: Wireshark reassembled the first DATA frame from four packets (62, 63, 65, and 66). The diagram shows packets with no frame boundary as QUIC STREAM arrows, with their stream offset. Packet 15 (frame 78) sets FIN on stream 0 at offset 10,288, 70.3 ms after Chrome's first packet. It also carries an empty DATA frame, which HTTP/3 doesn't need: the stream's FIN is what ends the response.
The ACKs
Chrome acknowledges Cloudflare's 1-RTT packets with small ACK-only packets, each with a few bytes of PADDING. An ACK frame reports the largest packet number received, then ranges of received packets counting down from it:
| Frame | Chrome's packet | Acknowledges Cloudflare's packets |
|---|---|---|
| 58 | 6 | 0–1 |
| 61 | 7 | 0–3 |
| 64 | 8 | 0–5 |
| 67 | 9 | 0–7 |
| 71 | 10 | 3–9 |
| 74 | 11 | 3–11 |
| 77 | 12 | 3–13 |
| 79 | 13 | 3–15 |
Every range is unbroken: no packet was lost, and nothing was retransmitted. The drop from 0–7 to 3–9 in frame 71 is deliberate. In frame 68, Cloudflare acknowledged Chrome's packet 7, which carried the ACK reporting packets up to 3. Chrome now knows that Cloudflare saw that report, so it stops repeating packets 0–2 (RFC 9000 section 13.2.4). This keeps ACK frames short on long connections.
Cloudflare acknowledges far less often. Its only 1-RTT ACKs are in frame 56 (Chrome's packets 4–5) and frame 68 (packets 6–7). Chrome's later packets hold nothing but ACK frames and padding, and RFC 9000 doesn't require anyone to acknowledge a packet like that. Packet 7 got an ACK because it also carried the STOP_SENDING.
Phase 4 — Teardown (frames 80–83)
Both connections then sit idle for 5.3 seconds. At 10.8 seconds Chrome closes both within half a millisecond: a TCP FIN in frame 80 and a QUIC CONNECTION_CLOSE in frame 81.
The CONNECTION_CLOSE carries transport error NO_ERROR with the reason phrase 70:net error from Chrome's network stack. It isn't an idle timeout, which would take 30 seconds. The same packet repeats the ACK of Cloudflare's packets 3–15. Its ACK Delay field reads 659,814. Multiplied by 2³ (the default ack_delay_exponent of 3, which Chrome didn't change), that is 5.28 seconds, exactly the time since Cloudflare's last packet.
TCP needs Cloudflare's FIN and Chrome's final ACK (frames 82–83) to finish. QUIC needs nothing more: once a CONNECTION_CLOSE is sent, the connection is over.
TCP versus QUIC, same page, same server
| Milestone | TCP + TLS + HTTP/2 | QUIC + HTTP/3 |
|---|---|---|
Handshake complete (client Finished) | 45.4 ms (frame 10) | 24.0 ms (frame 53) |
| Request sent | 45.7 ms (frame 12) | 24.2 ms (frame 55) |
| Response headers received | 79.2 ms (frame 19) | 56.6 ms (frame 62) |
| Response complete | 81.6 ms (frame 44) | 70.3 ms (frame 78) |
| Round trips before the request | 2 | 1 |
Times are from each connection's first packet. The response headers arrived 22.6 ms sooner over QUIC, roughly one round trip on this path. That is the saved handshake round trip. One page load on one network doesn't prove a speedup in general, but the round-trip count is structural: TCP and TLS each need their own, and QUIC does both in one.
Capturing your own decrypted QUIC trace
The embedded secrets are what make this capture readable. You can make one like it:
-
Log the TLS secrets. Chrome, Firefox, and curl write their TLS session secrets to the file named in the
SSLKEYLOGFILEenvironment variable, in the NSS key log format. Set it before starting the browser:export SSLKEYLOGFILE=$HOME/tls-keys.log # macOS / Linux setx SSLKEYLOGFILE "%USERPROFILE%\tls-keys.log" # Windows, then restart the browserQUIC uses the same TLS 1.3 secrets, so the same file covers both TCP and QUIC connections.
-
Capture the traffic with Wireshark or
tcpdumpwhile you browse. QUIC runs on UDP port 443. -
Decrypt. In Wireshark, point Preferences → Protocols → TLS → (Pre)-Master-Secret log filename at the key log. With
tshark, add-o tls.keylog_file:tls-keys.log. -
Embed the secrets in the capture so it decrypts anywhere, with no separate key file:
editcap --inject-secrets tls,tls-keys.log capture.pcapng capture-with-secrets.pcapngThis writes a pcapng Decryption Secrets Block.
editcap --extract-secretsreads it back out. The capture in this article carries ten secret lines: five for each of its two TLS sessions, the TCP one and the QUIC one.
A key log decrypts every session recorded in it, so treat it like a password. Before you share a capture, make sure the embedded file holds only the sessions you mean to share, not your whole browsing history.
Takeaways
- The first visit uses TCP, by design. A browser can't know a server speaks HTTP/3 until it tells it. Here the
alt-svcheader in the HTTP/2 response did that, and the next load used QUIC. - One round trip instead of two. QUIC folds the transport and TLS handshakes together. The request left after 24 ms instead of 46, and the response headers arrived 23 ms sooner.
- The Initial is readable by anyone, the rest isn't.
Initialkeys come from the packet itself. Everything from theHandshakepackets on needs the TLS secrets, which is whySSLKEYLOGFILEmatters for QUIC troubleshooting. - Connection IDs replace the 4-tuple. Each side picks the ID its peer uses. Chrome chose a zero-length one, so Cloudflare's packets carry none.
- Each packet number space keeps its own count and its own ACKs. Cloudflare restarted at 0 in each space; Chrome's numbers kept climbing across them. Both work, because receivers only need numbers to increase within a space.
- GREASE is visible once decrypted. Reserved settings, frames, and a whole reserved stream show both sides checking that the other ignores what it doesn't understand. Chrome's
STOP_SENDINGand Cloudflare'sRESET_STREAMon stream 15 are that check working.