Re: [QUIC] 2 issues for the hopper: terminology of packet vs sequence # and byte order

Brian Trammell <ietf@trammell.ch> Sat, 05 November 2016 09:23 UTC

Return-Path: <ietf@trammell.ch>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4FC701294E3 for <quic@ietfa.amsl.com>; Sat, 5 Nov 2016 02:23:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.399
X-Spam-Level:
X-Spam-Status: No, score=-3.399 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-1.497, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 psrufG-oI2A0 for <quic@ietfa.amsl.com>; Sat, 5 Nov 2016 02:23:45 -0700 (PDT)
Received: from trammell.ch (trammell.ch [5.148.172.66]) by ietfa.amsl.com (Postfix) with ESMTP id 413B8129496 for <quic@ietf.org>; Sat, 5 Nov 2016 02:23:44 -0700 (PDT)
Received: from [10.0.27.103] (dynamic-94-247-222-033.catv.glattnet.ch [94.247.222.33]) by trammell.ch (Postfix) with ESMTPSA id 2006E1A0A4A; Sat, 5 Nov 2016 10:23:13 +0100 (CET)
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Content-Type: multipart/signed; boundary="Apple-Mail=_CEB37ECE-15EE-4075-A538-678BC86D71CF"; protocol="application/pgp-signature"; micalg="pgp-sha512"
X-Pgp-Agent: GPGMail
From: Brian Trammell <ietf@trammell.ch>
In-Reply-To: <CAOdDvNo_WjE-39uWm49aFH-_TCeaKdik2hsGbSduhowtKqNHqQ@mail.gmail.com>
Date: Sat, 05 Nov 2016 10:23:12 +0100
Message-Id: <F35EFDD2-A799-45F6-A976-1376B43D287F@trammell.ch>
References: <CAOdDvNo_WjE-39uWm49aFH-_TCeaKdik2hsGbSduhowtKqNHqQ@mail.gmail.com>
To: Patrick McManus <pmcmanus@mozilla.com>
X-Mailer: Apple Mail (2.3124)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/PTlVe8rBUKL60--ZviLf7VwVklU>
Cc: quic@ietf.org
Subject: Re: [QUIC] 2 issues for the hopper: terminology of packet vs sequence # and byte order
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 05 Nov 2016 09:23:47 -0000

hi Patrick, all,

> On 04 Nov 2016, at 22:01, Patrick McManus <pmcmanus@mozilla.com> wrote:
> 
> Hi All - two more things to raise.. one I hope editorial and one design - when we start doing github, I'll open issues to track there.
> 
> First, editorially draft-hamilton-quic-transport-protocol-01 generally refers to packet numbers instead of sequence numbers. There seem to be two exceptions to that - in 6.2 and the identifier SEQUENCE_NUMBER_LIMIT_REACHED. OTOH https://tools.ietf.org/html/draft-thomson-quic-tls-01 almost always refers to sequence numbers (with one exception). I think SN is not defined, but PN is and it should standardize on the PN language.
> 
> Second, draft-hamilton-quic-transport-protocol-01 boldly uses little endian encoding. Ya gotta admire that chutzpah in an IETF draft :) From a processor alignment pov, it makes perfect sense and I would support it on a clean slate or on a well layered protocol. quic however, by design, is neither of those things.
> 
> So we get into a bit of a mess - the packet number is little endian when it appears in transport fields, but in the TLS document the AEAD nonce is formed by padding the big endian representation of the same number. That smells like a bug waiting to happen. Likewise a Stream ID in a transport STREAM frame would be big endian, but when that same ID is encoded via 7540 rules from the h2-mapping document (e.g. in a PUSH_PROMISE) then it needs to be big endian. Again - seems like a footgun. So while I salute the valiant effort to go little endian, I think we ought to bow to the constraints this effort faces and go the traditional all network byte order path.

Either +1 or +16777216 to this, depending on your native byte order.

Even without the interactions with TLS and H2, a QUIC header merged with a UDP header would have two byte orders (big in the ports and length, little everywhere else).

The currently dominant processor architectures may be little-endian (though, given that the byte-order conversion calls pretty much always operate on cache, they're basically free) but we've spent decades training everyone that the network is big endian, and this decision itself also has a rationale grounded in transparency and diagnosability for humans looking at packet dumps: most of our notations for dealing with numbers are big-endian. So going little-endian seems like an esoteric choice with a whole lot more downside than upside.

Cheers,

Brian