Subject: [lp-wan] new version of YANG SCHC Data Model draft

From: Laurent Toutain <[email-masked]>
Date: Thu, 9 Jan 2020 09:13:54 +0100

Hi,

You will find in https://github.com/lp-wan/datamodel the document we
discussed yesterday during the interim meeting.

Currently, there are 2 yang files:

[email-masked] and [email-masked] to split between the
definition of identifier and the data model, but when the model will be
stable these two files will merge.

The open question we had yesterday are:
- CoAP identifier space. Carsten suggested allocating by default al the
option values as YANG identifiers, but this may lead to a very large number
of identifier regarding what is currently used in CoAP.
- The structure of the TV. In the current model we have:

 grouping target-values-struct {
      leaf numerical {
            type uint64;
      }
      leaf string {
            type string;
      }
      leaf position {
            type uint8;
      }
  }

The reason to have both numerical and string is related to the YANG types.
In YANG, for instance, an IPv6 address is defined as a string with some
regex to structure it. This leads to an ASCII representation that is
transparent in NETCONF or RESTCONF. With CORECONF, using ASCII will lead to
something sub-optimal.

So numerical is limited to 64 bits and string is not limited, for SCHC we
have this way the possibility to use a compact representation up to 64 bits
or a string.

If we look at fields in headers, we largest one is 128 bit long, so uint64
is too small.

We can add another numerical to reach the 128 limit:

grouping target-values-struct {
      leaf numerical_high {
            type uint64;
      }
      leaf numerical_low {
            type uint64;
      }
      leaf string {
            type string;
      }
      leaf position {
            type uint8;
      }
  }

or we can be more generic by using a list of numerical which i may be too
complex.

Another solution is to stay in the YANG standards and say that the TV is a
string and then
we have a serialization method that converts into binary or ASCII regarding
the field type.

Laurent