Re: [QUIC] h2 mapping - hpack dynamic table by reference

Mike Bishop <Michael.Bishop@microsoft.com> Thu, 03 November 2016 22:35 UTC

Return-Path: <Michael.Bishop@microsoft.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 2946D129874 for <quic@ietfa.amsl.com>; Thu, 3 Nov 2016 15:35:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.021
X-Spam-Level:
X-Spam-Status: No, score=-2.021 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=microsoft.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 ibXF85IldSAR for <quic@ietfa.amsl.com>; Thu, 3 Nov 2016 15:35:55 -0700 (PDT)
Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0118.outbound.protection.outlook.com [104.47.34.118]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 75B1B12986E for <quic@ietf.org>; Thu, 3 Nov 2016 15:35:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PG8hOXwzD4jDeUglQytcRMnD7t5CMW5LBTiHPLUGRX0=; b=S5s7lMaOyYsu2EOS8gSh3aKPwpKxa9kEnSfhevOL03HXyoggYffqwwMvgophTNfC4U7XlV5you0jZTE2MouWBbyEUq8rBTJIUVhLPxO86fQkwpM1Jav6+4HBilV5mofjs0wyv0CguVZ+7FNvOySRqdP5Y1w5r+1Bw8R6hKX5yPQ=
Received: from BN6PR03MB2708.namprd03.prod.outlook.com (10.173.144.15) by BN6PR03MB2706.namprd03.prod.outlook.com (10.173.144.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Thu, 3 Nov 2016 22:35:53 +0000
Received: from BN6PR03MB2708.namprd03.prod.outlook.com ([10.173.144.15]) by BN6PR03MB2708.namprd03.prod.outlook.com ([10.173.144.15]) with mapi id 15.01.0693.009; Thu, 3 Nov 2016 22:35:53 +0000
From: Mike Bishop <Michael.Bishop@microsoft.com>
To: Patrick McManus <pmcmanus@mozilla.com>, "quic@ietf.org" <quic@ietf.org>
Thread-Topic: [QUIC] h2 mapping - hpack dynamic table by reference
Thread-Index: AQHSNhlXVDFlp6NaHU6EWkOyW4vQq6DH1GNw
Date: Thu, 03 Nov 2016 22:35:53 +0000
Message-ID: <BN6PR03MB2708E353447E58F702ACCF1987A30@BN6PR03MB2708.namprd03.prod.outlook.com>
References: <CAOdDvNrTv5kKFZ44jceiVtv2BS9dpfTmmu+MECSMo8viK16C0g@mail.gmail.com>
In-Reply-To: <CAOdDvNrTv5kKFZ44jceiVtv2BS9dpfTmmu+MECSMo8viK16C0g@mail.gmail.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=Michael.Bishop@microsoft.com;
x-originating-ip: [2001:4898:80e8:f::157]
x-ms-office365-filtering-correlation-id: c3478acf-9f5c-4469-ce6f-08d40439c553
x-microsoft-exchange-diagnostics: 1; BN6PR03MB2706; 7:vXznxuhHBxqPXalfhUGmtw+ZU6ow2tyeUarkiACTSVHjRsM+LqfSnHrsLMojie0VS33yTfiyo3dqzhbxcNiiJ0uhZI5+pY7VNqtoki6JY7rNdFWIjh/1ffCyTVgeieJb9pVoG/kGKw7u6css1avUk+uf4FEBYw7Wol6VtyuH8VFqFuNcWGFlxYZsc5G5+RsTQY+fM771a5x3V9dSbnEG5r4QHoJ40ID6LYYXRc9wEU+Rza9qXbeo6BqPnqtCCLqiC6YZwZhL1KzicWKrscI/cPYgP/bA1vUVuVlZ1Ny1YXsvICRhSyCCwBOonxhMkMyIr5Rhsw2v8ox3vBP3hVEAaY1R3kjsKMixluhxTh1gyngr6ynLwMdRy95C+gYuzVDN
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN6PR03MB2706;
x-microsoft-antispam-prvs: <BN6PR03MB27062CEDEDC70B7E521FA1A787A30@BN6PR03MB2706.namprd03.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040176)(6045074)(6060222)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(61426038)(61427038)(6061219)(6046074); SRVR:BN6PR03MB2706; BCL:0; PCL:0; RULEID:; SRVR:BN6PR03MB2706;
x-forefront-prvs: 011579F31F
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(7916002)(189002)(377454003)(199003)(189998001)(97736004)(9686002)(5001770100001)(76576001)(2950100002)(7736002)(7846002)(5660300001)(81166006)(8676002)(107886002)(81156014)(11100500001)(102836003)(19580405001)(19580395003)(74316002)(586003)(790700001)(19300405004)(6116002)(3280700002)(2900100001)(87936001)(3660700001)(8936002)(19609705001)(54356999)(10400500002)(10290500002)(122556002)(33656002)(76176999)(50986999)(5005710100001)(86362001)(10090500001)(101416001)(2501003)(7696004)(2906002)(19625215002)(92566002)(7906003)(19617315012)(106356001)(68736007)(105586002)(77096005)(5002640100001)(8990500004)(99286002)(106116001)(15975445007)(86612001)(16236675004); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR03MB2706; H:BN6PR03MB2708.namprd03.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_BN6PR03MB2708E353447E58F702ACCF1987A30BN6PR03MB2708namp_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2016 22:35:53.4812 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2706
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/hMvcVTPFb-b9OLKdlG13B3HwEew>
Subject: Re: [QUIC] h2 mapping - hpack dynamic table by reference
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.17
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, 03 Nov 2016 22:35:58 -0000

Jana and I were talking about that at the HTTP Workshop.  The current solution is probably the best that can be achieved without modifying HPACK, because HPACK takes a hard dependency on reliable in-order delivery, which a dedicate stream can provide.  If we were to define HPACKv2 (or QPACK, if you prefer) and make its semantics more out-of-order-friendly, we could do a number of things, as you suggest.

Some approaches we talked about:

  *   Establish a static dictionary in the first flight and never change it.
  *   Newly-added entries have explicit and never-reused indices.  All HPACK frames are on-stream and only block if they reference an entry you don’t yet have.
  *   Split HPACK into two different frame types – one only modifies the header table; one only emits headers.  Each “modify” frame increments a generation number and records the number of “emit” frames in the previous generation.  Emitting frames block until the header table reaches its generation; the old header state can be discarded when you know you’ve seen all emitting frames from that generation.

Your idea is similar to the last of these, but choosing to encode to an old state for better reliability is an interesting wrinkle.  You’d have to add an explicit signal to evict the old state for that to work.  Defining an endpoint’s memory commitment and management gets a little fuzzier in this world, no matter what approach we take.

I think we’ll need to seriously consider something in this space.  It also implies changing HPACK implementations to be more cautious about adding to the table.  I did some prototypes during HTTP/2 and concluding that “index everything” was not substantially worse than the hypothetical ideal given a reasonable table size, so we went with that to save time.  With QPACK, that will be a decidedly sub-optimal strategy, and there will be some art in designing compressors to be as effective as possible in the presence of reordering.

From: QUIC [mailto:quic-bounces@ietf.org] On Behalf Of Patrick McManus
Sent: Thursday, November 3, 2016 2:29 PM
To: quic@ietf.org
Subject: [QUIC] h2 mapping - hpack dynamic table by reference

Hi Robbie, Mike, et al. Thanks for getting the ball rolling with https://tools.ietf.org/html/draft-shade-quic-http2-mapping-00..
I have a thought on the mapping - Putting all of the header frames onto one in-order stream is a pretty big hammer.

Is there stomach for looking at a strategy where hpack references the dynamic table state via some kind of instruction counter? That way the headers could be on the data (>=5) stream and just the dynamic table manipulation stuff from hpack could be on stream 3.. implementations would be able to choose whether to generate hpack that referenced the current counter or an older one (within some window).. an older one is going to be more robust to reordering happening on stream 3 so the dep between the streams is loosened. Anecdotally the rate of change of the dynamic table slows down (though I have no data - could collect it if we're serious) after an initial burst and at that point not using table updates until they've been acked could be a reasonable thing to do... and this even allows pre-populating the dynamic table at setup time with site-local values rather than in response to a query. Rewinding to any particular instruction seems to be a big burden, but we could probably do some things with checkpoints and acks to bound it all.

this is a fairly significant bit of surgery to h2's formats, but given that one of the real quic opportunities is to perform better under loss it could be worthwhile to sever ordering dependencies even further. Seems like a reasonable thing to investigate to me.
Thanks
-Patrick