TodayTools

QUIC transport protocol

How QUIC works

A faster, encrypted transport built on UDP

Donate
L4TransportPort 443UDP
What brings you here?

Watch it happen

How much detail

A first connection: transport and encryption set up together in one round trip.

Omar's phone
Home Wi-Fi router
Internet
media.example.com
Wi-FiInternetSetupRequestResponseDataControlEncrypted

4 steps, 7 packets

First up: Initial packet. Press Play to watch it happen, one step at a time.

0 of 40/4

What is QUIC?

QUIC is a transport protocol, a modern replacement for TCP plus TLS. It runs on top of UDP, has TLS 1.3 built in, and carries many independent streams inside one connection. Setting up a new connection takes one round trip, and a return visit can send data in the very first packet.

It matters because phones move between networks and Wi-Fi drops packets. A QUIC connection is named by an ID, not by an address, so it survives switching from Wi-Fi to mobile data. A lost packet only delays the stream it belonged to. HTTP/3 is HTTP running on QUIC.

Think of it like this. TCP is a phone call tied to one landline: move house and the call drops. QUIC is a chat thread with a case number: you can switch from your home phone to your mobile, quote the case number, and carry on where you left off. And each topic in the chat is its own thread, so a missing message in one does not hold up the others.

Step by step

Normal

4 steps

A first connection: transport and encryption set up together in one round trip.

  1. 1

    Initial packet

    Hello, padded to 1200 bytes or more

    The phone sends a QUIC Initial packet holding a TLS 1.3 Client Hello. It is padded to at least 1200 bytes so the server is not tricked into flooding a fake address with replies.

  2. 2

    Server handshake

    Initial and Handshake packets together

    The server answers with its Server Hello, then its certificate and Finished in Handshake packets. Several QUIC packets can share one UDP datagram.

  3. 3

    Ready after one round trip

    Finished plus the first request

    The phone checks the certificate, sends its Finished and its first request in the same datagram. TCP plus TLS would need two round trips for this.

  4. 4

    Encrypted data

    Short headers from now on

    Data now uses 1-RTT packets with a tiny header. Everything, even ACKs and most of the header, is encrypted.

Wi-Fi to mobile

5 steps

Omar walks out of the house mid-download. The connection moves to mobile data without starting over.

  1. 1

    On Wi-Fi

    Data flowing from the home address

    The download runs over home Wi-Fi. The server sees the router's public address and port.

  2. 2

    Signal gone

    A packet is lost as Wi-Fi drops

    Omar leaves the house. The phone loses Wi-Fi and a packet goes missing. With TCP the connection would now be dead: TCP connections are tied to the address and port.

  3. 3

    New path

    Same connection, new address

    The phone sends from its mobile address using a fresh connection ID it was given earlier. The server knows the connection by the ID, not the address.

  4. 4

    Path check

    PATH_CHALLENGE and PATH_RESPONSE

    Before sending a lot to the new address, the server checks the phone really is there by sending 8 random bytes and waiting for them to come back.

  5. 5

    Carry on

    The download resumes

    Lost data is resent and the download continues. No new handshake, no restart.

0-RTT return

4 steps

Opening the app again later: the request rides in the very first packet.

  1. 1

    Ticket from last time

    The phone kept a resumption ticket

    On the earlier visit the server sent a session ticket. The phone also remembered the server's transport settings.

  2. 2

    Request in the first flight

    Initial plus 0-RTT in one datagram

    The phone sends its Client Hello and, right behind it, a 0-RTT packet holding the request, encrypted with keys from the ticket.

  3. 3

    Answer at once

    The reply comes with the handshake

    The server accepts the early data and sends the response with its handshake reply. The page starts after a single trip there and back, counting everything.

  4. 4

    The catch

    Early data can be replayed

    Someone could copy the first datagram and send it again. So servers accept 0-RTT only for safe requests like reading a page, never for a payment.

Myths and mix-ups

  • QUIC is just UDP; it adds its own reliability, ordering per stream, flow control and congestion control on top.
  • QUIC can be turned off without encryption; there is no plain-text mode at all.
  • QUIC is only for the web; it is a general transport also used for DNS (DoQ) and other apps.
  • 0-RTT is always safe to use; early data can be replayed, so only harmless requests should use it.

Try it yourself

Run these on your own computer to see QUIC at work.

  • Fetch over QUIC

    curl --http3-only -sI https://example.com/

    Needs a curl built with HTTP/3 support. curl -V lists HTTP3 under Features when it has it.

  • See QUIC sessions in Chrome

    chrome://net-internals/#quic

    Lists live QUIC connections and the versions in use.

  • Spot it in the browser

    F12, Network tab, Protocol column

    Files loaded over QUIC show h3.

QUIC at a glance

Layer
Transport (4), runs over UDP
Usual port
UDP 443 for the web
Encryption
Always on, TLS 1.3 built in
New connection
1 round trip (0 on resumption)
Streams
Many, each delivered in order on its own
Survives address change
Yes, connection IDs
Standardised
May 2021

Defined inRFC 9000RFC 9001RFC 9002RFC 8999

Header fields

What QUIC puts in its messages, with example values from the stories above.

QUIC 0 (Initial)

Header form
1 (long header)Long headers are used only while connecting. They carry the version and both connection IDs.
Fixed bit
1
Packet type
0 (Initial)
Version
0x00000001 (QUIC v1)
Destination connection ID
8394c8f03e515708Names the connection, not the address. This is what lets a connection survive a change of network.
Packet number
0Never reused, even for a resend, so there is no doubt which copy an ACK refers to.
Frames
CRYPTO (Client Hello, ALPN h3), PADDING
Token length
0
Padding
Fills the datagram to 1250 bytesThe server may send at most three times what it received until it trusts the address.

QUIC 2 (Handshake)

Header form
1 (long header)Long headers are used only while connecting. They carry the version and both connection IDs.
Fixed bit
1
Packet type
2 (Handshake)
Version
0x00000001 (QUIC v1)
Destination connection ID
c4a5f2b1e0d39a77Names the connection, not the address. This is what lets a connection survive a change of network.
Packet number
0Never reused, even for a resend, so there is no doubt which copy an ACK refers to.
Frames
CRYPTO (Encrypted Extensions, Certificate part 1)
Encrypted with
Handshake keysKeys from the key exchange, so the certificate is already hidden from onlookers.

QUIC 1-RTT

Header form
0 (short header)After the handshake the header shrinks to a few bytes: no version, no source ID.
Key phase
0
Destination connection ID
3e9b1a20f7c66d01
Packet number
0Even the packet number is hidden by header protection.
Frames (encrypted)
STREAM 0 (request), STREAM 2, 6, 10 (HTTP/3 control)
Saved time
One round tripTCP and TLS have separate handshakes. QUIC does both in one.
NEW_CONNECTION_ID
9d02e4a8b13f5c70A spare ID the phone can switch to later, so a move to another network cannot be linked by onlookers.
NEW_TOKEN
Address tokenLets the phone skip address checks next time.
Stream offset
1186Each stream counts its own bytes, so a gap in one stream does not block the others.
ACK delay
1 msTells the server how long the phone held the ACK, so round trip time is measured fairly.

Test yourself

Question 1 of 5Score 0

What does QUIC run on top of?

Questions people ask

What is the difference between QUIC and TCP?

Both deliver data reliably. QUIC runs over UDP, is always encrypted, connects faster, keeps streams independent and survives address changes. TCP is older, simpler and supported everywhere.

What port does QUIC use?

QUIC has no fixed port. For the web it uses UDP port 443, matching HTTPS.

Is QUIC the same as HTTP/3?

No. QUIC is the transport. HTTP/3 is the version of HTTP that runs on it, the way HTTP/2 runs on TCP plus TLS.

Why do some networks block QUIC?

Some firewalls block UDP 443 because they cannot inspect encrypted QUIC traffic. Browsers then fall back to HTTPS over TCP.

Is QUIC secure?

Yes. It always uses TLS 1.3 and also encrypts most of its own header, including ACKs and packet numbers.

Donate