<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,               
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.             
    There has to be one entity for each item to be referenced.                    
    An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC2697 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2697.xml">
<!ENTITY RFC2698 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2698.xml">
<!ENTITY RFC6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes" ?>
<?rfc tocompact="yes"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-tao-netconf-notif-node-tag-capabilities-03"
     ipr="trust200902">
  <front>
    <title abbrev="Node Tags Capability">Self describing data Node tag
    capability</title>

    <author fullname="Qin Wu" initials="Q." surname="Wu">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>bill.wu@huawei.com</email>
      </address>
    </author>

    <author fullname="Qiufang Ma" initials="Q." surname="Ma">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>101 Software Avenue, Yuhua District</street>

          <city>Nanjing</city>

          <region>Jiangsu</region>

          <code>210012</code>

          <country>China</country>
        </postal>

        <email>maqiufang1@huawei.com</email>
      </address>
    </author>

    <author fullname="Peng Liu" initials="P." surname="Liu">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street>32 Xuanwumen West St, Xicheng District</street>

          <city>Beijing</city>

          <code>10053</code>
        </postal>

        <email>liupengyjy@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Yuexia Fu" initials="Y." surname="Fu">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street>32 Xuanwumen West St, Xicheng District</street>

          <city>Beijing</city>

          <code>10053</code>
        </postal>

        <email>yuexiafu@chinamobile.com</email>
      </address>
    </author>

    <date year="2020"/>

    <area>OPS Area</area>

    <workgroup>NETCONF Working Group</workgroup>

    <abstract>
      <t>Before a client application subscribes to updates from a datastore,
      server capabilities related to "Subscription to YANG Datastores" can be
      advertised using YANG Instance Data format. These server capabilities
      can be documented at implement time or reported at run-time.</t>

      <t>This document proposes a YANG module for self describing data Object
      tag capability which augments system capabilities model and provide
      additional self describing data node attributes associated with node
      selectors within per-node capabilities.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>As described in [I-D.netconf-notification-capabilities], a server
      supporting YANG-Push MAY have a number of capabilities such as<list
          style="symbols">
          <t>Supported (reporting) periods for periodic subscriptions;</t>

          <t>Maximum number of objects that can be sent in an update;</t>

          <t>Supported dampening periods for on-change subscriptions;</t>

          <t>The set of data nodes for which on-change notification is
          supported.</t>
        </list></t>

      <t>Notification capability model defined in
      [I-D.netconf-notification-capabilities] allows a client to discover
      basic system capability and YANG-Push related capabilities both at
      implementation-time and run-time. Without using this notification
      capability, it might lead to unexpected failures or additional message
      exchanges for NETCONF clients to discover data objects with specific
      capability supported by a NETCONF server.</t>

      <t>When all telemetry data on the server subscribed by a particular
      subscriber is huge, it becomes more likely that a burst of streamed data
      may temporarily overwhelm a receiver and consume expensive computing and
      storage resource. Accordingly, there is a need for filtering subscribed
      telemetry data on a server based on server capabilities, which can
      greatly reduce the amount of data to be streamed out to the
      destination.</t>

      <t>However without telemetry data classification or prior knowledge of
      data objects correlation relationship, it is difficult for NETCONF
      clients to automatically select target data objects that are of interest
      to the client applications, e.g., identify a set of objects from
      different YANG data modules which have a common characteristic, collect
      specific object type nodes for multiple dimensional network visibility
      analysis.</t>

      <t>This document proposes a YANG module for self describing data Node
      tag capability which augments System Capabilities model and provide
      additional self describing data node tag attributes associated with node
      selector for queries filtering.</t>

      <section title="Terminology">
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP
        14 [RFC2119] [RFC8174] when, and only when, they appear in all
        capitals, as shown here.</t>
      </section>
    </section>

    <!-- intro -->

    <section title="Self-explanation data Node tag capability">
      <t>The YANG module ietf-notification-capabilities defined in
      [I-D.netconf-notification-capabilities] specifies the following server
      capabilities related to YANG Push:<list style="symbols">
          <t>A set of capabilities related to the amount of notifications the
          server can send out</t>

          <t>Specification of which data nodes support on-change
          notifications.</t>

          <t>Capability values can be specified on server level, datastore
          level or on specific data nodes (and their contained sub-tree) of a
          specific datastore. Capability values on a smaller, more specific
          part of the server's data always override more generic values.</t>

          <t>On-change capability is not specified on a server level as
          different datastores usually have different on-change capabilities.
          On a datastore level on-change capability for configuration and
          state data can be specified separately.</t>
        </list></t>

      <t>These server capabilities can be provided either at implementation
      time or reported at run time.</t>

      <t>This document augments system capabilities model and provide
      additional data node self explaination tag attributes associated with
      node selector within per-node capabilities:<list style="symbols">
          <t>Specification of which data objects (e.g., data object tagged
          with object tag, property subobject tag, metri subobject tag) they
          can push to the target recipient;</t>

          <t>Specification of metric group tag associated with a set of metric
          subobjects;</t>

          <t>Specfication of multi-source aggregation tag assocaited with
          specific metric subobject;</t>
        </list></t>

      <section title="Tree Diagram">
        <t>The following tree diagram [RFC8340] provides an overview of the
        data model.</t>

        <figure>
          <artwork>    module: ietf-self-describing-capabilities
    augment /sysc:system-capabilities/sysc:datastore-capabilities/ +
          sysc:per-node-capabilities/sys:node-selection/sys:node-selector:
       +--ro self-describing-attributes
           +--ro opm-tag*                 tags:tag
           +--ro metric-group            tags:tag
           +--ro muli-source-tag         tags:tag</artwork>
        </figure>
      </section>
    </section>

    <section title="YANG Module">
      <figure>
        <artwork>&lt;CODE BEGINS&gt; file "ietf-self-describing-capabilities.yang"
module ietf-self-describing-capabilities {
  yang-version 1.1;
  namespace urn:ietf:params:xml:ns:yang:ietf-self-description-capabilities;
  prefix sdc;
  import ietf-system-capabilities  { prefix sysc ; }
  import ietf-module-tags  { prefix tags; }
  organization
    "IETF NETMOD (Network Modeling) Working Group";
  contact
    "WG Web:   &lt;https://tools.ietf.org/wg/netconf/&gt;
     WG List:  &lt;mailto:netconf@ietf.org&gt;

     Editor:   Qin Wu
               &lt;mailto:bill.wu@huawei.com&gt;
               Qiufang Ma
               &lt;mailto:maqiufang1@huawei.com&gt;
               Peng Liu
               &lt;liupengyjy@chinamobile.com&gt;
               Hui Cai
               &lt;caihui@chinamobile.com&gt;";
  description
    "This module defines an extension to System Capabilities model 
     and provides additional self explaination data node tag attributes 
     associated with node selector for queries filtering.

     Copyright (c) 2020 IETF Trust and the persons identified as
     authors of the code.  All rights reserved.

     Redistribution and use in source and binary forms, with or
     without modification, is permitted pursuant to, and subject
     to the license terms contained in, the Simplified BSD License
     set forth in Section 4.c of the IETF Trust's Legal Provisions
     Relating to IETF Documents
     (http://trustee.ietf.org/license-info).

     This version of this YANG module is part of RFC XXXX;
     see the RFC itself for full legal notices.";
    revision 2020-07-08 {
    description
      "Initial revision";
    reference
      "RFC XXXX";
  }
    augment "/sysc:system-capabilities/sysc:datastore-capabilities" +
         "/sysc:per-node-capabilities" +
          "/sysc:node-selection/sysc:node-selector" {
     description "Allows per-node capabilities have additional self-explanation attributes";
     container self-describing-attributes {
      description "self describing attributes for specific data node.";
         leaf-list opm-tag {
           type tags:tag;
           description
            "Object, Property and Metric(OPM) Tags associated with 
             specific data object within YANG module.
            See the IANA 'YANG Data Node Tag Prefixes' registry
            for reserved prefixes and the IANA
            'IETF YANG Data Node Tags' registry for IETF tags.";
         }
         leaf metric-group {
           type tags:tag;
           description
           "The metric-group can be used to provide correlation between 
           different performance metric information associated with YANG 
           data node.";
         }
         leaf multi-source-tag {
          type tags:tag;
          description
           "The multiple source tag can be used to aggregate peformance 
            metric from different sources.";
         }
     }
   }
}
&lt;CODE ENDS&gt;</artwork>
      </figure>
    </section>

    <section title="IANA Considerations">
      <section anchor="xml" title="Updates to the IETF XML Registry">
        <t>This document registers a URI in the "IETF XML Registry" [RFC3688].
        Following the format in [RFC3688], the following registration has been
        made:</t>

        <figure>
          <artwork>   URI:
      urn:ietf:params:xml:ns:yang:ietf-self-describing-capabilities
   Registrant Contact:
      The IESG.
   XML:
      N/A; the requested URI is an XML namespace.</artwork>
        </figure>
      </section>

      <section anchor="module"
               title="Updates to the YANG Module Names Registry">
        <t>This document registers one YANG module in the "YANG Module Names"
        registry [RFC6020]. Following the format in [RFC6020], the following
        registration has been made:</t>

        <figure>
          <artwork>   name:
      ietf-self-describing-capabilities
   namespace:
      urn:ietf:params:xml:ns:yang:ietf-self-describing-capabilities
   prefix:
      sec
   reference:
      RFC XXXX (RFC Ed.: replace XXX with actual RFC number and remove
      this note.)</artwork>
        </figure>
      </section>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>The YANG module specified in this document defines a schema for data
      that is designed to be accessed via network management protocols such as
      NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the
      secure transport layer, and the mandatory-to-implement secure transport
      is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and
      the mandatory-to-implement secure transport is TLS [RFC8446].</t>

      <t>The NETCONF Configuration Access Control Model (NACM) [RFC8341]
      provides the means to restrict access for particular NETCONF or RESTCONF
      users to a preconfigured subset of all available NETCONF or RESTCONF
      protocol operations and content.</t>

      <t>There are a number of data nodes defined in this YANG module that are
      writable/creatable/deletable (i.e., config true, which is the default).
      These data nodes may be considered sensitive in some network
      environments. Write operations (e.g., edit-config) to these data nodes
      without proper protection can have a negative effect on network
      operations. These are the subtrees and data nodes and their
      sensitivity/vulnerability:<list style="symbols">
          <t>/sysc:system-capabilities/sysc:datastore-capabilities/sysc:per-node-capabilities/sys:node-selection/sys:node-selector/sec:self-describing-attributes/sec:opm-tag</t>

          <t>/sysc:system-capabilities/sysc:datastore-capabilities/sysc:per-node-capabilities/sys:node-selection/sys:node-selector/sec:self-describing-attributes/sec:metric-group</t>

          <t>/sysc:system-capabilities/sysc:datastore-capabilities/sysc:per-node-capabilities/sys:node-selection/sys:node-selector/sec:self-describing-attributes/sec:multi-source-tag</t>
        </list></t>
    </section>

    <section title="Contributors">
      <t>The authors would like to thank Ran Tao, Hui Cai for his major
      contributions to the initial modeling and use cases.</t>
    </section>

    <!---->
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119.xml"?>

      <?rfc include="reference.RFC.8174.xml"?>

      <?rfc include="reference.RFC.7950.xml"?>

      <?rfc include="reference.RFC.8342.xml"?>

      <?rfc include="reference.RFC.8407.xml"?>

      <?rfc include="reference.RFC.8126.xml"?>

      <?rfc include="reference.RFC.8040.xml"?>

      <?rfc include="reference.RFC.6241.xml"?>

      <?rfc include="reference.RFC.6242.xml"?>

      <?rfc include="reference.RFC.8341.xml"?>

      <?rfc include="reference.RFC.8446.xml"?>
    </references>

    <references title="Informative References">
      <?rfc include="reference.RFC.3688.xml"?>

      <?rfc include="reference.RFC.6020.xml"?>

      <?rfc include="reference.RFC.8340.xml"?>
    </references>

    <section title="Targeted data object subscription example">
      <t>The following subsections provides targeted data object subscription
      example. The subscription "id" values of 22 used below is just an
      example. In production, the actual values of "id" might not be small
      integers.</t>

      <figure>
        <artwork> +-----------+                       +-----------+
 | Subscriber|                       | Publisher |
 +------+----+                       +-----+-----+
        |                                  |
        |                                  |
        |Telemery data Tagging Advertisement
        |  (node-selector, opm-tag = metric)
        |&lt;---------------------------------|
        |                                  |
        |    establish-subscription        |
        |  (datasore,node-selector)        |
        |---------------------------------&gt;|
        |                                  |
        |                                  |
        |                                  |
        |    RPC Reply: OK, id = 22        |
        |&lt;---------------------------------|
        |                                  |
        |                                  |
        |                                  |
        |    Notification Message (for 22) |
        | &lt;--------------------------------|
        |                                  |
        |                                  |
        |                                  |</artwork>
      </figure>

      <t>The publisher advertise telemetry data node capability to the
      subscriber to instruct the receiver to subscribe targeted data object
      with specific characteristics (e.g., performance metric related data
      object) and specific data path corresponding to the targeted data
      object.</t>

      <t>The following XML example [W3C.REC-xml-20081126] illustrates the
      advertisment of the list of available target objects:</t>

      <figure>
        <artwork>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;instance-data-set xmlns=\
    "urn:ietf:params:xml:ns:yang:ietf-yang-instance-data"&gt;
  &lt;name&gt;acme-router-notification-capabilities&lt;/name&gt;
  &lt;content-schema&gt;
    &lt;module&gt;ietf-system-capabilities@2020-03-23&lt;/module&gt;
    &lt;module&gt;ietf-notification-capabilities@2020-03-23&lt;/module&gt;
    &lt;module&gt;ietf-data-export-capabilities@2020-03-23&lt;/module&gt;
  &lt;/content-schema&gt;
  &lt;!-- revision date, contact, etc. --&gt;
  &lt;description&gt;Defines the notification capabilities of an acme-router.
    The router only has running, and operational datastores.
    Every change can be reported on-change from running, but
    only config=true nodes and some config=false data from operational.
    Statistics are not reported based on timer based trigger and counter
    threshold based trigger.
  &lt;/description&gt;
  &lt;content-data&gt;
    &lt;system-capabilities \
      xmlns="urn:ietf:params:xml:ns:yang:ietf-system-capabilities" \
      xmlns:inc=\
        "urn:ietf:params:xml:ns:yang:ietf-notification-capabilities" \
      xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores"&gt;
      &lt;datastore-capabilities&gt;
        &lt;datastore&gt;ds:operational&lt;/datastore&gt;
        &lt;per-node-capabilities&gt;
          &lt;node-selector&gt;\
              /if:interfaces/if:interface/if:statistics/if:in-errors\
          &lt;/node-selector&gt;
          &lt;sec:self-describing-capabilities&gt;
            &lt;sec:opm-tag&gt;metric&lt;/sec:opm-tag&gt;
            &lt;sec:metric-group&gt;loss&lt;/sec:metric-group&gt;
          &lt;/sec:self-describing-capabilities&gt;
        &lt;/per-node-capabilities&gt;
      &lt;/datastore-capabilities&gt;
    &lt;/system-capabilities&gt;
  &lt;/content-data&gt;
&lt;/instance-data-set&gt;</artwork>
      </figure>

      <t>With telemetry data tagging information carried in the Telemetry data
      Tagging Advertisement, the subscriber identifies targeted data object
      and associated data path to the datastore node and sends a establish-
      subscription RPC to subscribe specific data objects that are interests
      to the client application from the publisher.</t>

      <figure>
        <artwork> &lt;netconf:rpc message-id="101"
     xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
   &lt;establish-subscription
       xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"
       xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push"&gt;
     &lt;yp:datastore
          xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores"&gt;
       ds:operational
     &lt;/yp:datastore&gt;
     &lt;yp:datastore-xpath-filter
         xmlns:ex="https://example.com/sample-data/1.0"&gt;
       /if:interfaces/if:interface/if:statistics/if:in-errors
     &lt;/yp:datastore-xpath-filter&gt;
     &lt;yp:periodic&gt;
       &lt;yp:period&gt;500&lt;/yp:period&gt;
     &lt;/yp:periodic&gt;
   &lt;/establish-subscription&gt;
 &lt;/netconf:rpc&gt;</artwork>
      </figure>

      <t>The publisher returns specific object type of operational state
      related to the subscriber.</t>
    </section>
  </back>
</rfc>
