Re: [core] YANG to CBOR mapping version 1

peter van der Stok <stokcons@xs4all.nl> Thu, 14 July 2016 15:46 UTC

Return-Path: <stokcons@xs4all.nl>
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 9A70E12D53C for <core@ietfa.amsl.com>; Thu, 14 Jul 2016 08:46:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.602
X-Spam-Level:
X-Spam-Status: No, score=-2.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-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 IuSXz2TDiSJ0 for <core@ietfa.amsl.com>; Thu, 14 Jul 2016 08:46:29 -0700 (PDT)
Received: from lb1-smtp-cloud6.xs4all.net (lb1-smtp-cloud6.xs4all.net [194.109.24.24]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1BAC312D0F9 for <core@ietf.org>; Thu, 14 Jul 2016 08:46:28 -0700 (PDT)
Received: from webmail.xs4all.nl ([194.109.20.209]) by smtp-cloud6.xs4all.net with ESMTP id JfmT1t0064WfiVN01fmTh4; Thu, 14 Jul 2016 17:46:27 +0200
Received: from 2001:983:a264:1:4563:dcea:23df:e56a by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Thu, 14 Jul 2016 17:46:27 +0200
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Date: Thu, 14 Jul 2016 17:46:27 +0200
From: peter van der Stok <stokcons@xs4all.nl>
To: Alexander Pelov <a@ackl.io>
Organization: vanderstok consultancy
Mail-Reply-To: consultancy@vanderstok.org
In-Reply-To: <9409ECE5-77DF-481B-B2C6-0BA6337EA60A@ackl.io>
References: <1ed9a5d16aca7d13412259e94afc1aa2@xs4all.nl> <BLUPR06MB17639739570760661AEC32C3FE3C0@BLUPR06MB1763.namprd06.prod.outlook.com> <e18f0f45bfae89fc55df444fdd957550@xs4all.nl> <BLUPR06MB17638EB4CCB4235B5101D540FE300@BLUPR06MB1763.namprd06.prod.outlook.com> <d58ca58bd8f89b9856a2e23290a18ba8@xs4all.nl> <BLUPR06MB1763A212CD1C3386722B88D9FE310@BLUPR06MB1763.namprd06.prod.outlook.com> <8aa9950d6b8ff0cfe8968276d18cad7d@xs4all.nl> <BLUPR06MB1763D6B8ADAE036D5E63FBA3FE310@BLUPR06MB1763.namprd06.prod.outlook.com> <43805298839959a534d83c720ac6239c@xs4all.nl> <9409ECE5-77DF-481B-B2C6-0BA6337EA60A@ackl.io>
Message-ID: <bba27d1f30b38b53752b544e0bc94cff@xs4all.nl>
X-Sender: stokcons@xs4all.nl (bEWbkZcd82ri5/BfpqhBlNlD5zqTlk7E)
User-Agent: XS4ALL Webmail
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/93a45Ak1rJKUdVmzX_niRMpQk8c>
Cc: Core <core@ietf.org>
Subject: Re: [core] YANG to CBOR mapping version 1
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
Reply-To: consultancy@vanderstok.org
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, 14 Jul 2016 15:46:30 -0000

Alexander Pelov schreef op 2016-07-14 10:39:
> Dear Peter,
> 
> I agree with you - if a server expects TWO keys, but receives ONE this
> is an error. What I don’t understand is how marking the CBOR content
> changes anything to this. (if the client insists that a leaf is a key
> and the server disagrees - then you have error. if the server requires
> a key and the client does not provide it - stil an error).
> 
> From implementation point of view, the server will never recompile the
> YANG module. YANG is used compile-time (when you generate your program
> on your laptop) and as a contract between the client and the server.
> The same goes for constrained clients.
> 
> In most cases, the server and the client will actually not need to
> have the YANG module scheme at all - only a couple of SIDs, associated
> meta-data (in binary - such as the type) and the associated functions
> (which you need anyways). As SIDs never change, you don’t need
> anything else on the device. It could be even simpler - without the
> meta-data - but then the associated functions need to do the
> validation (e.g. Arduino implementations).
> 
> Alexander

Hi Alexander,

absolutely agree with you in the above.
The need to identify keys and to distinguish different instances is 
needed when you want to "replace" (same key values) or "add" (different 
key values) individual instances to a list.

I try to argue that you want that express this in the payload because 
you cannot count on server and client to have the same view on the key 
set.

Peter