RE: Header Compression Implementation Feedback
Mike Bishop <Michael.Bishop@microsoft.com> Tue, 09 July 2013 15:04 UTC
Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 71C0611E8111 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 9 Jul 2013 08:04:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.712
X-Spam-Level:
X-Spam-Status: No, score=-7.712 tagged_above=-999 required=5 tests=[AWL=-0.245, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8, UNRESOLVED_TEMPLATE=3.132]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hKg8kVcLv2K0 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 9 Jul 2013 08:04:09 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 32B2211E8139 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 9 Jul 2013 08:04:08 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UwZRR-0001h7-7j for ietf-http-wg-dist@listhub.w3.org; Tue, 09 Jul 2013 15:02:57 +0000
Resent-Date: Tue, 09 Jul 2013 15:02:57 +0000
Resent-Message-Id: <E1UwZRR-0001h7-7j@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <Michael.Bishop@microsoft.com>) id 1UwZRJ-0001gO-3T for ietf-http-wg@listhub.w3.org; Tue, 09 Jul 2013 15:02:49 +0000
Received: from mail-by2lp0240.outbound.protection.outlook.com ([207.46.163.240] helo=na01-by2-obe.outbound.protection.outlook.com) by maggie.w3.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from <Michael.Bishop@microsoft.com>) id 1UwZRA-0001vJ-Kh for ietf-http-wg@w3.org; Tue, 09 Jul 2013 15:02:49 +0000
Received: from BL2FFO11FD001.protection.gbl (10.173.161.200) by BL2FFO11HUB034.protection.gbl (10.173.161.114) with Microsoft SMTP Server (TLS) id 15.0.717.3; Tue, 9 Jul 2013 15:02:12 +0000
Received: from TK5EX14MLTC104.redmond.corp.microsoft.com (131.107.125.37) by BL2FFO11FD001.mail.protection.outlook.com (10.173.160.101) with Microsoft SMTP Server (TLS) id 15.0.717.3 via Frontend Transport; Tue, 9 Jul 2013 15:02:12 +0000
Received: from tx2outboundpool.messaging.microsoft.com (157.54.51.114) by mail.microsoft.com (157.54.79.159) with Microsoft SMTP Server (TLS) id 14.3.136.1; Tue, 9 Jul 2013 15:02:09 +0000
Received: from mail240-tx2-R.bigfish.com (10.9.14.252) by TX2EHSOBE015.bigfish.com (10.9.40.35) with Microsoft SMTP Server id 14.1.225.22; Tue, 9 Jul 2013 15:01:05 +0000
Received: from mail240-tx2 (localhost [127.0.0.1]) by mail240-tx2-R.bigfish.com (Postfix) with ESMTP id 5BE5F32023E for <ietf-http-wg@w3.org.FOPE.CONNECTOR.OVERRIDE>; Tue, 9 Jul 2013 15:01:05 +0000 (UTC)
X-Forefront-Antispam-Report-Untrusted: CIP:157.56.240.21; KIP:(null); UIP:(null); (null); H:BL2PRD0310HT005.namprd03.prod.outlook.com; R:internal; EFV:INT
X-SpamScore: -24
X-BigFish: PS-24(zzbb2dI98dI9371I936eI542I1432Izz1f42h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzz1033IL17326ah8275bh8275dhz31h2a8h668h839h944hd24hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h18e1h1946h19b5h19ceh1ad9h1b0ah1d07h1d0ch1d2eh1d3fh1de9h1dfeh1dffh1e1dh9a9j1155h)
Received-SPF: softfail (mail240-tx2: transitioning domain of microsoft.com does not designate 157.56.240.21 as permitted sender) client-ip=157.56.240.21; envelope-from=Michael.Bishop@microsoft.com; helo=BL2PRD0310HT005.namprd03.prod.outlook.com ; .outlook.com ;
X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(199002)(189002)(24454002)(377424004)(479174003)(13464003)(51704005)(377454003)(66066001)(81542001)(79102001)(56816003)(74502001)(77096001)(46102001)(83072001)(65816001)(77982001)(16406001)(76786001)(76796001)(50986001)(51856001)(81342001)(54356001)(49866001)(74662001)(74316001)(80022001)(31966008)(59766001)(74366001)(69226001)(47446002)(54316002)(74876001)(4396001)(15202345003)(47976001)(53806001)(74706001)(76482001)(76576001)(33646001)(56776001)(47736001)(63696002)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB025; H:BY2PR03MB025.namprd03.prod.outlook.com; RD:InfoNoRecords; A:1; MX:1; LANG:en;
Received: from mail240-tx2 (localhost.localdomain [127.0.0.1]) by mail240-tx2 (MessageSwitch) id 137338204756481_2598; Tue, 9 Jul 2013 15:00:47 +0000 (UTC)
Received: from TX2EHSMHS036.bigfish.com (unknown [10.9.14.233]) by mail240-tx2.bigfish.com (Postfix) with ESMTP id D367A4201DA; Tue, 9 Jul 2013 15:00:46 +0000 (UTC)
Received: from BL2PRD0310HT005.namprd03.prod.outlook.com (157.56.240.21) by TX2EHSMHS036.bigfish.com (10.9.99.136) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 9 Jul 2013 15:00:42 +0000
Received: from BY2PR03MB025.namprd03.prod.outlook.com (10.255.240.39) by BL2PRD0310HT005.namprd03.prod.outlook.com (10.255.97.40) with Microsoft SMTP Server (TLS) id 14.16.329.3; Tue, 9 Jul 2013 15:00:42 +0000
Received: from BY2PR03MB025.namprd03.prod.outlook.com (10.255.240.39) by BY2PR03MB025.namprd03.prod.outlook.com (10.255.240.39) with Microsoft SMTP Server (TLS) id 15.0.702.21; Tue, 9 Jul 2013 15:00:39 +0000
Received: from BY2PR03MB025.namprd03.prod.outlook.com ([169.254.8.74]) by BY2PR03MB025.namprd03.prod.outlook.com ([169.254.8.179]) with mapi id 15.00.0702.005; Tue, 9 Jul 2013 15:00:39 +0000
From: Mike Bishop <Michael.Bishop@microsoft.com>
To: Michael Sweet <msweet@apple.com>
CC: Amos Jeffries <squid3@treenet.co.nz>, "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Thread-Topic: Header Compression Implementation Feedback
Thread-Index: AQHOfBr3Y2My4X/UH0m418MLDu59k5lbdq+AgABXRQCAAG1VgIAAHtoQgAAOuQCAAAaFkA==
Date: Tue, 09 Jul 2013 15:00:39 +0000
Message-ID: <67c8ad257f474933b9e076efed67972f@BY2PR03MB025.namprd03.prod.outlook.com>
References: <CABP7RbcjzwY6YgQWxRSu9zLJ6v2kwyQHyyr7t7SYOqH5e1Opow@mail.gmail.com> <CABP7RbdND8yMknhrBmc7Qh9Qzyv=XrxcXFh4FAmhSRcEWMNBQw@mail.gmail.com> <51DB9C08.4010005@treenet.co.nz> <C381B945-1AAE-43E9-A8D0-1323984004F4@apple.com> <049a36f0d74e4b34a4847bc3249bac66@BY2PR03MB025.namprd03.prod.outlook.com> <99B29D96-EFBB-4E6C-A945-797B8E5412E7@apple.com>
In-Reply-To: <99B29D96-EFBB-4E6C-A945-797B8E5412E7@apple.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [24.16.13.163]
x-forefront-prvs: 0902222726
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OrganizationHeadersPreserved: BY2PR03MB025.namprd03.prod.outlook.com
X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn%
X-FOPE-CONNECTOR: Id%59$Dn%W3.ORG$RO%2$TLS%6$FQDN%corpf5vips-237160.customer.frontbridge.com$TlsDn%
X-FOPE-CONNECTOR: Id%59$Dn%TREENET.CO.NZ$RO%2$TLS%6$FQDN%corpf5vips-237160.customer.frontbridge.com$TlsDn%
X-FOPE-CONNECTOR: Id%59$Dn%APPLE.COM$RO%2$TLS%6$FQDN%corpf5vips-237160.customer.frontbridge.com$TlsDn%
X-CrossPremisesHeadersPromoted: TK5EX14MLTC104.redmond.corp.microsoft.com
X-CrossPremisesHeadersFiltered: TK5EX14MLTC104.redmond.corp.microsoft.com
X-Forefront-Antispam-Report: CIP:131.107.125.37; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(24454002)(189002)(51704005)(13464003)(377424004)(199002)(377454003)(479174003)(59766001)(74366001)(66066001)(4396001)(44976004)(79102001)(51856001)(54356001)(46102001)(76786001)(53806001)(31966008)(81542001)(63696002)(49866001)(76576001)(74502001)(76796001)(69226001)(47976001)(83072001)(77982001)(47446002)(47776003)(65816001)(15202345003)(74316001)(56776001)(16676001)(50986001)(56816003)(54316002)(23726002)(50466002)(80022001)(6806003)(81342001)(33646001)(74876001)(46406003)(76482001)(47736001)(20776003)(74706001)(77096001)(74662001)(24736002); DIR:OUT; SFP:; SCL:1; SRVR:BL2FFO11HUB034; H:TK5EX14MLTC104.redmond.corp.microsoft.com; CLIP:131.107.125.37; RD:InfoDomainNonexistent; MX:1; A:1; LANG:en;
X-OriginatorOrg: microsoft.onmicrosoft.com
X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY)
X-Forefront-PRVS: 0902222726
Received-SPF: pass client-ip=207.46.163.240; envelope-from=Michael.Bishop@microsoft.com; helo=na01-by2-obe.outbound.protection.outlook.com
X-W3C-Hub-Spam-Status: No, score=-3.0
X-W3C-Hub-Spam-Report: AWL=-2.988, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, UNRESOLVED_TEMPLATE=0.716
X-W3C-Scan-Sig: maggie.w3.org 1UwZRA-0001vJ-Kh 3f125688cacd4daa1f92efe8761d8090
X-Original-To: ietf-http-wg@w3.org
Subject: RE: Header Compression Implementation Feedback
Archived-At: <http://www.w3.org/mid/67c8ad257f474933b9e076efed67972f@BY2PR03MB025.namprd03.prod.outlook.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18646
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>
No, you couldn't end up with that sequence as currently specced. I agree, it would be an issue if the client did that, and you're right that there's no guarantee the individual HEADERS frame ends at a boundary -- but it's required to be the only frame type sent until a boundary is reached, and you are guaranteed to have reached a boundary at the end of the last HEADERS frame in the sequence. >From http://tools.ietf.org/html/draft-ietf-httpbis-http2-04: A HEADERS frame without the END_HEADERS flag set MUST be followed by a HEADERS frame for the same stream. A receiver MUST treat the receipt of any other type of frame or a frame on a different stream as a connection error (Section 5.4.1) of type PROTOCOL_ERROR. ... A compressed and encoded header block is transmitted in one or more HEADERS or PUSH_PROMISE frames. If the number of octets in the block is greater than the space remaining in the frame, the block is divided into multiple fragments, which are then transmitted in multiple frames. Header blocks MUST be transmitted as a contiguous sequence of frames, with no interleaved frames of any other type, or from any other stream. The last frame in a sequence of HEADERS frames MUST have the END_HEADERS flag set. The last frame in a sequence of PUSH_PROMISE frames MUST have the END_PUSH_PROMISE flag set. ... An HTTP request or response each consist of: o one contiguous sequence of HEADERS frames; o zero or more DATA frames; and o optionally, a contiguous sequence of HEADERS frames The last frame in the sequence bears an END_STREAM flag. Other frames, including HEADERS, MAY be interspersed with these frames, but those frames do not carry HTTP semantics. Trailing header fields are carried in a header block that also terminates the stream. That is, a sequence of HEADERS frames that carries an END_STREAM flag on the last frame. Header blocks after the first that do not terminate the stream are not part of an HTTP request or response. -----Original Message----- From: Michael Sweet [mailto:msweet@apple.com] Sent: Tuesday, July 9, 2013 7:28 AM To: Mike Bishop Cc: Amos Jeffries; ietf-http-wg@w3.org Subject: Re: Header Compression Implementation Feedback Mike, On Jul 9, 2013, at 9:38 AM, Mike Bishop <Michael.Bishop@microsoft.com> wrote: > No -- there's a single encoding and single decoding table *per connection* and this wouldn't change that. Each table starts in an initial state with common values in each direction already in the table for convenient back-reference. > > The problem with the initial state as it's currently defined is that it assumes clients only send request headers and servers only send response headers. In fact, servers also send request headers (PUSH_PROMISE). > > The suggestion is that both directions start with the same initial state. I'm ok with that part. However, I think we need to make it clear in the HTTP/2.0 specification that (partial) HEADER frames cannot be interleaved from multiple streams, otherwise the state of the header table will be undefined. For example, let's say a (multithreaded) client wants to GET /image1.jpg and /image2.png from a server over a single HTTP/2.0 connection using streams 1 and 2, respectively. And let's say that, because of cookies used by the web site, we can't fit all of the request headers into a single HEADER frame. If the client doesn't serialize the two requests you could end up with: 1:HEADER (first request frame on stream 1) 2:HEADER (first request frame on stream 2) 2:HEADER (second request frame on stream 2) 1:HEADER (second request frame on stream 1) 2:HEADER (last request frame on stream 2) 1:HEADER (last request frame on stream 1) Since each frame cannot be guaranteed to end at a header boundary, the server reading those HEADER frames has no way to reliably update its copy of the header table used for decoding. So this means the client needs to serialize HEADER frames (and thus any requests it sends) at a cost of memory and some complexity - whether this cost is greater than per-stream header tables will likely depend on the situation. It will also limit how quickly a client can issue requests, but that isn't necessarily a bad thing and in most cases the limiting factor is network bandwidth, not CPU... Oh, and implementations will need to add protection against receiving interleaved HEADER frames from multiple streams... Similarly, servers have to serialize their outgoing HEADER frames and do the same sort of error checking for incoming HEADER frames. If instead we use a per-stream header table then we avoid this complexity but end up with less effective compression, particularly if clients and servers do not reuse streams for multiple requests. But personally I think the savings in connection setup time and simultaneous streaming of multiple requests and responses makes this loss in compression acceptable. It would also simplify the protocol and implementation. > -----Original Message----- > From: Michael Sweet [mailto:msweet@apple.com] > Sent: Tuesday, July 9, 2013 4:45 AM > To: Amos Jeffries > Cc: ietf-http-wg@w3.org > Subject: Re: Header Compression Implementation Feedback > > If you are suggesting that each endpoint should maintain a single encoding and a single decoding table per stream, I'm +1 on that. > > Sent from my iPad > > On 2013-07-09, at 1:13 AM, Amos Jeffries <squid3@treenet.co.nz> wrote: > >> On 9/07/2013 12:01 p.m., James M Snell wrote: >>> Another minor item as I've been going through the implementation: >>> >>> 4. Right now, the Header Compression scheme assumes two separate >>> pre-filled header tables... one for Request headers, the other for >>> response headers. The challenge with this is that it does not >>> account for the use of Request Headers within PUSH_PROMISE frames. >>> This is minor right now, but it means that PUSH_PROMISE frames will >>> not have optimum compression because the request headers will need >>> to be added as Literal representations with Indexing. It would be >>> better if we just had ONE prefilled table (it would make >>> implementation generally easier as well) >> >> +1. >> >> Amos >> > > > > _________________________________________________________ Michael Sweet, Senior Printing System Engineer, PWG Chair
- Header Compression Implementation Feedback James M Snell
- Re: Header Compression Implementation Feedback James M Snell
- Re: Header Compression Implementation Feedback Amos Jeffries
- Re: Header Compression Implementation Feedback Michael Sweet
- RE: Header Compression Implementation Feedback Mike Bishop
- Re: Header Compression Implementation Feedback Michael Sweet
- RE: Header Compression Implementation Feedback Mike Bishop
- Re: Header Compression Implementation Feedback Martin Thomson
- Re: Header Compression Implementation Feedback Michael Sweet
- Re: Header Compression Implementation Feedback James M Snell
- Re: Header Compression Implementation Feedback Michael Sweet
- Re: Header Compression Implementation Feedback Michael Sweet