Re: [netmod] [Netconf] What should a server response be? - depending on NP-containers

Alex Campbell <Alex.Campbell@Aviatnet.com> Mon, 22 August 2016 22:08 UTC

Return-Path: <Alex.Campbell@Aviatnet.com>
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 8F02A12D144 for <netmod@ietfa.amsl.com>; Mon, 22 Aug 2016 15:08:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.449
X-Spam-Level:
X-Spam-Status: No, score=-2.449 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.548, SPF_PASS=-0.001] 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 Y6mex1PYhyBD for <netmod@ietfa.amsl.com>; Mon, 22 Aug 2016 15:08:21 -0700 (PDT)
Received: from mail-send.aviatnet.com (mail-send.aviatnet.com [192.147.115.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2787A12D1A5 for <netmod@ietf.org>; Mon, 22 Aug 2016 15:08:21 -0700 (PDT)
From: Alex Campbell <Alex.Campbell@Aviatnet.com>
To: Vladimir Vassilev <vladimir@transpacket.com>
Thread-Topic: [netmod] [Netconf] What should a server response be? - depending on NP-containers
Thread-Index: AQHR+ocq89Xw8H9xFUu/056uGxZN96BR+jEAgACT5QCAAsqiAIAAELgAgAALVICAACfjgIAADOKAgAAOBwCAAA5XgIAAFKQA//+y81Q=
Date: Mon, 22 Aug 2016 22:08:19 +0000
Message-ID: <1471903699434.77842@Aviatnet.com>
References: <57BB2169.9050100@transpacket.com> <20160822.184543.235535345519950294.mbj@tail-f.com> <57BB37FC.5000202@transpacket.com> <20160822.202715.1748199491210115278.mbj@tail-f.com>, <57BB5554.2000400@transpacket.com>
In-Reply-To: <57BB5554.2000400@transpacket.com>
Accept-Language: en-NZ, en-US
Content-Language: en-NZ
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.15.6.10]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/FT21et0nmwgrKULLRuQQ1Lg99Zk>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] [Netconf] What should a server response be? - depending on NP-containers
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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, 22 Aug 2016 22:08:22 -0000

The intention in this case is obviously to evaluate the 'must' statement if
the container contains any values; what would break if we said that

   A non-presence container exists in the data tree if and only if it has
   any children which exist in the data tree.

thus disallowing the existence of empty NP-containers in the data tree?

________________________________________
From: netmod <netmod-bounces@ietf.org> on behalf of Vladimir Vassilev <vladimir@transpacket.com>
Sent: Tuesday, 23 August 2016 7:41 a.m.
To: Martin Bjorklund; netmod@ietf.org
Subject: Re: [netmod] [Netconf] What should a server response be? - depending on NP-containers

On 08/22/2016 08:27 PM, Martin Bjorklund wrote:
> Vladimir Vassilev <vladimir@transpacket.com> wrote:
>> On 08/22/2016 06:45 PM, Martin Bjorklund wrote:
>>> I disagree.  If the model needs to have some semantic validation
>>> rules, the designer is going to put them in a place such that they are
>>> evaluated when the need to be evaluated.
>> So designers augmenting /interfaces/interface with non-presence
>> container with child leaves should just pick one of the leaves in YANG
>> 1.1 and put the must statements there instead of the parent
>> container.
> Sorry I can't parse this.  What is "leaves in YANG 1.1"?
Well for example the designer wants to add container with multiple leaf
children (leaves) to /interfaces/interface. Assume there is only 1 of
the 96 interfaces on a switch that can have inet address for the purpose
of managing the device:

augment "/if:interfaces/if:interface" {
     container inet {
         must "../name = 'me0'" {
             description
                  "The inet container is only valid for the management
('me0') interface.";
         }
         leaf address {
             type inet:ip-prefix;
         }
     }
}

So in this example the must expression will be evaluated not only for
interfaces the user attempts to create
/interfaces/interface/inet/address but for all those he does not attempt
to create it. This is not the case in YANG 1.0 and this is example how
processing of validation expressions increases in YANG 1.1

In this case the designer can copy the must expression to the address
leaf and it will be evaluated only when the user attempts to create that
leaf ... however when it is not a single leaf in the container the
workaround can get trickier.

>
> My point is that must expressions don't just exist w/o any reason for
> the sake of theoretical arguments.  If there is a YANG 1.1 model with
> a must expression in an NP-container, then there is probably a reason
> for it - the designer wants it to be evaluated if its parent exist.
Well this would be the case in YANG 1.1. In YANG 1.0 the designer wants
it to be evaluated if the non-presence container itself exists not its
parent. Now this changes because of the "clarification" from Y41.
> If we change the rules for when must expressions are evaluated, the
> module designer will have to figure out some other way to add these
> must expressions, and the performance will be the same.  So your
> argument that many must expressions can lead to performance issues is
> not really a problem in itself.
We are changing the rules from YANG 1.0. Auto evaluation of all
non-presence containers must statements is now mandatory when their
parent container exists. I still don't see how there is no problem with
the increased must statement processing and believe there is
misunderstanding somewhere.

Vladimir
>
>
> /martin
>
>> Yes this might work. There is no problem adding extra "../"
>> in the Xpath expressions. But what is the justification of all that
>> except the "If a container does not have a "presence" statement and
>> the last child node is deleted, the NETCONF server MAY delete the
>> container." text?
>>

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod