Re: draft-ietf-httpbis-jfv: what's next

"Poul-Henning Kamp" <> Sat, 15 October 2016 15:53 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 5AC6F12950B for <>; Sat, 15 Oct 2016 08:53:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -9.897
X-Spam-Status: No, score=-9.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-2.996, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id wC9cTJevHbIp for <>; Sat, 15 Oct 2016 08:53:05 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 42586129447 for <>; Sat, 15 Oct 2016 08:53:04 -0700 (PDT)
Received: from lists by with local (Exim 4.80) (envelope-from <>) id 1bvRDL-0006H5-In for; Sat, 15 Oct 2016 15:49:35 +0000
Resent-Date: Sat, 15 Oct 2016 15:49:35 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <>) id 1bvRDH-0006GF-Ey for; Sat, 15 Oct 2016 15:49:31 +0000
Received: from ([]) by with esmtp (Exim 4.80) (envelope-from <>) id 1bvRDF-0005dn-0y for; Sat, 15 Oct 2016 15:49:30 +0000
Received: from (unknown []) by (Postfix) with ESMTP id 5F4F5273B3; Sat, 15 Oct 2016 15:49:06 +0000 (UTC)
Received: from (localhost []) by (8.15.2/8.15.2) with ESMTP id u9FFn4uR079227; Sat, 15 Oct 2016 15:49:04 GMT (envelope-from
To: Martin Thomson <>
cc: Matt Menke <>, HTTP Working Group <>
In-reply-to: <>
From: Poul-Henning Kamp <>
References: <> <> <>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <>
Content-Transfer-Encoding: quoted-printable
Date: Sat, 15 Oct 2016 15:49:04 +0000
Message-ID: <>
Received-SPF: none client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-5.6
X-W3C-Hub-Spam-Report: AWL=-1.229, BAYES_00=-1.9, RP_MATCHES_RCVD=-0.425, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: 1bvRDF-0005dn-0y 8578da98bf04632acd37d90f9e3b54e5
Subject: Re: draft-ietf-httpbis-jfv: what's next
Archived-At: <>
X-Mailing-List: <> archive/latest/32603
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

In message <>
, Martin Thomson writes:
>On 15 October 2016 at 20:41, Poul-Henning Kamp <> wrote:
>> Looking forward, if we want to be able to use CS to build H3
>> compression, we cannot allow CS headers with format errors.
>I tend to agree with this, though there are levels of format errors.
>For instance, if you use the >< notation and the < is absent, that's a
>flat parse error (I would argue that the < is redundant actually, save
>an octet).

It is redundant, but it might still be a good idea.

Truncation of headers happens a lot more than it should in the wild,
so apart from the recursive role of the '<' I do like that it also
tells you that you are not missing half the header.

>But what I think that Matt is looking for is a grammar that supports
>an in-band signal about type so that syntax checking can be done by
>the parser (and not by the semantics layer).  That - to me - seems
>like a pretty reasonable request.

Yes, I agree, but it runs into the very inclusive definition of

We need three markers: '(h1_)number', 'h1_timestamp' and 'h1_blob',
which are all valid 'identifier' (= RFC7230::token) today.

We have three options:

1. Keep using RFC7230::token for 'identifier'

    Then only '<', '>', '{', '}', '[' and ']' are still available.

    We have already given '<', '>' meaning and even though we could
    disambiguate them, I'd really like to avoid overloading.

    So one proposal could be:

	h1_number = '}' number

	h1_timestamp = '{' number

	h1_blob = '[' base64

    Leaving us with only ']' if we forgot something.

    (It rattles my OCD to use "precious" balanced glyphs this way...)

    (For reasons of transmission efficiency I am intentionally not proposing
    formats such as "{#" number "}")

2. Restrict 'identifier'

    If we use a restricted RFC7230::token for 'identifier', we can shake
    some special characters free for type marking duty.


	identifier = ALPHA *(ALPHA / DIGIT / '_' / '-' / '*')

	h1_number = '#' number

	h1_timestamp = '$' number

	h1_blob = "'" base64 "'"

3. Let the semantic layer sort it out.

    As the draft does today.

    This has best H1/H2/HPACK transmission efficiency.

    This also enforces only the minimum necessary restriction on
    HTTP-header inventors.

    For instance: h1_blob is a valid identifier and thus a valid
    name of a dictionary.

    On the contra side, exploiting such "loopholes" is almost
    guaranteed to hurt H3 compression for that header later on.

I picked 3 based on 'minimum intrusiveness', but I can live with
all three.

Given that a H3 compression likely will serialize the type, the two
first alternatives are probably the most forward-compatible.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.