Subject: [netmod] Abusing YANG extensions

From: Andy Bierman <[email-masked]>
Date: Wed, 2 May 2018 09:19:45 -0700

Hi,

The discussion about yang-data is stuck because the NETMOD WG does not
understand or does not agree on what it means to abuse a YANG extension
and use it improperly.

If a tool implementing a standard cannot do so without implementing
certain extensions, then those extensions are not optional,
but rather they are mandatory, and therefore violating YANG 1.1.

The NACM extensions are OK because they can be safely ignored
unless the implementation supports NACM, These extensions
are only implemented by the server, so the client is not impacted.

The <config> element is a use-case where YANG fails completely.
According to YANG, the <config> element should only contain child nodes
if they are defined directly or defined with the augment-stmt.
YANG says absolutely nothing about nested data nodes that contain
top-level data nodes.

The "mount-point" extension in YANG Schema Mount also violates
YANG 1.1 in this way. A plain client that does not support schema-mount
will find container and list elements that contain undefined child nodes.
If the server chooses to support schema-mount, the client
is forced to support it, and this is a violation of YANG 1.1.

However, the yang-data extension cannot possibly interfere with standard
YANG 1.1 statements because it is used to specify data structures
that are outside the plain data nodes, instead of over-riding the
definitions of the plain data nodes.

Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Thu, 03 May 2018 14:57:51 +0200

> understand or does not agree on what it means to abuse a YANG extension

In my view, we should strictly separate the concerns of YANG and
extensions:

1. YANG should deal only with (abstract) schemas and rules for
   determining whether a given instance data tree is valid or not. All
   other considerations should be removed (moved elsewhere).

2. Extensions must not tinker with #1. In other words, if extensions are
   removed, the resulting schemas must be the same and validity rules as
   well.

> but rather they are mandatory, and therefore violating YANG 1.1.

Yes.

> are only implemented by the server, so the client is not impacted.

Yes, this satisfies #2 above.

> is forced to support it, and this is a violation of YANG 1.1.

This is a bit more complicated, the extension itself doesn't cause any
data to appear under the mount point - it is some state data that the
client may understand or not. That's why I think YANG library and schema
mount data have to be treated specially (as metadata describing
datastore organization).

> definitions of the plain data nodes.

YANG inside yang-data has somewhat different rules (described in the
description) and still the text of RFC 7950 has to be interpreted
liberally, e.g. because there is in general no server and hence no YANG
library.

YANG (according to #1 above) should be able to cover such uses out of
the box.

Lada

>
>
> Andy
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67