Re: [netmod] draft-srivastav-netmod-formulae-00

Robert Wilton <> Wed, 13 September 2017 09:41 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 9C47C13301E for <>; Wed, 13 Sep 2017 02:41:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -14.499
X-Spam-Status: No, score=-14.499 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] 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 Gwg99vMfoPRz for <>; Wed, 13 Sep 2017 02:41:35 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id EA6661321A7 for <>; Wed, 13 Sep 2017 02:41:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;;; l=60135; q=dns/txt; s=iport; t=1505295695; x=1506505295; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to; bh=K/ywVsKLk6/1wq2LCNcniSo/Kkgf0MKqRTSW9U7+vE4=; b=EhNUOSFYdtzPEl9RPFRGWgZZuRtDKBYGM7yFXJT7kgcK3TOOnsTBN6Nh 6Q1vJCB9L+9l1MPgKTX+buGTixsk8jbIsTyqeaNhlbR5uJgH44bC8aw3c z7/2hABoe3e2XYZuH2QEJQtCcAKnAT1iHkJHoK6awo5v5achguFUWKG98 o=;
X-Files: 201602111742151_N3WZA6X7.png : 33527
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-AV: E=Sophos;i="5.42,387,1500940800"; d="png'150?scan'150,208,217,150";a="657429577"
Received: from (HELO ([]) by with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 09:41:32 +0000
Received: from [] ( []) by (8.14.5/8.14.5) with ESMTP id v8D9fWgd012950; Wed, 13 Sep 2017 09:41:32 GMT
To:, "" <>
References: <CGME20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106@epcms5p3> <20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106@epcms5p3>
From: Robert Wilton <>
Message-ID: <>
Date: Wed, 13 Sep 2017 10:41:32 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106@epcms5p3>
Content-Type: multipart/alternative; boundary="------------10939D576D7DD9B32C2DC8F2"
Content-Language: en-US
Archived-At: <>
Subject: Re: [netmod] draft-srivastav-netmod-formulae-00
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 13 Sep 2017 09:41:38 -0000

Hi Sudhanshu,

Thanks for posting this.

The premise of what you are trying to achieve here is interesting.  My 
interpretation is that your idea is to allow a NETCONF/RESTCONF 
server/device to take existing data in the operational state data tree 
and to construct new derived data (or perhaps just metadata) by 
executing a client defined algorithm that is described via extensions 
statements to YANG.

This broadly seems a reasonable idea to me, but I'm not sure that I 
would implement it in quite the same way, and I've put forward some 
other points or issues that you may want to consider.

1) In particular, rather than modeling the expression directly in YANG 
using YANG extensions, which effectively makes the expression look like 
quite a verbose abstract syntax tree, I think that you may be better off 
defining a separate expression language, similar to how Xpath is used 
today.  Probably it could be related to Xpath, perhaps it could be a 

E.g .to take your example in 3.10, I think that it would be better if 
the expression was written more like a normal mathematical expression.  
E.g. I think that the following would be easier to read/understand.  
Obviously an implementation needs to parse the expression, but that 
shouldn't be too difficult, and they would need to write code to 
interpret the expression anyway.

    container formula {
       leaf a {
          type int32;
       ... leaves b to d defined similarly ...
       leaf e {
          type int32;
       mt:math x {
         leaf x {
           type int32;
           mt:expression"((a+b) - (c-d)/(e*100))";

2) I think that there are some questions about how these expressions 
would get programmed into the device.  Are they statically included as 
part of the schema loaded by the NETCONF/RESTCONF server?  Or are they 
programmed dynamically via the NETCONF/RESTCONF client.  For the latter 
case it would be necessary to either define new RPC operations, or 
perhaps better a configuration and operational YANG data model to manage 
the expressions.

3) I think that it would also need to be considered whether the 
constructed expression values are represented as new nodes in the YANG 
schema (which would probably prevent them from be constructed 
dynamically), or perhaps they should make use of YANG metadata (RFC 
7952) instead so that the base underlying schema isn't changed.

4) Any solution should probably also consider how it would inter-operate 
with the work currently being doing in NETCONF on YANG push and related 

5) They may be security implications of allowing a client to execute 
arbitrarily complex expressions would may degrade the performance of the 
system, although perhaps the memory and cpu available to execute the 
expressions could be limited.

I hope the brief feedback is useful.  I'm not sure how familiar you are 
with the IETF process, but please note that these comments just 
represent my personal opinion and do not necessarily reflect those of 
the wider participants in the NETMOD WG. Other opinions may, and in my 
experience probably will, differ :-)


On 13/09/2017 08:30, Sudhanshu Kumar Srivastav wrote:
> Dear NETMOD Team,
>   I have submitted a draft for new YANG module that defines new YANG 
> extension statements and method to model the formulae/KPI's.
>   Request you to please check and provide your comments.
> *Draft Details:*
> Name: draft-srivastav-netmod-formulae
> Revision: 00
> Title: YANG extension Statements for formulae modeling
> Document date: 2017-09-12
> Group: Individual Submission
> Pages: 28
> URL: 
> Status:
> Htmlized:
> Htmlized: 
> Regards
> Sudhanshu
> _______________________________________________
> netmod mailing list