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

Vladimir Vassilev <vladimir@transpacket.com> Mon, 22 August 2016 19:41 UTC

Return-Path: <vladimir@transpacket.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 11F2512D7D1 for <netmod@ietfa.amsl.com>; Mon, 22 Aug 2016 12:41:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, 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 ePn9roSc8WMK for <netmod@ietfa.amsl.com>; Mon, 22 Aug 2016 12:41:13 -0700 (PDT)
Received: from mail.transpacket.com (s91205186171.blix.com [91.205.186.171]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 201FB12D1E0 for <netmod@ietf.org>; Mon, 22 Aug 2016 12:41:13 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id 01DE7926472; Mon, 22 Aug 2016 21:41:11 +0200 (CEST)
Received: from mail.transpacket.com ([127.0.0.1]) by localhost (mail.transpacket.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id DQ4yESh65d14; Mon, 22 Aug 2016 21:41:10 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1]) by mail.transpacket.com (Postfix) with ESMTP id CDCEC926487; Mon, 22 Aug 2016 21:41:10 +0200 (CEST)
Received: from mail.transpacket.com ([127.0.0.1]) by localhost (mail.transpacket.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lAYB0wDUScTM; Mon, 22 Aug 2016 21:41:10 +0200 (CEST)
Received: from [192.168.209.141] (s1853520235.blix.com [185.35.202.35]) by mail.transpacket.com (Postfix) with ESMTPSA id A6224926472; Mon, 22 Aug 2016 21:41:10 +0200 (CEST)
Message-ID: <57BB5554.2000400@transpacket.com>
Date: Mon, 22 Aug 2016 21:41:08 +0200
From: Vladimir Vassilev <vladimir@transpacket.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0
MIME-Version: 1.0
To: Martin Bjorklund <mbj@tail-f.com>, netmod@ietf.org
References: <57BB2169.9050100@transpacket.com> <20160822.184543.235535345519950294.mbj@tail-f.com> <57BB37FC.5000202@transpacket.com> <20160822.202715.1748199491210115278.mbj@tail-f.com>
In-Reply-To: <20160822.202715.1748199491210115278.mbj@tail-f.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/NiHqjCVqHpo9jCx8FYBPlO6MhNw>
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 19:41:15 -0000

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?
>>