Re: QPACK - proposal to optimize compression

Alan Frindell <afrind@fb.com> Tue, 08 May 2018 20:39 UTC

Return-Path: <prvs=8666beae1a=afrind@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 22C1C12EAC0 for <quic@ietfa.amsl.com>; Tue, 8 May 2018 13:39:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.719
X-Spam-Level:
X-Spam-Status: No, score=-2.719 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_LOW=-0.7, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=fb.com header.b=fpteT1pl; dkim=pass (1024-bit key) header.d=fb.onmicrosoft.com header.b=dX5IO6J6
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 XBU3zdtcIGNo for <quic@ietfa.amsl.com>; Tue, 8 May 2018 13:39:38 -0700 (PDT)
Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) (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 8083612EAC6 for <quic@ietf.org>; Tue, 8 May 2018 13:39:38 -0700 (PDT)
Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w48KCCdu022013; Tue, 8 May 2018 13:13:23 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=facebook; bh=IijVSuV1fDxYFZ4vViicUfbFZsoxEwAlWnLEr21aSWw=; b=fpteT1plvuDBYEmzgZcwsHXTf/IVYmeBBCx4OrF1ID6b+5dfq7Un1K00zbR9TVj3nHFL iJI74u18wG1jXsPV18Ay6+PZ9uhYBEx7mPMQretWc5inPrGXGjt7aVa/xspHevREjJJL aLVInqD1MTCQmu4BZAROEwQOrXHwaJfE2dE=
Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2huhqa06f0-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 08 May 2018 13:13:22 -0700
Received: from NAM01-BN3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 8 May 2018 13:12:59 -0700
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; bh=IijVSuV1fDxYFZ4vViicUfbFZsoxEwAlWnLEr21aSWw=; b=dX5IO6J689imrOoovinrhyUA8BjIUjBm95GOnUagjf7upEPOaDIdJv9nT1hn0rT27G6ku+ByDKjrdAgdXGlyjEjCwD9/wbpH+ZgI5wRMPmOpmLZD9wJ64FzjVO0PfBkroUe7ufZH9E0tKcSqMpd73eAUCbzjH8GtoduqLrnA+90=
Received: from MWHPR15MB1181.namprd15.prod.outlook.com (10.175.2.135) by MWHPR15MB1743.namprd15.prod.outlook.com (10.174.255.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.17; Tue, 8 May 2018 20:12:53 +0000
Received: from MWHPR15MB1181.namprd15.prod.outlook.com ([fe80::555:6a20:1573:7b7a]) by MWHPR15MB1181.namprd15.prod.outlook.com ([fe80::555:6a20:1573:7b7a%18]) with mapi id 15.20.0735.019; Tue, 8 May 2018 20:12:53 +0000
From: Alan Frindell <afrind@fb.com>
To: Brian Swander <briansw=40microsoft.com@dmarc.ietf.org>, "quic@ietf.org" <quic@ietf.org>
Subject: Re: QPACK - proposal to optimize compression
Thread-Topic: QPACK - proposal to optimize compression
Thread-Index: AdPmSVy6766G9sm1TzOdAr1rcH/nrAAhOhQA
Date: Tue, 08 May 2018 20:12:53 +0000
Message-ID: <BCF18407-B5DD-4608-ACFE-C229E17A2C1B@fb.com>
References: <DM5PR21MB0857F41DCB080F130E1436ADB39B0@DM5PR21MB0857.namprd21.prod.outlook.com>
In-Reply-To: <DM5PR21MB0857F41DCB080F130E1436ADB39B0@DM5PR21MB0857.namprd21.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.c.0.180410
x-originating-ip: [2620:10d:c090:200::5:d48]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; MWHPR15MB1743; 7:i56o/CSggBlEgqrBeUFWZMaqyNdz+2tGtbCCJdxBzboMd9evGk6F5bynZiabnrV9te1Z8WJRnol+dnw5xIB/iLyPspnb3+62an1smFefgCMI/8uW/mAk9PhaVLweMljFHL1pVgNOGgHYeioghVgfgTTjqPpU9RXJJIQOwn2RT/KvQm3c14YRTlTJ149N8ZkGDT9fuK9W97VJQPECoMRFMgbKdjBEBM7ZqCManFWKcJDWTm+LaNE6A+LcufRNoDIJ; 20:JmBcGaDm3ltIyRnicGBCY5fKMkpeQLAl6yAMkkK9FpVJQSCW/G3paBziUCZQH3o+5jQm1yEbuuLicpzAxcnwvLsVdK+iLT4LDswD6fNtajcU3CydXSglbrcb4jqP9/sqcsGfZOaUcfWZJYv441BPzLwLou+SDWZ6q6lhrMY+kn0=
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:MWHPR15MB1743;
x-ms-traffictypediagnostic: MWHPR15MB1743:
x-microsoft-antispam-prvs: <MWHPR15MB1743A46E7EDA6D716DF7904AA79A0@MWHPR15MB1743.namprd15.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(100405760836317)(21748063052155);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231254)(11241501184)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:MWHPR15MB1743; BCL:0; PCL:0; RULEID:; SRVR:MWHPR15MB1743;
x-forefront-prvs: 0666E15D35
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(396003)(346002)(376002)(39860400002)(39380400002)(199004)(189003)(561944003)(8936002)(316002)(14454004)(81156014)(46003)(53546011)(59450400001)(6506007)(68736007)(6436002)(446003)(58126008)(7736002)(8676002)(110136005)(6486002)(2616005)(11346002)(33656002)(6116002)(102836004)(3660700001)(5660300001)(25786009)(3280700002)(2906002)(478600001)(36756003)(105586002)(106356001)(76176011)(81166006)(82746002)(86362001)(99286004)(486006)(6306002)(6512007)(54896002)(2501003)(5250100002)(83716003)(186003)(476003)(6246003)(2900100001)(53936002)(97736004)(229853002); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR15MB1743; H:MWHPR15MB1181.namprd15.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: fb.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: 7yZnKMnTrcOdgWZ5SQRjkEg6gHDDPp1QbZ7UD9RUBsyTLxT/6K7pAWSOJMyzDNSBjdZEGFtnAB3AtnPavbUyQ2FU2OPR6gpsWmqv6ZWwIlX+um0hANYrmYWKgTzObsUeZE673FPsWnRJW4UijVCk9L57P61A8CjrjDaPNTRNlSjHj3lW+rzJw4akZiw9ubL/
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_BCF18407B5DD4608ACFEC229E17A2C1Bfbcom_"
MIME-Version: 1.0
X-MS-Office365-Filtering-Correlation-Id: eb90aa1d-8471-4162-e578-08d5b520149b
X-MS-Exchange-CrossTenant-Network-Message-Id: eb90aa1d-8471-4162-e578-08d5b520149b
X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2018 20:12:53.0885 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR15MB1743
X-OriginatorOrg: fb.com
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-08_07:, , signatures=0
X-Proofpoint-Spam-Reason: safe
X-FB-Internal: Safe
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/iGqBU3u95V7-6cIcX2QSJrkyWeA>
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:39:41 -0000

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> on behalf of Brian Swander <briansw=40microsoft.com@dmarc.ietf.org>
Date: Monday, May 7, 2018 at 2:35 PM
To: "quic@ietf.org" <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