Re: Payload length 0

Martin Thomson <> Fri, 18 May 2018 05:34 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 307BC1270AB for <>; Thu, 17 May 2018 22:34:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
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: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 6U7_u20RWcUF for <>; Thu, 17 May 2018 22:34:24 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4003:c0f::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 629F31270A3 for <>; Thu, 17 May 2018 22:34:24 -0700 (PDT)
Received: by with SMTP id m11-v6so7766410otf.3 for <>; Thu, 17 May 2018 22:34:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; 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;; 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: <>
In-Reply-To: <>
From: Martin Thomson <>
Date: Fri, 18 May 2018 15:34:12 +1000
Message-ID: <>
Subject: Re: Payload length 0
To: Marten Seemann <>
Cc: QUIC WG <>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <>
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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 <>

> Jana asked me to raise this issue on the list, after we already had a bit
of discussion in

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