QCRAM Review Request: PR #1141

Mike Bishop <mbishop@evequefou.be> Thu, 01 March 2018 00:40 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 E59911272E1 for <quic@ietfa.amsl.com>; Wed, 28 Feb 2018 16:40:03 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.918
X-Spam-Level:
X-Spam-Status: No, score=-1.918 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_FONT_LOW_CONTRAST=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, 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 1BK6fEKguOCO for <quic@ietfa.amsl.com>; Wed, 28 Feb 2018 16:40:01 -0800 (PST)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0126.outbound.protection.outlook.com [104.47.36.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0A62C12711A for <quic@ietf.org>; Wed, 28 Feb 2018 16:40:00 -0800 (PST)
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; bh=VnLntNsZ39Jj/bdkEykYfJ+MoUeRqHErEy/WQYP6R5Q=; b=d3JS2qvcaosQz/01ApCv3K44lm3vE6n5d+sIHi4vhEKX297EicGOGTIQJ6q4fPHCVyWPZtHyDh9jyEnB1bBD9JTkriCeBe/V/dXdEUvIgbnNlGdNUm+7rcBPchKZUlPSgBW2glcovdW9ur8xGKH4uQWpW+67L1NfurNYxxVhk2I=
Received: from MWHPR08MB2432.namprd08.prod.outlook.com (10.169.203.136) by MWHPR08MB3584.namprd08.prod.outlook.com (10.164.203.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 1 Mar 2018 00:39:58 +0000
Received: from MWHPR08MB2432.namprd08.prod.outlook.com ([fe80::5410:deca:3ee5:983f]) by MWHPR08MB2432.namprd08.prod.outlook.com ([fe80::5410:deca:3ee5:983f%16]) with mapi id 15.20.0527.021; Thu, 1 Mar 2018 00:39:57 +0000
From: Mike Bishop <mbishop@evequefou.be>
To: QUIC WG <quic@ietf.org>
Subject: QCRAM Review Request: PR #1141
Thread-Topic: QCRAM Review Request: PR #1141
Thread-Index: AdOw7SHmzhNvawT0SnaeDYyjVrIBRA==
Date: Thu, 1 Mar 2018 00:39:57 +0000
Message-ID: <MWHPR08MB24325CADE88C887A869F65F1DAC60@MWHPR08MB2432.namprd08.prod.outlook.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: [38.134.241.6]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; MWHPR08MB3584; 7:HpORCLLAnx1mjh+tC53mZA4jToukfxTjSXz00qIa/T2yewZjH6KeBIrXx9AH4m+Ta0lWhfA4EFP+GSxCTNj5J0+6yhv/XyfTtFplXnBhwx19oIB1lCMNOVLLMGyET3Dt5rSSIijYC+BQgbeVLWHNZnkYVI7VZ8Y003uIM5DGMS98oUORAqduGp9XUBCaXiJ9Zf5v//FBHCL2yzkTeHr5Cu09hVnXldlpZU5mbP1v9SmcG5DSM9nhIc6jiWpJdEy+
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: 4b5505e7-7541-4072-bb7e-08d57f0cf597
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:MWHPR08MB3584;
x-ms-traffictypediagnostic: MWHPR08MB3584:
x-microsoft-antispam-prvs: <MWHPR08MB358460029E311FE4A1A8DFA9DAC60@MWHPR08MB3584.namprd08.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(28532068793085)(166708455590820)(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501221)(52105095)(93006095)(93001095)(10201501046)(6041288)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(2016111802025)(6072148)(6043046)(201708071742011); SRVR:MWHPR08MB3584; BCL:0; PCL:0; RULEID:; SRVR:MWHPR08MB3584;
x-forefront-prvs: 05986C03E0
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39830400003)(366004)(376002)(346002)(39380400002)(396003)(199004)(189003)(14454004)(966005)(8936002)(81166006)(6306002)(54896002)(86362001)(9686003)(53946003)(81156014)(478600001)(8676002)(74482002)(5250100002)(186003)(33656002)(55016002)(606006)(25786009)(6506007)(106356001)(6116002)(3846002)(59450400001)(790700001)(5660300001)(6916009)(102836004)(7696005)(66066001)(97736004)(26005)(7736002)(236005)(74316002)(6436002)(99286004)(2906002)(3660700001)(3280700002)(68736007)(105586002)(2900100001)(53936002)(316002)(19627235001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR08MB3584; H:MWHPR08MB2432.namprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:1; LANG:en;
received-spf: None (protection.outlook.com: evequefou.be does not designate permitted sender hosts)
x-microsoft-antispam-message-info: WkYOa2y+0gM3zjoZuSJyTIh/W4wHG2qnB41kcnfjDo7gpKuK+iGyDN1SDye5Ss19tPTEPSwv9FtRtFw4lsJt01YoOhp80vmzkFZEM+KIY4XRu2H3ZmLO0uZl5CwWN/+aJ/s6/HElYqKjCnBPTQNfzCQJjfk2obY210xyMZsEy6Q=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_MWHPR08MB24325CADE88C887A869F65F1DAC60MWHPR08MB2432namp_"
MIME-Version: 1.0
X-OriginatorOrg: evequefou.be
X-MS-Exchange-CrossTenant-Network-Message-Id: 4b5505e7-7541-4072-bb7e-08d57f0cf597
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 00:39:57.7458 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 41eaf50b-882d-47eb-8c4c-0b5b76a9da8f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR08MB3584
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/E49d1tbMXaqm7vYwy_LrA0yz7C4>
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, 01 Mar 2018 00:40:04 -0000

https://github.com/quicwg/base-drafts/pull/1141

One suggestion from Martin's implementation feedback that has been mentioned before is reworking the QCRAM instruction space.  The QCRAM draft uses the HPACK instructions, except that it cannibalizes table size changes for the Duplicate instruction.  That leads to some inefficiency with the separate streams, since you have to validate that instructions aren't used on the wrong stream and some of the opcode space is wasted on each stream.

This PR observes that each stream has a fully disjoint set of commands from the other:

  *   Table updates
     *   Insert with Name Reference from Static Table
     *   Insert with Name Reference from Dynamic Table
     *   Insert without Name Reference
     *   Duplicate
     *   Change table size
  *   Header blocks
     *   Indexed entry from Static
     *   Indexed entry from Dynamic
     *   Literal with Name Reference from Static Table
     *   Literal with Name Reference from Static Table, Never Indexed
     *   Literal with Name Reference from Dynamic Table
     *   Literal with Name Reference from Dynamic Table, Never Indexed
     *   Literal without Name Reference
     *   Literal without Name Reference, Never Indexed

The PR takes advantage of the disjoint space to rework the opcodes in hopes of saving bytes on common instructions.  It does this in two ways:

  *   Uses a bit in the opcode to differentiate static versus dynamic tables, instead of concatenating them
     *   Gives us the future option to make the static table longer without hurting the dynamic table performance
  *   Uses a bit in the opcode to identify string literals, instead of using a sentinel value of zero
     *   Requires modifying the HPACK string definition to not require byte alignment at the beginning
     *   Gives us the future option to make the tables zero-based instead of one-based
     *   Makes indexing easier to explain in a future PR

Here's the impact:

Operation

HPACK

QCRAM

PR#1141

Impact

Table updates









Insert with Name Reference from Static Table

"01" + index < 62

"01" + index < 62

"11" + index

Same

Insert with Name Reference from Dynamic Table

"01" + index >= 62
(one byte for first 2 entries, then 2 bytes)

"01" + index >= 62
(one byte for first 2 entries, then 2 bytes)

"10" + index
(one byte for first 64 entries)

One byte saved for 62 of 64 most recent entries

Insert without Name Reference

"01000000"

"01000000"

"01"


One byte saved for header names < 32 octets

Duplicate

Not supported

"001" + index >= 62

"000" + index

Moot; you're unlikely to duplicate recent entries

Change table size

"001"

Not supported

"001"

Same

Header blocks









Indexed entry from Static

"1" + index < 62

"1" + index < 62

"11" + index

Same

Indexed entry from Dynamic

"1" + index >= 62

"1" + index >= 62

"10" + index

One byte longer for indices 62-63

Literal with Name Reference from Static Table

"0000" + index < 62
(two bytes for index > 15)

"0000" + index < 62
(two bytes for index > 15)

"0001" + index

Same

Literal with Name Reference from Static Table, Never Indexed

"0001" + index < 62
(two bytes for index > 15)

"0001" + index < 62
(two bytes for index > 15)

"0011" + index

Same

Literal with Name Reference from Dynamic Table

"0000" + index >= 62
(always 2+ bytes)

"0000" + index >= 62
(always 2+ bytes)

"0000" + index

One byte saved for first 15 entries

Literal with Name Reference from Dynamic Table, Never Indexed

"0001" + index > 62
(always 2+ bytes)

"0001" + index > 62
(always 2+ bytes)

"0010" + index

One byte saved for first 15 entries

Literal without Name Reference

"00000000"

"00000000"

"010"

One byte saved for header names < 16 octets

Literal without Name Reference, Never Indexed

"00010000"

"00010000"

"011"

One byte saved for header names < 16 octets


There's been some churn on the PR today as Martin and I worked some of this out, so please give it a read (or another read) now and provide feedback.

Thanks!