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

Martin Thomson <martin.thomson@gmail.com> Mon, 07 November 2016 23:35 UTC

Return-Path: <martin.thomson@gmail.com>
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 2A575129462 for <quic@ietfa.amsl.com>; Mon, 7 Nov 2016 15:35:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 IgzrTSXpQxV4 for <quic@ietfa.amsl.com>; Mon, 7 Nov 2016 15:35:45 -0800 (PST)
Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3903A1294AC for <quic@ietf.org>; Mon, 7 Nov 2016 15:35:45 -0800 (PST)
Received: by mail-qt0-x231.google.com with SMTP id c47so97642928qtc.2 for <quic@ietf.org>; Mon, 07 Nov 2016 15:35:45 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YtHueWpmAJXKCZYxQPeA8KjMh6EliRtitXDN0JklnlI=; b=jE6TnQNm6YZ7w8eXNH31ZXgPtIK6/M4QW4N8bm3q+IVjyGsMHf8HHGqG6j11wZZA5j ciEvYfbKPCfcK44FQgWrKtWqUOJViGs0aPMth0Ffcw96oJCDdYWFUbDttN2kF1PVmhiI RSSHT8Wlq97ys/mrV9PzjmNbhbGlDZyIzJ0k9iPGjnxRs9CyFCb2gnDPxAq407y2ng2M UDHdy2tLG5glNNnZh4r+5FQOrY/bu3ssyMIPUwgmP3xQIYmfAVaudZxKIuEoTRYPlCb0 hWH1rxE9EN3zLahUUH8RW/OHoEieJOXSaLigxJcR2z0w4XjDtSAUaCuBkxoxbrTGuGuj gIBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YtHueWpmAJXKCZYxQPeA8KjMh6EliRtitXDN0JklnlI=; b=NbIsLiWqGcFLOAriHDa4oTX2zeoJR6DOAYrQXqq3spDjSUuDKvozfSuZ96Q94jBw+3 Ps5yTsBnhxONhCM3ug63KEromcfBVd7uuIUeHDebRJacvsO30x/sR+Pr3WWCqCbp4STX 7hhouU+PA4Je3J4sYeLxg+wippBbQifSGLsFKb7tn87IU7lhlYRPYDP598JYLfLKKXK/ hcGRQqmgE8zHoGYUmp51HPGOJd0CqzMsoGi+wdAhWqwJFyHkr1SR7pNKCLgBe77chzYL ZilD32fAnw5oDXfHs+vg0VI4Pdpc0F477/H5B1ylAuapzvRDJxJAn4vah7tw0PxsINRm 0YHw==
X-Gm-Message-State: ABUngvdP62RgSbM994E3NAqssG2DtqVxduY/FSQUaPrBiR/FrpcoHqocvg6SRjeMD2JySfgTGF9wC5Iw947qQw==
X-Received: by 10.200.56.27 with SMTP id q27mr9936180qtb.116.1478561744341; Mon, 07 Nov 2016 15:35:44 -0800 (PST)
MIME-Version: 1.0
Received: by 10.140.85.7 with HTTP; Mon, 7 Nov 2016 15:35:43 -0800 (PST)
In-Reply-To: <CAGD1bZY3P5uqEU6KepW5gN-UMGeKOzOhY5wF_=SjQQcyMhkRXg@mail.gmail.com>
References: <CAOdDvNo_WjE-39uWm49aFH-_TCeaKdik2hsGbSduhowtKqNHqQ@mail.gmail.com> <CAGD1bZY3P5uqEU6KepW5gN-UMGeKOzOhY5wF_=SjQQcyMhkRXg@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Tue, 08 Nov 2016 10:35:43 +1100
Message-ID: <CABkgnnVHdFL7JySZOSKtvTrV9MWfxtAx-nWakyLxz3ZzD-_qOw@mail.gmail.com>
To: Jana Iyengar <jri@google.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/mgS48B1SZLAaWakBrKhm_NWpclo>
Cc: quic@ietf.org, Patrick McManus <pmcmanus@mozilla.com>
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: Mon, 07 Nov 2016 23:35:47 -0000

I'm going to recommend that the big-endian and little-endian
proponents find themselves a room in Seoul.  I plan to mute any thread
that continues in this fashion.  It's not a rathole, it's the Sarlacc.

On 8 November 2016 at 10:30, Jana Iyengar <jri@google.com> wrote:
> Hi Patrick,
>
> On Fri, Nov 4, 2016 at 2:01 PM, 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.
>
>
> This should all be Packet Number, and we should fix it all. The history is
> that we used to call these Sequence Numbers, until we decided that the
> overlap with TCP terminology was unnecessarily confusing, since there are
> clear semantic differences between sequence number in TCP and packet number
> in QUIC. (Specifically, sequencing is used in TCP to order received bytes at
> the receiver, whereas Sequence Numbers in QUIC have only to do with the
> order in which packets may have been sent. There's also freedom at a sender
> to skip some numbers while sending, to avoid optimistic ack attacks, which
> means that packets sent in sequence may have discontiguous numbers
> assigned.)
>
>>
>> Second, draft-hamilton-quic-transport-protocol-01 boldly uses little
>> endian encoding. Ya gotta admire that chutzpah in an IETF draft :)
>
>
> More chutzpah than redefining HTTP transport with a 3-part non-layered
> protocol at the IETF? :-)
>
>> 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.
>
>
> (I now proceed into this bikeshed. It was good to know you all.)
> I think disagree. I definitely think we have a clean-slate, at least as far
> as *this* protocol is concerned (modulo the running code.) I would argue
> that we have a well-layered protocol, but it is not "simply-layered". See
> more below.
>
>> 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.
>
>
> So, to be clear, as long as the QUIC framer (as against the TLS or the HTTP
> framer) is the thing that's writing numbers on one side, and the QUIC framer
> is the thing reading numbers on the other side, there's no issue with
> endianness. In addition, if it's a non-QUIC framer writing numbers on one
> side, and a non-QUIC framer reading numbers on the other side, QUIC doesn't
> introduce any issues with endianness.
> On how the bits are used by other components which interact with the QUIC
> framer, that's a matter of API.
>
> So, if the TLS nonce is sent and delivered over Stream 1. QUIC transports
> and delivers bytes over Stream 1. QUIC doesn't care about the endianness of
> the nonce just as the nonce's endianness would have nothing to do with TCP's
> rules about endianness in TCP fields.
>
> Similarly,  a Stream ID in a PUSH_PROMISE frame, which is sent as an H2
> frame is basically opaque data on the wire to QUIC. In the mapping doc, a
> PUSH_PROMISE frame is sent over the Headers stream, which is entirely an
> HTTP-mapping concept. From QUIC's pov, it's a stream as any other. When an
> HTTP client receives this frame over QUIC, it will probably "reserve" this
> stream ID through an API call down into QUIC.
>
> So yes, while not simply-layered, there's very clear encapsulation and
> separation of functions and concerns. Non-QUIC entities MUST NOT put things
> in the QUIC frame format, and MUST NOT read things directly from the frame
> format.
>
> That said, I understand that there's baggage in terms of what the IETF has
> always done. The argument against it is that when engineering for the common
> case, little endian makes much more sense in today's world.
>
> (ducking for cover)
> - jana
>
>>
>>
>> -Patrick
>>
>>
>>
>