Re: [quicwg/base-drafts] Allow Smaller Stateless Resets (#2927)

Martin Thomson <notifications@github.com> Mon, 29 July 2019 23:11 UTC

Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 08E831200A4 for <quic-issues@ietfa.amsl.com>; Mon, 29 Jul 2019 16:11:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8
X-Spam-Level:
X-Spam-Status: No, score=-8 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cBz8ReeJFFpV for <quic-issues@ietfa.amsl.com>; Mon, 29 Jul 2019 16:11:25 -0700 (PDT)
Received: from out-21.smtp.github.com (out-21.smtp.github.com [192.30.252.204]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5728A12004E for <quic-issues@ietf.org>; Mon, 29 Jul 2019 16:11:25 -0700 (PDT)
Date: Mon, 29 Jul 2019 16:11:24 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1564441884; bh=jXjdgsrkPwaxbu0o8sLvWJSZGzjiWPfO2/cOz4UEjt8=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=1SRNKt/PEQTw+KPG7r8pdWjvVtEuoqhXHx9IPmHbfc6nkVQUEeWSgtYQjqSfGIRg9 2t9FYYrjYibHyRqkChNrU74nvfy/48aJ/FAgoz9al+gC+Qtvr4W0J6DKhplozwUyB4 uWSOXOtzI2Aj64/aWvjK9U06s178ecnNYcb/FQ7s=
From: Martin Thomson <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+AFTOJKZMLX5KUQ6HI5BQCSF3JSXZZEVBNHHBYHMRI4@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/pull/2927/review/268080997@github.com>
In-Reply-To: <quicwg/base-drafts/pull/2927@github.com>
References: <quicwg/base-drafts/pull/2927@github.com>
Subject: Re: [quicwg/base-drafts] Allow Smaller Stateless Resets (#2927)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5d3f7d1c79982_1c803fd07e6cd96c791fc"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: martinthomson
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/jtyMwYjlS3pdLNWABA-AdOanrYM>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.29
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 29 Jul 2019 23:11:28 -0000

martinthomson requested changes on this pull request.

One calculation error to fix, and some editorial suggestions.

> @@ -2389,11 +2389,17 @@ 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 48 bits of data (or 6 bytes, less the

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

> @@ -2389,11 +2389,17 @@ 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 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.

```suggestion
total packet length is at least the minimum chosen CID length plus 22 bytes.
```

> @@ -2389,11 +2389,17 @@ 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 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.
+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
```

> @@ -2389,11 +2389,17 @@ 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 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.
+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,
```

> @@ -2389,11 +2389,17 @@ 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

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