Re: QPACK and the Static Table

Roberto Peon <fenix@fb.com> Thu, 24 May 2018 17:53 UTC

Return-Path: <prvs=868201a72d=fenix@fb.com>
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 81C8B12EAD0 for <quic@ietfa.amsl.com>; Thu, 24 May 2018 10:53:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.72
X-Spam-Level:
X-Spam-Status: No, score=-2.72 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, T_DKIMWL_WL_MED=-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=fb.com header.b=aYyyk9vc; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.b=dH0mNDal
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 LQPGy6E3LiLx for <quic@ietfa.amsl.com>; Thu, 24 May 2018 10:53:44 -0700 (PDT)
Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 142CA1274D2 for <quic@ietf.org>; Thu, 24 May 2018 10:53:44 -0700 (PDT)
Received: from pps.filterd (m0089730.ppops.net [127.0.0.1]) by m0089730.ppops.net (8.16.0.22/8.16.0.22) with SMTP id w4OHmiTH022697; Thu, 24 May 2018 10:53:18 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=bs5o6Veyvt5TVf0JkiLjr4foezg8WLywJfSW0vQsmCI=; b=aYyyk9vcf/nnjRuW/0JbJZunwsExiE/kSHEucVGpgiLcx8rzzaPWlGOzYmqlrTxMMuAw 9pn3GeRA9f8tXpReLndLl7a+eSxC4pqTqAVBjIEQfbi9i4qjBtSKEoDfJpN4QaPVsHL7 qVIjbfRGla/YWCPnQbV7Ch+k4DxG1QhyKug=
Received: from maileast.thefacebook.com ([199.201.65.23]) by m0089730.ppops.net with ESMTP id 2j61tcr2n3-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 24 May 2018 10:53:17 -0700
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.26) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 24 May 2018 13:53:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bs5o6Veyvt5TVf0JkiLjr4foezg8WLywJfSW0vQsmCI=; b=dH0mNDal2RZ3U+uP7Lu+qp+Cxzs2Q32mR2AZ9BSfzmmxAb7SEVh9DWMYvGEOHeJ8X0nK8E+JDufwaxlwtmI5JkyAfEkQfcRUZZAj/2jL6oRyqLw9OLyEST5kpnuk5Lf9TpXZ3J+/zMd0Ghk4nEVX7B3BgqPDt8Q7qDvRqahxs6E=
Received: from BYAPR15MB2312.namprd15.prod.outlook.com (52.135.197.146) by BYAPR15MB2486.namprd15.prod.outlook.com (52.135.198.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.797.11; Thu, 24 May 2018 17:53:14 +0000
Received: from BYAPR15MB2312.namprd15.prod.outlook.com ([fe80::b434:da9b:6102:49eb]) by BYAPR15MB2312.namprd15.prod.outlook.com ([fe80::b434:da9b:6102:49eb%13]) with mapi id 15.20.0776.019; Thu, 24 May 2018 17:53:14 +0000
From: Roberto Peon <fenix@fb.com>
To: Willy Tarreau <w@1wt.eu>, Mike Bishop <mbishop@evequefou.be>
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+UF0YtinwQALZGwAAAz5BYA=
Date: Thu, 24 May 2018 17:53:14 +0000
Message-ID: <993659D9-8A3B-4375-AEC6-0B7706F96B42@fb.com>
References: <SN1PR08MB1854395A2875541C4DC0673DDA6B0@SN1PR08MB1854.namprd08.prod.outlook.com> <20180524044146.GA5215@1wt.eu>
In-Reply-To: <20180524044146.GA5215@1wt.eu>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.d.0.180513
x-originating-ip: [2620:10d:c090:200::7:88c]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; BYAPR15MB2486; 7:artymMB+4cNpX0hKOaCAE0C2rPQfojUp2E3q9NklG73q31UJ7CrJRh+IM+5EF/sgxi5md+QPU0klvqXEo3nP2LSLm15tAnjzqZbEd9ACu/No1DHgpgEVKRQ3aROUOfp0/f8D+alx78PKlkQuC1x9TDjn2eIEiWraqutN/GZryrvYQ0gmYimK+ywcihZwrZK1jmXb4/UXF6qHtpovIiGDJOK/I31Q0pLYKewT6im/TNAMrGdME4/hBSszOGBN7jH/; 20:oqzDwEh3h79HPziOPMwAQ9ias3n6CWQmgufaw5dK1nfRKQIl43EBNsyWZqh6ZNLDz128gdj/XEIcgugEOL6g7Kzwxw7jSdaEoymggCJB7XdBPytHS5ZNSxQtLzNGvnZ3w96a12R64HGsxS0lHKgan22zxN4L0biKul79JIRBicw=
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BYAPR15MB2486;
x-ms-traffictypediagnostic: BYAPR15MB2486:
x-microsoft-antispam-prvs: <BYAPR15MB2486A5BEA843386F9FE7ACFDCD6A0@BYAPR15MB2486.namprd15.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(166708455590820)(17755550239193);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231254)(11241501184)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BYAPR15MB2486; BCL:0; PCL:0; RULEID:; SRVR:BYAPR15MB2486;
x-forefront-prvs: 0682FC00E8
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(346002)(39380400002)(376002)(396003)(52314003)(189003)(199004)(51444003)(6436002)(2906002)(97736004)(106356001)(4326008)(486006)(99286004)(68736007)(305945005)(14454004)(186003)(86362001)(6116002)(229853002)(76176011)(2900100001)(102836004)(82746002)(3280700002)(25786009)(81156014)(8936002)(53936002)(8676002)(36756003)(105586002)(46003)(83716003)(59450400001)(5250100002)(81166006)(6506007)(6512007)(3660700001)(5660300001)(446003)(6306002)(2616005)(58126008)(476003)(6486002)(33656002)(6246003)(316002)(110136005)(54906003)(7736002)(478600001)(11346002)(781001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR15MB2486; H:BYAPR15MB2312.namprd15.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: V6Ib91KhQWTlX72QtRJm1fEyA2NpbtRzw72lZTZEMs3lDQK7g5BOksjcQ/BhQhIjfK3gpKiQBw6vdurXq9KEF9RFK3pfVr6fBNYCQqTf/HnFDtLMzLWK6V1jIv7xCUBukBVGTW6PD7Coqc66NchNgQm6F6d/ojjik+42uZ8iKEN/7/fezADABm9jkQZD6jpS
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <EED2E1014C84204A93FD79D9B29A1E4F@namprd15.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: 27900cdf-653d-4a29-9a3e-08d5c19f3946
X-MS-Exchange-CrossTenant-Network-Message-Id: 27900cdf-653d-4a29-9a3e-08d5c19f3946
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 May 2018 17:53:14.5807 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR15MB2486
X-OriginatorOrg: fb.com
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-24_06:, , signatures=0
X-Proofpoint-Spam-Reason: safe
X-FB-Internal: Safe
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/gje6Gm5wW4uxesuIoT0Uo30Rzrc>
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 17:53:47 -0000

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