Re: Payload length 0

Martin Thomson <martin.thomson@gmail.com> Fri, 18 May 2018 05:34 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 307BC1270AB for <quic@ietfa.amsl.com>; Thu, 17 May 2018 22:34:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 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_NONE=-0.0001, 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 6U7_u20RWcUF for <quic@ietfa.amsl.com>; Thu, 17 May 2018 22:34:24 -0700 (PDT)
Received: from mail-ot0-x236.google.com (mail-ot0-x236.google.com [IPv6:2607:f8b0:4003:c0f::236]) (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 629F31270A3 for <quic@ietf.org>; Thu, 17 May 2018 22:34:24 -0700 (PDT)
Received: by mail-ot0-x236.google.com with SMTP id m11-v6so7766410otf.3 for <quic@ietf.org>; Thu, 17 May 2018 22:34:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4CpTIGAMEHdFs97YNZkUybkYF/PmnZvrQ2/0u9U2Bug=; b=hdPRLE1cahP5fQRgI7Of08XrlBpaDqeAJ5ztg76jXUXlXmTmOW5a5zBVAvcTIYYORD TS0v4iLK72lnTfpTta3puDdU9DYptMXgn1SPixxv8AVLd/VBUkfIwLFdTM+qLaiAH2Fe 4jyU8g7wRVrj/mC/z4m/384XybW3Ggl9nA2Qu+T8Znl6qOV5W4Vo7zAkkRiYQvh32S8O nwFHi3KiDWGVFKePMmIpzT6z7J0a0S1L6eXzyKPr6G9excRtYdsLk8cD1XMblHPZJbWC CClx6XvaaBk5UsqHn4k6D+sRsgRKZtTKMfCS2jo0jzHj+she5xER6I2yF0eJLUzuwgO4 t+Bw==
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:cc; bh=4CpTIGAMEHdFs97YNZkUybkYF/PmnZvrQ2/0u9U2Bug=; b=eF1WUOKmJU0lmEKsZNQehyr0+A/S4PwWSAVnVWloigr9ShHDDgLrfr6v3grsglSUa+ NzQUMBwT5Qj6yMgnH0LDsBbAnXfUlFhs+Cumdh8NBa2LLyioLiEl6C8+NQtwkdgr9luV Lkp0SnurpuyuDDEP2O0/9uGMByULyfUCqONtgWIsuBSLXNMVpXW5xTWSzgvgk64iTU7F wDv4D/jeCTboJYS0jlIuAt8X+3TkAPXtKOSK0gVTLWJBTz7Kh3qtnObcejBsBqmmEsny pEo2wBrd6m5bL0Lm/XG0g7zWdVB3M3tpRkup0q2YczSab6y7uDFEe3zCcnW80tkca4Wu UTaw==
X-Gm-Message-State: ALKqPwd0z2TLPBnXIyk628U+Igz6fEsMQOqaerKoztnJRvEcmP0oLWHu 7Qo1Re1Ky6I2F6ccdCSmnMx7bh1cv//z0GjOFCU=
X-Google-Smtp-Source: AB8JxZqu0LdtZRzTy3yyZdDmW2ZsxN7d6NjLtqZldoMT9uy9zJE+dl2ft3KTkIK3gZjx0//CJYGExficb/CHb7f/us0=
X-Received: by 2002:a9d:354a:: with SMTP id l10-v6mr5815352ote.15.1526621663609; Thu, 17 May 2018 22:34:23 -0700 (PDT)
MIME-Version: 1.0
References: <CAOYVs2q63DpkPZTbw9T24ZcFOxbvrWAGvOtUaHvCuSg_13pSkQ@mail.gmail.com>
In-Reply-To: <CAOYVs2q63DpkPZTbw9T24ZcFOxbvrWAGvOtUaHvCuSg_13pSkQ@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
Date: Fri, 18 May 2018 15:34:12 +1000
Message-ID: <CABkgnnWpgyN_OPac-uSKALEaVc8mO_LpT9gAOs-n1eKqso5QAQ@mail.gmail.com>
Subject: Re: Payload length 0
To: Marten Seemann <martenseemann@gmail.com>
Cc: QUIC WG <quic@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/tRBd-rGchKWzQOfb7GubepqrXVo>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
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: Fri, 18 May 2018 05:34:27 -0000

Having just implemented this (and gotten it wrong once), I don't want more
special cases.  Both of these options need extra code.  As Kazuho points
out, filling in a two octet length is trivial.

It's true that a length of 0 is invalid, but so is 1 through 16.

Yes, this saves an octet, on about 4 packets per connection in the common
case, more like 2 if you actually take advantage of compound packets.
On Fri, May 18, 2018 at 3:08 PM Marten Seemann <martenseemann@gmail.com>
wrote:

> Jana asked me to raise this issue on the list, after we already had a bit
of discussion in https://github.com/quicwg/base-drafts/pull/1301.

> The proposal is to make a payload length of 0 a special value, indicating
that the packet is not a coalesced packet, i.e. that the whole payload of
the UDP packet is the QUIC packet. This would eliminate an invalid value of
the payload length (there are no empty packets), save one byte for packet
lengths where varint encoding would result in a two byte number, and
apparently also simplify (some) implementations.

> Kazuho argued creating two versions of each Long Header type (one with
and one without a payload length) is the better solution, since all values
below the AEAD tag length + 1 are invalid values anyway, and it would save
one more byte.

> We should make a decision if and what we want to do about this.