Re: [core] map (5), ordering vs YANG SID in ietf-core-yang-cbor

Carsten Bormann <cabo@tzi.org> Thu, 17 August 2017 05:48 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1046124E15; Wed, 16 Aug 2017 22:48:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z0hjTWoi84vJ; Wed, 16 Aug 2017 22:48:26 -0700 (PDT)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DB3281323B2; Wed, 16 Aug 2017 22:48:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::b]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id v7H5mLbV019929; Thu, 17 Aug 2017 07:48:21 +0200 (CEST)
Received: from [192.168.217.124] (p5DC7FC78.dip0.t-ipconnect.de [93.199.252.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (Postfix) with ESMTPSA id 3xXwHT0m9RzDLbQ; Thu, 17 Aug 2017 07:48:21 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <13753.1502939016@obiwan.sandelman.ca>
Date: Thu, 17 Aug 2017 07:48:20 +0200
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 524641700.331557-e714c0e8394a04a63bb401ec92b1aabd
Content-Transfer-Encoding: quoted-printable
Message-Id: <7689DC42-6C05-462F-8466-C067B34232A9@tzi.org>
References: <13753.1502939016@obiwan.sandelman.ca>
To: core WG <core@ietf.org>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/ufhO6FVqkJpcsHD5mel9UNyK50g>
Subject: Re: [core] map (5), ordering vs YANG SID in ietf-core-yang-cbor
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 17 Aug 2017 05:48:29 -0000

Hi Michael,

SID deltas in maps are parent-referenced (and not sibling-referenced) for this reason.
Do you see anything that makes you think they are sibling-referenced?
That would indeed not work in maps.

(We discussed using one or more of your solutions for introducing “ordered maps”, but then it seemed parent-referenced was good enough.)

Grüße, Carsten


> On Aug 17, 2017, at 05:03, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
> 
> 
> Hi. I was trying to generate some code to implement a YANG model in
> CBOR using:
>  https://tools.ietf.org/html/draft-ietf-core-yang-cbor-05#section-4.2
> 
> which quite clearly says that I'm to use a CBOR map type (5).  Except that
> my understanding of SIDs is that they are deltas for the key part.
> (My other problem is that I don't have a SID until the SID document
> progresses, but I can use the experimental range for now)
> 
> In many languages for which there are easy to use CBOR bindings, ruby,
> python, perl, js, java, the CBOR map translates to a hash or directionary.
> So I wondered how I could do deltas on keys in such an unordered structure...
> 
> My reading of:
>  https://tools.ietf.org/html/draft-ietf-core-yang-cbor-05#section-4.2
> about type 5, and then I read:
>  https://tools.ietf.org/html/rfc7049#section-3.7
> 
> which says:
>   The CBOR data model for maps does not allow ascribing semantics to
>   the order of the key/value pairs in the map representation.
> 
> so, it seems that the SID concept as described in ietf-core-yang-cbor can not
> work using the map type!!!
> At first I thought it was just a language binding issue; that I needed
> ordered sets of some kind, but no... It violates the above property.
> 
> Solutions that I can imagine:
> 1) use an array of 2-element arrays (requires an extra byte for each inner
>   array!)
> 2) use an array 2x the size, and let the application reconstruct things as a
>   hash after taking in account the SID delta.
> 3) use one of the discussed point/multi-dimensional-array/etc. structures
>   that I believe were presented at IETF99... I think draft-jroatch-cbor-tags
>   was the document.
> 
> I think that I favour (2), as being the most expedient and easiest to implement.
> 
> --
> Michael Richardson <mcr+IETF@sandelman.ca>, Sandelman Software Works
> -= IPv6 IoT consulting =-
> 
> 
> 
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core