Re: [core] πŸ”” WG adoption of draft-veillette-core-yang-cbor-mapping-00

Andy Bierman <andy@yumaworks.com> Thu, 21 April 2016 16:12 UTC

Return-Path: <andy@yumaworks.com>
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 EB7D812E769 for <core@ietfa.amsl.com>; Thu, 21 Apr 2016 09:12:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 G_Dx68yYas_G for <core@ietfa.amsl.com>; Thu, 21 Apr 2016 09:12:23 -0700 (PDT)
Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9F72E12E5D7 for <core@ietf.org>; Thu, 21 Apr 2016 09:12:22 -0700 (PDT)
Received: by mail-lf0-x22a.google.com with SMTP id g184so63720940lfb.3 for <core@ietf.org>; Thu, 21 Apr 2016 09:12:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=xXDSrm3BPQdhuPjPunNB3WAcoIr7qEGDnT7DoCDxR40=; b=tLPL3BqHCbJ9UTEGJTg+UFQ9bX8I6q0hgp4gHRxDqccSQlUJ4u2ypTRFvq3sgFB4YU yHEzqSIw1MYdBjpdnWFZuNZqeRF4n01Iz/DLnUtlxJpd9LiVBj37LFrz3c8fjgNZJ20/ LKkqn0xmD49RB1vJCxjf1Ky7b5aVOfzWSMabwrlUAmD7vJrTIJUzyUyKEh7sjjYUtuxs nsijAKWDDEBQrbs16BOQDSwrvYXKsA/eljDxoxd0b+NZqUEu5IjTLb2FbeOJ3n/aPyXT i4HfHRaHvGN6g3Te7r7RHxRrU59sgRbzW03aMFO6I8yzXSydy9u+LIN49sIjgz8TsYpp k5qg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=xXDSrm3BPQdhuPjPunNB3WAcoIr7qEGDnT7DoCDxR40=; b=GwVugw5WeCFYx8bynWXWCO1pZiyxphI4LbuQpDKOcPsIfvKoCT1Ml3LS4oQbLSZx1a +NDt/1ZnH5N6R9+upJN6AMluZRpSatLcARDP1bwKovs00vWPenzYb8VXl9xbyFgoqVap j70KFhMxv+Wx+ZvU94rGIughlZbDPUFQi559mxiOrw3MBp7Iaum75YQlXoz14WvrRhAm SOQXQhfeZIi+sPByoKRLxaHd69GNMICbrPqrdKlN5Th6ynK1bFHFO2X+sqWMGZRjAKCc 1ja4xgP0cKCq00c7IU4Wozj7XZ/iQhdImfidcZ5dcBZ3rPjCsekw+5o0qezpefHzmm7W rJxA==
X-Gm-Message-State: AOPr4FVmD7vG6rP42SZpDHftny0tSAuv5ASNcwo4LjDn6PkerGFpHa73QD7dqvI4HpCgF9CnFBru2K0vqc4BVA==
MIME-Version: 1.0
X-Received: by 10.25.27.200 with SMTP id b191mr7104564lfb.8.1461255140748; Thu, 21 Apr 2016 09:12:20 -0700 (PDT)
Received: by 10.112.198.70 with HTTP; Thu, 21 Apr 2016 09:12:20 -0700 (PDT)
In-Reply-To: <5718A09E.7040607@gmx.net>
References: <570A4583.2030100@tzi.org> <5718A09E.7040607@gmx.net>
Date: Thu, 21 Apr 2016 09:12:20 -0700
Message-ID: <CABCOCHQmXPG2-9saF126ueFx4g9fE2_VPR+E2ZZc6+hRP36zJQ@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: Hannes Tschofenig <hannes.tschofenig@gmx.net>
Content-Type: multipart/alternative; boundary="001a11402c48974b2f053100f97a"
Archived-At: <http://mailarchive.ietf.org/arch/msg/core/A2lql_4me9_ZGnY0v2kZlC74Cyc>
Cc: "core@ietf.org WG" <core@ietf.org>
Subject: Re: [core] πŸ”” WG adoption of draft-veillette-core-yang-cbor-mapping-00
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.17
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, 21 Apr 2016 16:12:26 -0000

Hi,

I am obviously a proponent of using YANG, for the reasons outlined
in our IOTSI position paper:

https://www.iab.org/wp-content/IAB-uploads/2016/03/CoMI_IoT_Position_Paper_4.pdf

You are asking the right questions -- is it worth the effort to
use a formal data modeling language in IoT?  If the data models
are trivial, why bother?

IMO, here's why:

 - the model is a formal description of the server API. Client programmers
   need to code to your server API.  Mistakes like 1 side thinks it's meters
   and the other side thinks it's feet can be catastrophic.  Automated
   data validation can help avoid that.

- the model fully describes the API so there is no need to send any
meta-data
  with API content.  This saves a lot of bandwidth.  The client reads the
  module-set ID and the YANG module list (once) if the module-set ID is
unknown.

- the model can define defaults. The protocol can utilize this info to omit
lots
  of data on the wire without any loss of info.

 - unconstrained devices on constrained networks need real data models

 - the lack of IoT YANG modules is a reflection on the lack of a protocol
   suitable for constrained devices.  NETCONF is focused on SDN and there
   is no concern whatsoever for CPU, memory, or network usage.

 - YANG is functioning as an easy-to-use info modeling language, because
   there are multiple protocols and multiple message encoding formats
   supporting it.  YANG to CBOR will provide an efficient encoding format
   that could be used in many protocols, not just CoAP.


Andy

On Thu, Apr 21, 2016 at 2:42 AM, Hannes Tschofenig <
hannes.tschofenig@gmx.net> wrote:

> Hi Carsten, Hi all,
>
> I think we are going to fast here.
>
> We hardly make any progress with the existing WG items but then we add a
> number of new items that are barely understood.
>
> This call for adoption is not a call for this document this is a
> question whether we want to work on the following two types of things:
>
> a) a data modelling language (Yang) for use with IoT objects (which in
> case of IoT are largely defined elsewhere), and
>
> b) re-use a protocol machinery originally defined for network management
> around Netconf (which may now be converted to CoAP and CBOR usage).
>
> I have spent some time trying to figure out what the implications are
> and (that's a bold statement) doubt that most WG participants (except
> for the authors of the documents) really understand what this really means.
>
> Here are the claims:
>
> 1) IoT will re-use many of the objects defined for network management.
>
> 2) There is a need for a formal language to describe the data model.
>
> 3) There is a value in generating code using that formal data model
> description.
>
> 4) Yang (as a data modelling language) and the related protocols are a
> good match for the requirements people have.
>
> Are these claims actually true?
>
> Given that we are late at the party and other organizations have done a
> fair amount of work in that space already I am wondering whether we have
> done our home work of analysis the existing landscape or whether we are
> just interested to add another set of standards to the mix.
>
> I have my opinion about the claims and I would like to share them with you.
>
> Regarding (1) on the re-use argument. I do not believe that the
> existing, already standardized objects defined for network management
> are a good fit for what we are doing in IoT. I have not seen the
> examples where there is re-use. As illustrated below, I am exposing my
> sensors, buttons, and LEDs to outside world rather than network
> interfaces and alike. I fully understand that the world is far more
> complex with routers and switches that have many ports and lots of
> configuration parameters. They are also running regular operating
> systems, like Linux.
>
> Regarding (2) on the use of formal languages. It seems that most
> organizations are using formal languages for describing their object
> definitions already today. I personally believe that these formal
> languages do not provide a lot of value in general but using something
> that is easy for humans to write and read is something I may be OK with.
> Particularly the example below shows that all I need as a developer is
> very little. IoT devices typically do not have many sensors and the
> implementation complexity is elsewhere (with the operating system, the
> tool chain, and various low power settings).
>
> Regarding (3) on the value of code generation.
>
> I am currently in the process of writing a new tutorial for a developer
> workshop hosted by the Open Mobile Alliance (OMA), see
>
> http://openmobilealliance.org/free-hands-on-training-for-iot-developers-with-oma-lwm2m-and-arm-based-microprocessors/
>
> I am using regular IoT hardware, namely the K64F board with onboard
> sensors, namely an accelerometer and magnetometer, an RGB LED, and two
> buttons. The sensors are connected using I2C and are certainly not among
> the most simplistic (which the data sheet of almost 100 pages can easily
> tell you).
>
> In the process of writing code I need to do the following:
>
> * Figure out how to connect to the sensors using I2C.
>
> * Learn how the sensor works, how to configure the sensor to do what I
> want, and to convert the raw sensor data into something suitable for my
> application. One can only hope to find a library that does these things
> already and to only have to adjust the settings rather than writing
> everything from scratch. That typically takes a lot of time.
>
> * Determine whether is a suitable object definition already available.
> In my case I am looking at the OMNA registry (which has also been
> populated with the objects from the IPSO Alliance). Here are the
> registered objects:
>
> http://technical.openmobilealliance.org/Technical/technical-information/omna/lightweight-m2m-lwm2m-object-registry
>
> In case of the Accelerometer and the Magnetometer I am lucky since those
> have already been defined. I don't need to define my own objects, which
> is a simple task given the new OMA object editor
> http://devtoolkit.openmobilealliance.org/OEditor/Default
>
> * Then, I need to add the code for use with them. Here is where the
> formal description of the data model could help me to automatically
> produce code.
>
> Now, this is the funny thing: this code amounts for around 5 lines,
> depending on the API and programming language you are using. Most likely
> the code generation will produce some code that you cannot directly use.
>
> Here is what I have to write on the IoT side:
>
> ----
>
> // Create object '3313' = 'Accelerometer'
> acc_object = M2MInterfaceFactory::create_object("3313");
>
> M2MObjectInstance* acc_inst = acc_object->create_object_instance();
>
> M2MResource* acc_x_res = acc_inst->create_dynamic_resource("5702", "X
> Value",M2MResourceInstance::FLOAT, true /* observable */);
>
> M2MResource* acc_y_res = acc_inst->create_dynamic_resource("5703", "Y
> Value",M2MResourceInstance::FLOAT, true /* observable */);
>
> M2MResource* acc_z_res = acc_inst->create_dynamic_resource("5704", "Z
> Value",M2MResourceInstance::FLOAT, true /* observable */);
>
> -----
>
> I fear that we are optimizing for something that does not take a long
> time anyway. It will take longer to fetch the relevant Yang file, to use
> the tools to generate the code and to integrate it into the existing
> code than to just write these few lines yourself.
>
> What the above example does not utilize potential code generation for
> the actual interaction model. In my case my code is hard-wired to use
> LWM2M.
>
> Since I have not yet seen a meaningful example of Yang for the IoT
> environment I also haven't seen one that produces meaningful code for
> the interaction model either.
>
> Regarding (4) concerning Yang as a data modelling language (vs. other
> languages also considered by the IoT communities). As Paul noted there
> are other languages in town and I personally do not know whether the
> features offered by Yang are better or equal to those offered by the
> other languages. I certainly haven't done that analysis.
>
> As a concluding remark I would like to say that while my current
> assessment may sound negative I am happy to learn more about this topic
> and might get convinced that Yang is the right tool. Currently, I just
> haven't reached that level yet and I can claim that I have spent some
> time looking at this topic already.
>
> Ciao
> Hannes
>
>
> On 04/10/2016 02:22 PM, Carsten Bormann wrote:
> > In Buenos Aires, we discussed the adoption of
> > draft-veillette-core-yang-cbor-mapping-00 but not enough people had read
> > the document to go for an in-room consensus call.
> >
> > This is a two-week call for adoption of
> > draft-veillette-core-yang-cbor-mapping-00 as a WG document of CoRE.
> > Specifically, if you (1) support or (2) have an objection to this
> > decision, please speak up on the mailing list by 2016-04-24.
> >
> > Note that this work is explicitly covered by our charter, so discussions
> > of which WG should work on this are off-topic.
> >
> > As always, adoption of a document as a WG document is not a vote on
> > whether we already have reached last-call state; the intention is to
> > work on the WG document after adoption for a while to get it ready for
> > last call.  If you want to combine your support/objection with technical
> > comments, this is certainly welcome so we can accelerate that process.
> >
> > Grüße, Carsten
> >
> > _______________________________________________
> > 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
>
>