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

Sudhanshu Kumar Srivastav <> Fri, 15 September 2017 14:29 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id CE5A9133343 for <>; Fri, 15 Sep 2017 07:29:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -6.196
X-Spam-Status: No, score=-6.196 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id B_vh_uDmWwnR for <>; Fri, 15 Sep 2017 07:29:03 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8237C12421A for <>; Fri, 15 Sep 2017 07:29:03 -0700 (PDT)
Received: from (unknown []) by (KnoxPortal) with ESMTP id 20170915142900epoutp01029a9339c2a3d8cc61e38830512aed85~kj04U1lMs0861308613epoutp015 for <>; Fri, 15 Sep 2017 14:29:00 +0000 (GMT)
Received: from (unknown []) by (KnoxPortal) with ESMTP id 20170915142900epcas5p457e07281b289c633c28ccba2cce51808~kj03wtNsV1992119921epcas5p4z; Fri, 15 Sep 2017 14:29:00 +0000 (GMT)
X-AuditID: b6c32a4a-f79896d000000f29-8c-59bbe3ac4494
Received: from ( []) by (Symantec Messaging Gateway) with SMTP id E7.3F.03881.CA3EBB95; Fri, 15 Sep 2017 23:29:00 +0900 (KST)
Mime-Version: 1.0
Sender: Sudhanshu Kumar Srivastav <>
From: Sudhanshu Kumar Srivastav <>
To: Robert Wilton <>, "" <>
CC: KARTHIKEYAN SUBRAMANIAM <>, "cpgs ." <>, Surendra Pal Sharma <>
X-Priority: 3
X-Content-Kind-Code: NORMAL
In-Reply-To: <>
X-Drm-Type: N,general
X-EPLocale: en_US.EUC-KR
X-EPWebmail-Msg-Type: personal
X-Msg-Generator: Mail
X-Reply-Demand: N
X-Sender: Samsung ElectronicsSRI-Bangalore-CUChief Engineer
X-Local-Sender: Sudhanshu Kumar SrivastavSRI-Bangalore-CU삼성전자Chief Engineer
X-Global-Sender: Sudhanshu Kumar SrivastavSRI-Bangalore-CUSamsung ElectronicsChief Engineer
X-Sender-Code: C10C10ID01ID010915
Message-ID: <20170915142859epcms5p526b9d21b55ddd8f0eb13edfec62efcff@epcms5p5>
Date: Fri, 15 Sep 2017 14:28:59 +0000
X-CMS-MailID: 20170915142859epcms5p526b9d21b55ddd8f0eb13edfec62efcff
Content-Type: multipart/related; boundary="=_NamoWEC-i81mnnsa33"
X-MTR: 20170915142859epcms5p526b9d21b55ddd8f0eb13edfec62efcff
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrBKsWRmVeSWpSXmKPExsWy7bCmhu6ax7sjDT7+EbZ4eUjTYsGkH8wW 8y82slqcONfHbPHz/w52B1aPKb83snosWfKTyaNvyyrGAOYoLpuU1JzMstQifbsEroz/326w FDy9wFzx9uExtgbGG0eYuxg5OSQETCSaz65ngbDFJC7cW8/WxcjFISSwm1Hixbnt7F2MHBy8 AoISf3cIg9QIC9hI3OyfDFYvJKAk0biilwUmfuj7MVYQm03ASuJJ/3kwW0TAS2L1mTssIDOZ BVoYJbZ9usoGsYxXYkb7U6jF0hLbl29lBNnFKWArsfFvMkRYVOLm6rfsELaExOqFz6Fa5SSm fV3DDFPz/th8RghbRKL13lmouKDEg5+7oeK5Eh3725lhVv39d4QR5B4JgW5GiVdXbkE5Uxgl 9p98ArXBXOJyfy9YN6+Ar8T66U/AulkEVCX6p02Hmuoi8f70XSYQm1nAQeLG573sMI81bPwN DjgJoGdePBCCKOGT6P39hAmiRE3i7J0HbBMYVWYhgncWkkEQtqLElO6HULaGROucuVC2jcTs 68dYMNWoSvw6sIR1ASP7KkbJ1ILi3PTUYtMCo7zUcr3ixNzi0rx0veT83E2M4DSl5bWDcdk5 n0OMAhyMSjy8Ghd3RwqxJpYVV+YeYlQBmvVow+oLjFIsefl5qUoivLvvA6V5UxIrq1KL8uOL SnNSiw8xSnOwKInzHttZGikkkJ5YkpqdmlqQWgSTZeLglGpgXBStpyXt0qbxsHz7ycfL8m7t Dzyt+7N7mcxng9cTnrzIqDkuUuvKvmjLUialTWKJKpH1aaK7S+9JXmSPXrvommf/2frZ63l+ N+2+88R26poTt6r0vqT3ROV+cVx5Z57GjEfLfC5NZDSONnjyY6bNmp0s19qOqTZVMPXsDpI9 9Et3u6Bv1sX77UosxRmJhlrMRcWJALnjSoZbAwAA
X-CMS-RootMailID: 20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106
X-RootMTR: 20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106
References: <> <20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106@epcms5p3> <CGME20170913073034epcms5p3ba5e2a0c180d8cd9f4464d8e5921d106@epcms5p5>
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: Fri, 15 Sep 2017 14:29:07 -0000

Dear  Robert,


   Thanks a lot for your feedback. It gave me other key areas to be considered which can be impacted due to the suggested idea.


   With respect to first feedback, I think there is slight difference in suggested idea and that is "Model the formula as schema, not as Data".  So it's getting statically included at server and not programmed dynamically.

   As I think "Modeling formula" as Data may have security implications. 


   I am going through the feedbacks provided in details, I will check and come back to this.





--------- Original Message ---------

Sender : Robert Wilton <>

Date : 2017-09-13 15:11 (GMT+5:30)

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

To : Sudhanshu Kumar Srivastav<>, null<>



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 superset.

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 technologies.

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:  " rel="nofollow">
Status:" rel="nofollow">
Htmlized:" rel="nofollow">
Htmlized:" rel="nofollow">



Sudhanshu" width="0" height="0">

netmod mailing list" rel="nofollow">" border="0" width="0" height="0">