Subject: [quicwg/base-drafts] Randomize packet numbers more, not less (#964)

From: Martin Thomson <[email-masked]>
Date: Wed, 29 Nov 2017 01:18:48 +0000 (UTC)

Closes #864, #850.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Randomize packet numbers more, not less

-- File Changes --

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

-- Patch Links --

https://github.com/quicwg/base-drafts/pull/964.patch
https://github.com/quicwg/base-drafts/pull/964.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/964

---

From: Matthew Kerwin <[email-masked]>
Date: Wed, 29 Nov 2017 01:48:24 +0000 (UTC)

phluid61 commented on this pull request.

> +The initial value for packet number MUST be selected randomly from a range
+between 0 and 2^32 - 1024.  This value is selected so that Initial and Handshake
+packets exercise as many possible values for the Packet Number field as
+possible.
+
+Limiting the range allows both for loss of packets and for any stateless
+exchanges.  Packet numbers are incremented for subsequent packets, but packet
+loss and stateless handling can both mean that the first packet sent by an
+endpoint isn't necessarily the first packet received by its peer.  The first
+packet received by a peer cannot be 2^32 or greater or the recipient will
+incorrectly assume a packet number that is 2^32 values lower and discard the
+packet.
+
+Use of a secure random number generator {{?RFC4086}} is not necessary for
+generating the initial packet number, nor is it necessary that the value be
+uniformly distributed.

[![oblig.](https://imgs.xkcd.com/comics/random_number.png)](https://xkcd.com/221/)

-- 
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/964#pullrequestreview-79716259

---

From: janaiyengar <[email-masked]>
Date: Wed, 29 Nov 2017 01:56:09 +0000 (UTC)

janaiyengar approved this pull request.

LGTM, modulo one comment.

+
+Packets with the long header include the low 32-bits of the packet number.
+Packets that use the short header can use a shorter packet number encoding.

These last two sentences seem out of place. This section is about Initial packet number.

-- 
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/964#pullrequestreview-79717231

---

From: janaiyengar <[email-masked]>
Date: Wed, 29 Nov 2017 02:00:19 +0000 (UTC)

janaiyengar commented on this pull request.

Sorry, one more comment.

+

Never mind. This seems fine.

> @@ -743,14 +743,25 @@ have special rules for populating the packet number field.
 
 ### Initial Packet Number {#initial-packet-number}
 
-The initial value for packet number MUST be selected from an uniform random
-distribution between 0 and 2^31-1.  That is, the lower 31 bits of the packet
-number are randomized.  {{?RFC4086}} provides guidance on the generation of
-random values.
-
-The first set of packets sent by an endpoint MUST include the low 32-bits of the
-packet number.  Once any packet has been acknowledged, subsequent packets can
-use a shorter packet number encoding.
+The initial value for packet number MUST be selected randomly from a range
+between 0 and 2^32 - 1024.  This value is selected so that Initial and Handshake

Is this inclusive of 0 and 2 ^ 32 - 1024? I would say yes, and I don't actually care, but the spec should say it.

-- 
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/964#pullrequestreview-79717699

---

From: Martin Thomson <[email-masked]>
Date: Wed, 29 Nov 2017 02:55:28 +0000 (UTC)

martinthomson commented on this pull request.

+

Sure, I'll delete those.  I was trying to fix a paragraph that wasn't right in the first place.

-- 
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/964#discussion_r153683130

---

From: Martin Thomson <[email-masked]>
Date: Wed, 29 Nov 2017 02:56:06 +0000 (UTC)

indeed

-- 
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/964#discussion_r153683199

---

From: Martin Thomson <[email-masked]>
Date: Wed, 29 Nov 2017 02:57:19 +0000 (UTC)

I wanted to avoid invoking the spectre of #832, but I will clarify (the easiest is probably [0, 2^32-1024] because that makes a check using a bitmask easier).

-- 
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/964#discussion_r153683332

---

From: Martin Thomson <[email-masked]>
Date: Wed, 29 Nov 2017 02:58:50 +0000 (UTC)

@martinthomson pushed 2 commits.

191b506  More precisely define the range (not that it matters)
6b38f60  Remove sentence about encodings

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/964/files/d2379eb4ee10151ba314e23e7768e0acc94f7e95..6b38f60a2f723d110502f044efa039df934ff707

---

From: janaiyengar <[email-masked]>
Date: Thu, 30 Nov 2017 00:27:34 +0000 (UTC)

Thanks, merging.

-- 
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/964#pullrequestreview-80045012

---

From: janaiyengar <[email-masked]>
Date: Wed, 29 Nov 2017 16:28:57 -0800

Merged #964.

-- 
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/964#event-1364701397