Re: [netmod] schematree-statement extension?

Robert Varga <nite@hq.sk> Mon, 15 October 2018 19:36 UTC

Return-Path: <nite@hq.sk>
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 4BB52130DDA for <netmod@ietfa.amsl.com>; Mon, 15 Oct 2018 12:36:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
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: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=hq.sk
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 L5JX6RH7qEHR for <netmod@ietfa.amsl.com>; Mon, 15 Oct 2018 12:36:11 -0700 (PDT)
Received: from mail.hq.sk (hq.sk [81.89.59.181]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 86608130ED2 for <netmod@ietf.org>; Mon, 15 Oct 2018 12:36:09 -0700 (PDT)
Received: from nitebug.localdomain (chello085216197060.chello.sk [85.216.197.60]) by mail.hq.sk (Postfix) with ESMTPSA id 1F5AC240246; Mon, 15 Oct 2018 21:36:07 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hq.sk; 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 <mbj@tail-f.com>
Cc: netmod@ietf.org
References: <4d793f08-4073-751e-105d-f83ce407611c@hq.sk> <20181015.210937.2105117531520960939.mbj@tail-f.com>
From: Robert Varga <nite@hq.sk>
Openpgp: preference=signencrypt
Message-ID: <6a6a6411-9d60-3918-fdf7-f38a1220adc7@hq.sk>
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: <20181015.210937.2105117531520960939.mbj@tail-f.com>
Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="a0mg9xpwXjVMEzShwSmugjD8S99cMwxDX"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/nekieMc9v0rwWhbFAFsdXa5ZtSY>
Subject: Re: [netmod] schematree-statement extension?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 15 Oct 2018 19:36:14 -0000

On 15/10/2018 21:09, Martin Bjorklund wrote:
> Hi,
> 
> Robert Varga <nite@hq.sk> 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 7.20.3.2), 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? :)

Thanks,
Robert