<?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-data-export-capabilities-07"
     ipr="trust200902">
  <front>
    <title abbrev="Data Export Capability">Data Export Notification
    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>Beiqijia Town, Changping District</street>

          <city>Beijing</city>

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

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

    <author fullname="Wei Wang" initials="W." surname="Wang">
      <organization>China Telecom</organization>

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

          <city>Beijing</city>

          <code>102209</code>
        </postal>

        <email>wangw36@chinatelecom.cn</email>
      </address>
    </author>

    <date year="2022"/>

    <area>OPS Area</area>

    <workgroup>NETCONF Working Group</workgroup>

    <abstract>
      <t>This document proposes a YANG module for data export notification
      capabilities which augments "ietf-system-capabilities" YANG module
      defined in [RFC9196] and provides additional data export attributes
      associated with system capabilities for transport specific Notification.
      This YANG module can be used by the client to learn capability
      information from the server at runtime or at implementation time, by
      making use of the YANG instance data file format.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>Notification capabilities model defined in [RFC9196] allows a client
      to discover a set of capabilities supported by the server (e.g., basic
      system capabilities and YANG-Push related capabilities) both at
      implementation time and at runtime. These capabilities allow the client
      to adjust its behavior to take advantage of the features exposed by the
      server.</t>

      <t>However the client and the server may still support various different
      transport specific parameters (e.g., transport protocol, encoding
      format, encryption). As described in section 3.1 of [RFC8641], a simple
      negotiation (i.e., inserting hints into error responses to a failed RPC
      request) between subscribers and publishers for subscription parameters
      increases the likelihood of success for subsequent RPC requests, but not
      guaranteed, which may cause unexpected failure or additional message
      exchange between client and server.</t>

      <t>This document defines a corresponding solution that is built on top
      of [RFC9196]. Supplementing that work are YANG data model augmentations
      for transport specific notification. The module can be used by the
      client to discover capability information from the server at runtime or
      at implementation time, by making use of the YANG instance data file
      format.</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="Data Export Capability">
      <t>The YANG module "ietf-notification-capabilities" defined in [RFC9196]
      specifies the following server capabilities related to YANG Push: <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>The set of datastores or data nodes for which "periodic" or
          "on-change" notification is supported</t>

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

      <t>These server capabilities are transport independent, session level
      capabilities. They can be provided either at the implementation time or
      reported at runtime.</t>

      <t>This document augments System Capabilities model and provides
      additional data export attributes associated with system
      capabilities:<list style="symbols">
          <t>Specification of transport protocols the client can use to
          establish a transport connection;</t>

          <t>Specification of the encoding selection used (e.g., XML or JSON,
          Binary) for Data modeled with YANG;</t>

          <t>Specification of secure transport mechanisms that are needed by
          the client to communicate with the server;</t>

          <t>Specification of the notification message encapsulation type,
          either one notification per message or multiple notifications per
          message [I-D. ietf-netconf-notification-messages].</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-data-export-capabilities
  augment /sysc:system-capabilities:
    +--ro data-export-capabilities
       +--ro data-export-capability* []
          +--ro transport-protocol?            identityref
          +--ro encoding-format*               identityref
          +--ro security-protocol?             identityref
          +--ro message-bundling-support?      empty</artwork>
        </figure>
      </section>
    </section>

    <section title="YANG Module">
      <figure>
        <artwork>&lt;CODE BEGINS&gt; file "ietf-data-export-capabilities.yang"
module ietf-data-export-capabilities {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-data-export-capabilities";
  prefix dec;

  import ietf-system-capabilities {
    prefix sysc;
  }
  import ietf-notification-capabilities {
    prefix inc;
  }
  organization
    "IETF NETCONF (Network Configuration) 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;
     Editor:   Qiufang Ma &lt;mailto: maqiufang1@huawei.com&gt;
     Editor:   Peng Liu &lt;mailto: liupengyjy@chinamobile.com&gt;
     Editor:   Wei Wang &lt;mailto: wangw36@chinatelecom.cn&gt;";
  description
    "This module defines an extension to System Capability and YANG Push
     Notification Capabilities model and provides additional data export
     attributes for transport specific notification.

     Copyright (c) 2019 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-03 {
    description
      "Initial revision.";
    reference
      "RFC XXXX: Data Export Notification Capability";
  }

  identity transport-protocol {
    description
      "Base identity for transport protocol type.";
  }

  identity tcp {
    base transport-protocol;
    description
      "Identity for tcp as transport protocol.";
  }

  identity udp-notif {
    base transport-protocol;
    description
      "Identity for udp notif as transport protocol.";
    reference
      "draft-ietf-netconf-udp-notif:UDP-based Transport 
       for Configured Subscriptions";
  }

  identity http-notif {
    base transport-protocol;
    description
      "Identity for http notif as transport protocol.";
    reference
      "draft-ietf-netconf-https-notif: An HTTPS-based 
       Transport for Configured Subscriptions";
  }

  identity grpc {
    base transport-protocol;
    description
      "Identity for grpc as transport protocol.";
  }

  identity security-protocol {
    description
      "Base identity for security protocol type.";
  }

  identity tls {
    base security-protocol;
    description
      "Identity for tls security protocol.";
  }

  identity dtls {
    base security-protocol;
    description
      "Identity for dtls security protocol.";
  }

  identity ssh {
    base security-protocol;
    description
      "Identity for ssh transport protocol.";
  }

  identity encoding-format {
    description
      "Base identity for encoding format type.";
  }

  identity xml {
    base encoding-format;
    description
      "Identity for xml encoding format.";
  }

  identity json {
    base encoding-format;
    description
      "Identity for json encoding format.";
  }

  identity binary {
    base encoding-format;
    description
      "Identity for binary encoding format.";
  }

  identity cbor {
    base binary;
    description
      "Identity for cbor encoding format.";
  }

  augment "/sysc:system-capabilities" {
    description
      "Add system level capability.";
    container data-export-capabilities {
      description
        "Capabilities related to data export notification capabilities negotiation.";
      list data-export-capability {
        description
          "Capability list related to data export notification capabilities negotiation.";
        leaf transport-protocol {
          type identityref {
            base transport-protocol;
          }
          description
            "Type of transport protocol.";
        }
        leaf-list encoding-format {
          type identityref {
            base encoding-format;
          }
          description
            "Type of encoding format.";
        }
        leaf security-protocol {
          type identityref {
            base security-protocol;
          }
          description
            "Type of secure transport.";
        }
        leaf message-bundling-support {
          type empty;
          description
            "Enables message bundling support.";
        }
      }
    }
  }
}
&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-data-export-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-data-export-capabilities
   namespace:
      urn:ietf:params:xml:ns:yang:ietf-data-export-capabilities
   prefix:
      dec
   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>All protocol-accessible data nodes are read-only and cannot be
      modified. The data in these modules is not security sensitive. Access
      control may be configured, to avoid exposing the read-only data.</t>

      <t>When this data is in file format, data should be protected against
      modification or unauthorized access using normal file handling
      mechanisms.</t>
    </section>

    <section title="Contributors">
      <figure>
        <artwork>   Ran Tao
   Huawei
   101 Software Avenue, Yuhua District
   Nanjing, Jiangsu  210012
   China
   Email: taoran20@huawei.com

   Liang Geng
   China Mobile
   32 Xuanwumen West St, Xicheng District
   Beijing  10053

   Email: gengliang@chinamobile.com

   Thomas Graf
   Swisscom
   Binzring 17
   Zuerich 8045
   Switzerland

   Email: thomas.graf@swisscom.com</artwork>
      </figure>
    </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"?>

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

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

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

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

      <?rfc include='reference.I-D.ietf-netconf-udp-notif'?>

      <?rfc include='reference.I-D.ietf-netconf-https-notif'?>

      <?rfc include='reference.I-D.ietf-netconf-notification-messages'?>
    </references>

    <section title="Usage Example of interaction with UDP Notif and HTTP Notif for Configured Subscription">
      <t>The following instance-data example describes the Data Export
      Notification capabilities of a hypothetical "acme-router".</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;Server Capability Discovery&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;data-export-capabilities&gt;
        &lt;data-export-capability&gt;
          &lt;transport-protocol&gt;http-notif&lt;/transport-protocol&gt;
          &lt;encoding-format&gt;json&lt;/encoding-format&gt;
          &lt;encoding-format&gt;xml&lt;/encoding-format&gt;
        &lt;/data-export-capability&gt;
        &lt;data-export-capability&gt;
          &lt;transport-protocol&gt;udp-notif&lt;/transport-protocol&gt;
          &lt;encoding-format&gt;binary&lt;/encoding-format&gt;
        &lt;/data-export-capability&gt;
      &lt;/data-export-capabilities&gt;
    &lt;/system-capabilities&gt;
  &lt;/content-data&gt;
&lt;/instance-data-set&gt;</artwork>
      </figure>

      <t>In addition, the client could also query data export capability from
      the server. For example, the client sends &lt;get&gt; request message to
      the the server to query data export capability from the server.</t>

      <figure>
        <artwork> &lt;rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
   &lt;get&gt;
     &lt;filter type="subtree"&gt;
     &lt;system-capabilities xmlns="urn:ietf:params:xml:ns:yang:ietf-system-capabilities"&gt;
       &lt;data-export-capabilities/&gt;
     &lt;/system-capabilities&gt;
    &lt;/filter&gt;
   &lt;/get&gt;
 &lt;/rpc&gt;</artwork>
      </figure>

      <t>The server returns server data export capability using
      &lt;rpc-reply&gt; as follows:</t>

      <figure>
        <artwork>&lt;rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&gt;
  &lt;data&gt;
  &lt;system-capabilities 
   xmlns="urn:ietf:params:xml:ns:yang:ietf-system-capabilities" 
   xmlns:dec="urn:ietf:params:xml:ns:yang:ietf-data-export-capabilities"&gt;
    &lt;data-export-capabilities&gt;
      &lt;data-export-capability&gt;
        &lt;transport-protocol&gt;http-notif&lt;/transport-protocol&gt;
        &lt;encoding-format&gt;json&lt;/encoding-format&gt;
      &lt;/data-export-capability&gt;
      &lt;data-export-capability&gt;
        &lt;transport-protocol&gt;udp-notif&lt;/transport-protocol&gt;
        &lt;encoding-format&gt;binary&lt;/encoding-format&gt;
      &lt;/data-export-capability&gt;
    &lt;/data-export-capabilities&gt;
  &lt;/system-capabilities&gt;
&lt;/data&gt;
&lt;/rpc-reply&gt;</artwork>
      </figure>
    </section>

    <section title="Changes between Revisions">
      <t>v06-v07<list style="symbols">
          <t>Delete the per-node related capability parameters from the
          Appendix.</t>
        </list></t>

      <t>v05-v06<list style="symbols">
          <t>Revise abstract and introduction sessions so that the scope of
          this draft is not limited to telemetry but other notification.</t>

          <t>Revise the description of module ietf-system-capabilities to
          align with the latest version of
          draft-ietf-netconf-notification-capabilities.</t>

          <t>Remove compression-mode, timer-event-support and
          suppress-redundant parameters in the model.</t>

          <t>Move per-node related capability parameters to appendix
          section.</t>

          <t>Add a container to wrap data export capabilities to cleanly
          separate different groups of capabilities.</t>
        </list></t>

      <t>v04 - v05<list style="symbols">
          <t>Change per-node-capabilities related parameters into empty
          type.</t>

          <t>Revise abstract and introduction section to only focus on
          capability fetching mechanism from the client to the server.</t>

          <t>Update Usage Example of interaction with HTTP-Notif and UDP-Notif
          for Configured Subscription.</t>
        </list></t>

      <t>v03 - v04<list style="symbols">
          <t>Add interface namespace in the Adaptive Subscription usage
          example.</t>

          <t>subtrees and data nodes changes in the security section.</t>

          <t>Two compression mode related identities change.</t>

          <t>Move message-bundling-support parameer to system capabilities
          level.</t>

          <t>Add an example to discuss report reciever capability from the
          client per yang instance file format.</t>

          <t>Change encoding format from leaf to leaf-list and support
          multiple encoding formats for the same transport specific notif.</t>
        </list></t>

      <t>v02 - v03<list style="symbols">
          <t>Change 'data-export-capabilities' into list type to support
          multiple transport protocol, encoding on the server.</t>

          <t>Add Usage Example of interaction with UDP based Transport for
          Configured Subscription.</t>

          <t>Add Thomas Graf as a contributor;</t>

          <t>Update motivation in the introduction to clarify why this work is
          needed.</t>

          <t>Support udp notif and http notif as two optional transport in the
          YANG data model.</t>
        </list></t>
    </section>
  </back>
</rfc>
