<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="2"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="yes"?>
<rfc category="std" docName="draft-ietf-netconf-netconf-event-notifications-08"
     ipr="trust200902">
<front>
    <title abbrev="NETCONF-notif">NETCONF Support for Event Notifications</title>

        <author fullname="Alberto Gonzalez Prieto" initials="A"
            surname="Gonzalez Prieto">
            <organization>VMware</organization>
            <address>
                <email>agonzalezpri@vmware.com</email>
            </address>
        </author>

        <author fullname="Eric Voit" initials="E." surname="Voit">
            <organization>Cisco Systems</organization>
            <address>
                <email>evoit@cisco.com</email>
            </address>
        </author>
        
        <author fullname="Alexander Clemm" initials="A" surname="Clemm">
            <organization>Huawei</organization>
            <address>
                <email>ludwig@clemm.org</email>
            </address>
        </author>

        <author fullname="Einar Nilsen-Nygaard" initials="E"
            surname="Nilsen-Nygaard">
            <organization>Cisco Systems</organization>
            <address>
                <email>einarnn@cisco.com</email>
            </address>
        </author>
      
        <author fullname="Ambika Prasad Tripathy" initials="A" surname="Tripathy">
            <organization>Cisco Systems</organization>
            <address>
                <email>ambtripa@cisco.com</email>
            </address>
        </author>    
        

        <date day="22" month="February" year="2018"/>

        <area>Operations &amp; Management</area>

        <workgroup>NETCONF</workgroup>

        <keyword>Draft</keyword>

    <abstract>
    
      <t>This document provides a NETCONF binding to subscribed notifications and to YANG push.</t>
	  
	  <t>RFC Editor note: please replace the four references to pre-RFC normative drafts with the actual assigned RFC numbers.</t>
		
    </abstract>
</front>

<middle>
  <section title="Introduction">
       
    <t>This document provides a binding for events streamed over the NETCONF protocol <xref target="RFC6241"/> as per <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>. In addition, as <xref target="I-D.ietf-netconf-yang-push"/> is itself built upon <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>, this document enables a NETCONF client to request and receive updates from a YANG datastore located on a NETCONF server.</t>
    
  </section>

  <section title="Terminology">
    <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>.</t>
            
    <t>The following terms are defined in <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>: notification message, stream, publisher, receiver, subscriber, subscription, configured subscription.</t> 

  </section>

  
  <section title="Interleave Capability">
     <t> To support multiple subscriptions on a single session, a NETCONF publisher MUST support the :interleave capability as defined in <xref target="RFC5277"/>. Such support MUST be indicated by the following capability: "urn:ietf:params:netconf:capability:interleave:1.0".  Advertisement of both the :interleave capability and "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications" within a NETCONF capability exchange MUST indicate that a NETCONF publisher is able to receive, process, and respond to NETCONF requests and <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/> subscription operations.</t>
	 
  </section>
  
  <section title="Compatibility with RFC-5277's create-subscription">
     <t>A publisher is allowed to concurrently support both <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/> and <xref target="RFC5277"/>'s "create-subscription" RPC, however this support MUST NOT happen on a single transport NETCONF session. To accomplish this:</t>
      
     <t><list style="symbols">
	 
	   <t>A solution must reply with the <xref target="RFC6241"/> error "operation-not-supported" if a "create-subscription" RPC is received on a NETCONF session where at least one subscription is currently active.</t>
	   <t>It is a prohibited to send updates or state change notifications for a configured subscription on a NETCONF session where the create-subscription RPC has successfully created a subscription. </t> 
       <t>A "create-subscription" RPC MUST be rejected if a subscription is already active across that NETCONF transport session.</t>

	 </list></t>

  </section>
  
  
  <section title="Mandatory XML, stream and datastore support">
    
    <t>A NETCONF publisher MUST support XML encoding of RPCs and Notifications.</t>
    
    <t>A NETCONF publisher supporting <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/> MUST support the "NETCONF" event stream identified in that draft.</t>


    <t>A NETCONF publisher supporting <xref target="I-D.ietf-netconf-yang-push"/> MUST support the operational state
   datastore as defined by <xref target="I.D.draft-ietf-netmod-revised-datastores"/>.</t>
  </section>
  
  <section title="Transport connectivity">
  
    <section title="Dynamic Subscriptions">
  
      <t>For dynamic subscriptions, if the NETCONF session involved with the "establish-subscription" terminates, the subscription MUST be deleted.</t>
      
    </section>
    
    <section title="Configured Subscriptions">
    
      <t>For a configured subscription, there is no guarantee a transport session is currently in place with each associated receiver. In cases where a configured subscription has a receiver in the connecting state and the protocol configured as NETCONF, but no NETCONF transport session exists to that receiver, the publisher MUST initiate a transport session via NETCONF call home <xref target="RFC8071"/>, section 4.1 to that receiver.  Until NETCONF connectivity is established and a subscription-started state change notification is successfully sent, that receiver MUST remain in a status of either "connecting" or "timeout".</t>
      
      <t>If the call home fails because the publisher receives receiver credentials which are subsequently declined per <xref target="RFC8071"/>, Section 4.1, step S5 authentication, then that receiver MUST be assigned a "timeout" status.</t>
    
      <t>If the call home fails to establish for any other reason, the publisher MUST NOT progress the receiver to the "active" state.   Additionally, the publisher SHOULD place the receiver into a "timeout" status after a predetermined number of either failed call home attempts or NETCONF sessions remotely terminated by the receiver.</t>
    
      <t>NETCONF Transport session connectivity SHOULD be verified via Section 4.1, step S7.</t>

      <t>If an active NETCONF session is disconnected but the stop-time of a subscription has not been reached, the publisher MUST restart the call home process and return the receiver to the "connecting" state.</t>
    
    </section>
    
  </section>
  
  <section title="Notification Messages">
    <t>Notification messages transported over NETCONF will be identical in format and content to those encoded using one-way operations defined within <xref target="RFC5277"/>, section 4.</t>
  </section>
  
  <section title="Dynamic Subscriptions and RPC Error Responses">
    <t>Management of dynamic subscriptions occurs via RPCs as defined in 
    <xref target="I-D.ietf-netconf-yang-push"/> and <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>.  When an RPC error occurs, 
     the NETCONF RPC reply MUST include an "rpc-error" element per <xref target="RFC6241"/> with the
     error information populated as follows:
     <list style="symbols">
      <t> "error-type" of "application".</t>

      <t>"error-tag" of "operation-failed".</t>

      <t>Optionally, an "error-severity" of "error" (this MAY but does not
      have to be included). </t>

      <t>"error-app-tag" with the value being a string that corresponds to
      an identity associated with the error, as defined in 
      <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/> section 2.4.6 for general subscriptions, 
      and <xref target="I-D.ietf-netconf-yang-push"/> Appendix A.1, for datastore (YANG-Push) subscriptions.   
      The tag to use depends on the RPC for which the error occurred.  Applicable are identities 
      with a base identity of "establish-subscription-error" (for
      error responses to an establish-subscription request), "modify-
      subscription-error" (for error responses to a modify-subscription
      request), "delete-subscription-error" (for error responses to a
      delete-subscription request), "resynch-subscription-error" (for
      error responses to resynch-subscription request), or "kill-
      subscription-error" (for error responses to a kill-subscription
      request), respectively. </t>

      <t>In case of error responses to an establish-subscription or modify-
      subscription request: optionally, "error-info" containing XML-
      encoded data with hints regarding parameter settings that might
      lead to successful requests in the future, per yang-data
      definitions "establish-subscription-error-datastore" (for error
      responses to an establish-subscription request) or "modify-
      subscription-error-datastore (for error responses to a modify-
      subscription request), respectively.  
      <vspace blankLines="1"/>
      These yang-data that is included in "error-info" SHOULD NOT include the optional leaf 
      "error-reason", as such a leaf would be redundant with the information that is already placed within the error-app-tag. 
      <vspace blankLines="1"/>
      In case of an rpc error as a
      result of a delete-subscription, or a kill-subscription, or a
      resynch-subscription request, no error-info needs to be included,
      as the subscription-id is the only RPC input parameter and no
      hints regarding RPC input parameters need to be provided. </t>
    </list>
    </t>
    <t> Note that "error-path" does not need to be included with the "rpc-error" element, as subscription errors are generally not associated with nodes in the datastore but with the choice of RPC input parameters. </t>
    
  </section>
  
  <section title="Security Considerations">
            
    <t>Notification messages (including state change notifications) are never sent before the NETCONF capabilities exchange has completed.</t>
            
    <t>If a malicious or buggy NETCONF subscriber sends a number of "establish-subscription" requests, then these subscriptions accumulate and may use up system resources.  In such a situation, subscriptions MAY be terminated by terminating the underlying NETCONF session.  The publisher MAY also suspend or terminate a subset of the active subscriptions on that NETCONF session.</t>

    <t>The NETCONF Authorization Control Model <xref target="rfc6536bis"/> SHOULD be used to control and restrict authorization of subscription configuration.</t>
  </section>
        
  <section title = "Acknowledgments">
     <t>We wish to acknowledge the helpful contributions, comments, and suggestions that were received from: Andy Bierman, Yan Gang, Sharon Chisholm, Hector Trevino, Peipei Guo, Susan Hares, Tim Jenkins, Balazs Lengyel, Martin Bjorklund, Mahesh Jethanandani, Kent Watsen, and Guangying Zheng.</t>
  </section>
        
</middle>
    
<back>
  <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>
      <?rfc include="reference.RFC.5277"?>
      <?rfc include="reference.RFC.6241"?>
      <?rfc include="reference.RFC.8071"?>
      
      <reference anchor="I-D.ietf-netconf-yang-push"
                 target="https://datatracker.ietf.org/doc/draft-ietf-netconf-yang-push/">
        <front>
          <title>YANG Datastore Subscription</title>
          <author fullname="A Clemm" initials="Alexander" surname="Clemm"></author>
          <author fullname="E Voit" initials="Eric" surname="Voit"></author>
          <author fullname="A Gonzalez Prieto" initials="Alberto" surname="Gonzalez Prieto"></author>
          <author fullname="Ambika Prasad Tripathy" initials="A" surname="Tripathy"></author>
          <author fullname="Einar Nilsen-Nygaard" initials="E" surname="Nilsen-Nygaard"></author>
          <author fullname="Andy Bierman" initials="A" surname="Bierman"></author>
          <author fullname="B Lengyel" initials="B" surname="Lengyel"></author>
          <date month="February" year="2018"/>
        </front>
      </reference>
        

      <reference anchor="I-D.draft-ietf-netconf-subscribed-notifications">
        <front>
          <title>Custom Subscription to Event Streams</title>
          <author fullname="Eric Voit" initials="E" surname="Voit">
            <organization/>
          </author>
          <author fullname="Alexander Clemm" initials="A" surname="Clemm">
            <organization/>
          </author>
          <author fullname="Alberto Gonzalez Prieto" initials="A"
                  surname="Gonzalez Prieto">
            <organization/>
          </author>
          <author fullname="Ambika Prasad Tripathy" initials="A"
                  surname="Tripathy">
            <organization/>
          </author>
          <author fullname="Einar Nilsen-Nygaard" initials="E"
                  surname="Nilsen-Nygaard">
            <organization/>
          </author>
          <date month="January" year="2018"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netconf-subscribed-notifications-10"/>
        <format target="https://datatracker.ietf.org/doc/draft-ietf-netconf-subscribed-notifications/"
                type="TXT"/>
      </reference>
      
      <reference anchor="I.D.draft-ietf-netmod-revised-datastores">
        <front>
          <title>Network Management Datastore Architecture</title>
          <author fullname="M. Bjorklund" initials="M" surname="Bjorklund">
            <organization/>
          </author>
          <author fullname="J. Schoenwaelder" initials="J" surname="Schoenwaelder">
            <organization/>
          </author>
          <author fullname="P. Shafer" initials="P" surname="Shafer">
            <organization/>
          </author>
          <author fullname="K. Watsen" initials="K" surname="Watsen">
            <organization/>
          </author>
          <author fullname="R. Wilton" initials="R"  surname="Wilton">
            <organization/>
          </author>
          <date month="January" year="2018"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-netmod-revised-datastores-10"/>
        <format target="https://tools.ietf.org/html/draft-ietf-netmod-revised-datastores-10"
                type="TXT"/>
      </reference>   

	  <reference anchor="rfc6536bis"
                 target="https://datatracker.ietf.org/doc/draft-ietf-netconf-rfc6536bis/">
        <front>
          <title>Network Configuration Access Control Module</title>
          <author fullname="Andy Bierman" initials="A" surname="Bierman"></author>
          <author fullname="M. Bjorklund" initials="M" surname="Bjorklund">
            <organization/>
          </author>
          <date month="December" year="2017"/>
        </front>
      </reference>
	  
	  
  </references> 

  <section title="Examples">
    
    <section title="Event Stream Discovery">

        <t>As defined in <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/> an event stream exposes a continuous set of events available for subscription.  A NETCONF client can retrieve the list of available event streams from a NETCONF publisher using the "get" operation against the top-level container "/streams" defined in <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>.</t>
            
        <t>The following example illustrates the retrieval of the list of available event streams using the "get" operation.</t>
            
        <figure align="center" anchor="get-streams" title="Get streams request">       
            <artwork><![CDATA[
<rpc message-id="101"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <streams
     xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"/>
    </filter>
  </get>
</rpc>
            ]]></artwork>
        </figure>
            
        <t>After such a request, the NETCONF publisher returns a list of event streams available. </t>

    </section>

    <section title="Dynamic Subscriptions">
    
    
      <section title="Establishing Dynamic Subscriptions">
      
        <t>The following figure shows two successful "establish-subscription" RPC requests as per <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>.  The first request is given a subscription identifier of 22, the second, an identifier of 23.</t>

        <figure anchor = "mess-flow-establishment" 
          title="Multiple subscriptions over a NETCONF session">
          <artwork><![CDATA[
   +------------+                 +-----------+
   | Subscriber |                 | Publisher |
   +------------+                 +-----------+
         |                              |
         |    Capability Exchange       |
         |<---------------------------->|
         |                              |
         |                              |
         |    establish-subscription    |
         |----------------------------->|  (a)
         | RPC Reply: OK, id = 22       |
         |<-----------------------------|  (b)
         |                              |
         | notification message (for 22)|
         |<-----------------------------|
         |                              |
         |                              |
         |    establish-subscription    |
         |----------------------------->|
         | RPC Reply: OK, id = 23       |
         |<-----------------------------|
         |                              |
         |                              |
         | notification message (for 22)|
         |<-----------------------------|
         | notification message (for 23)|
         |<-----------------------------|
         |                              |                
          ]]></artwork>
        </figure> 
    
        <t>To provide examples of the information being transported, example messages for interactions (a) and (b) in  <xref target="mess-flow-establishment"/> are detailed below:</t>
    
        <figure align="center" anchor="establish-subs" title="establish-subscription request (a)"> 
          <artwork><![CDATA[
<rpc netconf:message-id="102"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <establish-subscription
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
    <stream>
      <name>NETCONF</name>
      <xpath-filter xmlns:ex="http://example.com/events">
           /ex:foo
      </xpath-filter>
    </stream>
    <dscp>
       10
    </dscp>
  </establish-subscription>
</rpc>
            ]]></artwork>
        </figure>
        
        <t>As NETCONF publisher was able to fully satisfy the request (a), the publisher sends the subscription identifier of the accepted subscription within message (b):</t>
                
        <figure align="center" anchor="positive-establish-subs" title="establish-subscription success (b)">       
          <artwork><![CDATA[
<rpc-reply message-id="102"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <identifier
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
    22
  </identifier>
</rpc-reply>
           ]]></artwork>
        </figure>               

        <t>If the NETCONF publisher had not been able to fully satisfy the request, or 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"/> proved unacceptable, the publisher may have returned:</t>
            
        <figure align="center" anchor="negative-establish-subs" title="an unsuccessful establish subscription">       
          <artwork><![CDATA[

<rpc-reply message-id="102"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
   <error-type>application</error-type>
   <error-tag>operation-failed</error-tag>
   <error-severity>error</error-severity>
   <error-app-tag>
    dscp-unavailable
   </error-app-tag>    
   <error-info>
    <establish-subscription-error-datastore 
     xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
     <dscp>
      100
     </dscp>
   </error-info>
  </rpc-error>
</rpc-reply>
          ]]></artwork>
        </figure> 
        
        <t>The subscriber can use this information in future attempts to establish a subscription.</t>
        
      </section>
      
      <section title="Modifying Dynamic Subscriptions">
      
        <t>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"
                title="Interaction model for successful subscription modification">
          <artwork><![CDATA[                  
   +------------+                 +-----------+
   | Subscriber |                 | Publisher |
   +------------+                 +-----------+
         |                              |
         | notification message (for 23)|
         |<-----------------------------|
         |                              |
         | modify-subscription (id = 23)|
         |----------------------------->|  (c)
         | RPC error (with hint)        |
         |<-----------------------------|  (d)
         |                              |
         | modify-subscription (id = 23)|
         |----------------------------->|
         | RPC Reply: OK                |
         |<-----------------------------|
         |                              |
         | notification message (for 23)|
         |<-----------------------------|
         |                              |          
          ]]></artwork>
        </figure>    
        
        <t>If the subscription being modified in <xref target="mess-flow-subs-modification"/> is a datastore subscription as per <xref target="I-D.ietf-netconf-yang-push"/>, the modification request made in (c) may look like that shown in <xref target="simple-modify-subs"/>.  As can be seen, the modifications being attempted are the application of a new xpath filter as well as the setting of a new periodic time interval.</t>
        
        <figure align="center" anchor="simple-modify-subs" title="Subscription modification request (c)">
          <artwork><![CDATA[
<rpc message-id="303"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <modify-subscription
       xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"
       xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
    <yp:datastore>
      <yp:xpath-filter xmlns="http://example.com/datastore"> 
        /interfaces-state/interface/oper-status
      </yp:xpath-filter>
      <yp:periodic>
        <yp:period>500</yp:period>
      </yp:periodic> 
    </yp:datastore>
    <identifier>
      23
    </identifier>
  </modify-subscription>
</rpc>
          ]]></artwork>
        </figure>
    
        <t>If the NETCONF publisher can satisfy both changes, the publisher sends a positive result for the RPC. If the NETCONF publisher cannot satisfy either of the proposed changes, the publisher sends an RPC error response (d).  The following is an example RPC error response for (d) which includes a hint. This hint is an alternative time period value which might have resulted in a successful modification:</t>
        
        <figure align="center" anchor="negative-modify-subs" title="Modify subscription failure with Hint (d)">       
          <artwork><![CDATA[

<rpc-reply message-id="303"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-app-tag>
        period-unsupported 
    </error-message>
    <error-info
       xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push">
       <modify-subscription-error-datastore>
         <period-hint>
             3000
         </period-hint>
       </modify-subscription-error-datastore>
    </error-info>
  </rpc-error>
</rpc-reply>
          ]]></artwork>
        </figure>        
    

    
     
      </section>
    
      <section title="Deleting Dynamic Subscriptions">
      
      <t>The following demonstrates deleting a subscription.</t>
                    
      <figure align="center" anchor="simple-delete-subs" title="Delete subscription"> 
        <artwork><![CDATA[
<rpc message-id="103"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <delete-subscription
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
    <identifier>22</identifier>
  </delete-subscription>
</rpc> 
        ]]></artwork>
      </figure>
                
      <t>If the NETCONF publisher can satisfy the request, the publisher replies with success to the RPC request.</t>
            

      <t>If the NETCONF publisher cannot satisfy the request, the publisher sends an error-rpc element indicating the modification didn't work. <xref target="negative-delete-subs"/> shows a valid response for existing valid subscription identifier, but that subscription identifier was created on a different NETCONF transport session:</t>
                
      <figure align="center" anchor="negative-delete-subs" title="Unsuccessful delete subscription">       
        <artwork><![CDATA[
<rpc-reply message-id="103"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-app-tag>
        no-such-subscription
    </error-app-tag>
  </rpc-error>
</rpc-reply>
          ]]></artwork>
        </figure>     
    
      </section>
    
    </section>

    <section title="Configured Subscriptions">
    
      <t>Configured subscriptions may be established, modified, and deleted using configuration operations against the top-level subtree of <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/> or <xref target="I-D.ietf-netconf-yang-push"/>.</t>
        
      <t>In this section, we present examples of how to manage the configuration subscriptions using a NETCONF client.</t>

      <section title="Creating Configured Subscriptions">
    
        <t>For subscription creation, a NETCONF client may send:</t>
                
        <figure align="center" anchor="create-config-subs" title="Create a configured subscription">       
          <artwork><![CDATA[
<rpc message-id="201"
    xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
    xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <edit-config>
    <target>
      <running/>
    </target>
    <subscriptions
      xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
      <subscription>
        <identifier>22</identifier>
        <encoding>encode-xml</encoding>
        <stream>
          <name>NETCONF</name>
          <receiver>
            <address>1.2.3.4</address>
            <port>1234</port>
          </receiver>
        </stream>
      </subscription>
    </subscriptions>
  </edit-config>
</rpc>
          ]]></artwork>
        </figure>
                    
        <t>If the request is accepted, the publisher will indicate this. If the request is not accepted because the publisher cannot serve it, no configuration is changed.  In this case the publisher may reply:</t>
                    
        <figure align="center" anchor="failed-establish-config-subs" title="Response to a failed configured subscription establishment">       
          <artwork><![CDATA[
   <rpc-reply message-id="201" 
              xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <rpc-error>
           <error-type>application</error-type>
           <error-tag>resource-denied</error-tag>
           <error-severity>error</error-severity>
           <error-message xml:lang="en">
               Temporarily the publisher cannot serve this
               subscription due to the current workload.
           </error-message>
       </rpc-error>
   </rpc-reply>
          ]]></artwork>
        </figure>
        
        <t>After a subscription has been created, NETCONF connectivity to each receiver's IP address and port will be established if it does not already exist.  This will be accomplished via <xref target="RFC8071"/>. </t>
         
        <t>The following figure shows the interaction model for the successful creation of a configured subscription.</t>
  
        <figure anchor = "mess-flow-subs-establishment-config" 
                title="Interaction model for configured subscription establishment">
          <artwork><![CDATA[                               
 +----------+                 +-----------+     +---------+   
 |Config Ops|                 | Publisher |     | 1.2.3.4 |   
 +----------+                 +-----------+     +---------+   
      |                            |                |   
      |    Capability Exchange     |                |            
      |<-------------------------->|                |            
      |                            |                |            
      |                            |                |         
      |        Edit-config         |                |          
      |--------------------------->|                |           
      |       RPC Reply: OK        |                |            
      |<---------------------------|                |  
      |                            |   Call Home    |            
      |                            |<-------------->|            
      |                            |                |          
      |                            |  subscription- |           
      |                            |  started       |           
      |                            |--------------->|          
      |                            |                |        
      |                            |  notification  |           
      |                            |  message       |            
      |                            |--------------->|                    
          ]]></artwork>
        </figure>

      </section>
      
      <section title="Modifying Configured Subscriptions">
      
        <t>Configured subscriptions can be modified using configuration operations against the top-level container "/subscriptions".</t>
                
        <t>For example, the subscription established in the previous section could be modified as follows, here a adding a second receiver:</t>

        <figure align="center" anchor="modify-configured-subs" title="Modify configured subscription">          
          <artwork><![CDATA[
   <rpc message-id="202"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
          xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
     <edit-config>
       <target>
         <running/>
       </target>
       <subscriptions
      xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
         <subscription>
           <identifier>
             1922
           </identifier>
           <receiver>
             <address>
               1.2.3.5
             </address>
             <port>
               1234
             </port>
           </receiver>
         </subscription>
       </subscriptions>
     </edit-config>
   </rpc>
           ]]></artwork>
        </figure>
                
        <t>If the request is accepted, the publisher will indicate success.  The result is that the interaction model described in <xref target="mess-flow-subs-establishment-config"/> may be extended as follows.</t>            
        <figure anchor = "mess-flow-subs-modification-configured"
               title="Interaction model for configured subscription modification">
          <artwork><![CDATA[                               
 +----------+                 +-----------+     +---------+  +---------+
 |Config Ops|                 | Publisher |     | 1.2.3.4 |  | 1.2.3.5 |
 +----------+                 +-----------+     +---------+  +---------+
       |                            |  notification  |            |
       |                            |  message       |            |
       |                            |--------------->|            |
       |        Edit-config         |                |            |
       |--------------------------->|                |            |
       |       RPC Reply: OK        |                |            |
       |<---------------------------|                |            |
       |                            |  subscription- |            |
       |                            |  started       |            |
       |                            |---------------------------->|
       |                            |                |            |
       |                            |  notification  |            |
       |                            |  message       |            |
       |                            |--------------->|            |
       |                            |---------------------------->|
       |                            |                |            |     
          ]]></artwork>
        </figure>

        <t>Note in the above that in the specific example above, modifying a configured subscription actually resulted in "subscription-started" notification.  And because of an existing NETCONF session, no additional call home was needed.  Also note that if the edit of the configuration had impacted the filter, a separate modify-subscription would have been required for the original receiver.</t>
            
      </section>
    
      <section title="Deleting Configured Subscriptions">
      
        <t>Configured subscriptions can be deleted using configuration operations against the top-level container "/subscriptions".  Deleting the subscription above would result in the following flow impacting all active receivers.</t>
    
        <figure anchor="mess-flow-subs-deletion-configured"
           title="Interaction model for configured subscription deletion">
           <artwork><![CDATA[
                               
 +----------+                 +-----------+     +---------+  +---------+
 |Config Ops|                 | Publisher |     | 1.2.3.4 |  | 1.2.3.5 |
 +----------+                 +-----------+     +---------+  +---------+
       |                            |                |            |
       |                            |  notification  |            |
       |                            |  message       |            |
       |                            |--------------->|            |
       |                            |---------------------------->|
       |                            |                |            |
       |        Edit-config         |                |            |
       |--------------------------->|                |            |
       |       RPC Reply: OK        |                |            |
       |<---------------------------|                |            |
       |                            |  subscription- |            |
       |                            |  terminated    |            |
       |                            |--------------->|            |
       |                            |---------------------------->|
       |                            |                |            |
           
         ]]></artwork>
        </figure>    
    
      </section>
    
    </section>    

    <section title="Subscription State Notifications">
    
       <t>A publisher will send subscription state notifications according to the definitions within <xref target="I-D.draft-ietf-netconf-subscribed-notifications"/>).</t>

      <section title="subscription-started and subscription-modified">
      
                  
        <t>A "subscription-started" over NETCONF encoded in XML would look like:</t>    
                        
        <figure align="center" anchor="subscription-started-ctrl-plane-notif" 
                title="subscription-started subscription state notification">       
          <artwork><![CDATA[
<notification
  xmlns=" urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2007-09-01T10:00:00Z</eventTime>
  <subscription-started
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"/>
    <identifier>39</identifier>
    <encoding>encode-xml</encoding>
    <stream>
      <name>NETCONF</name>
      <xpath-filter xmlns:ex="http://example.com/events">
           /ex:foo
      </xpath-filter>
    </stream>
  </subscription-started>
</notification>
           ]]></artwork>
        </figure>

        <t>The "subscription-modified" is identical to <xref target="subscription-started-ctrl-plane-notif"/>, with just the word "started" being replaced by "modified".</t>
    
      </section>
      
      <section title="subscription-completed, subscription-resumed, and replay-complete">
    
        <t>A "subscription-completed" would look like:</t>    
                
        <figure align="center" 
                anchor="subscription-completed" 
                title="subscription-completed notification in XML">       
          <artwork><![CDATA[
<notification
  xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2007-09-01T10:00:00Z</eventTime>
  <subscription-completed
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
    <identifier>39</identifier>
  </subscription-completed>
</notification>
           ]]></artwork>
        </figure>
                
        <t>The "subscription-resumed" and "replay-complete" are virtually identical, with "subscription-completed" simply being replaced by "subscription-resumed" and "replay-complete" in both encodings.</t>
    
      </section>
    
      <section title="subscription-terminated and subscription-suspended">

        <t>A "subscription-terminated" would look like:</t>    
                
        <figure align="center" 
                anchor="subscription-terminated" 
                title="subscription-terminated subscription state notification">       
                    <artwork><![CDATA[
<notification
  xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2007-09-01T10:00:00Z</eventTime>
  <subscription-terminated
    xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications">
    <identifier>39</identifier>
    <error-id>
       suspension-timeout
    </error-id>
  </subscription-terminated>
</notification>
          ]]></artwork>
        </figure>
                
        <t>The "subscription-suspended" is virtually identical, with "subscription-terminated" simply being replaced by "subscription-suspended".</t>
 
      </section>

    </section>
    
  </section>
    
  <section title="Changes between revisions">
    <t>(To be removed by RFC editor prior to publication)</t>
	<section title="v07 to v08">
      <t><list style="symbols">                
        <t>Tweaks and clarification on :interleave.</t>
      </list></t>
    </section>
    <section title="v06 to v07">
      <t><list style="symbols">                
        <t>XML encoding and operational datastore mandatory.</t>
        <t>Error mechanisms and examples updated.</t>
      </list></t>
    </section>
    <section title="v05 to v06">
      <t><list style="symbols">                
        <t>Moved examples to appendices</t>
        <t>All examples rewritten based on namespace learnings</t>
        <t>Normative text consolidated in front</t>
        <t>Removed all mention of JSON</t>
        <t>Call home process detailed</t>
        <t>Note: this is a major revision attempting to cover those comments received from two week review.</t>
      </list></t>
    </section>
    <section title="v03 to v04">
      <t><list style="symbols">                
        <t>Added additional detail to "configured subscriptions"</t>
        <t>Added interleave capability</t>
        <t>Adjusted terminology to that in draft-ietf-netconf-subscribed-notifications</t>
        <t>Corrected namespaces in examples</t>
      </list></t>
    </section>
    <section title="v01 to v03">
      <t><list style="symbols">
        <t>Text simplifications throughout</t>
        <t>v02 had no meaningful changes</t>
      </list></t>
    </section>
    <section title="v00 to v01">
      <t><list style="symbols">
        <t>Added Call Home in solution for configured subscriptions.</t>
        <t>Clarified support for multiple subscription on a single session. No need to support multiple create-subscription.</t>
        <t>Added mapping between terminology in yang-push and <xref target="RFC6241"/> (the one followed in this document).</t>
        <t>Editorial improvements.</t>
      </list></t>
    </section>
  </section>

</back>
</rfc>
