Re: Suggestion for simplified HTTP 2.0 header compression algorithm

Amos Jeffries <squid3@treenet.co.nz> Wed, 06 November 2013 10:40 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 EB17C21E8088 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 6 Nov 2013 02:40:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.974
X-Spam-Level:
X-Spam-Status: No, score=-9.974 tagged_above=-999 required=5 tests=[AWL=0.625, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
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 P52MWo-Rpyv2 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 6 Nov 2013 02:40:17 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id AEAFF11E80E4 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 6 Nov 2013 02:40:17 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Ve0W5-0004rn-Ee for ietf-http-wg-dist@listhub.w3.org; Wed, 06 Nov 2013 10:39:17 +0000
Resent-Date: Wed, 06 Nov 2013 10:39:17 +0000
Resent-Message-Id: <E1Ve0W5-0004rn-Ee@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1Ve0Vv-0004qz-VG for ietf-http-wg@listhub.w3.org; Wed, 06 Nov 2013 10:39:07 +0000
Received: from ip-58-28-153-233.static-xdsl.xnet.co.nz ([58.28.153.233] helo=treenet.co.nz) by lisa.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1Ve0Vq-0003Qg-Mw for ietf-http-wg@w3.org; Wed, 06 Nov 2013 10:39:07 +0000
Received: from [IPv6:2002:7963:24bf:e472:6aa3:c4ff:fef8:6a1d] (unknown [IPv6:2002:7963:24bf:e472:6aa3:c4ff:fef8:6a1d]) by treenet.co.nz (Postfix) with ESMTP id 766E8E6F4B for <ietf-http-wg@w3.org>; Wed, 6 Nov 2013 23:38:37 +1300 (NZDT)
Message-ID: <527A1C29.9020301@treenet.co.nz>
Date: Wed, 06 Nov 2013 23:38:33 +1300
From: Amos Jeffries <squid3@treenet.co.nz>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
MIME-Version: 1.0
To: ietf-http-wg@w3.org
References: <3DA2CCFE1950214281EBD48CE0FBDABD3572B53F@ESESSMB303.ericsson.se>
In-Reply-To: <3DA2CCFE1950214281EBD48CE0FBDABD3572B53F@ESESSMB303.ericsson.se>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=58.28.153.233; envelope-from=squid3@treenet.co.nz; helo=treenet.co.nz
X-W3C-Hub-Spam-Status: No, score=-0.0
X-W3C-Hub-Spam-Report: SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1Ve0Vq-0003Qg-Mw 61dee3137f8d12d6be63e8106c7070d1
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Suggestion for simplified HTTP 2.0 header compression algorithm
Archived-At: <http://www.w3.org/mid/527A1C29.9020301@treenet.co.nz>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/20354
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>

On 6/11/2013 10:04 p.m., Hans Spaak wrote:
>
> Hello,
>
> The proposed header compression algorithm is rather complicated and we 
> foresee that there will be at least initially a lot of interworking 
> problems
> when different compressor and de-compressor implementations need to 
> work together.
> We experienced those problems when the equally complicated WAP1.x 
> header compression was implemented.
>
> Here is our proposal for simplifying how headers are compressed in 
> HTTP/2.0.
>
> It does not compress as hard as the currently proposed solution (if 
> the encoder is written in a very smart way),
>
> but it is much easier to implement.
>
> Please have a look at it and comment.
>
> _Exchange of static headers, which are the same for one TCP connection:_
>
> The SETTINGS frame is used to transmit the static request and response 
> headers.
>
> The HEADERS frame is used to transmit the dynamic request and response 
> headers.
>
> Static headers and dynamic headers are combined in the following way:
>
> 1.Emit the dynamic headers.
>
> 2.Emit the static headers whose header names are not present in the 
> dynamic headers.
>

Your diagram shows those in reverse order. I assume your diagram is the 
right version as it makes more sense than re-transmitting static headers 
constantly.


> Client Server
>
> | |
>
> |SETTINGS |
> | - static request headers |
> | (:method, :host, |
>
> | User-Agent, Accept, …) |
>
> |---------------------------->| Store static request
> | | headers for connection
>
> |SETTINGS |
>
> | - static response headers |
>
> | (:status 200, Server, …) |
>
> | |
>
> Store static response |<----------------------------|
>
> headers for connection | |
>
> |HEADERS |
>
> | - dynamic request headers |
>
> | (:path, …) |
>
> |---------------------------->| Combine static and
>
> | | dynamic request
>
> | | headers.
> | | Dynamic headers have
>
> | | precedence over static
>
> | | headers.
>
> |HEADERS |
>
> | - dynamic response headers |
>
> | (Content-Type, Age, …) |
>
> Combine static and |<----------------------------|
>
> dynamic response headers. | |
> Dynamic headers have | |
>
> precedence over static | |
>
> headers. | |
>

Sounds familiar....
http://tools.ietf.org/html/draft-tarreau-httpbis-network-friendly-00#section-2.2

Slightly different frame and grouping names though.

> _Coding of header names and values:_
>
> Standard headers are coded in the following way:
>
> 0 1 2 3 4 5 6 7
>
> +---+---+---+---+---+---+---+---+
>
> | 1 | Index of standard header |
>
> +---+---------------------------+
>
> | Value length (8+) |
>
> +-------------------------------+
>
> | Value String (Length octets) |
>
> +-------------------------------+
>
> Non-standard headers are coded in the following way:
>
> 0 1 2 3 4 5 6 7
>
> +---+---+---+---+---+---+---+---+
>
> | 0 | Name Length (7+) |
>
> +---+---------------------------+
>
> | Name String (Length octets) |
>
> +-------------------------------+
>
> | Value length (8+) |
>
> +-------------------------------+
>
> | Value String (Length octets) |
>
> +-------------------------------+
>

... and the header encoding can be made more efficient without affecting 
transport encrypt/decrypt speed:
http://tools.ietf.org/html/draft-tarreau-httpbis-network-friendly-00#section-2.1.5

Amos