Re: [netmod] yang-data-ext issues

Ladislav Lhotka <lhotka@nic.cz> Wed, 25 April 2018 12:38 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 03332120454 for <netmod@ietfa.amsl.com>; Wed, 25 Apr 2018 05:38:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 vJh-yYzKf_ZX for <netmod@ietfa.amsl.com>; Wed, 25 Apr 2018 05:38:51 -0700 (PDT)
Received: from trail.lhotka.name (trail.lhotka.name [77.48.224.143]) by ietfa.amsl.com (Postfix) with ESMTP id 82E77129C6E for <netmod@ietf.org>; Wed, 25 Apr 2018 05:38:42 -0700 (PDT)
Received: by trail.lhotka.name (Postfix, from userid 109) id 4625F1820158; Wed, 25 Apr 2018 14:44:17 +0200 (CEST)
Received: from localhost (unknown [195.113.220.121]) by trail.lhotka.name (Postfix) with ESMTPSA id C0BB21820055; Wed, 25 Apr 2018 14:44:14 +0200 (CEST)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: nite@hq.sk, netmod@ietf.org
In-Reply-To: <20180424.164323.134787755202916169.mbj@tail-f.com>
References: <20180423165104.zi7g75tifhekmezh@elstar.local> <ecb9cc29-67c5-df8f-8a37-140733e0c1e7@hq.sk> <87zi1sr896.fsf@nic.cz> <20180424.164323.134787755202916169.mbj@tail-f.com>
Mail-Followup-To: Martin Bjorklund <mbj@tail-f.com>, nite@hq.sk, netmod@ietf.org
Date: Wed, 25 Apr 2018 14:38:41 +0200
Message-ID: <871sf3v4tq.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/xtIubZVbKWDTyme0x6zLTKPaHNM>
Subject: Re: [netmod] yang-data-ext issues
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Apr 2018 12:38:54 -0000

Martin Bjorklund <mbj@tail-f.com> writes:

> Ladislav Lhotka <lhotka@nic.cz> wrote:
>> Robert Varga <nite@hq.sk> writes:
>> 
>> > On 23/04/18 18:51, Juergen Schoenwaelder wrote:
>> >> Some people will say that the cost of a new language version is high.
>> >> (Well, when we did 1.1, some people said it will never be deployed.)
>> >> Anyway, not bumping the YANG version number but having instead several
>> >> (optional) language extensions is just hiding the version number
>> >> change under the carpet.
>> >
>> > Not quite, as extensions allow for modular/incremental evolution, as an
>> > implementer I do not have to go through a long development cycle where I
>> > need to rewire language aspects just to get the features my users need
>> > for their models...
>> 
>> But what prevents you from forking YANG, indicating it in the
>> "yang-version" string and implementing your new statements as built-ins?
>> 
>> It is tempting to think about extensions as a magic for adding modular
>> extensions but it breaks down as soon as such extensions interfere with
>> the YANG core (with and each other, or both).
>
> Sure, nothing new here.  This is how the extension mechanism is
> designed.  Do you feel that there are so many standard extensions that

My objections are also not new. Implementations are permitted to ignore
extensions, but if an extension affects the resulting schema, then
implementation A that supports the extension may end up working with
another schema than implementation B that doesn't support the
extension. This situation has to be avoided.

> interfere with each other that we actually have a problem?  I strongly

Perhaps not yet, but we do have extensions (or proposals thereof) that
interfere with core YANG. And my impression is that OpenConfig is going
to use extensions for creating their own YANG silo.

> agree that we need to be careful with standard extensions, and I
> strongly encourage vendors to not define extensions that interfere
> with YANG core (been there, done that, bad idea).
>
> In the case of yang-data, the fact is that it *is* used in standard
> models (in ways not originally anticipated), and vendors have similar
> proprietary extensions (we have a tailf:structure, and I think others
> have reported similar things).

I don't know how much effort those vendors invested into the
specification of such extensions, but the text of the current draft and
module descriptions leave quite a few questions unanswered. Here are
just a few that come to my mind:

- What is the accessible tree for XPath evaluations and leafrefs? In
  particular, error messages might want to refer to state data. Is it
  possible?

- This sentence makes no sense: "The XPath document root is the
  extension statement itself, ..." A YANG statement cannot be an XPath
  node.

- What is the meaning of leaf and leaf-list default values? In RFC 7950
  it is defined in terms of server behaviour but there is no server for
  yang-data.

- What does it mean if an action is defined inside yang-data?

- If a module is imported without revision and its groupings/typedefs
  are used inside yang-data, how is the exact revision of the imported
  module determined?

I suspect that users of such extensions accept the fact that some amount
of hand-waving is necessary. But then, why all this hassle? Why cannot
normal YANG be used for specifying a schema that is not intended for an
NM protocol? It requires just a little bit more hand-waving. The draft
doesn't explain why the extension is needed.

Also, I am quite sure that YANG experts can use it carefully so that it
makes sense. But as a Standard Track document it becomes an official
part of YANG that seems to give unsuspecting users enough rope for
hanging themselves.

Lada

>
>
>
> /martin

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