Header compression: buffer management

RUELLAN Herve <Herve.Ruellan@crf.canon.fr> Thu, 21 March 2013 12:53 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 D2EBE21F8E57 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 21 Mar 2013 05:53:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.249
X-Spam-Level:
X-Spam-Status: No, score=-10.249 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_FR=0.35, 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 1siDaMbh7Q2C for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 21 Mar 2013 05:53:03 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 20C4D21F8E5C for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 21 Mar 2013 05:53:02 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1UIeyL-00077S-GM for ietf-http-wg-dist@listhub.w3.org; Thu, 21 Mar 2013 12:51:57 +0000
Resent-Date: Thu, 21 Mar 2013 12:51:57 +0000
Resent-Message-Id: <E1UIeyL-00077S-GM@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <Herve.Ruellan@crf.canon.fr>) id 1UIey3-00076O-2q for ietf-http-wg@listhub.w3.org; Thu, 21 Mar 2013 12:51:39 +0000
Received: from inari-bsr.crf.canon.fr ([194.2.158.68]) by lisa.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <Herve.Ruellan@crf.canon.fr>) id 1UIexy-0002nC-Io for ietf-http-wg@w3.org; Thu, 21 Mar 2013 12:51:39 +0000
Received: from mir-bsr.corp.crf.canon.fr (mir-bsr.corp.crf.canon.fr [172.19.77.99]) by inari-bsr.crf.canon.fr (8.13.8/8.13.8) with ESMTP id r2LCp8jI017073 for <ietf-http-wg@w3.org>; Thu, 21 Mar 2013 13:51:08 +0100
Received: from ADELE.crf.canon.fr (adele.fesl2.crf.canon.fr [172.19.70.17]) by mir-bsr.corp.crf.canon.fr (8.13.8/8.13.8) with ESMTP id r2LCotJx025666 for <ietf-http-wg@w3.org>; Thu, 21 Mar 2013 13:50:55 +0100
Received: from ADELE.crf.canon.fr ([::1]) by ADELE.crf.canon.fr ([::1]) with mapi id 14.02.0342.003; Thu, 21 Mar 2013 13:50:54 +0100
From: RUELLAN Herve <Herve.Ruellan@crf.canon.fr>
To: "ietf-http-wg@w3.org" <ietf-http-wg@w3.org>
Thread-Topic: Header compression: buffer management
Thread-Index: Ac4mKEB4rOwKdoC6QHy2X3WZpGsVgg==
Date: Thu, 21 Mar 2013 12:50:54 +0000
Message-ID: <6C71876BDCCD01488E70A2399529D5E5163F39C4@ADELE.crf.canon.fr>
Accept-Language: en-US, fr-FR
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.20.7.30]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Received-SPF: none client-ip=194.2.158.68; envelope-from=Herve.Ruellan@crf.canon.fr; helo=inari-bsr.crf.canon.fr
X-W3C-Hub-Spam-Status: No, score=-4.5
X-W3C-Hub-Spam-Report: AWL=-1.956, RP_MATCHES_RCVD=-2.497
X-W3C-Scan-Sig: lisa.w3.org 1UIexy-0002nC-Io 7815b6832704780cf010aa89b31388cb
X-Original-To: ietf-http-wg@w3.org
Subject: Header compression: buffer management
Archived-At: <http://www.w3.org/mid/6C71876BDCCD01488E70A2399529D5E5163F39C4@ADELE.crf.canon.fr>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17094
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>

In HeaderDiff we chose to let the encoder decide how the buffer is managed (regarding additions and removals). These decisions are encoded on the wire and applied by the decoder on its own buffer. We think this choice has several advantages.

First, this allows to have a very simple and lightweight decoder: it only needs to decode the decisions made by the encoder and apply them. It has no need to effectively implements a LRU mechanism for its buffer. This is especially important for small devices with limited CPU.
In addition, we think it could be of interest for an intermediary, that could keep a partial buffer containing only the entries it is interested with, ignoring the other entries.

Second, this allows to adapt the buffer management to the context. While LRU is a good algorithm in the general case for deciding which entry to remove from the buffer, it may not be the best one for every specific case. More complex algorithms can probably be devised to improve the compaction (for example taking also into account the frequency of occurrence of headers), or simpler algorithms could be used to reduce the CPU cost to the detriment of compaction (this is important for small devices).
Adaptability is also important for the future of HTTP/2.0. If we do our job correctly, HTTP/2.0 will still be used in 10 or 20 years, but we have no idea how it will be used at that time. Making HTTP/2.0 adaptable to new usages is crucial to give it a long life expectancy.


For these reasons, we prefer to keep all the buffer management on the encoder side, allowing an implementer to choose its preferred approach.

Hervé.