<?xml version='1.0' encoding='utf-8'?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" category="std" consensus="true" docName="draft-ietf-netconf-restconf-notif-15" indexInclude="true" ipr="trust200902" number="8650" prepTime="2019-11-17T01:57:02" scripts="Common,Latin" sortRefs="true" submissionType="IETF" symRefs="true" tocDepth="3" tocInclude="true" xml:lang="en">
  <link href="https://datatracker.ietf.org/doc/draft-ietf-netconf-restconf-notif-15" rel="prev"/>
  <link href="https://dx.doi.org/10.17487/rfc8650" rel="alternate"/>
  <link href="urn:issn:2070-1721" rel="alternate"/>
  <front>
    <title abbrev="RESTCONF Transport for Event Notifications">Dynamic Subscription to YANG Events and Datastores over RESTCONF</title>
    <seriesInfo name="RFC" value="8650" stream="IETF"/>
    <author fullname="Eric Voit" initials="E." surname="Voit">
      <organization showOnFrontPage="true">Cisco Systems</organization>
      <address>
        <email>evoit@cisco.com</email>
      </address>
    </author>
    <author fullname="Reshad Rahman" initials="R." surname="Rahman">
      <organization showOnFrontPage="true">Cisco Systems</organization>
      <address>
        <email>rrahman@cisco.com</email>
      </address>
    </author>
    <author fullname="Einar Nilsen-Nygaard" initials="E." surname="Nilsen-Nygaard">
      <organization showOnFrontPage="true">Cisco Systems</organization>
      <address>
        <email>einarnn@cisco.com</email>
      </address>
    </author>
    <author fullname="Alexander Clemm" initials="A." surname="Clemm">
      <organization showOnFrontPage="true">Futurewei</organization>
      <address>
        <email>ludwig@clemm.org</email>
      </address>
    </author>
    <author fullname="Andy Bierman" initials="A." surname="Bierman">
      <organization showOnFrontPage="true">YumaWorks</organization>
      <address>
        <email>andy@yumaworks.com</email>
      </address>
    </author>
    <date month="11" year="2019"/>
    <area>Operations &amp; Management</area>
    <workgroup>NETCONF</workgroup>
    <keyword>YANG-Push</keyword>
    <abstract pn="section-abstract">
      <t pn="section-abstract-1">This document provides a RESTCONF binding to the dynamic subscription
      capability of both subscribed notifications and YANG-Push.</t>
    </abstract>
    <boilerplate>
      <section anchor="status-of-memo" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.1">
        <name slugifiedName="name-status-of-this-memo">Status of This Memo</name>
        <t pn="section-boilerplate.1-1">
            This is an Internet Standards Track document.
        </t>
        <t pn="section-boilerplate.1-2">
            This document is a product of the Internet Engineering Task Force
            (IETF).  It represents the consensus of the IETF community.  It has
            received public review and has been approved for publication by
            the Internet Engineering Steering Group (IESG).  Further
            information on Internet Standards is available in Section 2 of 
            RFC 7841.
        </t>
        <t pn="section-boilerplate.1-3">
            Information about the current status of this document, any
            errata, and how to provide feedback on it may be obtained at
            <eref target="https://www.rfc-editor.org/info/rfc8650" brackets="none"/>.
        </t>
      </section>
      <section anchor="copyright" numbered="false" removeInRFC="false" toc="exclude" pn="section-boilerplate.2">
        <name slugifiedName="name-copyright-notice">Copyright Notice</name>
        <t pn="section-boilerplate.2-1">
            Copyright (c) 2019 IETF Trust and the persons identified as the
            document authors. All rights reserved.
        </t>
        <t pn="section-boilerplate.2-2">
            This document is subject to BCP 78 and the IETF Trust's Legal
            Provisions Relating to IETF Documents
            (<eref target="https://trustee.ietf.org/license-info" brackets="none"/>) in effect on the date of
            publication of this document. Please review these documents
            carefully, as they describe your rights and restrictions with
            respect to this document. Code Components extracted from this
            document must include Simplified BSD License text as described in
            Section 4.e of the Trust Legal Provisions and are provided without
            warranty as described in the Simplified BSD License.
        </t>
      </section>
    </boilerplate>
    <toc>
      <section anchor="toc" numbered="false" removeInRFC="false" toc="exclude" pn="section-toc.1">
        <name slugifiedName="name-table-of-contents">Table of Contents</name>
        <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1">
          <li pn="section-toc.1-1.1">
            <t keepWithNext="true" pn="section-toc.1-1.1.1"><xref derivedContent="1" format="counter" sectionFormat="of" target="section-1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-introduction">Introduction</xref></t>
          </li>
          <li pn="section-toc.1-1.2">
            <t keepWithNext="true" pn="section-toc.1-1.2.1"><xref derivedContent="2" format="counter" sectionFormat="of" target="section-2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-terminology">Terminology</xref></t>
          </li>
          <li pn="section-toc.1-1.3">
            <t keepWithNext="true" pn="section-toc.1-1.3.1"><xref derivedContent="3" format="counter" sectionFormat="of" target="section-3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-dynamic-subscriptions">Dynamic Subscriptions</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.3.2">
              <li pn="section-toc.1-1.3.2.1">
                <t keepWithNext="true" pn="section-toc.1-1.3.2.1.1"><xref derivedContent="3.1" format="counter" sectionFormat="of" target="section-3.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-transport-connectivity">Transport Connectivity</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.2">
                <t keepWithNext="true" pn="section-toc.1-1.3.2.2.1"><xref derivedContent="3.2" format="counter" sectionFormat="of" target="section-3.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-discovery">Discovery</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.3">
                <t keepWithNext="true" pn="section-toc.1-1.3.2.3.1"><xref derivedContent="3.3" format="counter" sectionFormat="of" target="section-3.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-restconf-rpcs-and-http-stat">RESTCONF RPCs and HTTP Status Codes</xref></t>
              </li>
              <li pn="section-toc.1-1.3.2.4">
                <t keepWithNext="true" pn="section-toc.1-1.3.2.4.1"><xref derivedContent="3.4" format="counter" sectionFormat="of" target="section-3.4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-call-flow-for-server-sent-e">Call Flow for Server-Sent Events</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.4">
            <t keepWithNext="true" pn="section-toc.1-1.4.1"><xref derivedContent="4" format="counter" sectionFormat="of" target="section-4"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-qos-treatment">QoS Treatment</xref></t>
          </li>
          <li pn="section-toc.1-1.5">
            <t keepWithNext="true" pn="section-toc.1-1.5.1"><xref derivedContent="5" format="counter" sectionFormat="of" target="section-5"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-notification-messages">Notification Messages</xref></t>
          </li>
          <li pn="section-toc.1-1.6">
            <t keepWithNext="true" pn="section-toc.1-1.6.1"><xref derivedContent="6" format="counter" sectionFormat="of" target="section-6"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-yang-tree">YANG Tree</xref></t>
          </li>
          <li pn="section-toc.1-1.7">
            <t keepWithNext="true" pn="section-toc.1-1.7.1"><xref derivedContent="7" format="counter" sectionFormat="of" target="section-7"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-yang-module">YANG Module</xref></t>
          </li>
          <li pn="section-toc.1-1.8">
            <t keepWithNext="true" pn="section-toc.1-1.8.1"><xref derivedContent="8" format="counter" sectionFormat="of" target="section-8"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-iana-considerations">IANA Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.9">
            <t keepWithNext="true" pn="section-toc.1-1.9.1"><xref derivedContent="9" format="counter" sectionFormat="of" target="section-9"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-security-considerations">Security Considerations</xref></t>
          </li>
          <li pn="section-toc.1-1.10">
            <t keepWithNext="true" pn="section-toc.1-1.10.1"><xref derivedContent="10" format="counter" sectionFormat="of" target="section-10"/>. <xref derivedContent="" format="title" sectionFormat="of" target="name-references">References</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.10.2">
              <li pn="section-toc.1-1.10.2.1">
                <t keepWithNext="true" pn="section-toc.1-1.10.2.1.1"><xref derivedContent="10.1" format="counter" sectionFormat="of" target="section-10.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-normative-references">Normative References</xref></t>
              </li>
              <li pn="section-toc.1-1.10.2.2">
                <t keepWithNext="true" pn="section-toc.1-1.10.2.2.1"><xref derivedContent="10.2" format="counter" sectionFormat="of" target="section-10.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-informative-references">Informative References</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.11">
            <t keepWithNext="true" pn="section-toc.1-1.11.1"><xref derivedContent="Appendix A" format="default" sectionFormat="of" target="section-appendix.a"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-examples">Examples</xref></t>
            <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.11.2">
              <li pn="section-toc.1-1.11.2.1">
                <t keepWithNext="true" pn="section-toc.1-1.11.2.1.1"><xref derivedContent="A.1" format="counter" sectionFormat="of" target="section-a.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-dynamic-subscriptions-2">Dynamic Subscriptions</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.11.2.1.2">
                  <li pn="section-toc.1-1.11.2.1.2.1">
                    <t keepWithNext="true" pn="section-toc.1-1.11.2.1.2.1.1"><xref derivedContent="A.1.1" format="counter" sectionFormat="of" target="section-a.1.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-establishing-dynamic-subscr">Establishing Dynamic Subscriptions</xref></t>
                  </li>
                  <li pn="section-toc.1-1.11.2.1.2.2">
                    <t keepWithNext="true" pn="section-toc.1-1.11.2.1.2.2.1"><xref derivedContent="A.1.2" format="counter" sectionFormat="of" target="section-a.1.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-modifying-dynamic-subscript">Modifying Dynamic Subscriptions</xref></t>
                  </li>
                  <li pn="section-toc.1-1.11.2.1.2.3">
                    <t keepWithNext="true" pn="section-toc.1-1.11.2.1.2.3.1"><xref derivedContent="A.1.3" format="counter" sectionFormat="of" target="section-a.1.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-deleting-dynamic-subscripti">Deleting Dynamic Subscriptions</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.11.2.2">
                <t keepWithNext="true" pn="section-toc.1-1.11.2.2.1"><xref derivedContent="A.2" format="counter" sectionFormat="of" target="section-a.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-subscription-state-notifica">Subscription State Notifications</xref></t>
                <ul bare="true" empty="true" indent="2" spacing="compact" pn="section-toc.1-1.11.2.2.2">
                  <li pn="section-toc.1-1.11.2.2.2.1">
                    <t keepWithNext="true" pn="section-toc.1-1.11.2.2.2.1.1"><xref derivedContent="A.2.1" format="counter" sectionFormat="of" target="section-a.2.1"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-subscription-modified">"subscription-modified"</xref></t>
                  </li>
                  <li pn="section-toc.1-1.11.2.2.2.2">
                    <t keepWithNext="true" pn="section-toc.1-1.11.2.2.2.2.1"><xref derivedContent="A.2.2" format="counter" sectionFormat="of" target="section-a.2.2"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-subscription-completed-subs">"subscription-completed", "subscription-resumed", and "replay-completed"</xref></t>
                  </li>
                  <li pn="section-toc.1-1.11.2.2.2.3">
                    <t keepWithNext="true" pn="section-toc.1-1.11.2.2.2.3.1"><xref derivedContent="A.2.3" format="counter" sectionFormat="of" target="section-a.2.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-subscription-terminated-and">"subscription-terminated" and "subscription-suspended"</xref></t>
                  </li>
                </ul>
              </li>
              <li pn="section-toc.1-1.11.2.3">
                <t keepWithNext="true" pn="section-toc.1-1.11.2.3.1"><xref derivedContent="A.3" format="counter" sectionFormat="of" target="section-a.3"/>.  <xref derivedContent="" format="title" sectionFormat="of" target="name-filter-example">Filter Example</xref></t>
              </li>
            </ul>
          </li>
          <li pn="section-toc.1-1.12">
            <t keepWithNext="true" pn="section-toc.1-1.12.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.b"/><xref derivedContent="" format="title" sectionFormat="of" target="name-acknowledgments">Acknowledgments</xref></t>
          </li>
          <li pn="section-toc.1-1.13">
            <t keepWithNext="true" pn="section-toc.1-1.13.1"><xref derivedContent="" format="none" sectionFormat="of" target="section-appendix.c"/><xref derivedContent="" format="title" sectionFormat="of" target="name-authors-addresses">Authors' Addresses</xref></t>
          </li>
        </ul>
      </section>
    </toc>
  </front>
  <middle>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-1">
      <name slugifiedName="name-introduction">Introduction</name>
      <t pn="section-1-1">Mechanisms to support event subscription and YANG-Push are defined in <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>. Enhancements to <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/> that enable YANG datastore subscription and YANG-Push are defined in <xref target="RFC8641" format="default" sectionFormat="of" derivedContent="RFC8641"/>. 
This document provides a transport specification for dynamic subscriptions over RESTCONF <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/>.  Requirements for these mechanisms are captured in <xref target="RFC7923" format="default" sectionFormat="of" derivedContent="RFC7923"/>.</t>
      <t pn="section-1-2">The streaming of notifications that encapsulate the resulting information push is done via the mechanism described in <xref target="RFC8040" sectionFormat="of" section="6.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8040#section-6.3" derivedContent="RFC8040"/>.  </t>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-2">
      <name slugifiedName="name-terminology">Terminology</name>
      <t pn="section-2-1">
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP 14 <xref target="RFC2119" format="default" sectionFormat="of" derivedContent="RFC2119"/> <xref target="RFC8174" format="default" sectionFormat="of" derivedContent="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
      </t>
      <t pn="section-2-2">The following terms use the definitions from <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>: dynamic subscription, event stream, notification message, publisher, receiver, subscriber, and subscription.</t>
      <t pn="section-2-3">Other terms reused include datastore, which is defined in <xref target="RFC8342" format="default" sectionFormat="of" derivedContent="RFC8342"/>, and HTTP/2 stream, which maps to the definition of "stream" within <xref target="RFC7540" sectionFormat="comma" section="2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7540#section-2" derivedContent="RFC7540"/>.</t>
    </section>
    <section anchor="dyn-subs" numbered="true" toc="include" removeInRFC="false" pn="section-3">
      <name slugifiedName="name-dynamic-subscriptions">Dynamic Subscriptions</name>
      <t pn="section-3-1">This section provides specifics on how to establish and maintain dynamic subscriptions over RESTCONF <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/>. Subscribing to event streams is accomplished in this way via RPCs defined within <xref target="RFC8639" sectionFormat="comma" section="2.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-2.4" derivedContent="RFC8639"/>. The RPCs are done via RESTCONF POSTs. YANG datastore subscription is accomplished via augmentations to <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/> as described within <xref target="RFC8641" sectionFormat="comma" section="4.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8641#section-4.4" derivedContent="RFC8641"/>.</t>
      <t pn="section-3-2">As described in <xref target="RFC8040" sectionFormat="of" section="6.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8040#section-6.3" derivedContent="RFC8040"/>, a GET needs to be performed on a
      specific URI on the publisher. Subscribers cannot predetermine the URI
      against which a subscription might exist on a publisher, as the URI will
      only exist after the "establish-subscription" RPC has been
      accepted. Therefore, the POST for the "establish-subscription" RPC
      replaces the GET request for the "location" leaf that is used in <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/> to obtain the URI. The subscription
      URI will be determined and sent as part of the response to the
      "establish-subscription" RPC, and a subsequent GET to this URI will be
      done in order to start the flow of notification messages back to the
      subscriber.  As specified in <xref target="RFC8639" sectionFormat="of" section="2.4.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-2.4.1" derivedContent="RFC8639"/>, a subscription does not move to the active state
      until the GET is received.</t>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.1">
        <name slugifiedName="name-transport-connectivity">Transport Connectivity</name>
        <t pn="section-3.1-1">For a dynamic subscription, when a RESTCONF session doesn't already exist, a new RESTCONF session is initiated from the subscriber.</t>
        <t pn="section-3.1-2">As stated in <xref target="RFC8040" sectionFormat="of" section="2.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8040#section-2.1" derivedContent="RFC8040"/>, a subscriber <bcp14>MUST</bcp14> establish the HTTP session over TLS <xref target="RFC8446" format="default" sectionFormat="of" derivedContent="RFC8446"/> in order to secure the content in transit.</t>
        <t pn="section-3.1-3">Without the involvement of additional protocols, HTTP sessions by
   themselves do not support quick recognition of the loss of the
   communication path to the publisher. Where quick recognition of the loss of a publisher is required, a subscriber <bcp14>SHOULD</bcp14> use a TLS heartbeat <xref target="RFC6520" format="default" sectionFormat="of" derivedContent="RFC6520"/>, just from subscriber to publisher, to track HTTP session continuity.</t>
        <t pn="section-3.1-4">Loss of the heartbeat <bcp14>MUST</bcp14> result in the teardown
of any subscription-related TCP sessions between those endpoints.  
A subscriber can then attempt to re-establish the dynamic subscription by using the procedure described in <xref target="SSE" format="default" sectionFormat="of" derivedContent="Section 3.4"/>.</t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.2">
        <name slugifiedName="name-discovery">Discovery</name>
        <t pn="section-3.2-1">Subscribers can learn which event streams a RESTCONF server supports by querying the "streams" container of ietf-subscribed-notifications.yang in <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>. Support for the "streams" container of ietf-restconf-monitoring.yang in <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/> is not required. In the case when the RESTCONF binding specified by this document is used to convey the "streams" container from ietf-restconf-monitoring.yang (i.e., that feature is supported), any event streams contained therein are also expected to be present in the "streams" container of ietf-restconf-monitoring.yang.</t>
        <t pn="section-3.2-2">Subscribers can learn which datastores a RESTCONF server supports by following <xref target="RFC8527" sectionFormat="of" section="2" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8527#section-2" derivedContent="RFC8527"/>. </t>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-3.3">
        <name slugifiedName="name-restconf-rpcs-and-http-stat">RESTCONF RPCs and HTTP Status Codes</name>
        <t pn="section-3.3-1">Specific HTTP response codes as defined in <xref target="RFC7231" sectionFormat="of" section="6" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7231#section-6" derivedContent="RFC7231"/> will indicate the result of RESTCONF RPC requests with the publisher.  An HTTP status code of 200 is the proper response to any successful RPC defined within <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/> or <xref target="RFC8641" format="default" sectionFormat="of" derivedContent="RFC8641"/>.</t>
        <t pn="section-3.3-2">If a publisher fails to serve the RPC request for one of the reasons indicated in <xref target="RFC8639" sectionFormat="of" section="2.4.6" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-2.4.6" derivedContent="RFC8639"/> or <xref target="RFC8641" sectionFormat="of" section="A" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8641#appendix-A" derivedContent="RFC8641"/>, this will be indicated by an appropriate error code, as shown below, transported in the HTTP response.</t>
        <t pn="section-3.3-3">When an HTTP error code is returned, the RPC reply <bcp14>MUST</bcp14> include 
an &lt;rpc-error&gt; element per <xref target="RFC8040" sectionFormat="of" section="7.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8040#section-7.1" derivedContent="RFC8040"/> 
with the following parameter values:
        </t>
        <ul spacing="normal" bare="false" empty="false" pn="section-3.3-4">
          <li pn="section-3.3-4.1">an "error-type" node of "application".</li>
          <li pn="section-3.3-4.2">an "error-tag" node whose value is a string that corresponds 
           to an identity associated with the error.  This "error-tag" will
           come from one of two places and will correspond to the error 
           identities either within 
           <xref target="RFC8639" sectionFormat="of" section="2.4.6" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-2.4.6" derivedContent="RFC8639"/> 
           for general subscription errors (<xref target="gen-sub-errors" format="default" sectionFormat="of" derivedContent="Table 1"/>) 
           or within <xref target="RFC8641" sectionFormat="of" section="A.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8641#appendix-A.1" derivedContent="RFC8641"/>
           for subscription errors specific to YANG datastores (<xref target="datastore-specific-errors" format="default" sectionFormat="of" derivedContent="Table 2"/>).</li>
          <li pn="section-3.3-4.3">an "error-app-tag" node whose value is a string that corresponds to an 
          identity associated with the error, as defined in 
           <xref target="RFC8639" sectionFormat="of" section="2.4.6" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-2.4.6" derivedContent="RFC8639"/> 
           for general subscriptions or 
           <xref target="RFC8641" sectionFormat="of" section="A.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8641#appendix-A.1" derivedContent="RFC8641"/> 
           for subscription errors specific to YANG datastores. The tag to use depends on the RPC for which the 
           error occurred.  Viable errors for different RPCs are found in <xref target="rpc-errors" format="default" sectionFormat="of" derivedContent="Table 3"/>.</li>
        </ul>
        <table anchor="gen-sub-errors" align="center" pn="table-1">
          <name slugifiedName="name-general-subscription-error-">General Subscription Error Identities and Associated "error-tag" Use</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Error identity</th>
              <th align="left" colspan="1" rowspan="1">Uses "error-tag"</th>
              <th align="left" colspan="1" rowspan="1">HTTP code</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">dscp-unavailable</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">encoding-unsupported</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">filter-unsupported</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">insufficient-resources</td>
              <td align="left" colspan="1" rowspan="1">resource-denied</td>
              <td align="left" colspan="1" rowspan="1">409</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">no-such-subscription</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">404</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">replay-unsupported</td>
              <td align="left" colspan="1" rowspan="1">operation-not-supported</td>
              <td align="left" colspan="1" rowspan="1">501</td>
            </tr>
          </tbody>
        </table>
        <table anchor="datastore-specific-errors" align="center" pn="table-2">
          <name slugifiedName="name-datastore-specific-error-id">Datastore-Specific Error Identities and Associated "error-tag" Use</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Error identity</th>
              <th align="left" colspan="1" rowspan="1">Uses "error-tag"</th>
              <th align="left" colspan="1" rowspan="1">HTTP code</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">cant-include</td>
              <td align="left" colspan="1" rowspan="1">operation-not-supported</td>
              <td align="left" colspan="1" rowspan="1">501</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">datastore-not-subscribable</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">no-such-subscription-resync</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">404</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">on-change-unsupported</td>
              <td align="left" colspan="1" rowspan="1">operation-not-supported</td>
              <td align="left" colspan="1" rowspan="1">501</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">on-change-sync-unsupported</td>
              <td align="left" colspan="1" rowspan="1">operation-not-supported</td>
              <td align="left" colspan="1" rowspan="1">501</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">period-unsupported</td>
              <td align="left" colspan="1" rowspan="1">invalid-value</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">update-too-big</td>
              <td align="left" colspan="1" rowspan="1">too-big</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">sync-too-big</td>
              <td align="left" colspan="1" rowspan="1">too-big</td>
              <td align="left" colspan="1" rowspan="1">400</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">unchanging-selection</td>
              <td align="left" colspan="1" rowspan="1">operation-failed</td>
              <td align="left" colspan="1" rowspan="1">500</td>
            </tr>
          </tbody>
        </table>
        <table anchor="rpc-errors" align="center" pn="table-3">
          <name slugifiedName="name-rpc-errors-and-associated-e">RPC Errors and Associated Error Identities</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">RPC</th>
              <th align="left" colspan="1" rowspan="1">Select an identity with a base</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">establish-subscription</td>
              <td align="left" colspan="1" rowspan="1">establish-subscription-error</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">modify-subscription</td>
              <td align="left" colspan="1" rowspan="1">modify-subscription-error</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">delete-subscription</td>
              <td align="left" colspan="1" rowspan="1">delete-subscription-error</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">kill-subscription</td>
              <td align="left" colspan="1" rowspan="1">delete-subscription-error</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">resync-subscription</td>
              <td align="left" colspan="1" rowspan="1">resync-subscription-error</td>
            </tr>
          </tbody>
        </table>
        <t pn="section-3.3-8">Each error identity will be inserted as the "error-app-tag" using JSON encoding following the form &lt;modulename&gt;:&lt;identityname&gt;.  An example of such a valid encoding would be "ietf-subscribed-notifications:no-such-subscription".</t>
        <t pn="section-3.3-9">In the case of error responses to an "establish-subscription" or
	"modify-subscription" request, there is the option to include an
	"error-info" node.  This node may contain hints for parameter settings
	that might lead to successful RPC requests in the future. Tables <xref target="error-info-estab-sub" format="counter" sectionFormat="of" derivedContent="4"/> and <xref target="error-info-mod-sub" format="counter" sectionFormat="of" derivedContent="5"/> show the yang-data structures that may be returned.</t>
        <table anchor="error-info-estab-sub" align="center" pn="table-4">
          <name slugifiedName="name-optional-error-info-node-hi">Optional "error-info" Node Hints for an "establish-subscription" Request</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Target:</th>
              <th align="left" colspan="1" rowspan="1">Return hints in yang-data structure</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">event stream</td>
              <td align="left" colspan="1" rowspan="1">establish-subscription-stream-error-info</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">datastore</td>
              <td align="left" colspan="1" rowspan="1">establish-subscription-datastore-error-info</td>
            </tr>
          </tbody>
        </table>
        <table anchor="error-info-mod-sub" align="center" pn="table-5">
          <name slugifiedName="name-optional-error-info-node-hin">Optional "error-info" Node Hints for an "modify-subscription" Request</name>
          <thead>
            <tr>
              <th align="left" colspan="1" rowspan="1">Target:</th>
              <th align="left" colspan="1" rowspan="1">Returns hints in yang-data structure</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left" colspan="1" rowspan="1">event stream</td>
              <td align="left" colspan="1" rowspan="1">modify-subscription-stream-error-info</td>
            </tr>
            <tr>
              <td align="left" colspan="1" rowspan="1">datastore</td>
              <td align="left" colspan="1" rowspan="1">modify-subscription-datastore-error-info</td>
            </tr>
          </tbody>
        </table>
        <t pn="section-3.3-12">The yang-data included within "error-info" <bcp14>SHOULD NOT</bcp14> include the
      optional leaf "reason", as such a leaf would be redundant
      with information that is already placed within the
      "error-app-tag".
</t>
        <t pn="section-3.3-13">In case of an &lt;rpc-error&gt; as a result of a "delete-subscription", a
      "kill-subscription", or a "resync-subscription" request, no
      "error-info" needs to be included, as the "subscription-id" is
      the only RPC input parameter, and no hints regarding this RPC input
      parameters need to be provided.
</t>
        <t pn="section-3.3-14">Note that "error-path" <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/> does not need to be included with the &lt;rpc-error&gt; element, as subscription errors are generally associated with the choice of RPC input parameters. </t>
      </section>
      <section anchor="SSE" numbered="true" toc="include" removeInRFC="false" pn="section-3.4">
        <name slugifiedName="name-call-flow-for-server-sent-e">Call Flow for Server-Sent Events</name>
        <t pn="section-3.4-1">The call flow for Server-Sent Events (SSE) is defined in <xref target="dyn-sse" format="default" sectionFormat="of" derivedContent="Figure 1"/>.  The logical connections denoted
	by (a) and (b) can be a TCP connection or an HTTP/2 stream (if HTTP/2
	is used, multiple HTTP/2 streams can be carried in one TCP
	connection). Requests to RPCs as defined in <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/> or <xref target="RFC8641" format="default" sectionFormat="of" derivedContent="RFC8641"/> are
	sent on a connection indicated by (a).  A successful
	"establish-subscription" will result in an RPC response returned with
	both a subscription identifier that uniquely identifies a
	subscription, as well as a URI that uniquely identifies the location
	of subscription on the publisher (b). This URI is defined via the
	"uri" leaf in the data model in <xref target="YANG-module" format="default" sectionFormat="of" derivedContent="Section 7"/>. </t>
        <t pn="section-3.4-2">An HTTP GET is then sent on a separate logical connection (b) to the URI on the publisher.  This signals the publisher to initiate the flow of notification messages that are sent in SSE <xref target="W3C-20150203" format="default" sectionFormat="of" derivedContent="W3C-20150203"/> as a response to the GET. There cannot be two or more simultaneous GET requests on a subscription URI: any GET request received while there is a current GET request on the same URI <bcp14>MUST</bcp14> be rejected with HTTP error code 409.</t>
        <t pn="section-3.4-3">As described in <xref target="RFC8040" sectionFormat="of" section="6.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8040#section-6.4" derivedContent="RFC8040"/>, RESTCONF servers <bcp14>SHOULD NOT</bcp14> send the "event" or "id" fields in the SSE event notifications.</t>
        <figure anchor="dyn-sse" align="left" suppress-title="false" pn="figure-1">
          <name slugifiedName="name-dynamic-subscriptions-with-">Dynamic Subscriptions with Server-Sent Events</name>
          <artwork name="" type="" align="left" alt="" pn="section-3.4-4.1">
+--------------+                             +--------------+
|  Subscriber  |                             |   Publisher  |
|              |                             |              |
|    Logical   |                             |     Logical  |
|  Connection  |                             |   Connection |
|  (a)  (b)    |                             |    (a)  (b)  |
+--------------+                             +--------------+
    | RESTCONF POST (RPC:establish-subscription)   |
    |---------------------------------------------&gt;|
    |                          HTTP 200 OK (ID,URI)|
    |&lt;---------------------------------------------|
    |    |HTTP GET (URI)                                |
    |    |---------------------------------------------&gt;|
    |    |                                   HTTP 200 OK|
    |    |&lt;---------------------------------------------|
    |    |                           SSE (notif-message)|
    |    |&lt;---------------------------------------------|
    | RESTCONF POST (RPC:modify-subscription)      |    |
    |---------------------------------------------&gt;|    |
    |    |                              HTTP 200 OK|    |
    |&lt;---------------------------------------------|    |
    |    |                   SSE (subscription-modified)|
    |    |&lt;------------------------------------------(c)|
    |    |                           SSE (notif-message)|
    |    |&lt;---------------------------------------------|
    | RESTCONF POST (RPC:delete-subscription)      |    |
    |---------------------------------------------&gt;|    |
    |    |                              HTTP 200 OK|    |
    |&lt;---------------------------------------------|    |
    |    |                                         |    |
    |    |                                         |    |
    (a) (b)                                       (a)  (b) </artwork>
        </figure>
        <t pn="section-3.4-5">Additional requirements for dynamic subscriptions over SSE include:</t>
        <ul spacing="normal" bare="false" empty="false" pn="section-3.4-6">
          <li pn="section-3.4-6.1">
   A publisher <bcp14>MUST</bcp14> return all subscription state notifications
   in a separate SSE message used by the subscription to 
   which the state change refers.
          </li>
          <li pn="section-3.4-6.2">Subscription RPCs <bcp14>MUST NOT</bcp14> use the connection currently providing notification messages for that subscription.</li>
          <li pn="section-3.4-6.3">In addition to an RPC response for a "modify-subscription" RPC traveling over (a), a "subscription-modified" state change notification <bcp14>MUST</bcp14> be sent within (b).  This allows the receiver to know exactly when, within the stream of events, the new terms of the subscription have been applied to the notification messages.  See arrow (c).</li>
          <li pn="section-3.4-6.4">In addition to any required access permissions (e.g., Network Configuration Access Control Model (NACM)), the RPCs "modify-subscription", "resync-subscription", and
"delete-subscription" <bcp14>SHOULD</bcp14> only be allowed by the same RESTCONF username <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/> that invoked "establish-subscription". Such a restriction generally serves to preserve users' privacy, but exceptions might be made for administrators that may need to modify or delete other users' subscriptions.</li>
          <li pn="section-3.4-6.5">The "kill-subscription" RPC can be invoked by any RESTCONF username with the required administrative permissions.</li>
        </ul>
        <t pn="section-3.4-7">A publisher <bcp14>MUST</bcp14> terminate a subscription in the following cases:</t>
        <ul spacing="normal" bare="false" empty="false" pn="section-3.4-8">
          <li pn="section-3.4-8.1">Receipt of a "delete-subscription" or a "kill-subscription" RPC for that subscription</li>
          <li pn="section-3.4-8.2">Loss of TLS heartbeat</li>
        </ul>
        <t pn="section-3.4-9">A publisher <bcp14>MAY</bcp14> terminate a subscription at any time as stated in <xref target="RFC8639" sectionFormat="of" section="1.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-1.3" derivedContent="RFC8639"/>.</t>
      </section>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-4">
      <name slugifiedName="name-qos-treatment">QoS Treatment</name>
      <t pn="section-4-1">Qos treatment for event streams is described in <xref target="RFC8639" sectionFormat="of" section="2.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8639#section-2.3" derivedContent="RFC8639"/>. In addition, if HTTP/2 is used, the publisher <bcp14>MUST</bcp14>:</t>
      <ul spacing="normal" bare="false" empty="false" pn="section-4-2">
        <li pn="section-4-2.1">Take the "weighting" leaf node in <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/> and copy it into the HTTP/2 stream weight, <xref target="RFC7540" sectionFormat="of" section="5.3" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7540#section-5.3" derivedContent="RFC7540"/>, and </li>
        <li pn="section-4-2.2">Take any existing subscription "dependency", as specified by the
	"dependency" leaf node in <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>,
	and use the HTTP/2 stream for the parent subscription as the HTTP/2
	stream dependency (as described in <xref target="RFC7540" sectionFormat="of" section="5.3.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7540#section-5.3.1" derivedContent="RFC7540"/>) of the dependent
	subscription.</li>
        <li pn="section-4-2.3">Set the exclusive flag (<xref target="RFC7540" sectionFormat="of" section="5.3.1" format="default" derivedLink="https://rfc-editor.org/rfc/rfc7540#section-5.3.1" derivedContent="RFC7540"/>) to 0.</li>
      </ul>
      <t pn="section-4-3">For dynamic subscriptions with the same Differentiated Services Code Point (DSCP) value to a specific publisher, it is recommended that the subscriber sends all URI GET requests on a common HTTP/2 session (if HTTP/2 is used). Conversely, a subscriber cannot use a common HTTP/2 session for subscriptions with different DSCP values.</t>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-5">
      <name slugifiedName="name-notification-messages">Notification Messages</name>
      <t pn="section-5-1">Notification messages transported over RESTCONF will be encoded according to <xref target="RFC8040" sectionFormat="comma" section="6.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc8040#section-6.4" derivedContent="RFC8040"/>.</t>
    </section>
    <section anchor="YANG-tree" numbered="true" toc="include" removeInRFC="false" pn="section-6">
      <name slugifiedName="name-yang-tree">YANG Tree</name>
      <t pn="section-6-1"> The YANG module defined in <xref target="YANG-module" format="default" sectionFormat="of" derivedContent="Section 7"/> has one leaf that augments three nodes of <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>.</t>
      <sourcecode name="" type="yangtree" markers="false" pn="section-6-2">
module: ietf-restconf-subscribed-notifications
  augment /sn:establish-subscription/sn:output:
    +--ro uri?   inet:uri
  augment /sn:subscriptions/sn:subscription:
    +--ro uri?   inet:uri
  augment /sn:subscription-modified:
    +--ro uri?   inet:uri </sourcecode>
    </section>
    <section anchor="YANG-module" numbered="true" toc="include" removeInRFC="false" pn="section-7">
      <name slugifiedName="name-yang-module">YANG Module</name>
      <t pn="section-7-1">This module references <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>.</t>
      <sourcecode name="ietf-restconf-subscribed-notifications@2019-11-17.yang" type="yang" markers="true" pn="section-7-2">
module ietf-restconf-subscribed-notifications {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:"
          + "ietf-restconf-subscribed-notifications";
  prefix rsn;

  import ietf-subscribed-notifications {
    prefix sn;
  }
  import ietf-inet-types {
    prefix inet;
  }

  organization
    "IETF NETCONF (Network Configuration) Working Group";
  contact
    "WG Web:   &lt;https://datatracker.ietf.org/wg/netconf/&gt;
     WG List:  &lt;mailto:netconf@ietf.org&gt;

     Editor:   Eric Voit
               &lt;mailto:evoit@cisco.com&gt;

     Editor:   Alexander Clemm
               &lt;mailto:ludwig@clemm.org&gt;

     Editor:   Reshad Rahman
               &lt;mailto:rrahman@cisco.com&gt;";
  description
    "Defines RESTCONF as a supported transport for subscribed
     event notifications.

     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
     (https://trustee.ietf.org/license-info). 

     This version of this YANG module is part of RFC 8650; see the
     RFC itself for full legal notices.";

  revision 2019-11-17 {
    description
      "Initial version";
    reference
      "RFC 8650: Dynamic Subscription to YANG Events and Datastores
       over RESTCONF";
  }

  grouping uri {
    description
      "Provides a reusable description of a URI.";
    leaf uri {
      type inet:uri;
      config false;
      description
        "Location of a subscription-specific URI on the publisher.";
    }
  }

  augment "/sn:establish-subscription/sn:output" {
    description
      "This augmentation allows RESTCONF-specific parameters for a
       response to a publisher's subscription request.";
    uses uri;
  }

  augment "/sn:subscriptions/sn:subscription" {
    description
      "This augmentation allows RESTCONF-specific parameters to be
       exposed for a subscription.";
    uses uri;
  }

  augment "/sn:subscription-modified" {
    description
      "This augmentation allows RESTCONF-specific parameters to be
       included as part of the notification that a subscription has
       been modified.";
    uses uri;
  }
}
</sourcecode>
    </section>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-8">
      <name slugifiedName="name-iana-considerations">IANA Considerations</name>
      <t pn="section-8-1">
      This document registers the following namespace URI in the "ns"
      subregistry of the "IETF XML Registry" <xref target="RFC3688" format="default" sectionFormat="of" derivedContent="RFC3688"/>:
      </t>
      <dl newline="false" spacing="normal" pn="section-8-2">
        <dt pn="section-8-2.1">URI:</dt>
        <dd pn="section-8-2.2">urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-notifications</dd>
        <dt pn="section-8-2.3">Registrant Contact:</dt>
        <dd pn="section-8-2.4">The IESG.</dd>
        <dt pn="section-8-2.5">XML:</dt>
        <dd pn="section-8-2.6">N/A; the requested URI is an XML namespace.</dd>
      </dl>
      <t pn="section-8-3">
      This document registers the following YANG module in the "YANG Module
      Names" registry <xref target="RFC6020" format="default" sectionFormat="of" derivedContent="RFC6020"/>:
      </t>
      <dl newline="false" spacing="normal" pn="section-8-4">
        <dt pn="section-8-4.1">Name:</dt>
        <dd pn="section-8-4.2">ietf-restconf-subscribed-notifications</dd>
        <dt pn="section-8-4.3">Namespace:</dt>
        <dd pn="section-8-4.4">urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-notifications</dd>
        <dt pn="section-8-4.5">Prefix:</dt>
        <dd pn="section-8-4.6">rsn</dd>
        <dt pn="section-8-4.7">Reference:</dt>
        <dd pn="section-8-4.8">RFC 8650</dd>
      </dl>
    </section>
    <section anchor="security" numbered="true" toc="include" removeInRFC="false" pn="section-9">
      <name slugifiedName="name-security-considerations">Security Considerations</name>
      <t pn="section-9-1">The YANG module specified in this document defines a schema for data that is designed to be accessed via network management transports such as NETCONF <xref target="RFC6241" format="default" sectionFormat="of" derivedContent="RFC6241"/> or RESTCONF <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/>.  The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) <xref target="RFC6242" format="default" sectionFormat="of" derivedContent="RFC6242"/>.  The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS <xref target="RFC8446" format="default" sectionFormat="of" derivedContent="RFC8446"/>.</t>
      <t pn="section-9-2">The Network Configuration Access Control Model (NACM) <xref target="RFC8341" format="default" sectionFormat="of" derivedContent="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 pn="section-9-3">The one new data node introduced in this YANG module may be considered sensitive or vulnerable in some network environments.  It is thus important to control read access (e.g., via get, get-config, or notification) to this data node.  These are the subtrees and data nodes and their sensitivity/vulnerability:</t>
      <t pn="section-9-4">Container: "/subscriptions"</t>
      <ul spacing="normal" bare="false" empty="false" pn="section-9-5">
        <li pn="section-9-5.1">"uri": leaf will show where subscribed resources might be located on a publisher.  Access control must be set so that only someone with proper access permissions, i.e., the same RESTCONF <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/> user credentials that invoked the corresponding "establish-subscription", has the ability to access this resource.</li>
      </ul>
      <t pn="section-9-6">The subscription URI is implementation specific and is encrypted via the use of TLS. Therefore, even if an attacker succeeds in guessing the subscription URI, a RESTCONF username <xref target="RFC8040" format="default" sectionFormat="of" derivedContent="RFC8040"/> with the required administrative permissions must be used to be able to access or modify that subscription. It is recommended that the subscription URI values not be easily predictable.</t>
      <t pn="section-9-7">The access permission considerations for the RPCs "modify-subscription", "resync-subscription", "delete-subscription", and "kill-subscription" are described in <xref target="SSE" format="default" sectionFormat="of" derivedContent="Section 3.4"/>.</t>
      <t pn="section-9-8">If a buggy or compromised RESTCONF subscriber sends a number of "establish-subscription" requests, then these subscriptions accumulate and may
    use up system resources.  In such a situation, the publisher <bcp14>MAY</bcp14> also suspend or terminate a subset of the active
    subscriptions from that RESTCONF subscriber in order to reclaim resources and preserve normal operation for the other subscriptions.    
</t>
    </section>
  </middle>
  <back>
    <references pn="section-10">
      <name slugifiedName="name-references">References</name>
      <references pn="section-10.1">
        <name slugifiedName="name-normative-references">Normative References</name>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119" quoteTitle="true" derivedAnchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author initials="S." surname="Bradner" fullname="S. Bradner">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="1997" month="March"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC3688" target="https://www.rfc-editor.org/info/rfc3688" quoteTitle="true" derivedAnchor="RFC3688">
          <front>
            <title>The IETF XML Registry</title>
            <author initials="M." surname="Mealling" fullname="M. Mealling">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2004" month="January"/>
            <abstract>
              <t>This document describes an IANA maintained registry for IETF standards which use Extensible Markup Language (XML) related items such as Namespaces, Document Type Declarations (DTDs), Schemas, and Resource Description Framework (RDF) Schemas.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="81"/>
          <seriesInfo name="RFC" value="3688"/>
          <seriesInfo name="DOI" value="10.17487/RFC3688"/>
        </reference>
        <reference anchor="RFC6020" target="https://www.rfc-editor.org/info/rfc6020" quoteTitle="true" derivedAnchor="RFC6020">
          <front>
            <title>YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2010" month="October"/>
            <abstract>
              <t>YANG is a data modeling language used to model configuration and state data manipulated by the Network Configuration Protocol (NETCONF), NETCONF remote procedure calls, and NETCONF notifications. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6020"/>
          <seriesInfo name="DOI" value="10.17487/RFC6020"/>
        </reference>
        <reference anchor="RFC6241" target="https://www.rfc-editor.org/info/rfc6241" quoteTitle="true" derivedAnchor="RFC6241">
          <front>
            <title>Network Configuration Protocol (NETCONF)</title>
            <author initials="R." surname="Enns" fullname="R. Enns" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Bierman" fullname="A. Bierman" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2011" month="June"/>
            <abstract>
              <t>The Network Configuration Protocol (NETCONF) defined in this document provides mechanisms to install, manipulate, and delete the configuration of network devices.  It uses an Extensible Markup Language (XML)-based data encoding for the configuration data as well as the protocol messages.  The NETCONF protocol operations are realized as remote procedure calls (RPCs).  This document obsoletes RFC 4741.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6241"/>
          <seriesInfo name="DOI" value="10.17487/RFC6241"/>
        </reference>
        <reference anchor="RFC6242" target="https://www.rfc-editor.org/info/rfc6242" quoteTitle="true" derivedAnchor="RFC6242">
          <front>
            <title>Using the NETCONF Protocol over Secure Shell (SSH)</title>
            <author initials="M." surname="Wasserman" fullname="M. Wasserman">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2011" month="June"/>
            <abstract>
              <t>This document describes a method for invoking and running the Network Configuration Protocol (NETCONF) within a Secure Shell (SSH) session as an SSH subsystem.  This document obsoletes RFC 4742.  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6242"/>
          <seriesInfo name="DOI" value="10.17487/RFC6242"/>
        </reference>
        <reference anchor="RFC6520" target="https://www.rfc-editor.org/info/rfc6520" quoteTitle="true" derivedAnchor="RFC6520">
          <front>
            <title>Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) Heartbeat Extension</title>
            <author initials="R." surname="Seggelmann" fullname="R. Seggelmann">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Tuexen" fullname="M. Tuexen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Williams" fullname="M. Williams">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2012" month="February"/>
            <abstract>
              <t>This document describes the Heartbeat Extension for the Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS) protocols.</t>
              <t>The Heartbeat Extension provides a new protocol for TLS/DTLS allowing the usage of keep-alive functionality without performing a renegotiation and a basis for path MTU (PMTU) discovery for DTLS.   [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6520"/>
          <seriesInfo name="DOI" value="10.17487/RFC6520"/>
        </reference>
        <reference anchor="RFC7540" target="https://www.rfc-editor.org/info/rfc7540" quoteTitle="true" derivedAnchor="RFC7540">
          <front>
            <title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
            <author initials="M." surname="Belshe" fullname="M. Belshe">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Peon" fullname="R. Peon">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Thomson" fullname="M. Thomson" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2015" month="May"/>
            <abstract>
              <t>This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2).  HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection.  It also introduces unsolicited push of representations from servers to clients.</t>
              <t>This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax.  HTTP's existing semantics remain unchanged.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7540"/>
          <seriesInfo name="DOI" value="10.17487/RFC7540"/>
        </reference>
        <reference anchor="RFC8040" target="https://www.rfc-editor.org/info/rfc8040" quoteTitle="true" derivedAnchor="RFC8040">
          <front>
            <title>RESTCONF Protocol</title>
            <author initials="A." surname="Bierman" fullname="A. Bierman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="January"/>
            <abstract>
              <t>This document describes an HTTP-based protocol that provides a programmatic interface for accessing data defined in YANG, using the datastore concepts defined in the Network Configuration Protocol (NETCONF).</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8040"/>
          <seriesInfo name="DOI" value="10.17487/RFC8040"/>
        </reference>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174" quoteTitle="true" derivedAnchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author initials="B." surname="Leiba" fullname="B. Leiba">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2017" month="May"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol  specifications.  This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the  defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC8341" target="https://www.rfc-editor.org/info/rfc8341" quoteTitle="true" derivedAnchor="RFC8341">
          <front>
            <title>Network Configuration Access Control Model</title>
            <author initials="A." surname="Bierman" fullname="A. Bierman">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="March"/>
            <abstract>
              <t>The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or the RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability.  There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.  This document defines such an access control model.</t>
              <t>This document obsoletes RFC 6536.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="91"/>
          <seriesInfo name="RFC" value="8341"/>
          <seriesInfo name="DOI" value="10.17487/RFC8341"/>
        </reference>
        <reference anchor="RFC8342" target="https://www.rfc-editor.org/info/rfc8342" quoteTitle="true" derivedAnchor="RFC8342">
          <front>
            <title>Network Management Datastore Architecture (NMDA)</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Shafer" fullname="P. Shafer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Wilton" fullname="R. Wilton">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="March"/>
            <abstract>
              <t>Datastores are a fundamental concept binding the data models written in the YANG data modeling language to network management protocols such as the Network Configuration Protocol (NETCONF) and RESTCONF. This document defines an architectural framework for datastores based on the experience gained with the initial simpler model, addressing requirements that were not well supported in the initial model.  This document updates RFC 7950.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8342"/>
          <seriesInfo name="DOI" value="10.17487/RFC8342"/>
        </reference>
        <reference anchor="RFC8446" target="https://www.rfc-editor.org/info/rfc8446" quoteTitle="true" derivedAnchor="RFC8446">
          <front>
            <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
            <author initials="E." surname="Rescorla" fullname="E. Rescorla">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="August"/>
            <abstract>
              <t>This document specifies version 1.3 of the Transport Layer Security (TLS) protocol.  TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t>
              <t>This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961.  This document also specifies new requirements for TLS 1.2 implementations.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8446"/>
          <seriesInfo name="DOI" value="10.17487/RFC8446"/>
        </reference>
        <reference anchor="RFC8639" target="https://www.rfc-editor.org/info/rfc8639" quoteTitle="true" derivedAnchor="RFC8639">
          <front>
            <title>Subscription to YANG Notifications</title>
            <author initials="E." surname="Voit" fullname="E. Voit">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Clemm" fullname="A. Clemm">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Gonzalez Prieto" fullname="A. Gonzalez Prieto">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="E." surname="Nilsen-Nygaard" fullname="E. Nilsen-Nygaard">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Tripathy" fullname="A. Tripathy">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="September"/>
            <abstract>
              <t>This document defines a YANG data model and associated mechanisms enabling subscriber-specific subscriptions to a publisher's event streams.  Applying these elements allows a subscriber to request and receive a continuous, customized feed of publisher-generated information.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8639"/>
          <seriesInfo name="DOI" value="10.17487/RFC8639"/>
        </reference>
        <reference anchor="RFC8641" target="https://www.rfc-editor.org/info/rfc8641" quoteTitle="true" derivedAnchor="RFC8641">
          <front>
            <title>Subscription to YANG Notifications for Datastore Updates</title>
            <author initials="A." surname="Clemm" fullname="A. Clemm">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="E." surname="Voit" fullname="E. Voit">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="September"/>
            <abstract>
              <t>This document describes a mechanism that allows subscriber applications to request a continuous and customized stream of updates from a YANG datastore.  Providing such visibility into updates enables new capabilities based on the remote mirroring and monitoring of configuration and operational state.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8641"/>
          <seriesInfo name="DOI" value="10.17487/RFC8641"/>
        </reference>
        <reference anchor="W3C-20150203" target="https://www.w3.org/TR/2015/REC-eventsource-20150203/" quoteTitle="true" derivedAnchor="W3C-20150203">
          <front>
            <title>Server-Sent Events</title>
            <author fullname="I Hickson" initials="I" surname="Hickson">
              <organization showOnFrontPage="true"/>
            </author>
            <date day="03" month="February" year="2015"/>
          </front>
          <seriesInfo name="W3C" value="Recommendation"/>
          <annotation>Latest version available at &lt;<eref target="https://www.w3.org/TR/eventsource/"/>&gt;.</annotation>
        </reference>
      </references>
      <references pn="section-10.2">
        <name slugifiedName="name-informative-references">Informative References</name>
        <reference anchor="RFC7231" target="https://www.rfc-editor.org/info/rfc7231" quoteTitle="true" derivedAnchor="RFC7231">
          <front>
            <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
            <author initials="R." surname="Fielding" fullname="R. Fielding" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Reschke" fullname="J. Reschke" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2014" month="June"/>
            <abstract>
              <t>The Hypertext Transfer Protocol (HTTP) is a stateless \%application- level protocol for distributed, collaborative, hypertext information systems.  This document defines the semantics of HTTP/1.1 messages, as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7231"/>
          <seriesInfo name="DOI" value="10.17487/RFC7231"/>
        </reference>
        <reference anchor="RFC7923" target="https://www.rfc-editor.org/info/rfc7923" quoteTitle="true" derivedAnchor="RFC7923">
          <front>
            <title>Requirements for Subscription to YANG Datastores</title>
            <author initials="E." surname="Voit" fullname="E. Voit">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Clemm" fullname="A. Clemm">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Gonzalez Prieto" fullname="A. Gonzalez Prieto">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2016" month="June"/>
            <abstract>
              <t>This document provides requirements for a service that allows client applications to subscribe to updates of a YANG datastore.  Based on criteria negotiated as part of a subscription, updates will be pushed to targeted recipients.  Such a capability eliminates the need for periodic polling of YANG datastores by applications and fills a functional gap in existing YANG transports (i.e., Network Configuration Protocol (NETCONF) and RESTCONF).  Such a service can be summarized as a "pub/sub" service for YANG datastore updates. Beyond a set of basic requirements for the service, various refinements are addressed.  These refinements include: periodicity of object updates, filtering out of objects underneath a requested a subtree, and delivery QoS guarantees.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7923"/>
          <seriesInfo name="DOI" value="10.17487/RFC7923"/>
        </reference>
        <reference anchor="RFC7951" target="https://www.rfc-editor.org/info/rfc7951" quoteTitle="true" derivedAnchor="RFC7951">
          <front>
            <title>JSON Encoding of Data Modeled with YANG</title>
            <author initials="L." surname="Lhotka" fullname="L. Lhotka">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2016" month="August"/>
            <abstract>
              <t>This document defines encoding rules for representing configuration data, state data, parameters of Remote Procedure Call (RPC) operations or actions, and notifications defined using YANG as JavaScript Object Notation (JSON) text.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7951"/>
          <seriesInfo name="DOI" value="10.17487/RFC7951"/>
        </reference>
        <reference anchor="RFC8347" target="https://www.rfc-editor.org/info/rfc8347" quoteTitle="true" derivedAnchor="RFC8347">
          <front>
            <title>A YANG Data Model for the Virtual Router Redundancy Protocol (VRRP)</title>
            <author initials="X." surname="Liu" fullname="X. Liu" role="editor">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Kyparlis" fullname="A. Kyparlis">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Parikh" fullname="R. Parikh">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Lindem" fullname="A. Lindem">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="M." surname="Zhang" fullname="M. Zhang">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2018" month="March"/>
            <abstract>
              <t>This document describes a data model for the Virtual Router Redundancy Protocol (VRRP).  Both versions 2 and 3 of VRRP are covered.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8347"/>
          <seriesInfo name="DOI" value="10.17487/RFC8347"/>
        </reference>
        <reference anchor="RFC8527" target="https://www.rfc-editor.org/info/rfc8527" quoteTitle="true" derivedAnchor="RFC8527">
          <front>
            <title>RESTCONF Extensions to Support the Network Management Datastore Architecture</title>
            <author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="J." surname="Schoenwaelder" fullname="J. Schoenwaelder">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="P." surname="Shafer" fullname="P. Shafer">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="K." surname="Watsen" fullname="K. Watsen">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="R." surname="Wilton" fullname="R. Wilton">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="March"/>
            <abstract>
              <t>This document extends the RESTCONF protocol defined in RFC 8040 in order to support the Network Management Datastore Architecture (NMDA) defined in RFC 8342.</t>
              <t>This document updates RFC 8040 by introducing new datastore resources, adding a new query parameter, and requiring the usage of the YANG library (described in RFC 8525) by RESTCONF servers implementing the NMDA.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8527"/>
          <seriesInfo name="DOI" value="10.17487/RFC8527"/>
        </reference>
        <reference anchor="RFC8640" target="https://www.rfc-editor.org/info/rfc8640" quoteTitle="true" derivedAnchor="RFC8640">
          <front>
            <title>Dynamic Subscription to YANG Events and Datastores over NETCONF</title>
            <author initials="E." surname="Voit" fullname="E. Voit">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Clemm" fullname="A. Clemm">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Gonzalez Prieto" fullname="A. Gonzalez Prieto">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="E." surname="Nilsen-Nygaard" fullname="E. Nilsen-Nygaard">
              <organization showOnFrontPage="true"/>
            </author>
            <author initials="A." surname="Tripathy" fullname="A. Tripathy">
              <organization showOnFrontPage="true"/>
            </author>
            <date year="2019" month="September"/>
            <abstract>
              <t>This document provides a Network Configuration Protocol (NETCONF) binding to the dynamic subscription capability of both subscribed notifications and YANG-Push.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8640"/>
          <seriesInfo name="DOI" value="10.17487/RFC8640"/>
        </reference>
        <reference anchor="XPATH" target="http://www.w3.org/TR/1999/REC-xpath-19991116" quoteTitle="true" derivedAnchor="XPATH">
          <front>
            <title>XML Path Language (XPath) Version 1.0</title>
            <author fullname="J Clark" initials="J" surname="Clark"/>
            <author fullname="S DeRose" initials="S" surname="DeRose"/>
            <date day="16" month="November" year="1999"/>
          </front>
          <seriesInfo name="W3C" value="Recommendation"/>
          <annotation>Latest version available at &lt;<eref target="https://www.w3.org/TR/xpath/"/>&gt;.</annotation>
        </reference>
      </references>
    </references>
    <section numbered="true" toc="include" removeInRFC="false" pn="section-appendix.a">
      <name slugifiedName="name-examples">Examples</name>
      <t pn="section-appendix.a-1">This section is non-normative.  To allow easy comparison, this section mirrors the functional examples shown with NETCONF over XML within <xref target="RFC8640" format="default" sectionFormat="of" derivedContent="RFC8640"/>.  In addition, HTTP/2 vs HTTP/1.1 headers are not shown as the contents of the JSON encoded objects are identical within.</t>
      <t pn="section-appendix.a-2">The subscription URI values used in the examples in this section are purely illustrative, and are not indicative of the expected usage that is described in <xref target="security" format="default" sectionFormat="of" derivedContent="Section 9"/>.</t>
      <t pn="section-appendix.a-3">The DSCP values are only for example purposes and are all indicated in decimal since the encoding is JSON <xref target="RFC7951" format="default" sectionFormat="of" derivedContent="RFC7951"/>.</t>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-a.1">
        <name slugifiedName="name-dynamic-subscriptions-2">Dynamic Subscriptions</name>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-a.1.1">
          <name slugifiedName="name-establishing-dynamic-subscr">Establishing Dynamic Subscriptions</name>
          <t pn="section-a.1.1-1">The following figure shows two successful
	  "establish-subscription" RPC requests as per <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>.  The first request is given a subscription
	  identifier of 22, and the second, an identifier of 23.</t>
          <figure anchor="mess-flow-establishment" align="left" suppress-title="false" pn="figure-2">
            <name slugifiedName="name-multiple-subscriptions-over">Multiple Subscriptions over RESTCONF/HTTP</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.1-2.1">
   +------------+                  +-----------+
   | Subscriber |                  | Publisher |
   +------------+                  +-----------+
         |                               |
         |establish-subscription         |
         |------------------------------&gt;|  (a)
         |     HTTP 200 OK, id#22, URI#1 |
         |&lt;------------------------------|  (b)
         |GET (URI#1)                    |
         |------------------------------&gt;|  (c)
         | HTTP 200 OK,notif-mesg (id#22)|
         |&lt;------------------------------|
         |                               |
         |                               |
         |establish-subscription         |
         |------------------------------&gt;|
         |      HTTP 200 OK, id#23, URI#2|
         |&lt;------------------------------|
         |GET (URI#2)                    |
         |------------------------------&gt;|
         |                               |
         |                               |
         |             notif-mesg (id#22)|
         |&lt;------------------------------|
         | HTTP 200 OK,notif-mesg (id#23)|
         |&lt;------------------------------|
         |                               | </artwork>
          </figure>
          <t pn="section-a.1.1-3">To provide examples of the information being transported, example messages for interactions in  <xref target="mess-flow-establishment" format="default" sectionFormat="of" derivedContent="Figure 2"/> are detailed below:</t>
          <figure anchor="establish-subs" align="left" suppress-title="false" pn="figure-3">
            <name slugifiedName="name-establish-subscription-requ">"establish-subscription" Request (a)</name>
            <artwork name="ex-establish-subscription.json" type="" align="left" alt="" pn="section-a.1.1-4.1">
POST /restconf/operations
     /ietf-subscribed-notifications:establish-subscription

{
   "ietf-subscribed-notifications:input": {
      "stream-xpath-filter": "/example-module:foo/",
      "stream": "NETCONF",
      "dscp": 10
   }
} </artwork>
          </figure>
          <t pn="section-a.1.1-5">As the publisher was able to fully satisfy the request, the publisher sends the subscription identifier of the accepted subscription and the URI:</t>
          <figure anchor="positive-establish-subs" align="left" suppress-title="false" pn="figure-4">
            <name slugifiedName="name-establish-subscription-succ">"establish-subscription" Success (b)</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.1-6.1">
HTTP status code - 200

{
   "id": 22,
   "uri": "https://example.com/restconf/subscriptions/22"
} </artwork>
          </figure>
          <t pn="section-a.1.1-7">Upon receipt of the successful response, the subscriber does a
	  GET to the provided URI to start the flow of notification messages.
	  When the publisher receives this, the subscription is moved to the
	  active state (c).</t>
          <figure anchor="positive-establish-post" align="left" suppress-title="false" pn="figure-5">
            <name slugifiedName="name-establish-subscription-subs">"establish-subscription" Subsequent POST</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.1-8.1">
GET /restconf/subscriptions/22 </artwork>
          </figure>
          <t pn="section-a.1.1-9">While not shown in <xref target="mess-flow-establishment" format="default" sectionFormat="of" derivedContent="Figure 2"/>, if the publisher had not been able to fully satisfy the request, or the subscriber has no authorization to establish the subscription, the publisher would have sent an RPC error response. For instance, if the "dscp" value of 10 asserted by the subscriber in <xref target="establish-subs" format="default" sectionFormat="of" derivedContent="Figure 3"/> proved unacceptable, the publisher may have returned:</t>
          <figure anchor="negative-establish-subs" align="left" suppress-title="false" pn="figure-6">
            <name slugifiedName="name-an-unsuccessful-establish-s">An Unsuccessful "establish-subscription"</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.1-10.1">
HTTP status code - 400

{ "ietf-restconf:errors" : {
    "error" : [
      {
        "error-type": "application",
        "error-tag": "invalid-value",
        "error-severity": "error",
        "error-app-tag":
            "ietf-subscribed-notifications:dscp-unavailable"
      }
    ]
  }
} </artwork>
          </figure>
          <t pn="section-a.1.1-11">The subscriber can use this information in future attempts to establish a subscription.</t>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-a.1.2">
          <name slugifiedName="name-modifying-dynamic-subscript">Modifying Dynamic Subscriptions</name>
          <t pn="section-a.1.2-1">An existing subscription may be modified.  The following exchange shows a negotiation of such a modification via several exchanges between a subscriber and a publisher.  This negotiation consists of a failed RPC modification request/response followed by a successful one.</t>
          <figure anchor="mess-flow-subs-modification" align="left" suppress-title="false" pn="figure-7">
            <name slugifiedName="name-interaction-model-for-succe">Interaction Model for Successful Subscription Modification</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.2-2.1">
   +------------+                 +-----------+
   | Subscriber |                 | Publisher |
   +------------+                 +-----------+
         |                              |
         |  notification message (id#23)|
         |&lt;-----------------------------|
         |                              |
         |modify-subscription (id#23)   |
         |-----------------------------&gt;|  (d)
         |    HTTP 400 error (with hint)|
         |&lt;-----------------------------|  (e)
         |                              |
         |modify-subscription (id#23)   |
         |-----------------------------&gt;|
         |                  HTTP 200 OK |
         |&lt;-----------------------------|
         |                              |
         |            notif-mesg (id#23)|
         |&lt;-----------------------------|
         |                              | </artwork>
          </figure>
          <t pn="section-a.1.2-3">If the subscription being modified in <xref target="mess-flow-subs-modification" format="default" sectionFormat="of" derivedContent="Figure 7"/> is a datastore subscription as per <xref target="RFC8641" format="default" sectionFormat="of" derivedContent="RFC8641"/>, the modification request made in (d) may look like that shown in <xref target="simple-modify-subs" format="default" sectionFormat="of" derivedContent="Figure 8"/>.  As can be seen, the modifications being attempted are the application of a new XML Path Language (XPath) filter as well as the setting of a new periodic time interval.</t>
          <figure anchor="simple-modify-subs" align="left" suppress-title="false" pn="figure-8">
            <name slugifiedName="name-subscription-modification-r">Subscription Modification Request (c)</name>
            <artwork name="ex-modify-subscription.json" type="" align="left" alt="" pn="section-a.1.2-4.1">
POST /restconf/operations
     /ietf-subscribed-notifications:modify-subscription

{
 "ietf-subscribed-notifications:input": {
    "id": 23,
    "ietf-yang-push:datastore-xpath-filter": 
       "/example-module:foo/example-module:bar",
    "ietf-yang-push:periodic": {
       "ietf-yang-push:period": 500
    }
  }
} </artwork>
          </figure>
          <t pn="section-a.1.2-5">If the publisher can satisfy both changes, the publisher sends a positive result for the RPC. If the publisher cannot satisfy either of the proposed changes, the publisher sends an RPC error response (e).  The following is an example RPC error response for (e) that includes a hint. This hint is an alternative time period value that might have resulted in a successful modification:</t>
          <figure anchor="negative-modify-subs" align="left" suppress-title="false" pn="figure-9">
            <name slugifiedName="name-modify-subscription-failure">"modify-subscription" Failure with Hint (e)</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.2-6.1">
HTTP status code - 400

{ "ietf-restconf:errors" : {
    "error" : [
      "error-type": "application",
      "error-tag": "invalid-value",
      "error-severity": "error",
      "error-app-tag": "ietf-yang-push:period-unsupported",
      "error-info": {
        "ietf-yang-push":
        "modify-subscription-datastore-error-info": {
           "period-hint": 3000
        }
      }
    ]
  }
} </artwork>
          </figure>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-a.1.3">
          <name slugifiedName="name-deleting-dynamic-subscripti">Deleting Dynamic Subscriptions</name>
          <t pn="section-a.1.3-1">The following demonstrates deleting a subscription.  This subscription may have been to either a stream or a datastore.</t>
          <figure anchor="simple-delete-subs" align="left" suppress-title="false" pn="figure-10">
            <name slugifiedName="name-delete-subscription-request">"delete-subscription" Request</name>
            <artwork name="ex-delete-subscription.json" type="" align="left" alt="" pn="section-a.1.3-2.1">
POST /restconf/operations
     /ietf-subscribed-notifications:delete-subscription

{
 "delete-subscription": {
    "id": "22"
 }
} </artwork>
          </figure>
          <t pn="section-a.1.3-3">If the publisher can satisfy the request, the publisher replies with success to the RPC request.</t>
          <t pn="section-a.1.3-4">If the publisher cannot satisfy the request, the publisher sends
	  an &lt;rpc-error&gt; element indicating the modification didn't work. <xref target="negative-delete-subs" format="default" sectionFormat="of" derivedContent="Figure 11"/> shows a valid
	  response for an existing valid subscription identifier, but that subscription identifier was created on a different transport session:</t>
          <figure anchor="negative-delete-subs" align="left" suppress-title="false" pn="figure-11">
            <name slugifiedName="name-unsuccessful-delete-subscri">Unsuccessful "delete-subscription"</name>
            <artwork name="" type="" align="left" alt="" pn="section-a.1.3-5.1">
HTTP status code - 404

{
  "ietf-restconf:errors" : {
    "error" : [
      "error-type": "application",
      "error-tag": "invalid-value",
      "error-severity": "error",
      "error-app-tag":
         "ietf-subscribed-notifications:no-such-subscription"
    ]
  }
} </artwork>
          </figure>
        </section>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-a.2">
        <name slugifiedName="name-subscription-state-notifica">Subscription State Notifications</name>
        <t pn="section-a.2-1">A publisher will send subscription state notifications according to the definitions within <xref target="RFC8639" format="default" sectionFormat="of" derivedContent="RFC8639"/>.</t>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-a.2.1">
          <name slugifiedName="name-subscription-modified">"subscription-modified"</name>
          <t pn="section-a.2.1-1">A "subscription-modified" encoded in JSON would look like:</t>
          <figure anchor="subscription-modified-ctrl-plane-notif" align="left" suppress-title="false" pn="figure-12">
            <name slugifiedName="name-subscription-modified-subsc">"subscription-modified" Subscription State Notification</name>
            <sourcecode name="" type="json" markers="false" pn="section-a.2.1-2.1">
{
  "ietf-restconf:notification" : {
    "eventTime": "2007-09-01T10:00:00Z",
    "ietf-subscribed-notifications:subscription-modified": {
      "id": 39,
      "uri": "https://example.com/restconf/subscriptions/22"
      "stream-xpath-filter": "/example-module:foo",
      "stream": {
         "ietf-netconf-subscribed-notifications" : "NETCONF"
      }
    }
  }
} </sourcecode>
          </figure>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-a.2.2">
          <name slugifiedName="name-subscription-completed-subs">"subscription-completed", "subscription-resumed", and "replay-completed"</name>
          <t pn="section-a.2.2-1">A "subscription-completed" notification would look like:</t>
          <figure anchor="subscription-completed" align="left" suppress-title="false" pn="figure-13">
            <name slugifiedName="name-subscription-completed-noti">"subscription-completed" Notification in JSON</name>
            <sourcecode name="ex-subscription-completed.json" type="json" markers="false" pn="section-a.2.2-2.1">
{
  "ietf-restconf:notification" : {
    "eventTime": "2007-09-01T10:00:00Z",
    "ietf-subscribed-notifications:subscription-completed": {
      "id": 39,
    }
  }
} </sourcecode>
          </figure>
          <t pn="section-a.2.2-3">The "subscription-resumed" and "replay-complete" are virtually identical, with "subscription-completed" simply being replaced by "subscription-resumed" and "replay-complete".</t>
        </section>
        <section numbered="true" toc="include" removeInRFC="false" pn="section-a.2.3">
          <name slugifiedName="name-subscription-terminated-and">"subscription-terminated" and "subscription-suspended"</name>
          <t pn="section-a.2.3-1">A "subscription-terminated" would look like:</t>
          <figure anchor="subscription-terminated" align="left" suppress-title="false" pn="figure-14">
            <name slugifiedName="name-subscription-terminated-sub">"subscription-terminated" Subscription State Notification</name>
            <sourcecode name="ex-subscription-terminated.json" type="json" markers="false" pn="section-a.2.3-2.1">
{
  "ietf-restconf:notification" : {
    "eventTime": "2007-09-01T10:00:00Z",
    "ietf-subscribed-notifications:subscription-terminated": {
      "id": 39,
      "error-id": "suspension-timeout"
    }
  }
} </sourcecode>
          </figure>
          <t pn="section-a.2.3-3">The "subscription-suspended" is virtually identical, with "subscription-terminated" simply being replaced by "subscription-suspended".</t>
        </section>
      </section>
      <section numbered="true" toc="include" removeInRFC="false" pn="section-a.3">
        <name slugifiedName="name-filter-example">Filter Example</name>
        <t pn="section-a.3-1">This section provides an example that illustrates the method of filtering event record contents.  The example is based on the YANG notification "vrrp-protocol-error-event" as defined per the ietf-vrrp.yang module within <xref target="RFC8347" format="default" sectionFormat="of" derivedContent="RFC8347"/>.  Event records based on this specification that are generated by the publisher might appear as:</t>
        <figure anchor="VRRP-notification" align="left" suppress-title="false" pn="figure-15">
          <name slugifiedName="name-rfc-8347-vrrp-example-notif">RFC 8347 (VRRP) - Example Notification</name>
          <artwork name="" type="" align="left" alt="" pn="section-a.3-2.1">
data: {
data:   "ietf-restconf:notification" : {
data:     "eventTime" : "2018-09-14T08:22:33.44Z",
data:     "ietf-vrrp:vrrp-protocol-error-event" : {
data:       "protocol-error-reason" : "checksum-error"
data:     }
data:   }
data: } </artwork>
        </figure>
        <t pn="section-a.3-3">Suppose a subscriber wanted to establish a subscription that only passes instances of event records where there is a "checksum-error" as part of a Virtual Router Redundancy Protocol (VRRP) protocol event.  Also assume the publisher places such event records into the NETCONF stream.  To get a continuous series of matching event records, the subscriber might request the application of an XPath filter against the NETCONF stream.  An "establish-subscription" RPC to meet this objective might be:</t>
        <figure anchor="VRRP-XPATH" align="left" suppress-title="false" pn="figure-16">
          <name slugifiedName="name-establishing-a-subscription">Establishing a Subscription Error Reason via XPath</name>
          <artwork name="ex-establish-subscription-filter-xpath.json" type="" align="left" alt="" pn="section-a.3-4.1">
POST /restconf/operations
     /ietf-subscribed-notifications:establish-subscription
{
   "ietf-subscribed-notifications:input": {
      "stream": "NETCONF",
      "stream-xpath-filter": 
        "/ietf-vrrp:vrrp-protocol-error-event[
          protocol-error-reason='checksum-error']/",
   }
} </artwork>
        </figure>
        <t pn="section-a.3-5">For more examples of XPath filters, see <xref target="XPATH" format="default" sectionFormat="of" derivedContent="XPATH"/>.</t>
        <t pn="section-a.3-6">Suppose the "establish-subscription" in <xref target="VRRP-XPATH" format="default" sectionFormat="of" derivedContent="Figure 16"/> was accepted. And suppose later a subscriber decided they wanted to broaden this subscription cover to all VRRP protocol events (i.e., not just those with a "checksum error").  The subscriber might attempt to modify the subscription in a way that replaces the XPath filter with a subtree filter that sends all VRRP protocol events to a subscriber. Such a "modify-subscription" RPC might look like:</t>
        <figure anchor="VRRP-Subtree" align="left" suppress-title="false" pn="figure-17">
          <name slugifiedName="name-example-modify-subscription">Example "modify-subscription" RPC</name>
          <artwork name="ex-modify-subscription-filter-subtree.json" type="" align="left" alt="" pn="section-a.3-7.1">
POST /restconf/operations
     /ietf-subscribed-notifications:modify-subscription
{
   "ietf-subscribed-notifications:input": {
      "stream": "NETCONF",
      "stream-subtree-filter": {
        "/ietf-vrrp:vrrp-protocol-error-event" : {}
      }
   }
} </artwork>
        </figure>
        <t pn="section-a.3-8">For more examples of subtree filters, see <xref target="RFC6241" sectionFormat="comma" section="6.4" format="default" derivedLink="https://rfc-editor.org/rfc/rfc6241#section-6.4" derivedContent="RFC6241"/>.</t>
      </section>
    </section>
    <section numbered="false" toc="include" removeInRFC="false" pn="section-appendix.b">
      <name slugifiedName="name-acknowledgments">Acknowledgments</name>
      <t pn="section-appendix.b-1">We wish to acknowledge the helpful contributions, comments, and suggestions that were received from Ambika Prasad Tripathy, Alberto Gonzalez Prieto, Susan Hares, Tim Jenkins, Balazs Lengyel, Kent Watsen, Michael Scharf, Guangying Zheng, Martin Bjorklund, Qin Wu, and Robert Wilton.</t>
    </section>
    <section anchor="authors-addresses" numbered="false" removeInRFC="false" toc="include" pn="section-appendix.c">
      <name slugifiedName="name-authors-addresses">Authors' Addresses</name>
      <author fullname="Eric Voit" initials="E." surname="Voit">
        <organization showOnFrontPage="true">Cisco Systems</organization>
        <address>
          <email>evoit@cisco.com</email>
        </address>
      </author>
      <author fullname="Reshad Rahman" initials="R." surname="Rahman">
        <organization showOnFrontPage="true">Cisco Systems</organization>
        <address>
          <email>rrahman@cisco.com</email>
        </address>
      </author>
      <author fullname="Einar Nilsen-Nygaard" initials="E." surname="Nilsen-Nygaard">
        <organization showOnFrontPage="true">Cisco Systems</organization>
        <address>
          <email>einarnn@cisco.com</email>
        </address>
      </author>
      <author fullname="Alexander Clemm" initials="A." surname="Clemm">
        <organization showOnFrontPage="true">Futurewei</organization>
        <address>
          <email>ludwig@clemm.org</email>
        </address>
      </author>
      <author fullname="Andy Bierman" initials="A." surname="Bierman">
        <organization showOnFrontPage="true">YumaWorks</organization>
        <address>
          <email>andy@yumaworks.com</email>
        </address>
      </author>
    </section>
  </back>
</rfc>
