RE: QPACK and the Static Table

Mike Bishop <mbishop@evequefou.be> Thu, 24 May 2018 18:21 UTC

Return-Path: <mbishop@evequefou.be>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1C15D12EB14 for <quic@ietfa.amsl.com>; Thu, 24 May 2018 11:21:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, T_KAM_HTML_FONT_INVALID=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=evequefou.onmicrosoft.com
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 0bEWGclj8S8O for <quic@ietfa.amsl.com>; Thu, 24 May 2018 11:21:20 -0700 (PDT)
Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0128.outbound.protection.outlook.com [104.47.38.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AAE0E12EAFE for <quic@ietf.org>; Thu, 24 May 2018 11:21:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=evequefou.onmicrosoft.com; s=selector1-evequefou-be; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bcUDnE+BxHTuCdzOWqW2LGuh3rOF/YtDmpRwvgX+wMw=; b=eADzI8NW/UCIDzXKOTL9gBD8LTdNA5/10BKON9IO9SZQ7yWxtWD4PrRrSASS0/YUzosezCbPRR14n3H1K3rBalIfWX9nHI71aaExvbL6t5/iT9svL7UBETD+lRafC3Kp/E0lf1lf7izjuAfnzlrszBMFiREs/Y3G2Qp6e+1FrJI=
Received: from SN1PR08MB1854.namprd08.prod.outlook.com (10.169.39.8) by SN1PR08MB1680.namprd08.prod.outlook.com (10.162.133.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Thu, 24 May 2018 18:21:16 +0000
Received: from SN1PR08MB1854.namprd08.prod.outlook.com ([fe80::3c18:f60d:11c1:143d]) by SN1PR08MB1854.namprd08.prod.outlook.com ([fe80::3c18:f60d:11c1:143d%13]) with mapi id 15.20.0776.015; Thu, 24 May 2018 18:21:16 +0000
From: Mike Bishop <mbishop@evequefou.be>
To: Roberto Peon <fenix@fb.com>, Willy Tarreau <w@1wt.eu>
CC: "quic@ietf.org" <quic@ietf.org>, HTTP Working Group <ietf-http-wg@w3.org>
Subject: RE: QPACK and the Static Table
Thread-Topic: QPACK and the Static Table
Thread-Index: AdPy6/ObcVQE/1QBQB2X+UF0YtinwQALZGwAAAz5BYAAD2QCcA==
Date: Thu, 24 May 2018 18:21:15 +0000
Message-ID: <SN1PR08MB185459B20E930B87BAE380EFDA6A0@SN1PR08MB1854.namprd08.prod.outlook.com>
References: <SN1PR08MB1854395A2875541C4DC0673DDA6B0@SN1PR08MB1854.namprd08.prod.outlook.com> <20180524044146.GA5215@1wt.eu> <993659D9-8A3B-4375-AEC6-0B7706F96B42@fb.com>
In-Reply-To: <993659D9-8A3B-4375-AEC6-0B7706F96B42@fb.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=mbishop@evequefou.be;
x-originating-ip: [2601:600:8080:5a28:3dff:1440:9743:1059]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; SN1PR08MB1680; 7:a/K1TkvNfEUhU8og5+dTD9DD+GZqwDbmaVnsq2kGdb4z/BrlxrlTiBbthoPVxW1Nvz6xVojMRM3yppMEgx5yC2Sh381MrXEVPJeKZYf+qvf/yZRtzeEhMpVL9SzvdGc9IdwEzbWuXK96pC6fFOpeu13vx54awgZgV/luFQdMBCOSi9k1Qzp5qJuZfcJha1zhv2hW6jT0vdBFwvE8ppDd3YQpLur+08q/c1nNXrKYUHtXGCHe16Naf2zDNdDZ4oda
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020); SRVR:SN1PR08MB1680;
x-ms-traffictypediagnostic: SN1PR08MB1680:
x-microsoft-antispam-prvs: <SN1PR08MB1680008E946B4C429905F583DA6A0@SN1PR08MB1680.namprd08.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(158342451672863)(166708455590820)(67672495146484)(21748063052155)(17755550239193);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(2016111802025)(6043046)(6072148)(201708071742011)(7699016); SRVR:SN1PR08MB1680; BCL:0; PCL:0; RULEID:; SRVR:SN1PR08MB1680;
x-forefront-prvs: 0682FC00E8
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39380400002)(376002)(39830400003)(346002)(366004)(51444003)(13464003)(189003)(199004)(52314003)(25786009)(486006)(54906003)(99286004)(3660700001)(316002)(2906002)(74482002)(97736004)(110136005)(3280700002)(14454004)(7696005)(68736007)(478600001)(5660300001)(86362001)(5250100002)(74316002)(8676002)(6436002)(81156014)(81166006)(46003)(6116002)(2900100001)(606006)(236005)(186003)(790700001)(446003)(6246003)(11346002)(105586002)(33656002)(102836004)(76176011)(53936002)(6506007)(8936002)(9686003)(6306002)(55016002)(53546011)(229853002)(106356001)(59450400001)(7736002)(54896002)(4326008)(476003)(781001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR08MB1680; H:SN1PR08MB1854.namprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0;
received-spf: None (protection.outlook.com: evequefou.be does not designate permitted sender hosts)
x-microsoft-antispam-message-info: Q0Y5NxUiS222NOQXCgQvqPSPugU0xJvscEvrT1P1eKb1FRz3sHC6z6vyeXOjJ2Ai6oyAiNA74pPE/Kdu9RIzXzAc/2FPsvknWpX2YL+gY5fxrfwA47xeWAyBrX8PBRRiQ3jWNkiij/4QF7IQq0JzPJzFNNPAxCpetSo0PyIFIQL0aRqksav3HHcurxaNFQ5+
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_SN1PR08MB185459B20E930B87BAE380EFDA6A0SN1PR08MB1854namp_"
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: a2216954-ffd5-424d-b46e-08d5c1a32385
X-OriginatorOrg: evequefou.be
X-MS-Exchange-CrossTenant-Network-Message-Id: a2216954-ffd5-424d-b46e-08d5c1a32385
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2018 18:21:16.0176 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 41eaf50b-882d-47eb-8c4c-0b5b76a9da8f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR08MB1680
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/amvZkRU-ivHGwRb9tmrfU_QPPzA>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 24 May 2018 18:21:29 -0000

Yes, I think you need the lookup table for indices.  Alphabetical doesn't work as well, because there are two key barriers to deal with:

  *   Only the first sixteen entries can be name-referenced in a single byte.  We degraded performance in a previous draft of this table because :path wasn’t in the first sixteen entries, and the encoder that tried the updated table used two-byte name references for every request.
  *   Only the first sixty-four entries can be index-referenced in a single byte.



This implies that you want an ordering by likelihood of using the name at all, by likelihood of not indexing the value for repeat use, and by likelihood of using the name+value pair directly.



While an alphabetically-sorted list isn’t impossible within each tier, it seems easier to maintain a static map of the indices than to alphabetically index into each tier to see if the header you want is present.



I’d be open to additional sources of data to run the same query against.  Any browsers up to running an experiment and sharing the telemetry?



-----Original Message-----
From: Roberto Peon <fenix@fb.com>
Sent: Thursday, May 24, 2018 10:53 AM
To: Willy Tarreau <w@1wt.eu>; Mike Bishop <mbishop@evequefou.be>
Cc: quic@ietf.org; HTTP Working Group <ietf-http-wg@w3.org>
Subject: Re: QPACK and the Static Table



One could make the lookup (more) efficient by storing the index (a byte at most) with the key-value pair, where the key-value pair were sorted via whatever sorting you'd find most efficient.

If reordering allows for some increased efficiency without increasing bits-on-wire, I'd think it seems reasonable to change.



I would not trust the HTTP Archive to give a frequency analysis for real-world use. Remember that we gathered the freq data for HPACK from real-world use across a hopefully not-so-biased sample via browsers directly. If the world has changed since HPACK came out in terms of header freq (seems possible if not probable), then perhaps we should consider an update to HTTP2/HPACK as well?



I agree that perfection here isn't really needed, but I'm not sure adding items to the table arbitrarily makes sense either.



-=R



On 5/23/18, 9:42 PM, "QUIC on behalf of Willy Tarreau" <quic-bounces@ietf.org on behalf of w@1wt.eu<mailto:quic-bounces@ietf.org%20on%20behalf%20of%20w@1wt.eu>> wrote:



    Hi Mike,



    On Wed, May 23, 2018 at 11:16:18PM +0000, Mike Bishop wrote:

    > Rather than indexing the tables together and having the static table at 1-61,

    > QPACK uses a bit to indicate static vs. dynamic.  Since the field is seven

    > bits long, the performance is comparable for the dynamic table (you can

    > access 63 entries in one byte, 190 in two), but you can increase the size of

    > the static table without hurting the dynamic table.



    It will make the code look less "magic"!



    > As a result, we're

    > building a fresh static

    > table<https://github.com/quicwg/base-drafts/pull/1355> based on queries

    > against HTTPArchive data.

    >

    > The key question that has come up in a couple venues:  What real-world

    > headers do we want to artificially remove from what the data shows, and what

    > headers not seen by HTTP Archive do we want to force in anyway?



    I agree with Mark that request really is what matters the most.



    >   *   Reordered to put headers you're likely to name-reference at the front,

    >   especially if you're unlikely to add them to the dynamic table



    Well, some of us have been really bothered by the lack of ordering

    in the HPACK headers table, making it painful to perform efficient

    lookups. I'd suggest that they are sorted by (name,value) to make

    it possible to perform efficient dichotomic lookups.



    > The question is whether we should also backfill headers which HTTP Archive

    > wouldn't see, delete headers we wish people wouldn't use, and/or insert the

    > ones we hope they eventually will.  Some candidates:



    That's indeed a good point.



    >   *   Add Alt-Svc entry for HTTP/QUIC with QUIC v1

    >   *   Add X-Forwarded-For

    >   *   Don't add X-Forwarded-For, but do add Forwarded



    In practice, we can take both or none. After all, most QUIC requests going

    through proxies will be encrypted already thus the proxy will not be able

    to add these fields. For clear-text requests, the header field name is

    roughly as long as the value, so there's not *that* much to save by encoding

    them. And it will not change in most consecutive requests, so the dynamic

    compression will be more efficient than the static one. Thus I suggest that

    we only add them *if* we have enough unused slots at the end that we care

    to cover a very broad set.



    >   *   Remove Expires to incent the use of Cache-Control



    Expires is for responses only anyway, thus it matters much less. Cache-control

    can be used in both directions. I think that the technical focus on request

    may make Expires disappear from the table ;-)



    >   *   Collapse the "Content-Type: <thingey>" and "Content-Type: <thingey>; charset=utf-8" entries together

    >      *   ...but which one to keep?



    Probably just focus on the most reported ones and not try to collapse. I

    suspect that we see a lot of en-us alone, and utf-8 added to some other

    languages, but I could be wrong.



    >   *   Add Content-Encoding and/or Accept-Encoding entries for zstd



    Probably too early yet, and will not make a big difference overall (almost

    only response, 4 characters value).



    > There's an endless parade of bikesheds here.  As Martin has pointed out, this

    > will never be perfect, so the goal is "good enough and keep going."  Any

    > strong feelings about any of these before we merge it?



    No real strong feeling here except about the ability to perform fast lookups.



    > Also, there's been some discussion of a mechanism for selecting one of

    > several static tables at the start of a connection.  In that case, the spec

    > would probably define three tables (client headers, server headers [for

    > servers that don't push], combined [for servers that push]) and enable future

    > RFCs to define others for targeted scenarios (proxies, video playback, IoT,

    > etc.).  How much does that interest folks?



    I think it could be a good solution. We could also think about APIs and

    various datacenter-oriented use cases (eg: webservice etc) where very fast

    response and network efficiency matters. It could be a way to encourage

    QUIC adoption inside the DC. The risk however is that tables defined too

    late are never deployed due to interoperability concerns (unless there's

    a way to know that it will be supported before encoding). Thus if some

    participants are interested in optimizing for certain use cases, they should

    probably provide their own tables to be merged into the standard from day 1.



    Cheers,

    Willy