Re: Using varints to encode the Transport Parameters

Ian Swett <ianswett@google.com> Mon, 29 October 2018 17:45 UTC

Return-Path: <ianswett@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 376CA131048 for <quic@ietfa.amsl.com>; Mon, 29 Oct 2018 10:45:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.5
X-Spam-Level:
X-Spam-Status: No, score=-17.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] 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 Ik_hlh0jUfrb for <quic@ietfa.amsl.com>; Mon, 29 Oct 2018 10:45:52 -0700 (PDT)
Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) (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 B3062131023 for <quic@ietf.org>; Mon, 29 Oct 2018 10:45:51 -0700 (PDT)
Received: by mail-wm1-x330.google.com with SMTP id s10-v6so9141049wmc.5 for <quic@ietf.org>; Mon, 29 Oct 2018 10:45:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Ec2NxKH+4jIBgvhOoCeIXkWYJzqqNjvmxyVGzFnlCRQ=; b=TMvNlAiNlqHuA6Ac9zR1n8Qz9IRYQo22abuRCEO5N57Sq2TP9i95C8T6wR1yvewmi6 Qhdzz7gzh5s7u0isYoSuoilQ4NAUz9SRb+2pUqCdUA8+GE7LOxieDQZEAcSaubFZrkez d3hp1eILZZ0ee9IqbLlRtsPalkloHkGhpc4jivqy1Iae54hVUTk5XuwP+viUbyfP+mw7 eyVOGmDfXqauzESFOoNMO7txBvjQHiyXEtf4Sh6B1bvH7Lh0zl4s/OLdHw3j/MFNEOtN TOW3bP+bVBikYwkyaE5zW51TlsLDtQTqwfu1b+UiTeu+ZPkfruLju0ZBoAfmds7bFmNt KQmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=Ec2NxKH+4jIBgvhOoCeIXkWYJzqqNjvmxyVGzFnlCRQ=; b=OUGM/iEz3yzj+HWHy/G1hS9qEXwEtA+cg6K/ld1uiUkxHRrE91wB1YUmtnKYBsXicT 8Z38c/YHOZ3HuKJMzyCLcEUYmEEchqne4bsbXeOra1nzztGvN3QWw9WCDHmGWutgb85M 24U3VrCrJTbaM/JA1JSgFJ2qeV0aNSHd9ChW9NAvdY2Fjq0u55p5w5XJ8h9WY23mND05 aGSG7I8ZHDvnAYi6qBvA9uxDNC9shbM/xpWt7Bc3tAX8E5tVSjgwN5+a9cB0gHQmOZn8 7UZCht8LtoGEcduQX5Qp2xmbARKdGxqKZdRAkFSjHWqb6803/qJnvpVgAq3broNtnZqi KNOA==
X-Gm-Message-State: AGRZ1gIOj7lLbevPOh1Q16eC4oV1j7pL5EhOMJ3xkgDAXlqYiKuRFkFI 94BJafp96xfc0ZoIVUJBc24hxOg+H2ZtIDw2lGshEA==
X-Google-Smtp-Source: AJdET5fgqcdFxHEBgsmPQiy032aKzjSGTOKEGz2hjBILd9s/DE9ZEc1ClT8pTPYyEmo8ZWbzRBUPfh+mUAFYSUdtzKE=
X-Received: by 2002:a1c:cc8:: with SMTP id 191-v6mr14116132wmm.55.1540835150048; Mon, 29 Oct 2018 10:45:50 -0700 (PDT)
MIME-Version: 1.0
References: <CAOYVs2rKJMXO806Jp5CpCkH8T80zUHUAauUqdmwEQuTJUhPxnA@mail.gmail.com> <20181029124835.GA7258@ubuntu-dmitri>
In-Reply-To: <20181029124835.GA7258@ubuntu-dmitri>
From: Ian Swett <ianswett@google.com>
Date: Mon, 29 Oct 2018 13:45:38 -0400
Message-ID: <CAKcm_gNkVFOverE9GxhGDwf8xH4tb0rDBt6LqKSXj-z6o4r6aw@mail.gmail.com>
Subject: Re: Using varints to encode the Transport Parameters
To: Marten Seemann <martenseemann@gmail.com>, IETF QUIC WG <quic@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000c71fb0057961a339"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/y_wNH_NjwKFI_03WRg7RaSVTi6w>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.29
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, 29 Oct 2018 17:45:54 -0000

I agree on both of Dmitri's points and if we're going to discuss this in
London, a PR is necessary.

If we were discussing this 6 months ago, I'd be in favor.  If it doesn't
make -17 drafts, I'd say it's QUIC v2.

On Mon, Oct 29, 2018 at 8:48 AM Dmitri Tikhonov <dtikhonov@litespeedtech.com>
wrote:

> I see two problems with this proposal: timing and size.
>
> This is rather late in the game.  If the Working Group is to follow
> the plan Martin Thomson outlined in a recent email, this change would
> have to be included into -17.
>
> A hybrid of the TLS Presentation language and QUIC varints has to be
> specified somewhere itself, thereby increasing the size of the already
> hefty transport document.  This new specification, in turn, is likely
> to engender some debate and further optimization proposals.  Allowed
> to go unchecked, this work would slip our schedule further.
>
> One way to approach this proposal is to have a ready-to-merge PR and
> hum it at the upcoming meeting.
>
>   - Dmitri.
>
> On Mon, Oct 29, 2018 at 06:13:50PM +0700, Marten Seemann wrote:
> > This is based on issue https://github.com/quicwg/base-drafts/issues/1608
> .
> >
> > The proposal is to change the encoding of the QUIC Transport Parameters
> > exchanged during the handshake, in order to achieve greater consistency
> > with how QUIC encodes values, and also to save a few bytes.
> >
> > We have a few things that are called transport parameters. This proposal
> > only applies to the TransportParameter struct as defined in section 18
> as:
> > *struct {*
> > *      TransportParameterId parameter;*
> > *      opaque value<0..2^16-1>;*
> > *} TransportParameter;*
> > According to the encoding defined by the TLS spec, every key-value pair
> > will be serialized as:
> > TransportParameterID (2 byte), length (2 byte), value (length byte)
> > where the length of the value is specified for each TransportParameterID.
> >
> > We could switch to varint encoding, as follows:
> >
> > 1. for the TransportParameterID: Since we’re only using the code points 0
> > to 13, we could save one byte per ID by using a varint.
> > 2. for the length: We would save one more byte, as long as the length of
> > the value is less than 16 byte (which will be the case for all values
> > except the preferred_address).
> > 3. For numeric values: This would apply to the flow control offsets, the
> > maximum stream IDs, the ack delay exponent , the maximum packet size and
> > the max_ack_delay.
> >
> > In addition to the byte-savings of 1. and 2., 3. has some more desirable
> > properties:
> >     1. It would allow us to encode the whole range of permitted values.
> For
> > example, initial_max_data is a 62-bit value, but the current encoding
> just
> > allows to send 4 bytes.
> >     2. Depending on the value sent, this might or might not save a byte
> > here and there.
> >     3. We’d be consistent with the encoding we use everywhere else.
>
>