Re: Suggestion for simplified HTTP 2.0 header compression algorithm

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

Received on Wednesday, 6 November 2013 10:39:08 UTC