Re: Alternative Header Compression Update..

Michael Sweet <msweet@apple.com> Wed, 10 July 2013 13:11 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 DC32421F9F6F for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 10 Jul 2013 06:11:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.881
X-Spam-Level:
X-Spam-Status: No, score=-8.881 tagged_above=-999 required=5 tests=[AWL=1.718, 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 DhvyhvqBXO5X for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 10 Jul 2013 06:10:56 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 198D221F940D for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 10 Jul 2013 06:10:56 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Uwu9y-00076f-Bq for ietf-http-wg-dist@listhub.w3.org; Wed, 10 Jul 2013 13:10:18 +0000
Resent-Date: Wed, 10 Jul 2013 13:10:18 +0000
Resent-Message-Id: <E1Uwu9y-00076f-Bq@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <msweet@apple.com>) id 1Uwu9o-00072b-W1 for ietf-http-wg@listhub.w3.org; Wed, 10 Jul 2013 13:10:09 +0000
Received: from mail-out.apple.com ([17.151.62.51]) by lisa.w3.org with esmtps (TLS1.0:RSA_ARCFOUR_MD5:16) (Exim 4.72) (envelope-from <msweet@apple.com>) id 1Uwu9k-0004UT-DM for ietf-http-wg@w3.org; Wed, 10 Jul 2013 13:10:08 +0000
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: text/plain; CHARSET="US-ASCII"
Received: from relay7.apple.com ([17.128.113.101]) by mail-out.apple.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTP id <0MPQ00D2Y1VD3Q20@mail-out.apple.com> for ietf-http-wg@w3.org; Wed, 10 Jul 2013 06:09:37 -0700 (PDT)
X-AuditID: 11807165-b7fac6d0000008c6-27-51dd5d0f4c70
Received: from [17.153.30.10] (Unknown_Domain [17.153.30.10]) (using TLS with cipher AES128-SHA (128/128 bits)) (Client did not present a certificate) by relay7.apple.com (Apple SCV relay) with SMTP id 86.25.02246.01D5DD15; Wed, 10 Jul 2013 06:09:37 -0700 (PDT)
From: Michael Sweet <msweet@apple.com>
In-reply-to: <CABP7RbcoTSGVbGKkzwtCjKL__mC_3m91tsu=V5U8wQAMGfG=Ag@mail.gmail.com>
Date: Wed, 10 Jul 2013 09:09:34 -0400
Cc: "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Message-id: <0E4C5C6B-205F-41EF-BE29-075678913F15@apple.com>
References: <CABP7RbcoTSGVbGKkzwtCjKL__mC_3m91tsu=V5U8wQAMGfG=Ag@mail.gmail.com>
To: James M Snell <jasnell@gmail.com>
X-Mailer: Apple Mail (2.1784.1)
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsUiOFOOS1cw9m6gwbGJBhaHW2YxWTya1MNi ceRbrAOzx9aTP9g8ds66y+5xdN5+1gDmKC6blNSczLLUIn27BK6M9oZJzAXdahV9hw4xNzCu l+5i5OSQEDCReP3mGCOELSZx4d56ti5GLg4hgW4miTWN99lBEsJARTvuH2ACsXkFDCSWH77G CmIzC2hJ3Pj3EizOJqAm8XtSH1Ccg4NTIFDi9VdzkDCLgKrEp1cdbBDluhJNk74yQtjaEssW vmaGGGkjMffsX7AaIYEAictHp4GNFwHq/XzuOwvEbfISnQ2vWScw8s9CcsUsJFfMQjJ2ASPz KkaBotScxEpzvcSCgpxUveT83E2MoCBsKEzdwdi43OoQowAHoxIP7wGFO4FCrIllxZW5hxgl OJiVRHjVre4GCvGmJFZWpRblxxeV5qQWH2KU5mBREue11rsdKCSQnliSmp2aWpBaBJNl4uCU amC0dJ3gmtguqXTfpnSqfJpNzGLtpPsez1oPiGZ+7z9grmnJ/Mk196GtxLNJKy8Lxd3p3Mn5 XSTNfLtni3jOuzLzw/sfPIq++3yqQcQStmD1J0bbhX/1PhE+rn/aopfbPTHkDYPZpn8zuCbf z/hp0bVNovih64w1/3KKWbYlzvnxONZ99o9g7TdKLMUZiYZazEXFiQBLKq2PPgIAAA==
Received-SPF: pass client-ip=17.151.62.51; envelope-from=msweet@apple.com; helo=mail-out.apple.com
X-W3C-Hub-Spam-Status: No, score=-5.8
X-W3C-Hub-Spam-Report: AWL=-0.466, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.303, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1Uwu9k-0004UT-DM 5970c6ed791e6556cdc76dcb8fb7acee
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Alternative Header Compression Update..
Archived-At: <http://www.w3.org/mid/0E4C5C6B-205F-41EF-BE29-075678913F15@apple.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/18671
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>

James,

On Jul 9, 2013, at 8:40 PM, James M Snell <jasnell@gmail.com> wrote:
> ...
> This details an alternative scheme that ditches the differential
> encoding and the reference set, uses a fixed range of header table
> indices (0x00-FF), and uses a least-recently-written eviction strategy
> without renumbering. This approach is significantly less complicated
> to implement at the cost of only a small handful of additional bytes
> on the wire.


Actually, I think the typed encoding will probably yield enough savings to offset any increase in size, for example the date header going from 29 octets to ~6 in the variable integer encoding (or 8/11 for the RFC 2579 encoding - see below).

I like the 256-entry single header table approach.  Of course, I have some feedback... :)

1. Would be nice if you could just include the Unsigned Variable Length Integer Syntax section from the other header compression draft wholesale so this draft stands on its own. Add a notice at the beginning "(This is copied from draft-ietf-httpbis-header-compression-NN)" so people know it is the same encoding.  Then the reference to it becomes informative.

2. Would also be nice to use the same figure format as the compression and http2 drafts... (see below)

3. Representing timestamps as milliseconds since the traditional UNIX epoch is problematic since it requires support for large integers (at least 42 bits to get us to the traditional 2038 end year, more if you want to keep going past then...) and AFAIK isn't widely used in standards for actual representation of a date/time. RFC 2579 defines a DateAndTime format that is 8 (UTC) or 11 (local time) octets long and is easy to map to/from typical OS APIs without the use of large integers. Granted, it doesn't give you more than 10ths of seconds, but I think that should be enough for HTTP. (We use this format in IPP - I'd rename "Timestamp" to "DateAndTime" if you decide to make this change...)

4. I'm not super-keen on grouping the headers into 4 bins ahead of time, since that increases encoder storage requirements.  Also, there isn't a way to just replace the value for an existing indexed header in your current draft.  Perhaps a hybrid approach where the indexed representation can have 1-to-64 indexes and the others encode a single name/value?  Something like this:

    Non-Indexed Literal Representation
    (Name Length > 0)

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    | 0   0 |   Name Length (6+)    |
    +-------+-----------------------+
    | Name String                   |
    +---+---+---+-------------------+
    | Value Type| Value Length (5+) |
    +-----------+-------------------+
    | Value String                  |
    +-------------------------------+


    Indexed Literal Representation
    (Name Length > 0)

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    | 0   1 |   Name Length (6+)    |
    +-------+-----------------------+
    | Name String                   |
    +---+---+---+-------------------+
    | Value Type| Value Length (5+) |
    +-----------+-------------------+
    | Value String                  |
    +-------------------------------+


    Indexed Representation
    (Count = 1 to 64)

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    | 1   0 |   Count - 1 (6)       |
    +-------+-----------------------+
    | Name/Value Index 1 (8)        |
    ...                          ....
    | Name/Value Index N (8)        |
    +-------------------------------+


    Indexed Literal Replacement Representation
    (Name Length > 0 to replace name and value)

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    | 1   1 |   Name Length (6+)    |
    +-------+-----------------------+
    | Name String                   |
    +-------------------------------+
    | Index (8)                     |
    +---+---+---+-------------------+
    | Value Type| Value Length (5+) |
    +-----------+-------------------+
    | Value String                  |
    +-------------------------------+


    Indexed Literal Replacement Representation
    (Name Length = 0 to just replace value)

      0   1   2   3   4   5   6   7
    +---+---+---+---+---+---+---+---+
    | 1   1 | 0   0   0   0   0   0 |
    +-------+-----------------------+
    | Index (8)                     |
    +---+---+---+-------------------+
    | Value Type| Value Length (5+) |
    +-----------+-------------------+
    | Value String                  |
    +-------------------------------+

_________________________________________________________
Michael Sweet, Senior Printing System Engineer, PWG Chair