Re: Straw Poll: Restore Header Table and Static Table Indices

Willy Tarreau <w@1wt.eu> Tue, 07 October 2014 06:19 UTC

Return-Path: <ietf-http-wg-request@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 (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0EA8A1A014A for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 6 Oct 2014 23:19:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.088
X-Spam-Level:
X-Spam-Status: No, score=-7.088 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, J_CHICKENPOX_65=0.6, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.786, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 dBsN6D9lFU3k for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 6 Oct 2014 23:19:23 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 689C01A1B37 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 6 Oct 2014 23:19:23 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1XbO5N-0002HE-Bb for ietf-http-wg-dist@listhub.w3.org; Tue, 07 Oct 2014 06:17:25 +0000
Resent-Date: Tue, 07 Oct 2014 06:17:25 +0000
Resent-Message-Id: <E1XbO5N-0002HE-Bb@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <w@1wt.eu>) id 1XbO5J-0002Fw-Qy for ietf-http-wg@listhub.w3.org; Tue, 07 Oct 2014 06:17:21 +0000
Received: from 1wt.eu ([62.212.114.60]) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <w@1wt.eu>) id 1XbO5I-0005fy-KL for ietf-http-wg@w3.org; Tue, 07 Oct 2014 06:17:21 +0000
Received: (from willy@localhost) by pcw.home.local (8.14.3/8.14.3/Submit) id s976Gomm028886; Tue, 7 Oct 2014 08:16:50 +0200
Date: Tue, 07 Oct 2014 08:16:50 +0200
From: Willy Tarreau <w@1wt.eu>
To: Mark Nottingham <mnot@mnot.net>
Cc: Greg Wilkins <gregw@intalio.com>, Shigeki Ohtsu <ohtsu@iij.ad.jp>, HTTP Working Group <ietf-http-wg@w3.org>
Message-ID: <20141007061650.GD4566@1wt.eu>
References: <CA+pLO_jkN67HLT7oup+FcYVY+RZ7ckhpY2gGy=TAsr2UUMnVVA@mail.gmail.com> <987FB86A-EF8B-4CD1-A9A7-52A9163E8CB3@mnot.net> <54334615.40907@iij.ad.jp> <CAH_y2NGuRBeN=_NJExeFqt06Uq5MAdYHpAp2xhiFKj0AE1wcJQ@mail.gmail.com> <0BB64E69-463C-4D12-8582-FD1FF84D1B10@mnot.net> <20141007052847.GA11117@1wt.eu> <B47FA4E6-6F91-44A1-8257-AE5086EF4DC1@mnot.net> <20141007054917.GB4566@1wt.eu> <28897143-3030-4500-829A-4199CE17CA22@mnot.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <28897143-3030-4500-829A-4199CE17CA22@mnot.net>
User-Agent: Mutt/1.4.2.3i
Received-SPF: pass client-ip=62.212.114.60; envelope-from=w@1wt.eu; helo=1wt.eu
X-W3C-Hub-Spam-Status: No, score=-4.0
X-W3C-Hub-Spam-Report: AWL=-2.098, BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01
X-W3C-Scan-Sig: lisa.w3.org 1XbO5I-0005fy-KL c8ed537e967e85bc62a93cb6d654d767
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Straw Poll: Restore Header Table and Static Table Indices
Archived-At: <http://www.w3.org/mid/20141007061650.GD4566@1wt.eu>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/27475
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>

On Tue, Oct 07, 2014 at 04:54:01PM +1100, Mark Nottingham wrote:
> Willy, if you have a concrete proposal that you think can can strong
> consensus, please make it ASAP. Stopping the work to do research on whether a
> change is necessary isn't appropriate at this point in the work; that train
> left the station a while ago.

I have proposed two directions in July and was told it was already too late.
I'm sorry for not having accurate details anymore in my mind 3 months later,
but that was the first one :

       http://article.gmane.org/gmane.ietf.http-wg/23155

"
I'm noticing that we need only 4 bits to send any possible static header+value
(assuming we swap accept-charset and accept-encoding), since all other values
are empty and will never be used as-is but as litterals.

So I think that based on your suggestion to split indexing of static and
dynamic, I'm suspecting we could systematically split indexes between static
and dynamic in opcodes. Indeed, some index fields are already small (6+ for
litterals and 4+ for litterals not indexed/never indexed), so having the
static first will force one extra byte for all dynamic headers. However,
stealing one bit in unused value ranges could help make that situation
better. Something along these lines seems possible (please forgive me for
errors, I'm encoding as I write) :

  11 XXXXXX => send 6+indexed header from *dynamic* table as-is  (0xC0 reserved)
  10 01XXXX => send 4+indexed header from *static* table as-is   (0x80 reserved)

  00 00XXXX => send 4+indexed *dynamic* header without indexing (unchanged)
  10 00XXXX => send 4+indexed *static* header without indexing

  10 1XXXXX => send litteral based on *dynamic* header table (0=new name or reserved)
  01 XXXXXX => send litteral based on *static* header table (0=new name)

The idea is that even when we have few bits to encode the index, we're not
forced to add an extra byte to encode the values from the other table, whatever
table we pick first as first.
"

The second one was much simpler and Greg seems to favor it as well :

       http://article.gmane.org/gmane.ietf.http-wg/23201

"
If at least we had the ability to encode both static table and most recent
dynamic entries with a single index, I would feel better. For example you
can have another approach :
  - positive indexes = static table index
  - negative indexes = - dynamic table index

You encode (index + 10), so that you can encode up to the last 10 emitted
fields, and you can encode up to 54 static headers in a single byte (it's
just a matter of proper sorting but it's already reasonably clean). I think
you get the idea.
"

Greg proposed to run some tests. I really think the second one is *very*
easy to test in a sane environment, and represents a very small change.
It ensures that commonly used fields do not need an extra byte, that recently
indexed headers do not need an extra byte either, and that only old indexed
headers or rarely used static headers need one. Right now I think that some
of the static header fields might be less common than a number of the ones
that are found in the indexed table, precisely because if they're in the
indexed table, they're being used!

Regards,
Willy