Re: Last Call: <draft-bormann-cbor-04.txt> (Concise Binary Object Representation (CBOR)) to Proposed Standard

"Manger, James H" <James.H.Manger@team.telstra.com> Fri, 02 August 2013 04:49 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9AD3A11E81BE for <ietf@ietfa.amsl.com>; Thu, 1 Aug 2013 21:49:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.419
X-Spam-Level:
X-Spam-Status: No, score=-0.419 tagged_above=-999 required=5 tests=[AWL=0.482, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
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 6vpmi5vDKzXd for <ietf@ietfa.amsl.com>; Thu, 1 Aug 2013 21:48:54 -0700 (PDT)
Received: from ipxano.tcif.telstra.com.au (ipxano.tcif.telstra.com.au [203.35.82.200]) by ietfa.amsl.com (Postfix) with ESMTP id 883A611E81CF for <ietf@ietf.org>; Thu, 1 Aug 2013 21:48:54 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.89,798,1367935200"; d="scan'208";a="150380820"
Received: from unknown (HELO ipcbni.tcif.telstra.com.au) ([10.97.216.204]) by ipoani.tcif.telstra.com.au with ESMTP; 02 Aug 2013 14:48:53 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7154"; a="153833343"
Received: from wsmsg3755.srv.dir.telstra.com ([172.49.40.196]) by ipcbni.tcif.telstra.com.au with ESMTP; 02 Aug 2013 14:48:49 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3755.srv.dir.telstra.com ([172.49.40.196]) with mapi; Fri, 2 Aug 2013 14:48:49 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: IETF Discussion <ietf@ietf.org>
Date: Fri, 02 Aug 2013 14:48:47 +1000
Subject: Re: Last Call: <draft-bormann-cbor-04.txt> (Concise Binary Object Representation (CBOR)) to Proposed Standard
Thread-Topic: Last Call: <draft-bormann-cbor-04.txt> (Concise Binary Object Representation (CBOR)) to Proposed Standard
Thread-Index: Ac6O0XZOfE87L5d8QPuKdyzMxfiPsAAaVrzQ
Message-ID: <255B9BB34FB7D647A506DC292726F6E115281CEEC1@WSMSG3153V.srv.dir.telstra.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ietf>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Aug 2013 04:49:10 -0000

draft-bormann-cbor-04 adds text about handling maps with multiple identical keys., but it is contradictory. Section 3.4. "Specifying Keys for Maps" says:

   A CBOR-based protocol should make an intentional decision about what
   to do when a receiving application sees multiple identical keys in a
   map.  A protocol might have a rule that it is not an error to have
   identical keys in a map, and that the receiving application will
   discard all but the last key/value pair for a given key in a map.

   ...

   The CBOR data model for maps does not allow ascribing semantics to
   the order of the key/value pairs in the map representation.  A CBOR-
   based protocol MUST NOT be defined in such a way that changing the
   key/value pair order in a map would change the semantics, apart from
   trivial aspects (cache usage etc.).


A protocol that says "discard all but the last key/value pair for a given key" does change semantics if the key/value pair order is changed so it violates the text saying this "MUST NOT" happen.

Given there is no legacy CBOR data to maintain backward compatibility with, the spec should be clearer that a map with multiple identical keys is always an error. Discarding all but the last pair for a given key is NOT acceptable behaviour for a parser. A note that a streaming parser might not be able to detect duplicates is ok, accompanied by a warning that an application using such a parser will need its own checks for multiple identical keys to avoid unambiguous messages.

Suggestion:

Delete the whole paragraph starting "A CBOR-based protocol should make an intentional decision".

After the sentence "The CBOR data model for maps allows zero or one entries in the map for each specific key", add the following sentences:

   Consequently, a map in which a specific key appears multiple times is not
   a valid CBOR value. A parser MUST NOT accept such a map by keeping just
   one entry for an offending key.


Typo: s/for each a specific key/for each specific key/

--
James Manger