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

Carsten Bormann <> Wed, 22 May 2013 20:40 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 5B2E121F94F9 for <>; Wed, 22 May 2013 13:40:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -106.209
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id v3bleoMVYe+B for <>; Wed, 22 May 2013 13:40:26 -0700 (PDT)
Received: from ( [IPv6:2001:638:708:30c9::12]) by (Postfix) with ESMTP id 8C9AF21F960B for <>; Wed, 22 May 2013 13:40:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
Received: from ( []) by (8.14.4/8.14.4) with ESMTP id r4MKd3hC005632; Wed, 22 May 2013 22:39:03 +0200 (CEST)
Received: from [] ( []) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by (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 <>
In-Reply-To: <>
Date: Wed, 22 May 2013 22:39:01 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <> <> <> <>
To: Tony Finch <>
X-Mailer: Apple Mail (2.1503)
Cc: IETF Apps Discuss <>
Subject: Re: [apps-discuss] Concise Binary Object Representation (CBOR)
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 22 May 2013 20:40:32 -0000

On May 22, 2013, at 19:42, Tony Finch <> 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