Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to make the stateless reset text better #3007

Merged
merged 4 commits into from
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions draft-ietf-quic-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -2460,26 +2460,32 @@ of the packet header. The remainder of the first byte and an arbitrary number
of bytes following it that are set to unpredictable values. The last 16 bytes
of the datagram contain a Stateless Reset Token.

To entities other than its intended recipient, a stateless reset will appear
to be a packet with a short header. For the stateless reset to appear as a
valid QUIC packet and be smaller than the received packet, the Unpredictable
Bits field needs to include at least 46 bits of data (or 6 bytes, less the
two fixed bits). To ensure the stateless reset packet is not smaller than
other packets received on the connection, an endpoint SHOULD also ensure the
total packet length is at least the minimum chosen CID length plus 22 bytes.
22 bytes allows for 1 type byte, 4 packet number and data bytes,
16 bytes for AEAD expansion, and an extra byte to allow the peer to
send a smaller stateless reset than the packet it receives.

The Stateless Reset Token corresponds to the minimum expansion of the
packet protection AEAD. More unpredictable bytes might be necessary if the
endpoint could have negotiated a packet protection scheme with a larger minimum
AEAD expansion.

An endpoint SHOULD NOT send a stateless reset that is significantly larger than
the packet it receives. Endpoints MUST discard packets that are too small to be
valid QUIC packets. With the set of AEAD functions defined in {{QUIC-TLS}},
packets that are smaller than 21 bytes are never valid.
To entities other than its intended recipient, a stateless reset will appear to
be a packet with a short header. For the stateless reset to appear as a valid
QUIC packet, the Unpredictable Bits field needs to include at least 38 bits of
data (or 5 bytes, less the two fixed bits).

A minimum size of 21 bytes does not guarantee that a stateless reset is
difficult to distinguish from other packets if the recipient requires the use of
a connection ID. To prevent a resulting stateless reset from being trivially
distinguishable from a valid packet, all packets sent by an endpoint SHOULD be
padded to at least 22 bytes longer than the minimum connection ID that the
endpoint might use. An endpoint that sends a stateless reset in response to
packet that is 43 bytes or less in length SHOULD send a stateless reset that is
one byte shorter than the packet it responds to.
Copy link
Contributor

Choose a reason for hiding this comment

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

at least one byte?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is precisely one. If the sender is following their side and sending the absolute minimum, then you can't go smaller without the resulting packet becoming obviously invalid.


These values assume that the Stateless Reset Token is the same as the minimum
expansion of the packet protection AEAD. Additional unpredictable bytes are
necessary if the endpoint could have negotiated a packet protection scheme with
a larger minimum expansion.

An endpoint MUST NOT send a stateless reset that is three times or more larger
than the packet it receives to avoid being used for amplification.
{{reset-looping}} describes additional limits on stateless reset size.

Endpoints MUST discard packets that are too small to be valid QUIC packets.
With the set of AEAD functions defined in {{QUIC-TLS}}, packets that are smaller
than 21 bytes are never valid.

Endpoints MUST send stateless reset packets formatted as a packet with a short
header. However, endpoints MUST treat any packet ending in a valid stateless
Expand Down Expand Up @@ -2516,9 +2522,6 @@ Using a randomized connection ID results in two problems:
occasionally uses different connection IDs might introduce some uncertainty
about this.

Finally, the last 16 bytes of the packet are set to the value of the Stateless
Reset Token.

This stateless reset design is specific to QUIC version 1. An endpoint that
supports multiple versions of QUIC needs to generate a stateless reset that will
be accepted by peers that support any version that the endpoint might support
Expand Down