Re: Header Serialization Discussion
"Martin Nilsson" <nilsson@opera.com> Wed, 17 April 2013 01:09 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 00DF721F95F3 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 16 Apr 2013 18:09:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[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 K2O9d1otq7tP for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 16 Apr 2013 18:09:25 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id E46F821F95CE for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 16 Apr 2013 18:09:24 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.72) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1USGqd-00047E-OO for ietf-http-wg-dist@listhub.w3.org; Wed, 17 Apr 2013 01:07:43 +0000
Resent-Date: Wed, 17 Apr 2013 01:07:43 +0000
Resent-Message-Id: <E1USGqd-00047E-OO@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtp (Exim 4.72) (envelope-from <nilsson@opera.com>) id 1USGqa-00046O-DK for ietf-http-wg@listhub.w3.org; Wed, 17 Apr 2013 01:07:40 +0000
Received: from smtp.opera.com ([213.236.208.81]) by lisa.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <nilsson@opera.com>) id 1USGqZ-0000oA-7a for ietf-http-wg@w3.org; Wed, 17 Apr 2013 01:07:40 +0000
Received: from beryllium.bredbandsbolaget.se (c-741de353.03-25-6c6b7010.cust.bredbandsbolaget.se [83.227.29.116]) (authenticated bits=0) by smtp.opera.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id r3H17BfB023379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <ietf-http-wg@w3.org>; Wed, 17 Apr 2013 01:07:12 GMT
Content-Type: text/plain; charset="iso-8859-15"; format="flowed"; delsp="yes"
To: ietf-http-wg@w3.org
References: <CABP7RbfUH=U0hjcmEXKO1jJzy7pPffqFDE4TmAs-ahBX04qwJw@mail.gmail.com>
Date: Wed, 17 Apr 2013 03:07:13 +0200
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Martin Nilsson <nilsson@opera.com>
Organization: Opera Software
Message-ID: <op.wvnuqbukiw9drz@beryllium.bredbandsbolaget.se>
In-Reply-To: <CABP7RbfUH=U0hjcmEXKO1jJzy7pPffqFDE4TmAs-ahBX04qwJw@mail.gmail.com>
User-Agent: Opera Mail/12.15 (Win32)
Received-SPF: pass client-ip=213.236.208.81; envelope-from=nilsson@opera.com; helo=smtp.opera.com
X-W3C-Hub-Spam-Status: No, score=-4.6
X-W3C-Hub-Spam-Report: AWL=-1.616, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.702, SPF_PASS=-0.001
X-W3C-Scan-Sig: lisa.w3.org 1USGqZ-0000oA-7a 90bc8618f34a19d4dbb06e0bc2137498
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Header Serialization Discussion
Archived-At: <http://www.w3.org/mid/op.wvnuqbukiw9drz@beryllium.bredbandsbolaget.se>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/17272
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 Sun, 14 Apr 2013 00:01:24 +0200, James M Snell <jasnell@gmail.com>
wrote:
>
> As far as Value serialization is concerned... As I have discussed
> previously, I have been looking at support for four distinct value
> types, each represented by their own two-bit identifier. As I will
> explain further in a second, these types are represented using the two
> most significant bits in a byte:
>
> 00 = Text
> 01 = Number
> 10 = Date Time
> 11 = Binary
>
> Text can be either UTF-8 or ISO-8859-1, indicated by a single bit flag
> following the type code. All text strings are prefixed by it's length
> given as an unsigned variant length integer
> Numbers are encoded as unsigned variable length integers.
> Date Times are encoded as Numbers representing the number of seconds
> that have passed since the epoch (GMT).
> Binary data is encoded as raw binary octets prefixed by an unsigned
> variable length integer specifying the number of bytes.
>
I'll share what Opera Mini does for it's request protocol. It's a delta
encoded name-value list statically assigned property identifiers and with
a very minimal typing and length encoding. Since we control both client
and server there are a lot of property specific value encodings used, but
it doesn't change for a specific property (i.e. user strings are always
UTF-8).
From our documentation:
Each property is encoded as eight flag bits followed by the id# of
the property (16 bits) followed by the payload, the format of which
depends on the flags.
6bit 1bit 1bit 16 bit
+---------+------+------+---------------+----------------- - -
| unused | INT | LONG | PROPERTY ID# | PAYLOAD
+---------+------+------+---------------+----------------- - -
if INT is 1, the payload is an integer, otherwise it's a string
if LONG is 1, the payload length, or the integer, depending on INT,
is 4 bytes long instead of 1 byte.
-----+------+-----------------------------------------------------
INT | LONG | PAYLOAD
-----+------+-----------------------------------------------------
0 | 0 | 1 byte LEN (max 254), followed by LEN bytes data
1 | 0 | 1 byte INT (value between 0 and 254)
0 | 1 | 4 bytes LEN (max 0xfffffffe) followed by LEN bytes
1 | 1 | 4 bytes INT (value between 0 and 0xffffffff)
-----+------+------------------------------------------------------
Only properties that have changed value need to be transmitted to
the server, with a few exceptions.
Comparing with your proposal I would not create a specific Date Time type,
but just keep it as an integer representation of posix time. I would not
have different text encodings, but stick to only UTF-8. I would have a
really serious thinking about if I should have both Binary and Text.
/Martin Nilsson
--
Using Opera's revolutionary email client: http://www.opera.com/mail/
- Header Serialization Discussion James M Snell
- RE: Header Serialization Discussion RUELLAN Herve
- Re: Header Serialization Discussion James M Snell
- Re: Header Serialization Discussion Adrien W. de Croy
- Re: Header Serialization Discussion Frédéric Kayser
- RE: Header Serialization Discussion RUELLAN Herve
- RE: Header Serialization Discussion RUELLAN Herve
- Re: Header Serialization Discussion James M Snell
- Re: Header Serialization Discussion James M Snell
- Re: Header Serialization Discussion Roberto Peon
- Re: Header Serialization Discussion James M Snell
- Re: Header Serialization Discussion Martin Nilsson
- Re: Header Serialization Discussion James M Snell
- Re: Header Serialization Discussion Frédéric Kayser
- Re: Header Serialization Discussion Frédéric Kayser
- Re: Header Serialization Discussion James M Snell
- Re: UTF-8 text (was: Header Serialization Discuss… Frédéric Kayser
- Re: UTF-8 text (was: Header Serialization Discuss… James M Snell
- Re: UTF-8 text (was: Header Serialization Discuss… James M Snell
- Re: Header Serialization Discussion Martin Thomson
- Re: UTF-8 text James Cloos