Subject: [quicwg/base-drafts] Update draft-ietf-quic-transport.md (#2927)

From: ianswett <[email-masked]>
Date: Tue, 23 Jul 2019 06:32:29 -0700

Allows smaller stateless resets to be sent(as small as 21 bytes) and advises endpoints that want to ensure a stateless reset is not detectable send a larger packet if their chosen CIDs are more than 2 bytes.

Fixes #2869 
You can view, comment on, or merge this pull request online at:

  https://github.com/quicwg/base-drafts/pull/2927

-- Commit Summary --

  * Update draft-ietf-quic-transport.md

-- File Changes --

    M draft-ietf-quic-transport.md (21)

-- Patch Links --

https://github.com/quicwg/base-drafts/pull/2927.patch
https://github.com/quicwg/base-drafts/pull/2927.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927

---

From: Nick Banks <[email-masked]>
Date: Tue, 23 Jul 2019 06:36:19 -0700

nibanks commented on this pull request.

>  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.
+packets that are smaller than 21 bytes are never valid.  When a packet is b

```suggestion
packets that are smaller than 21 bytes are never valid.
```
This looks like it was unintentional?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927#pullrequestreview-265411582

---

From: David Schinazi <[email-masked]>
Date: Tue, 23 Jul 2019 06:38:45 -0700

DavidSchinazi commented on this pull request.

> @@ -2389,19 +2389,26 @@ 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 packet to appear as valid, the
-Unpredictable Bits field needs to include at least 198 bits of data (or 25
-bytes, less the two fixed bits).  This is intended to allow for a Destination
-Connection ID of the maximum length permitted, with a minimal packet number, and
-payload.  The Stateless Reset Token corresponds to the minimum expansion of the
+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), because packets that are smaller than 21 bytes are never
+valid.  To ensure the stateless reset packet is not smaller than other
+packets received on the connection, the an endpoint SHOULD also ensure the

typo: the an

> @@ -2389,19 +2389,26 @@ 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 packet to appear as valid, the
-Unpredictable Bits field needs to include at least 198 bits of data (or 25
-bytes, less the two fixed bits).  This is intended to allow for a Destination
-Connection ID of the maximum length permitted, with a minimal packet number, and
-payload.  The Stateless Reset Token corresponds to the minimum expansion of the
+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), because packets that are smaller than 21 bytes are never
+valid.  To ensure the stateless reset packet is not smaller than other
+packets received on the connection, the an endpoint SHOULD also ensure the
+total packet length is at least the minimum chosen CID length + 19 bytes.
+19 bytes allows for 1 type byte, 1 data byte, the 16 byte authentication

The invariant we have is `payload_length + packet_number_length >= 4` to which you add type byte (1) and auth tag (16) to get 1 + 4 + 16 = 21. I think we want 22 + chosen CID length

was this intentional?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927#pullrequestreview-265410787

---

From: ianswett <[email-masked]>
Date: Tue, 23 Jul 2019 06:40:40 -0700

@ianswett pushed 1 commit.

8988d53d105b1289de644a6b02feadbc0270b90c  Update draft-ietf-quic-transport.md

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927/files/a5c33c8c4578101aa56ce8a57b8fb4c52ea01512..8988d53d105b1289de644a6b02feadbc0270b90c

---

From: ianswett <[email-masked]>
Date: Tue, 23 Jul 2019 06:42:04 -0700

ianswett commented on this pull request.

SG

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927#discussion_r306324568

---

From: ianswett <[email-masked]>
Date: Tue, 23 Jul 2019 06:45:56 -0700

3644a037e309bad4897b0ddbbee596096f8004ae  David's comments

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927/files/8988d53d105b1289de644a6b02feadbc0270b90c..3644a037e309bad4897b0ddbbee596096f8004ae

---

From: ianswett <[email-masked]>
Date: Tue, 23 Jul 2019 06:46:25 -0700

70bbc1be0d67a35d3077ae8d9e2f9330e35c62e8  Update draft-ietf-quic-transport.md

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927/files/3644a037e309bad4897b0ddbbee596096f8004ae..70bbc1be0d67a35d3077ae8d9e2f9330e35c62e8

---

From: David Schinazi <[email-masked]>
Date: Tue, 23 Jul 2019 06:48:40 -0700

DavidSchinazi approved this pull request.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927#pullrequestreview-265420071

---

From: Mike Bishop <[email-masked]>
Date: Mon, 29 Jul 2019 07:25:50 -0700

MikeBishop approved this pull request.

> @@ -2389,11 +2389,17 @@ of bytes following it that are set to unpredictable values.  The last 16 bytes

Needing "at least 48 bits" isn't a requirement to "be smaller than the received packet."  This addition doesn't compute.

> @@ -2389,11 +2389,17 @@ of bytes following it that are set to unpredictable values.  The last 16 bytes
 
 To entities other than its intended recipient, a stateless reset will appear
-to be a packet with a short header.  For the packet to appear as valid, the
-Unpredictable Bits field needs to include at least 198 bits of data (or 25
-bytes, less the two fixed bits).  This is intended to allow for a Destination
-Connection ID of the maximum length permitted, with a minimal packet number, and
-payload.  The Stateless Reset Token corresponds to the minimum expansion of the
+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 48 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 + 22 bytes.

Defer to @martinthomson on the styling, but perhaps spell out "plus" here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927#pullrequestreview-267818042

---

From: Martin Thomson <[email-masked]>
Date: Mon, 29 Jul 2019 16:11:24 -0700

martinthomson requested changes on this pull request.

One calculation error to fix, and some editorial suggestions.

```suggestion
Bits field needs to include at least 46 bits of data (or 6 bytes, less the
```

```suggestion
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, the
+16 byte authentication tag, and the one extra byte to allow the peer to

```suggestion
16 bytes for AEAD expansion, and an extra byte to allow the peer to
```

+22 bytes allows for 1 type byte, 4 packet number and data bytes, the

```suggestion
22 bytes allows for 1 type byte, 4 packet number and data bytes,
```

What Mike said.  I think that you want to say:

> A stateless reset MUST include an Unpredictable Bits field of at least 38 bits (or 5 bytes, less the two fixed bits).  However, this does not account for the length of the connection ID chosen by a peer, which is not known by the endpoint sending a stateless reset.  For a stateless reset to appear to be a valid QUIC packet, the packet needs to appear to contain one type byte, a minimum-sized connection ID, four bytes of packet number and payload, and the AEAD expansion. In order to ensure that a stateless reset is smaller than the packet that triggers it, an endpoint needs to send a packet that is one byte longer than the minimum stateless reset size.  Therefore, endpoints SHOULD always send packets that are at least 22 bytes larger than the minimum connection ID that they might select.
>
>These calculations assume a 16 byte AEAD expansion.  Smaller packets can be sent if the AEAD expansion is less than 16 bytes and larger packets need to be sent for a larger expansion.

> @@ -2367,7 +2367,7 @@ following layout:
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-|0|1|               Unpredictable Bits (198..)                ...
+|0|1|               Unpredictable Bits (46 ..)                ...

```suggestion
|0|1|               Unpredictable Bits (38 ..)                ...
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/pull/2927#pullrequestreview-268080997