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

Jana Iyengar <jri@google.com> Mon, 07 November 2016 23:30 UTC

Return-Path: <jri@google.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 43EC21296EA for <quic@ietfa.amsl.com>; Mon, 7 Nov 2016 15:30:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.197
X-Spam-Level:
X-Spam-Status: No, score=-4.197 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-1.497, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.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 H4mHmpClI5lY for <quic@ietfa.amsl.com>; Mon, 7 Nov 2016 15:30:14 -0800 (PST)
Received: from mail-vk0-x22c.google.com (mail-vk0-x22c.google.com [IPv6:2607:f8b0:400c:c05::22c]) (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 45C2F1294AC for <quic@ietf.org>; Mon, 7 Nov 2016 15:30:14 -0800 (PST)
Received: by mail-vk0-x22c.google.com with SMTP id p9so135049554vkd.3 for <quic@ietf.org>; Mon, 07 Nov 2016 15:30:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oyyUg08gOT8Wu2WFeHZhYoilSP9HYmPqZIphB4yIZXU=; b=axVnASNuoYdbCAZFWuRHuZA7+TclE5WjHlFMvToN+cdioWiPYd4Ae+sGfl6mTMV/FZ Pq0RDmwbiAbsQZ4GRGTKyc4SmGn38c8oVo6U/65svz2MCoCbWQvX4hYCz2TPe56Xg3oK euocoj5xmU1yQcGxNUqy8TCpfyIBBQv47YnmYs1pSupUZ83zhmI90nLl+pBBAV1rFlDv tcxsTdvrbfT8Pnzcks5MF5/KKfm+ZonhpKGWvzF/SsG5DFWwkbP4wRPjouREA7UzD8+u GhpdTNCmsAaX0FG/fK62RhKwcNYOGum+SDtKGsiUZuOINTfiuMY8jvnr/Tedk2hCPVQg 1e4A==
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=oyyUg08gOT8Wu2WFeHZhYoilSP9HYmPqZIphB4yIZXU=; b=NGgYXW68s9bW31P2ovnMpScEw0isNnvNLrcJKFxUNP5d602jdnL5Lqtu6FNOhur/p2 3vTVYuGK5Kz+e/o2NK2IxFweRJQHbWD4EuJEaR1AuE0E5MEs4/fEa4XbRqQCEmGHx1FE u6Y5ox2qrxrfKUXcvoU/5mQTWSQiJ4rmkHuA/B3ApRsR4Ei24xF6/VRw1UyrTRDUyVh0 xA2JKEhNfdSwQ2mfe4ybKTf9GO++ZeA/HxBmrNoiCICt6kVSSWvdkK+m/2eiLrPWXLF8 TtGbQutNc3TpxvTkAnbANLTD5B+yF+DzpGBNwghQx8EZg3I0Iam0utMR/8IjtO403VSr weUw==
X-Gm-Message-State: ABUngvfSZWWXANUY/jnrsqxCkftnaaL8lhP9br8msDl3l9UvL95pZs/x5W8oj7onbHCTImeytxTo4FwcOwhfeyy4
X-Received: by 10.31.186.195 with SMTP id k186mr5601333vkf.23.1478561413230; Mon, 07 Nov 2016 15:30:13 -0800 (PST)
MIME-Version: 1.0
Received: by 10.103.82.68 with HTTP; Mon, 7 Nov 2016 15:30:12 -0800 (PST)
In-Reply-To: <CAOdDvNo_WjE-39uWm49aFH-_TCeaKdik2hsGbSduhowtKqNHqQ@mail.gmail.com>
References: <CAOdDvNo_WjE-39uWm49aFH-_TCeaKdik2hsGbSduhowtKqNHqQ@mail.gmail.com>
From: Jana Iyengar <jri@google.com>
Date: Mon, 07 Nov 2016 15:30:12 -0800
Message-ID: <CAGD1bZY3P5uqEU6KepW5gN-UMGeKOzOhY5wF_=SjQQcyMhkRXg@mail.gmail.com>
To: Patrick McManus <pmcmanus@mozilla.com>
Content-Type: multipart/alternative; boundary="001a11441088d0da120540be6789"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/xwu32Q8jHEdPHCtItaj4lxUF2oo>
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: Mon, 07 Nov 2016 23:30:26 -0000

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
>
>
>
>