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

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 17 August 2017 06:54 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 E9E77126B7E; Wed, 16 Aug 2017 23:54:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 dWxJ2T-GL_Bm; Wed, 16 Aug 2017 23:54:33 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7F459124BAC; Wed, 16 Aug 2017 23:54:33 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 58BFF6AA; Thu, 17 Aug 2017 08:54:32 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id GP2eaB5w8V7s; Thu, 17 Aug 2017 08:54:32 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Thu, 17 Aug 2017 08:54:32 +0200 (CEST)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id 36BEF200C5; Thu, 17 Aug 2017 08:54:32 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id 5g2w2uE5MPh8; Thu, 17 Aug 2017 08:54:31 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 963DE200C3; Thu, 17 Aug 2017 08:54:31 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 317F3404117B; Thu, 17 Aug 2017 08:54:30 +0200 (CEST)
Date: Thu, 17 Aug 2017 08:54:30 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Carsten Bormann <cabo@tzi.org>
Cc: core WG <core@ietf.org>, cbor@ietf.org
Message-ID: <20170817065430.wp3gqiui37f26ki6@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Carsten Bormann <cabo@tzi.org>, core WG <core@ietf.org>, cbor@ietf.org
References: <13753.1502939016@obiwan.sandelman.ca> <7689DC42-6C05-462F-8466-C067B34232A9@tzi.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
X-Clacks-Overhead: GNU Terry Pratchett
Content-Transfer-Encoding: 8bit
In-Reply-To: <7689DC42-6C05-462F-8466-C067B34232A9@tzi.org>
User-Agent: NeoMutt/20170714 (1.8.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/NMyguk3bCN1qHe_aEjt7JGJ0JU4>
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 06:54:36 -0000

Carsten,

if I search for 'delta' or 'reference SID', I do not find text that
says what the reference SID is. Where do I have to look at to
understand that delta SIDs are parent-referenced?

/js

PS: Why do we have this, I mean, why is there a $ for some of these?

           pattern 'Module|Submodule|feature|' +
	           'identity$|node$|notification$|rpc$|action$';

    Why is this not an enum in the first place? And why are the
    first two capitalized?

PS: Why do you not import yang-identifier from ietf-yang-types?

On Thu, Aug 17, 2017 at 07:48:20AM +0200, Carsten Bormann wrote:
> 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
> 
> _______________________________________________
> core mailing list
> core@ietf.org
> https://www.ietf.org/mailman/listinfo/core

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>