Re: [apps-discuss] Concise Binary Object Representation (CBOR)

Carsten Bormann <cabo@tzi.org> Wed, 22 May 2013 20:40 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5B2E121F94F9 for <apps-discuss@ietfa.amsl.com>; Wed, 22 May 2013 13:40:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.209
X-Spam-Level:
X-Spam-Status: No, score=-106.209 tagged_above=-999 required=5 tests=[AWL=0.040, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
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 v3bleoMVYe+B for <apps-discuss@ietfa.amsl.com>; Wed, 22 May 2013 13:40:26 -0700 (PDT)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id 8C9AF21F960B for <apps-discuss@ietf.org>; Wed, 22 May 2013 13:40:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.4/8.14.4) with ESMTP id r4MKd3hC005632; Wed, 22 May 2013 22:39:03 +0200 (CEST)
Received: from [192.168.217.105] (p54891D40.dip0.t-ipconnect.de [84.137.29.64]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id D78E539BB; Wed, 22 May 2013 22:39:02 +0200 (CEST)
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
Content-Type: text/plain; charset="iso-8859-1"
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <alpine.LSU.2.00.1305221841270.3056@hermes-2.csi.cam.ac.uk>
Date: Wed, 22 May 2013 22:39:01 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <AAEE1A37-B117-4C73-80B6-24B5CE1091D2@tzi.org>
References: <61CB1D18-BABC-4C77-93E6-A9E8CDA8326B@vpnc.org> <CABP7RbcUJJoPJYdCOGSoa8fJfqj+R5RttjDtG5zXDirUV9OMQA@mail.gmail.com> <3638B63C-0E75-4E99-BF65-28F83DB856A6@vpnc.org> <CAMm+LwjKzHnOKDp0dmHN1Czes-f7tcJ2U1qz7S_HoSpcfKMyyA@mail.gmail.com> <04905D53-5022-4741-A2B6-9EE4593A4C65@tzi.org> <alpine.LSU.2.00.1305221841270.3056@hermes-2.csi.cam.ac.uk>
To: Tony Finch <dot@dotat.at>
X-Mailer: Apple Mail (2.1503)
Cc: IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Concise Binary Object Representation (CBOR)
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 22 May 2013 20:40:32 -0000

On May 22, 2013, at 19:42, Tony Finch <dot@dotat.at> wrote:

> Why not BSON or BJSON or UBJSON or MsgPack or ... ?

Good question, and one that deserves to be answered (maybe not in a formal document).  
But, as Dave has alluded to, any such discussion MUST start with RFC 713.
I urge you to read it if you are interested in this space.

What have we learned in the 37 years since RFC 713?
Less than one might think.

I think the most important observation was that it is not the character that is the fundamental data type, but the text string.
We also have a pretty good and well accepted encoding for it: UTF-8.  So that is one centerpiece of CBOR.

The other sea change that has happened is that a number of S-expression based formats have come and gone, but JSON seems to be here to stay.
So JSON has been a strong inspiration, including the map (dictionary, hash, table, ...) type called "object" in JSON.

In contrast to RFC 713's well thought-out variable-size scheme, we did a fixed partitioning of the type byte (3 + 5 bits) because that is easier to handle both in high-speed and in very constrained implementations (of course, what is very constrained today might have been quite comfortable in 1976, except that we have to cram in so much more functionality today).

We are also using an item count and not a byte count for structured (non-atomic in RFC 713 terms) items.

There is no equivalent in CBOR to RFC 713's b-REPEAT -- we entirely left out compression mechanisms.

Grüße, Carsten