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

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

Received on Saturday, 15 October 2016 15:49:31 UTC