Re: [netmod] OpsState Direction Impact on Recommended IETF YANG Model Structure

Kent Watsen <kwatsen@juniper.net> Tue, 02 August 2016 01:10 UTC

Return-Path: <kwatsen@juniper.net>
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 BF1A312D0BC; Mon, 1 Aug 2016 18:10:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=junipernetworks.onmicrosoft.com
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 1TDRXX2dsCMJ; Mon, 1 Aug 2016 18:10:07 -0700 (PDT)
Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02hn0222.outbound.protection.outlook.com [104.47.37.222]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6D94112B012; Mon, 1 Aug 2016 18:10:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Q4INrs59tyt/USPcQnySORKWQwRWSf7S7SQ5k4SLo+8=; b=WaSJtUyvr5KFA3zjIaSq1/zHocz/eOZ3vPPY5iDIV85oydQDmeHP3OG4blZT03REHijttv9VJVCtW1zO4RtH5F2HL6LkwfDlhIH8bNJO/HdAXVGHAUzckjexZMa6WikRWbjzQ934GOmnkcU8XVJjdBAHS/0q+wB62Q6ar8LhKD0=
Received: from CY1PR0501MB1450.namprd05.prod.outlook.com (10.160.149.11) by CY1PR0501MB1451.namprd05.prod.outlook.com (10.160.149.12) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.8; Tue, 2 Aug 2016 01:10:04 +0000
Received: from CY1PR0501MB1450.namprd05.prod.outlook.com ([10.160.149.11]) by CY1PR0501MB1450.namprd05.prod.outlook.com ([10.160.149.11]) with mapi id 15.01.0557.009; Tue, 2 Aug 2016 01:10:05 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: Lou Berger <lberger@labn.net>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] OpsState Direction Impact on Recommended IETF YANG Model Structure
Thread-Index: AQHR426Bbp8QhQYR/0+rHOW0oBTwuqAjJxmAgADv8QCABT5TAIABj1SAgAAMLoCAAZpIAIABXKyAgAABWwCAAAZtAIAABi8AgAGKvYCAAAaEAIAAD6aAgAAKXwCABQo5gA==
Date: Tue, 02 Aug 2016 01:10:05 +0000
Message-ID: <125693B9-D275-495E-90BE-514803A75C0D@juniper.net>
References: <D3A935F0.6A4DC%acee@cisco.com> <eb15fd23-2c0a-50c4-1ebc-7c0e4867dfd8@cisco.com> <20160721174033.GB54646@elstar.local> <d18f5dd0-64d0-e223-88a9-faa4df4b7866@cisco.com> <DCB3EBBF-5EB1-4C8E-AA55-F59C4B5A8E4D@juniper.net> <bed9398c-0e6a-450e-d2ac-b381b6bebf87@cisco.com> <5296754B-8178-4B1B-B4A6-FE228ABB8E7F@juniper.net> <9367f4b1-7814-e175-32e8-d518438b841d@cisco.com> <m24m79c1ja.fsf@birdie.labs.nic.cz> <D3BF8708.72620%acee@cisco.com> <552008CB-F216-4578-A709-AE0613C2EFB9@nic.cz> <12ed1a4d-44c5-9a51-b6d4-95e1620a24ee@cisco.com> <m260roedim.fsf@birdie.labs.nic.cz> <CABCOCHRF98sTa=MA1VTkZovOufL-=yQr9Gzy+ojnncjSfK1y0Q@mail.gmail.com> <e307c2fc-e621-b5c6-4fcc-67bbcdcb87b9@cisco.com> <ea85a188-6228-f3a4-17f8-28c784c7b9b8@labn.net>
In-Reply-To: <ea85a188-6228-f3a4-17f8-28c784c7b9b8@labn.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.18.0.160709
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kwatsen@juniper.net;
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: [66.129.241.12]
x-ms-office365-filtering-correlation-id: ecc60f6c-0151-453e-b5ea-08d3ba71bcda
x-microsoft-exchange-diagnostics: 1; CY1PR0501MB1451; 6:4gGGXyJnOhKJesZEKnvKFS9PY+Jhmhxo+OEJbP+F/oXkEDt+uTw0+3MKxriDKqGlr3M6yyOyI4D572E630ZLjjKuxbOSupzODLZvDGNaE+YujRL81KMZbJYrcM5kT8BdlZOjioZGQ3ociJc9oFncuEFU+7Qi8BLv87MKSkL2c+VjwKa5Roh16cm1Z6Sk+AqDm/hyRsefzQZm3UsJeEEgrlOztAbExiJH4bN/TRM22cqA4R9fn9qLbYgakTyXtEZYlr+wTJg5KxHtEUnsazVPIElQxEsmxEAobpgFkfOUxSPrJSPWkZfVEM1G/SBbcUX0XEjuDWaGfDBpKpzYcv0WKw==; 5:V6rB7EG/T/CiUvc9DrRNpALgivZTK4InvgF2YegvRP/f8KryCFaO3a0Wk9W049tTE6V7sIekwZDuTiCp0003kd8YnqZD5HrD7gIYUqTyPMNAqOFxQK3n+aPM7FHIfmE1F30uDVXFczZ2fJlKOipJSESBLNiYP5PF5/guNntWyqg=; 24:UEba8DeRMFyUM/OcVHjypfvLZ3qGEv/ho2Mq/fIJMmUznN0JeRisP7aBFv7uwTmcucSK7aCPQ1IngIZgpPBYXA==; 7:bqitlWoSKpeHBUg+T4smVyBSD5UTRq8Ma4vNi5sq8prRug/kDtYJNNSn1lzrWYMgOTRDY5ZQ4UNOLzndcHvcwtMcxx8qjuowHPDSmtXBJCcwaif+j8ibTaCkSgn4rQ3TLPr6ayjZzOmGndnfbdy1m3qHjtxKOnmfFsGBGL1cGXJqt8NfdZdoUvNq6+inMEkoJrRnIs5sbtKuGFaI0N3ECXWJFeoegGwOMc/uPawzVPipB5jOq5jIR2TWliGT6APl
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1451;
x-fingerprintheader: 1
x-microsoft-antispam-prvs: <CY1PR0501MB1451BD721076EF01988379BBA5050@CY1PR0501MB1451.namprd05.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(20558992708506)(278428928389397)(35073007944872);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:CY1PR0501MB1451; BCL:0; PCL:0; RULEID:(304825044); SRVR:CY1PR0501MB1451;
x-forefront-prvs: 0022134A87
x-forefront-antispam-report: SFV:SPM; SFS:(10019020)(6009001)(7916002)(199003)(189002)(92566002)(4001350100001)(189998001)(105586002)(87936001)(5001770100001)(97736004)(99286002)(93886004)(122556002)(305945005)(10400500002)(106356001)(36756003)(586003)(106116001)(2501003)(50986999)(86362001)(76176999)(3846002)(6116002)(102836003)(54356999)(101416001)(2906002)(83716003)(83506001)(81156014)(3660700001)(68736007)(8936002)(66066001)(81166006)(5002640100001)(7736002)(82746002)(77096005)(4326007)(7846002)(8676002)(3280700002)(2900100001)(33656002)(2950100001)(180318011); DIR:OUT; SFP:1501; SCL:9; SRVR:CY1PR0501MB1451; H:CY1PR0501MB1450.namprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: juniper.net does not designate permitted sender hosts)
spamdiagnosticoutput: 1:22
Content-Type: text/plain; charset="utf-8"
Content-ID: <F45119CDDDC7FD48BA328BDDFDF1B33A@namprd05.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2016 01:10:05.0781 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1451
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/-zbXNhw2BJYMyrBT9nnCwoLAJ0s>
Cc: "draft-ietf-netmod-rfc6087bis@ietf.org" <draft-ietf-netmod-rfc6087bis@ietf.org>
Subject: Re: [netmod] OpsState Direction Impact on Recommended IETF YANG Model Structure
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: Tue, 02 Aug 2016 01:10:10 -0000

<as a contributor>

Following Lou’s recommendation, my proposed changes for rfc6087bis Section 5.23 follow:


5.23.  Operational Data

   In YANG, any data that has a "config" statement value of "false"
   could be considered operational data.  The relationship between
   configuration (i.e., "config" statement has a value of "true") and
   operational data can be complex.

-   One challenge for client developers is determining if the configured
-   value is being used, which requires the developer to know which
-   operational data parameters are associated with the particular
+  One challenge for client applications is determining if a configured
+  value is being used, which requires the application to know which
+  operational data parameters are associated with a particular
   configuration object (or group of objects).

   In the simplest use-cases, there is no interaction between
   configuration and operational data.  For example, the arbitrary
   administrative name or sequence number assigned to an access control
   rule.  The configured value is always the value that is being used by
   the system.

   However, some configuration parameters interact with routing and
-   other signalling protocols, such that the operational value in use by
+  other signaling protocols, such that the operational value in use by
   the system may not be the same as the configured value.  Other
   parameters specify the desired state, but environmental and other
   factors can cause the actual state to be different.

-   For example a "temperature" configuration setting only represents the
+   For example, a "temperature" configuration setting only represents the
   desired temperature.  An operational data parameter is needed that
   reports the actual temperature in order to determine if the cooling
   system is operating correctly.  YANG has no mechanism other than the
   "description" statement to associate the desired temperature and the
   actual temperature.

  [Editor’s Note: we should define a ‘related-config’ statement ASAP!]

   Careful consideration needs to be given to the location of
   operational data.  It can either be located within the configuration
   subtree for which it applies, or it can be located outside the
   particular configuration subtree.  Placing operational data within
-   the configuration subtree is appropriate if the operational values
-   can only exist if the configuration exists.
+   the configuration subtree is ideal, as the association between the
+   configuration and operational state is clear.  However, doing so must
+   be done with the knowledge that NETCONF and RESTCONF can 
+   currently only return the operational state for configured values,
+   not system generated values such as system created interfaces or
+   routing table entries.   This is because the config false nodes are 
+   descendants of config true nodes and hence cannot be returned
+   for nodes that haven’t been configured.   At least, this is the case
+   for how NETCONF and RESTCONF currently support returning
+   mixed config true and config false content.


-   The "interfaces" and "interfaces-state" subtrees defined in [RFC7223]
-   are an example of a complex relationship between configuration and
-   operational data.  The operational values can include interface
-   entries that have been discovered or initialized by the system.  An
-   interface may be in use that has not been configured at all.
-   Therefore, the operational data for an interface cannot be located
-   within the configuration for that same interface.
+   In order to support returning operational state for system generated
+   values, some YANG module designers have created a parallel top-level
+   config false hierarchy that mirrors the structure of the config true 
+   hierarchy.  For instance, this is seen in the ‘interfaces-state’ node in 
+   [RFC7223].  By doing this, it enables the operational state for system
+   generated values to be returned, since then all the ancestor nodes are
+   config false as well.  However, this approach is not ideal as it leads to 
+   needing to maintain duplicate structures and also requires the use of
+   description statements to describe the association between the two
+   structures.

+   To address this situation, the NETMOD and NETCONF working groups
+   are at this time in the process of defining a holistic operational state
+   solution that entails both a revised conceptual datastore model and
+   the necessary protocol extensions to enable, in part, both NETCONF
+   and RESTCONF to be able to return operational state for system
+   generated values using the same config true hierarchy used to return
+   the operational state for configured values.

+   This being the case, it is RECOMMENDED that YANG module designers
+   always mix config true and config false nodes into a single hierarchy.
+   This is so the YANG modules will be in proper form for when the
+   holistic operational state solution is available.   To address any 
+   immediate needs to also report the operational state for system
+   generated values, it is RECOMMENDED to define a second module
+   that imports the first module and defines a parallel top-level
+   config false hierarchy that mirrors the structure of the config true 
+   hierarchy in the first module.   This recommendation is made to
+   enable NETCONF/RESTCONF servers supporting the finalized
+   opstate solution to choose when to stop supporting the second 
+   module, as it would then only be needed to support legacy 
+   opstate-unaware clients.


FOUR SCENARIOS:

1) an opstate-unaware server might only support “ietf-foo”, as it is deemed unnecessary to provide the operational state for system-generated bars.  A client can get the operational state for just the configured bars using NETCONF’s <get> or RESTCONF’s content ‘all’ query parameter.
 
2) an opstate-unaware server might support both “ietf-foo” and “ietf-foo-state”, as it is deemed important to provide the operational state for system-generated bars.   Same as above, a client can get the operational state for just the configured bars, when targeting the “ietf-foo” module.  Better though, a client can get the operational state for both configured and system-generated bars together when targeting the “ietf-foo-state” module.  A client that is savvy enough to do this would of course not want the redundant operational state data from the ietf-foo module and therefore would likely only use NETCONF’s <get-config> and/or RESTCONF’s content ‘config’ query parameter when targeting the “ietf-foo” module.

3) an opstate-aware server might only support “ietf-foo”, as it can provide the operational state for both configured and system-generated bars using protocol mechanisms defined by the holistic opstate solution (e.g., via an “operational” datastore), and it doesn’t care about enabling legacy opstate-unaware clients to be able to obtain the operational state for the system generated bars.

4) an opstate-aware server might support both “ietf-foo” and “ietf-foo-state”, so that it can provide the operational state for both configured and system-generated bars to both opstate-aware and opstate-unaware clients.  This is hopefully a temporary condition as eventually the clients will be upgraded to be opstate-aware and then the vendor can deprecate support for the ietf-foo-state module.



WHY IMPORT?   The text above includes the statement “it is RECOMMENDED to define a second module that imports the first module”.  Technically, there isn’t a need for the import as of yet, but I’m very much thinking that we should *quickly* define a YANG statement called “related-config” that allows the client to programmatically related which config true nodes in the first module might are associated to the config false nodes in the second module.  Obviously, this would only make the association for configured values, and the client could assume that any key-misses are the result of the that operational state being for a system-generated value.  The association has to be in that direction because config false nodes can point to config true nodes, but not visa versa.




<EXAMPLE>

Assume we have module “ietf-foo” as follows:
 
module ietf-foo {
  namespace “foo-namespace”;
  container foo {
    list bar {
      key a;
      leaf a {
        type string;
      }
      leaf b {
         type int8;
         config false;
      }
   }
  }
}
 
whereby it’s possible that the system may generate some bars as well.  To address this, we create a second module “ietf-foo-state” (ideally using tool) that discards are the config true leafs and sets the entire tree to config false.  The resulting module follows:
 
module ietf-foo-state {
  namespace “foo-state-namespace”;
  import ietf-foo { prefix “f”; }
  container foo-state {
    config false;    <-- everything below is config false
    list bar {
      key a;
      related-config {      <-- config false point to config true (only present for *configured* bars)
          path “/f:foo/f:bar/f:a”
      }
      leaf a {    <-- this “config true” leaf is kept only because it’s the key (but now it’s config false)
        type string;
      }
      leaf b {
         type int8;
         config false;
      }
   }
  }
}
</EXAMPLE>





<SNIP - I didn’t try to rewrite any of the below stuff from Section 5.23. Some of it would be obsolete from the text above, but other parts may still be useful...>

   Sometimes the configured value represents some sort of procedure to
   be followed, in which the system will select an actual value, based
   on protocol negotiation.

      leaf duplex-admin-mode {
        type enumeration {
          enum auto;
          enum half;
          enum full;
        }
      }

      leaf duplex-oper-mode {
        config false;
        type enumeration {
          enum half;
          enum full;
        }
      }

   For example a "duplex" mode configuration may be "auto" to auto-
   negotiate the actual value to be used.  The operational parameter
   will never contain the value "auto".  It will always contain the
   result of the auto-negotiation, such as "half" or "full".  This is
   just one way in which the configuration data model is not exactly the
   same as the operational data model.  Another is if the detailed
   properties of the data are different for configured vs. learned
   entries.

   If all the data model properties are aligned between configuration
   and operational data, then it can be useful to define the
   configuration parameters within a grouping, and then replicate that
   grouping within the operational data portion of the data model.

       grouping parms {
          // do not use config-stmt in any of the nodes
          // placed in this grouping
       }

       container foo {
         uses parms;  // these are all config=true by default
         state {
           config false;  // only exists if foo config exists
           uses parms;
         }
       }

   Note that this mechanism can also be used if the configuration and
   operational data are in separate sub-trees:

       container bar { // bar config can exist without bar-state
         config true;
         uses parms;
       }

       container bar-state {  // bar-state can exist without bar
         config false;
         uses parms;
       }

   The need to replicate objects or define different operational data
   objects depends on the data model.  It is not possible to define one
   approach that will be optimal for all data models.  Designers SHOULD
   describe the relationship in detail between configuration objects and
   any associated operational data objects.  The "description"
   statements for both the configuration and the operational data SHOULD
   be used for this purpose.

</SNIP>


Thanks,
Kent