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

"Paul E. Jones" <> Thu, 23 May 2013 06:47 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id CFF2211E8155 for <>; Wed, 22 May 2013 23:47:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[AWL=-0.001, BAYES_00=-2.599, HTML_MESSAGE=0.001]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id E2beNnA4WuZK for <>; Wed, 22 May 2013 23:47:17 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 39F4121F96D2 for <>; Wed, 22 May 2013 23:47:17 -0700 (PDT)
Received: from sydney ( []) (authenticated bits=0) by (8.14.5/8.14.5) with ESMTP id r4N6lFV5008071 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 23 May 2013 02:47:15 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;; s=dublin; t=1369291635; bh=wQr3HZ4fsuvb51C0BxVUimLpAsnT5ex4HUyQVhxMyYI=; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=isUefg7KTcc9R7cdyyiRZhTJrDkqt8G4o/XemkZ4HpHjV4AfoF3Gk31+SGLTosh7g RC8080eRrBE4J7rPzD1O7Xf+K9mimPYFTEoJYzlgvDfaF1Mo6pE2+859ee6VfsHErS HvUkee8IA0eXCBgXHkQWGqq4ZmIkT4+S9QzQxbdA=
From: "Paul E. Jones" <>
To: 'Phillip Hallam-Baker' <>, 'Paul Hoffman' <>
References: <> <> <> <>
In-Reply-To: <>
Date: Thu, 23 May 2013 02:47:18 -0400
Message-ID: <002201ce5781$5ee92b20$1cbb8160$>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0023_01CE575F.D7D89C90"
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQK0gG+l38l//+1OzBi59iKBnwt7hwFzkLZUAoEBjIMBloxR9pcZpZdg
Content-Language: en-us
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: Thu, 23 May 2013 06:47:21 -0000

There are actually several XML binary encodings defined today.  But I assume
the one to which you refer is the one in the W3C called Efficient XML
Interchange (EXI).  I looked into that and compared the various compression
results against a vanilla compression algorithm (namely, zlib).  I recorded
the results here:


Basically, using EXI would reduce the size of messages and the more the
encoder knew about the schema, the better it would do... for small messages.
What was interesting is that the results I got rather consistently showed
that zlib would outperform most other binary encodings for messages of about
1K or larger.  However, l don't really want an encoding that requires the
encoder to be aware of a specific schema.  It might change tomorrow or next


Zlib worked well since much of the data being compressed was, of course,
text.  And text compresses pretty well.  It just has a fairly large
footprint that is visible with smaller messages.


The "no schema" variant of EXI did pretty well on small messages, so I think
if COBR can achieve compression at a comparable rate or better, that would
be great.  Now, it was mentioned elsewhere in the thread (and I'll admit
I've not read the draft) that streaming might be an issue.  Steaming is not
an issue with EXI (at least not with the "no schema" variant), as new tags
are encoded into the binary output as they are first seen.


ASN.1 PER did an really good job at compressing data.  Some of the ASN.1
syntax can be a bit hairy, but the encoding was small.  And it worked well
since the data it was encoding was binary data, too.  With most of the newer
protocols, binary optimization is a challenge because the protocols use so
much text (media types, URLs, etc.)  So, if COBR will exist mainly to
compress text data, it will not compress too well.  I assume it is being
introduced to produce a tight wire encoding of (largely) binary data.




From: []
On Behalf Of Phillip Hallam-Baker
Sent: Wednesday, May 22, 2013 12:14 PM
To: Paul Hoffman
Cc: IETF Apps Discuss
Subject: Re: [apps-discuss] Concise Binary Object Representation (CBOR)




I think we can all agree that *A* binary format would be useful and that two
dozen are not useful. The whole problem is how to convince people to use one
particular scheme rather than the alternatives.


ASN.1 has a decent binary encoding. The problem is that it also has some
terrible ones and the ASN.1 schema language was designed by a committee.


Text encodings do have problems. Floating Point values do not round trip
from IEEE floating point representations without special handling so the
format causes a loss in precision that can cause real trouble in scientific
work. And nobody likes base64 encoding binary values.



I would like to have available a BER like encoding for JSON. But this
proposal seems to be something rather different.


There is also the XML binary encoding effort that took place. They had a
competition and everything. And at the end the only real use for the work
was that it shut up the constant carping from people complaining that Web
Services in XML were verbose.



On Wed, May 22, 2013 at 12:00 PM, Paul Hoffman <>

On May 22, 2013, at 8:47 AM, James M Snell <> wrote:

> At first read it looks interesting, and can definitely see that a lot
> of thought was put into the design. There have, however, been a number
> of previous attempts at alternative compact binary representations (or
> at least discussions) that did not seem to really go anywhere.

We did ours differently than others: we started with an ordered set of
design goals and stuck to them. That means that our early arguments about
changes / bikeshedcolors had something we could compare against, and it make
coming up with a solution much more tractable.

> What is
> the current implementation status of this? Are there implementations
> available or any existing plans to use this new format in a specific
> app or spec?

Both Carsten and I did versions (in Ruby and Python) to make sure the spec
made sense and the examples worked. At least one other member of this list
has apparently done a version in JavaScript.

> I'm largely just curious about the context and motivation
> behind this...

There are many contexts. It might be useful in CORE and other
constrained-environment work. It might be useful for the next protocols that
need a compact binary representation and the WG doesn't want to fight over
the specific features. If the design goals fit your needs (and we actually
met them...), then it's useful to have it be widely available.

--Paul Hoffman
apps-discuss mailing list