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

"Poul-Henning Kamp" <phk@phk.freebsd.dk> Sat, 15 October 2016 15:53 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5AC6F12950B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 15 Oct 2016 08:53:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.897
X-Spam-Level:
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 mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wC9cTJevHbIp for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 15 Oct 2016 08:53:05 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 42586129447 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 15 Oct 2016 08:53:04 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bvRDL-0006H5-In for ietf-http-wg-dist@listhub.w3.org; Sat, 15 Oct 2016 15:49:35 +0000
Resent-Date: Sat, 15 Oct 2016 15:49:35 +0000
Resent-Message-Id: <E1bvRDL-0006H5-In@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <phk@phk.freebsd.dk>) id 1bvRDH-0006GF-Ey for ietf-http-wg@listhub.w3.org; Sat, 15 Oct 2016 15:49:31 +0000
Received: from phk.freebsd.dk ([130.225.244.222]) by maggie.w3.org with esmtp (Exim 4.80) (envelope-from <phk@phk.freebsd.dk>) id 1bvRDF-0005dn-0y for ietf-http-wg@w3.org; Sat, 15 Oct 2016 15:49:30 +0000
Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 5F4F5273B3; Sat, 15 Oct 2016 15:49:06 +0000 (UTC)
Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id u9FFn4uR079227; Sat, 15 Oct 2016 15:49:04 GMT (envelope-from phk@phk.freebsd.dk)
To: Martin Thomson <martin.thomson@gmail.com>
cc: Matt Menke <mmenke@google.com>, HTTP Working Group <ietf-http-wg@w3.org>
In-reply-to: <CABkgnnXw7WacnMf4Nsx-drktn__V4afK61G67A5bT5SSdqaucQ@mail.gmail.com>
From: Poul-Henning Kamp <phk@phk.freebsd.dk>
References: <CAEK7mvoXqyX3cADJytjU+C158EULgPLbzAb5kiUN=8WWxhi29Q@mail.gmail.com> <78301.1476524467@critter.freebsd.dk> <CABkgnnXw7WacnMf4Nsx-drktn__V4afK61G67A5bT5SSdqaucQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <79225.1476546544.1@critter.freebsd.dk>
Content-Transfer-Encoding: quoted-printable
Date: Sat, 15 Oct 2016 15:49:04 +0000
Message-ID: <79226.1476546544@critter.freebsd.dk>
Received-SPF: none client-ip=130.225.244.222; envelope-from=phk@phk.freebsd.dk; helo=phk.freebsd.dk
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: maggie.w3.org 1bvRDF-0005dn-0y 8578da98bf04632acd37d90f9e3b54e5
X-Original-To: ietf-http-wg@w3.org
Subject: Re: draft-ietf-httpbis-jfv: what's next
Archived-At: <http://www.w3.org/mid/79226.1476546544@critter.freebsd.dk>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32603
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

--------
In message <CABkgnnXw7WacnMf4Nsx-drktn__V4afK61G67A5bT5SSdqaucQ@mail.gmail.com>
, Martin Thomson writes:
>On 15 October 2016 at 20:41, Poul-Henning Kamp <phk@phk.freebsd.dk> 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
RFC7230::token.

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.

    Maybe:

	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.