RE: QPACK - proposal to optimize compression

Brian Swander <briansw@microsoft.com> Tue, 08 May 2018 20:50 UTC

Return-Path: <briansw@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 4497912EACA for <quic@ietfa.amsl.com>; Tue, 8 May 2018 13:50:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.009
X-Spam-Level:
X-Spam-Status: No, score=-2.009 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, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-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=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 YzIn8zKsMFGd for <quic@ietfa.amsl.com>; Tue, 8 May 2018 13:50:19 -0700 (PDT)
Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0101.outbound.protection.outlook.com [104.47.34.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0B50412EABF for <quic@ietf.org>; Tue, 8 May 2018 13:50:19 -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=gnDTzzWI8P5FiFAOxWvcAU4SkIRFzgp82vhyWK0SWug=; b=lfzUSkPp1jzvye9b7YxwwHp/vfZhK9nixwaHTLRPFvCbfOQe8T9u53f1n4g5mHQ6hpHGnlQ8gD0K+S6IMtBgg2R9xaIBVJQRXrupoPHZZfIQomqWKDZ65L4ng2MDGflnv+GLoqC27tbb0EV6xxE32BtQjZbKHJvPqgNv//nvK50=
Received: from DM5PR21MB0857.namprd21.prod.outlook.com (10.173.172.143) by DM5PR21MB0825.namprd21.prod.outlook.com (10.173.172.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.3; Tue, 8 May 2018 20:50:17 +0000
Received: from DM5PR21MB0857.namprd21.prod.outlook.com ([fe80::e926:e65e:c9a6:365d]) by DM5PR21MB0857.namprd21.prod.outlook.com ([fe80::e926:e65e:c9a6:365d%9]) with mapi id 15.20.0776.004; Tue, 8 May 2018 20:50:17 +0000
From: Brian Swander <briansw@microsoft.com>
To: Alan Frindell <afrind@fb.com>, "quic@ietf.org" <quic@ietf.org>
Subject: RE: QPACK - proposal to optimize compression
Thread-Topic: QPACK - proposal to optimize compression
Thread-Index: AdPmSVy6766G9sm1TzOdAr1rcH/nrAAhOhQAAA++e/A=
Date: Tue, 08 May 2018 20:50:17 +0000
Message-ID: <DM5PR21MB08572BEFDA60C6EE920D0357B39A0@DM5PR21MB0857.namprd21.prod.outlook.com>
References: <DM5PR21MB0857F41DCB080F130E1436ADB39B0@DM5PR21MB0857.namprd21.prod.outlook.com> <BCF18407-B5DD-4608-ACFE-C229E17A2C1B@fb.com>
In-Reply-To: <BCF18407-B5DD-4608-ACFE-C229E17A2C1B@fb.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=briansw@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-05-08T20:50:16.6195148Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General
x-originating-ip: [2001:4898:80e8:a::7cc]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DM5PR21MB0825; 7:0z4Uw3iHBfxyvxsguWOTBcN71GrOaQpk7MwaAP+RxjBkDnpGr5n5vwWqVOtx9HPiwt1nGG51vp5wuI2Alek2uNnYkJ3Ohs8RF6qUrErS9BpfYLuwEKqbWJSNnrP/iOF6JmCt7bx39mcKkehK2Wxn0P4PCPXFoGndmSFrZlcF3TwWVPktsB0T1HSjGP0q6bSF8tLWCMEo3jOYp6avD2T4gpyQRPkJ97AaAV717kOB6NA3CXlIgP0W10P2BvFl/f0F; 20:P9dmkaZSeaYW7Ihcyu3hqLG8tAmQJ8G61nIcaEw1Jg/RTLqn5oinTLZUAXpILknlePUCKvVCehu0naP+uhhDH2RIPFIAMC6jZyCa3vrRY16zzGaACAn/w9jRvSp0dMuR29K+rHZ8jwsa0KbE6CakZTnwhnmOrhKzlvfEF0mXRoM=
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7193020); SRVR:DM5PR21MB0825;
x-ms-traffictypediagnostic: DM5PR21MB0825:
x-microsoft-antispam-prvs: <DM5PR21MB0825D2B8A415BA9081CAF9E9B39A0@DM5PR21MB0825.namprd21.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(67672495146484)(100405760836317)(21748063052155);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231254)(2018427008)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR21MB0825; BCL:0; PCL:0; RULEID:; SRVR:DM5PR21MB0825;
x-forefront-prvs: 0666E15D35
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(376002)(346002)(39380400002)(39860400002)(366004)(189003)(199004)(81156014)(6506007)(81166006)(86612001)(53546011)(3660700001)(486006)(446003)(53936002)(476003)(8990500004)(11346002)(186003)(10090500001)(2906002)(74316002)(46003)(316002)(561944003)(6246003)(8936002)(33656002)(3280700002)(22452003)(102836004)(6436002)(5660300001)(6346003)(8676002)(97736004)(59450400001)(25786009)(110136005)(106356001)(790700001)(105586002)(478600001)(229853002)(6116002)(14454004)(7696005)(54896002)(7736002)(55016002)(99286004)(6306002)(2501003)(236005)(10290500003)(76176011)(2900100001)(5250100002)(86362001)(68736007)(9686003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR21MB0825; H:DM5PR21MB0857.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=briansw@microsoft.com;
x-microsoft-antispam-message-info: Om3mJStN4Wwpy1Pshr7nZPECVUjm/VnDpAbdFxGRLsnOsHXO/QE/HSBRFkzHoyCyeBRQBbVuj2BXv9cM12RP85nvt9dq/X+zKSGxBd/PgZXsCHbmyPzEEaw4eZKIQvDinI8FmlVgSHn1yzjoMJjmaRC1oEjaj9ZXKccSaxz8rqTLjZ5uls7EWEJEHjaab6WN
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_DM5PR21MB08572BEFDA60C6EE920D0357B39A0DM5PR21MB0857namp_"
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: cec91eca-21c1-471b-35df-08d5b5254e7f
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cec91eca-21c1-471b-35df-08d5b5254e7f
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2018 20:50:17.6764 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR21MB0825
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/GkV8iLFvc28_1NvOkuA4hrKPFko>
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: Tue, 08 May 2018 20:50:22 -0000

Of course single pass isn’t required.  But the PostBase is there only to support single pass.  So there are definitely (probably fringe) cases where the encoded size will be larger because of PostBase.

So IMO, it comes down to the tradeoff of the possible speed improvement of single pass vs. compression size.   And I just don’t see the speed of the single pass being very compelling either.  For instance, you can cache the indices, etc from pass 1, and just quickly burn thru the array again encoding the indices determined from pass 1.

Personally, given that the speed improvement of single pass is probably marginal at best, I’d err on the side of less complexity – and slightly better compression.

But I’m not passionate about this issue.   So I’m fine with the current draft, if everyone else likes it.   I just prefer simplicity when it seems like complexity isn’t buying us much.  And in this case, simplicity also gives slightly better compression.

bs

From: Alan Frindell <afrind@fb.com>
Sent: Tuesday, May 8, 2018 1:13 PM
To: Brian Swander <briansw@microsoft.com>; quic@ietf.org
Subject: Re: QPACK - proposal to optimize compression

Single pass encoding is not required, an encoder has the option to encode using one or two passes.  The only wire penalty for a two-pass encoder is one extra byte per header block in the prefix, as largest reference and base index can be the same in two-pass encoding.  The original specification (which used Depends) had a one bit flag in the HTTP frame that allowed the encoder save this byte as well, but the consensus seemed to be it was better to have a fixed format to the prefix.  Without post-base, there could also be one more bit available for the length of a literal header name without adding an extra byte (header names with 7 <= length < 15).  We can of course simulate it, but I expect the difference to be in the noise.

Decoders do need to support both kinds of instructions, but I don’t find it to be terribly complex.  The proxygen implementation of the latest draft including one-pass encoding/decoding should be synced to github this week.

I’m not sure what you mean when you say “Many of the headers are going to be encoded in both streams.”  If you mean it will encode an insert on the control stream and an index reference on the request stream, that is true, and the post-base encoding of the references occupies only one byte for the first 15 such headers per block.

-Alan


From: QUIC <quic-bounces@ietf.org<mailto:quic-bounces@ietf.org>> on behalf of Brian Swander <briansw=40microsoft.com@dmarc.ietf.org<mailto:briansw=40microsoft.com@dmarc.ietf.org>>
Date: Monday, May 7, 2018 at 2:35 PM
To: "quic@ietf.org<mailto:quic@ietf.org>" <quic@ietf.org<mailto:quic@ietf.org>>
Subject: QPACK - proposal to optimize compression

Please correct me if I’m wrong here.

It looks like the latest QPACK draft has been optimized to allow encode of both control and data streams in a single pass.
Because of this, we now must support that post-base encoding, and the multiple encoding formats that use Post-Base.
I.e. Literal Header Field with Name Reference and Literal Header Filter With Post-Base Name Reference, and similarly for Indexed Header Field.

To me, it seems like the simpler, more efficient option of removing post-base entirely could be better.   At the cost of requiring 2-pass encode, we can save a few bits for most headers since we would never need the post base header prefix.

So it’s a question of looping thru the headers twice, vs. being less efficient on the wire.

I haven’t profiled it, but I’d guess that double pass thru the headers isn’t going to be that much slower than single pass.   Many of the headers are going to be encoded in both streams.   So the more efficient wire format may be more optimal.

bs