Re: [netmod] schematree-statement extension?

Robert Varga <> Mon, 15 October 2018 19:36 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 4BB52130DDA for <>; Mon, 15 Oct 2018 12:36:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id L5JX6RH7qEHR for <>; Mon, 15 Oct 2018 12:36:11 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 86608130ED2 for <>; Mon, 15 Oct 2018 12:36:09 -0700 (PDT)
Received: from nitebug.localdomain ( []) by (Postfix) with ESMTPSA id 1F5AC240246; Mon, 15 Oct 2018 21:36:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=mail; t=1539632167; bh=hjcwdiHM42/PhYgQIUAdso+ZkcvW1YzhMVBtifu+a4o=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=PnwzG0KmuYKXSii/JVrlnWVinTDXBstRxA/S0uFjB/s9lvtBT8Tv5zEMNyFjRjBca IMQUxxaxzq9+Wxea1Tui4ZuS35lJU9q990kCIY5Jo0Iw6PV6bJ/2vodnK9C0ZB4j9S YOYEoO+q2s5mrffKIQB2I59eiY/hRfVARNnXf7ew=
To: Martin Bjorklund <>
References: <> <>
From: Robert Varga <>
Openpgp: preference=signencrypt
Message-ID: <>
Date: Mon, 15 Oct 2018 21:36:06 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="a0mg9xpwXjVMEzShwSmugjD8S99cMwxDX"
Archived-At: <>
Subject: Re: [netmod] schematree-statement extension?
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 15 Oct 2018 19:36:14 -0000

On 15/10/2018 21:09, Martin Bjorklund wrote:
> Hi,
> Robert Varga <> wrote:
>> It is wide-spread practice to use tailf:action and target statements
>> within it with augment/deviate statements -- which I think is a failure
>> to follow RFC7950 section 6.3.1:
>>    Care must be taken when defining extensions so that modules that use
>>    the extensions are meaningful also for applications that do not
>>    support the extensions.
> Yes, but note that 7950 means a 1.1 module, and tailf:action should be
> replaced with 'action' in a 1.1 module.

I think the argument applies (and proposed extension would be
applicable) to RFC6020 as well.

I am not complaining about tailf:action specifically, I will just map it
YANG 1.1 action even in YANG 1.0 mode and I'm done :)

> One reason we added the quoted paragraph to 7950 was because of the
> problem you describe with tailf:action.

I suspected as much, thank you for that :)

>> I think the proper way of fixing this would be to define a YANG
>> extension, which, when used within another extension, would indicate
>> that the extension being defined is part of the schema tree, for example:
>>    extension schematree-statement;
>>    extension foo {
>>        argument bar;
>>        sts:schematree-statement;
>>    }
> Unfortunately, this doesn't solve the problem, since a parser that
> doesn't understand sts:schematree-statement still wouldn't know that
> foo defined a schema node, and thus it will still complain if it sees
> an augment of a node introduced with "ex:foo".
> In order for this to work, "schematree-statement" would have to be a
> builtin statement.
> (... and if we had this statement, we could have used it in yang-ext
> as well, and avoid augement-yang-data)

Understood and agreed, parsers not supporting schematree-statement would
be left unfixed, but also no worse off.

My skin in the game is to future-proof my parser (based on supporting
widely-available specifications) until this is fixed for everyone with
YANG 1.2. Adding support for a language extension is much simpler than
to bump YANG language support by 0.1, at least in my experience.

This could even help augment-yang-data in that the semantics of what it
does would be kept with the extension (yang-data) as opposed to a
different, related (as understandable by humans), language extension. An
an implementor,

Such extension would also address a piece of RFC7950 section 7.19's:

   An extension can allow refinement (see Section 7.13.2) and deviations
   (Section, but the mechanism for how this is defined is
   outside the scope of this specification.

by defining how an extension can declare that it _does_allow_ refinement
and deviations without getting into the business of how that
refinement/deviations are done. This could even be separate extensions:

   extension augmentable-statement;
   extension deviable-statement;

Such a language extension can be picked up by parsers across all YANG
versions, making adoption much easier and faster.

>> Using that knowledge, the parser can correctly interpret
>> augment/deviation arguments as validly pointing to a particular use of
>> foo (or its descendants) and correctly ignore their effects.
>> Is this something the WG feels is a real problem and would be interested
>> in solving?
> The current advice is of course to NEVER add nodes to the schema tree
> with an extension.  I think it is probably best to stick to this
> advice...

That advice I missed. Is there a link I can quote? :)