Skip to content

blog: post about turning QUIC frames into datagrams#494

Open
matheus23 wants to merge 14 commits into
mainfrom
matheus23/frames-to-datagrams
Open

blog: post about turning QUIC frames into datagrams#494
matheus23 wants to merge 14 commits into
mainfrom
matheus23/frames-to-datagrams

Conversation

@matheus23

@matheus23 matheus23 commented Jul 7, 2026

Copy link
Copy Markdown
Member

My ramblings about QUIC

@matheus23 matheus23 self-assigned this Jul 7, 2026
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
iroh-computer Ready Ready Preview, Comment Jul 21, 2026 3:54pm

Request Review

@n0bot n0bot Bot added this to iroh Jul 7, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Jul 7, 2026
@matheus23
matheus23 marked this pull request as ready for review July 21, 2026 14:14

@flub flub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partial review only


These three encryption levels are in the order of increasing guarantees.
A connection starts out using "Initial" keys, then during the handshake moves to "Handshake" keys and after the full key exchange moves on to the "data" encryption level.
We only ever send application data using the "data" encryption level, also sometimes called the 1-RTT encryption level.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real encryption levels are those that @divagant-martian nicely separated out in the EncryptionLevel enum. I think those names come from RFC9001.

Using this key it can then process all handshake data, which gives it the necessary information to derive the key of the final encryption level: The data key.
Although both keys are derived from the ephemeral key shares from the client and server, the data encryption level provides some important guarantees by including a hash of the whole handshake transcript.

![QUIC handshake sequence across Initial, Handshake, and Data encryption levels](/blog/quic-frames-to-datagrams/handshake-sequence.svg)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's odd that you don't include an ACK for the Handshake from client to server here.

Each packet in the initial or handshake encryption level is a so-called "long header" packet which means it also has a length field indicating where the packet ends.
This allows us to put two packets prepended with their QUIC headers back-to-back into a datagram.

This does not work with the data encryption level. In that level the header doesn't contain a length field, presumably to save some bytes, as packet coalescing is pretty much only useful during the handshake and it's worth saving those bytes after the handshake when no coalescing happens instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a nitpicking view this kind of mixes up encryption levels and packet types. The long header is a 1-RTT packet type. That is kind of orthogonal to the encryption level it goes in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants