One document matched: draft-gonzalez-netconf-5277bis-01.xml


<?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="no"?>
<rfc category="std" docName="draft-gonzalez-netconf-5277bis-01"
     ipr="trust200902">
    <front>
        <title abbrev="5277 bis">NETCONF Event Notifications</title>

      
        <author fullname="Alberto Gonzalez Prieto" initials="A"
            surname="Gonzalez Prieto">
            <organization>Cisco Systems</organization>
            <address>
                <email>albertgo@cisco.com</email>
            </address>
        </author>

        <author fullname="Alexander Clemm" initials="A" surname="Clemm">
            <organization>Cisco Systems</organization>
            <address>
                <email>alex@cisco.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="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="21" month="March" year="2016"/>

        <area>Operations & Management</area>

        <workgroup>NETCONF</workgroup>

        <keyword>Draft</keyword>

        <abstract>
            <t>This document defines capabilities and operations for providing asynchronous message notification delivery on top of the Network Configuration protocol (NETCONF).  This notification delivery is an optional capability built on top of the base NETCONF definition.  This document is eventually intended to obsolete RFC 5277.</t>
        </abstract>
    </front>

    <middle>
        <section title="Introduction">
            <t><xref target="RFC6241"/> can be conceptually partitioned into four layers:</t>
        
            <figure>
                <preamble></preamble>

                <artwork><![CDATA[      Layer                         Example
    +-------------+     +-------------------------------------------+
    |   Content   |     |     Configuration data                    |
    +-------------+     +-------------------------------------------+
          |                           |
    +-------------+     +-------------------------------------------+
    | Operations  |     |<get-config>, <edit-config>, <notification>|
    +-------------+     +-------------------------------------------+
          |                           |                       |
    +-------------+     +-----------------------------+       |
    |     RPC     |     |    <rpc>, <rpc-reply>       |       |
    +-------------+     +-----------------------------+       |
          |                           |                       |
    +-------------+     +-------------------------------------------+
    |  Transport  |     |   BEEP, SSH, SSL, console                 |
    |  Protocol   |     |                                           |
    +-------------+     +-------------------------------------------+
          ]]></artwork>
            </figure>
               

        
            <t>This document defines mechanisms that provide an asynchronous message notification delivery service for the NETCONF protocol <xref target="RFC6241"/>.  This is an optional capability built on top of the base NETCONF definition. This document also defines the capabilities and operations necessary to establish, monitor, and support subscriptions into this notification delivery service.</t>
        
            <section title="Motivation">  

                <t>The motivation for this work is to enable the sending of asynchronous notification messages that are consistent with the data model (content) and security model used within a NETCONF implementation.</t>
                <t><xref target="RFC5277"/> defines a notification mechanism for NETCONF.  However, there are various limitations:</t>                
                <t><list style="symbols">
                    <t>Each subscription requires a separate NETCONF connection, which is wasteful.</t>
                    <t>The only mechanism to terminate a subscription is terminating the underlying NETCONF connection.</t>
                    <t>No ability to modify subscriptions once they have been created.</t>
                    <t>No ability to notify the receiver of a subscription if the server is dropping events.</t>
                    <t>No mechanism to monitor subscriptions.</t>
                    <t>No alternative mechanism to create subscriptions via RPCs. Thus the lifetime of the subscription is limited by that of the underlaying NETCONF session.</t>
                    <t>Predates YANG and defines RPCs, notifications, and data nodes outside of the YANG framework.</t>                    
                </list></t>
                <t>The scope of the work aims at meeting the following operational needs:</t>

                <t><list style="symbols">
                    <t>Ability to dynamically or statically subscribe to event notifications available on a NETCONF agent.</t>
                    <t>Ability to negotiate acceptable dynamic subscription parameters.</t>
                    <t>Ability to support multiple subscriptions over a single NETCONF session.</t>
                    <t>Ability to filter the subset of notifications to be pushed with stream-specific semantics. </t>
                    <t>Ability for the notification payload to be interpreted independently of the NETCONF transport protocol. (In other words, the encoded notification fully describes itself.) </t>
                    <t>Mechanism to communicate the notifications.</t>
                    <t>Ability to replay locally logged notifications.</t>
                    <t>Backwards compatible with RFC 5277 implementations.</t>
                    <t>Define in YANG, the RPCs, notifications, and data nodes in RFC 5277.</t>
                </list></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>Event: Something that happens that may be of interest. (e.g., a configuration change, a fault, a change in status, crossing a threshold, or an external input to the system.)</t>
                <t>Event notification: A message sent by a server to a receiver indicating that an event (of interest to the subscriber) has occurred. Events can trigger notifications if an interested party has subscribed to the stream(s) it belongs to.</t>
                <t>Stream (also referred to as "event stream"):  A continuous flow of event, status, state, or other information.</t>
                <t>Subscriber: An entity able to request and negotiate a contract for the receipt of event notifications from a NETCONF server.</t>
                <t>Receiver: A target to which a NETCONF server pushes event notifications. In many deployments, the receiver and subscriber will be the same entity.</t>
                <t>Subscription: A contract between a subscriber and a NETCONF server, stipulating which information the receiver wishes to have pushed from the server without the need for further solicitation.</t>
                <t>Filter: Evaluation criteria, which may be applied against a targeted set of objects/events in a subscription. Information traverses the filter only if specified filter criteria are met.</t>
                <t>Dynamic subscription: A subscription agreed between subscriber and NETCONF server via create, establish, modify, and delete RPC control plane signaling messages.</t>
                <t>Static subscription: A subscription installed via a configuration interface.</t>
                <t>Operation: In this document, this term refers to NETCONF protocol operations <xref target="RFC6241"/> defined in support of NETCONF notifications.</t>
                <t>NACM: NETCONF Access Control Model.</t>
                <t>RPC: Remote Procedure Call.</t>
            </section>

            <section title="Solution Overview">
                <t>This document describes mechanisms for subscribing and receiving event notifications from a NETCONF server. This document enhances the capabilities of RFC 5277 while maintaining backwards capability with existing implementations.  It is intended that a final version of this document might obsolete RFC 5277.</t>
                <t>The enhancements over <xref target="RFC5277"/> include the ability to terminate subscriptions without  terminating the client session, to modify existing subscriptions, and to have multiple subscriptions on a NETCONF session.</t>
                <t>These enhancements do not affect <xref target="RFC5277"/> clients that do not support these particular subscription requirements.</t> 
            
    
                <t>The solution supports subscribing to event notifications using two mechanisms.</t>
                <t><list style="numbers">
                    <t>Dynamic subscriptions, where a NETCONF client initiates a subscription negotiation with a NETCONF server. Here a client initiates a negotiation by issuing a subscription request. If the agent wants to serve this request, it will accept it, and then start pushing event notifications as negotiated. If the agent does not wish to serve it as requested, it may respond with subscription parameters, which it would have accepted.</t>
                    <t>Static subscriptions, which is an optional mechanism that enables managing subscriptions via a configuration interface so that a NETCONF agent sends event notifications to given receiver(s).</t>
                </list></t>
        
                <t>Some key characteristics of static and dynamic subscriptions include:</t>
                <t><list style="symbols">
                    <t>The lifetime of a dynamic subscription is limited by the lifetime of the subscriber session used to establish it.  Typically loss of the transport session tears down any dependent dynamic subscriptions.</t>
                    <t>The lifetime of a static subscription is driven by configuration being present on the running configuration. This implies static subscriptions persist across reboots, and persists even when transport is unavailable.  This also means static subscriptions do not support negotiation.</t>
                    <t>Subscriptions can be modified or terminated at any point of their lifetime. Static subscriptions can be modified by any configuration client with write rights on the configuration of the subscription.</t>
                    <t>A NETCONF agent can support multiple dynamic subscriptions simultaneously in the context of a single NETCONF session. (This requires supporting interleaving.) The termination of any of those subscriptions does not imply the termination of NETCONF transport session. </t>
                </list></t>
                <t>Note that there is no mixing-and-matching of RPC and configuration operations.  Specifically, a static subscription cannot be modified or deleted using RPC.  Similarly, a subscription created via RPC cannot be modified through configuration operations.</t>

                <t>The NETCONF agent may decide to terminate a dynamic subscription at any time. Similarly the NETCONF agent may decide to temporarily suspend the sending of event notifications for either static or dynamic subscriptions. Such termination or suspension may be driven by the agent running out of resources to serve the subscription, or by internal errors on the server. </t>
            </section>
        </section>
    
        <section title="Solution">   
            <section title="Event Streams">
                <t>An event stream is a set of events available for subscription from a NETCONF server. It is out of the scope of this document to identify a) how streams are defined, b) how events are defined/generated, and c) how events are assigned to streams. </t>
                <t>The following is a high-level description of the flow of a notification. Note that it does not mandate and/or preclude an implementation. As events are raised, they are assigned to streams. An event may be assigned to multiple streams.  The event is distributed to subscribers and receivers based on the current subscriptions and access control.  Access control is needed because if any receiver of that subscription does not have permission to receive an event, then it never makes it into a notification, and processing of the event is completed for that subscription.</t>
            </section>
            
            <section title="Event Stream Discovery">
                <t>A NETCONF client can retrieve the list of available event streams from a NETCONF server using the <get> operation. The reply contains the elements defined in the YANG model under the container /netconf/streams, which includes the name and description of the streams.</t>
                <t>The following example shows retrieving the list of available event stream list using the <get> operation.</t>
                <figure align="center" anchor="get-streams" title="Get streams">       
                    <artwork align="left">
<rpc message-id="101" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <get>
        <filter type="subtree">
            <netconf 
                 xmlns="urn:ietf:params:xml:ns:netmod:notification">
                <streams/>
            </netconf>
        </filter>
     </get>
</rpc>
                    </artwork>
                </figure>
                <t>The NETCONF server returns a list of event streams available for subscription. In this example, the list contains the NETCONF, SNMP, and syslog-critical streams.</t>
                <figure align="center" anchor="get-streams-resp" title="Get streams response">       
                    <artwork align="left">
<rpc-reply message-id="101" 
        xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <data>
        <netconf  
               xmlns="urn:ietf:params:xml:ns:netmod:notification">
            <streams>
                <stream>
                    <name>
                        NETCONF
                    </name>
                    <description>
                        default NETCONF event stream
                    </description>
                    <replaySupport>
                        true
                    </replaySupport>
                    <replayLogCreationTime>
                        2016-02-05T00:00:00Z
                    </replayLogCreationTime>
                </stream>
                <stream>
                    <name>
                        SNMP
                    </name>
                    <description>
                        SNMP notifications
                    </description>
                    <replaySupport>
                        false
                    </replaySupport>
                </stream>
                <stream>
                    <name>
                        syslog-critical
                    </name>
                    <description>
                        Critical and higher severity
                    </description>
                    <replaySupport>
                        true
                    </replaySupport>
                    <replayLogCreationTime>
                        2007-07-01T00:00:00Z
                    </replayLogCreationTime>
                </stream>
           </streams>
        </netconf>
    </data>
</rpc-reply>
                    </artwork>
                </figure>
            </section>
            
            <section title="Default Event Stream">
                <t>A NETCONF server implementation supporting the notification capability MUST support the "NETCONF" notification event stream. This stream contains all NETCONF XML event notifications supported by the NETCONF server, except for those belonging only to streams that explicitly indicate that they must be excluded from the NETCONF stream. The exact string "NETCONF" is used during the advertisement of stream support during the <get> operation on <streams> and during the <create-subscription> and <establish-subscription> operations. </t>
            </section>
            
            <section title="Data Model Trees for Event Notifications">
                <t>The YANG data models for event notifications are depicted in the following sections. </t>
                <section title="Data Model Tree for RFC5277 (netconf namespace)">
                    <figure align="left">
                        <artwork align="left">
module: ietf-5277-netconf
rpcs:
   +---x create-subscription    
      +--ro input     
         +--ro stream?      string
         +--ro (filter-type)?
         |  +--:(rfc5277)
         |     +--ro filter       
         +--ro startTime?   yang:date-and-time
         +--ro stopTime?    yang:date-and-time
                        </artwork>
                    </figure>                    
                </section>
                
                <section title="Data Model Tree for RFC5277 (netmod namespace)">
                    <figure align="left">
                        <artwork align="left">
module: ietf-5277-netmod
   +--rw netconf
      +--rw streams
         +--rw stream* [name]
            +--rw name                     string
            +--rw description              string
            +--rw replaySupport            boolean
            +--rw replayLogCreationTime    yang:date-and-time
            +--rw replayLogAgedTime        yang:date-and-time
notifications:
   +---n replayComplete          
   +---n notificationComplete    
                        </artwork>
                    </figure>
                </section>
                    
                <section title="Data Model for RFC5277-bis Extensions">
                    <figure align="left">
                        <artwork align="left">                
module: ietf-event-notifications
   +--rw filters
   |  +--rw filter* [filter-id]
   |     +--rw filter-id    filter-id
   |     +--rw (filter-type)?
   |        +--:(rfc5277)
   |           +--rw filter       
   +--rw subscription-config {configured-subscriptions}?
   |  +--rw subscription* [subscription-id]
   |     +--rw subscription-id     subscription-id
   |     +--rw stream?             string
   |     +--rw (filter-type)?
   |     |  +--:(rfc5277)
   |     |  |  +--rw filter              
   |     |  +--:(by-reference)
   |     |     +--rw filter-ref?         filter-ref
   |     +--rw startTime?          yang:date-and-time
   |     +--rw stopTime?           yang:date-and-time
   |     +--rw encoding?           encoding
   |     +--rw receivers
   |     |  +--rw receiver* [address]
   |     |     +--rw address     inet:host
   |     |     +--rw port        inet:port-number
   |     |     +--rw protocol?   transport-protocol
   |     +--rw (push-source)?
   |        +--:(interface-originated)
   |        |  +--rw source-interface?   if:interface-ref
   |        +--:(address-originated)
   |           +--rw source-vrf?         uint32
   |           +--rw source-address      inet:ip-address-no-zone
   +--ro subscriptions
      +--ro subscriptions* [subscription-id]
         +--ro subscription-id            subscription-id
         +--ro (subscription-type)?
         |  +--:(via-configuration)
         |  |  +--ro configured-subscription?   
                               empty {configured-subscriptions}?
         |  +--:(created-via-RPC)
         |     +--ro created-subscription?      empty
         +--ro subscription-status?       identityref
         +--ro stream?                    string
         +--ro (filter-type)?
         |  +--:(rfc5277)
         |  |  +--ro filter                     
         |  +--:(by-reference)
         |     +--ro filter-ref?                filter-ref
         +--ro startTime?                 yang:date-and-time
         +--ro stopTime?                  yang:date-and-time
         +--ro encoding?                  encoding
         +--ro receivers
         |  +--ro receiver* [address]
         |     +--ro address     inet:host
         |     +--ro port        inet:port-number
         |     +--ro protocol?   transport-protocol
         +--ro (push-source)?
            +--:(interface-originated)
            |  +--ro source-interface?       if:interface-ref
            +--:(address-originated)
               +--ro source-vrf?             uint32
               +--ro source-address          inet:ip-address-no-zone
augment /netmod-notif:replayComplete:
   +--ro subscription-id?   subscription-id
augment /netmod-notif:notificationComplete:
   +--ro subscription-id?   subscription-id
augment /netmod-notif:netconf/netmod-notif:streams:
   +--rw exclude-from-NETCONF-stream?   empty
rpcs:
   +---x establish-subscription    
   |  +--ro input     
   |  |  +--ro stream?       string
   |  |  +--ro (filter-type)?
   |  |  |  +--:(rfc5277)
   |  |  |  |  +--ro filter        
   |  |  |  +--:(by-reference)
   |  |  |     +--ro filter-ref?   filter-ref
   |  |  +--ro startTime?    yang:date-and-time
   |  |  +--ro stopTime?     yang:date-and-time
   |  |  +--ro encoding?     encoding
   |  +--ro output    
   |     +--ro subscription-result    subscription-result
   |     +--ro (result)?
   |        +--:(success)
   |        |  +--ro subscription-id        subscription-id
   |        +--:(no-success)
   |           +--ro stream?                string
   |           +--ro (filter-type)?
   |           |  +--:(rfc5277)
   |           |  |  +--ro filter                 
   |           |  +--:(by-reference)
   |           |     +--ro filter-ref?            filter-ref
   |           +--ro startTime?             yang:date-and-time
   |           +--ro stopTime?              yang:date-and-time
   |           +--ro encoding?              encoding
   +---x modify-subscription       
   |  +--ro input     
   |  |  +--ro subscription-id?   subscription-id
   |  |  +--ro stream?            string
   |  |  +--ro (filter-type)?
   |  |  |  +--:(rfc5277)
   |  |  |  |  +--ro filter             
   |  |  |  +--:(by-reference)
   |  |  |     +--ro filter-ref?        filter-ref
   |  |  +--ro startTime?         yang:date-and-time
   |  |  +--ro stopTime?          yang:date-and-time
   |  |  +--ro encoding?          encoding
   |  +--ro output    
   |     +--ro subscription-result    subscription-result
   |     +--ro stream?                string
   |     +--ro (filter-type)?
   |     |  +--:(rfc5277)
   |     |  |  +--ro filter                 
   |     |  +--:(by-reference)
   |     |     +--ro filter-ref?            filter-ref
   |     +--ro startTime?             yang:date-and-time
   |     +--ro stopTime?              yang:date-and-time
   |     +--ro encoding?              encoding
   +---x delete-subscription       
      +--ro input     
         +--ro subscription-id?   subscription-id
notifications:
   +---n subscription-started         
   |  +--ro subscription-id    subscription-id
   |  +--ro stream?            string
   |  +--ro (filter-type)?
   |  |  +--:(rfc5277)
   |  |  |  +--ro filter             
   |  |  +--:(by-reference)
   |  |     +--ro filter-ref?        filter-ref
   |  +--ro startTime?         yang:date-and-time
   |  +--ro stopTime?          yang:date-and-time
   |  +--ro encoding?          encoding
   +---n subscription-suspended       
   |  +--ro subscription-id    subscription-id
   |  +--ro reason?            subscription-susp-reason
   +---n subscription-resumed         
   |  +--ro subscription-id    subscription-id
   +---n subscription-modified        
   |  +--ro subscription-id    subscription-id
   |  +--ro stream?            string
   |  +--ro (filter-type)?
   |  |  +--:(rfc5277)
   |  |  |  +--ro filter             
   |  |  +--:(by-reference)
   |  |     +--ro filter-ref?        filter-ref
   |  +--ro startTime?         yang:date-and-time
   |  +--ro stopTime?          yang:date-and-time
   |  +--ro encoding?          encoding
   +---n subscription-terminated      
   |  +--ro subscription-id    subscription-id
   |  +--ro reason?            subscription-term-reason
   +---n added-to-subscription        
   |  +--ro subscription-id    subscription-id
   |  +--ro stream?            string
   |  +--ro (filter-type)?
   |  |  +--:(rfc5277)
   |  |  |  +--ro filter             
   |  |  +--:(by-reference)
   |  |     +--ro filter-ref?        filter-ref
   |  +--ro startTime?         yang:date-and-time
   |  +--ro stopTime?          yang:date-and-time
   |  +--ro encoding?          encoding
   +---n removed-from-subscription    
      +--ro subscription-id    subscription-id
                        </artwork>
                    </figure>
                </section>
            </section>
            
            <section title="Creating a Subscription">
                <t>This operation is fully defined in <xref target="RFC5277"/>. It allows a subscriber to request the creation of a dynamic subscription. If successful, the subscription remains in effect for the duration of the NETCONF session.</t>
                <t>This operation is included in the document for supporting backwards compatibility with <xref target="RFC5277"/> clients. New clients are expected not to use this operation, but establish subscriptions as defined in <xref target="sec_establish_subs"/></t>
                
                <section title="Parameters">
                    <t>The input parameters of the operation are:</t>
                    <t>stream:  An optional parameter that indicates which stream of events is of interest.  If not present, events in the default NETCONF stream will be sent.</t>
                    <t>filter: An optional parameter that indicates which subset of all possible events is of interest.  The format of this parameter is the same as that of the filter parameter in the NETCONF protocol operations.  If not present, all events not precluded by other parameters will be sent. </t>
                    <t>startTime: An optional parameter used to trigger the replay feature and indicate that the replay should start at the time specified.  If startTime is not present, this is not a replay subscription.  It is not valid to specify start times that are later than the current time.  If the startTime specified is earlier than the log can support, the replay will begin with the earliest available notification. Implementations must support time zones.</t>
                    <t>stopTime: An optional parameter used with the optional replay feature to indicate the newest notifications of interest.  If stopTime is not present, the notifications will continue until the subscription is terminated.  Must be used with and be later than startTime. Implementations must support time zones.</t>
                </section>
                
                <section title="Usage Example">
                    <t>The following demonstrates dynamically creating a simple subscription. </t>
                    <figure align="center" anchor="simple-create-subs" title="Create subscription">       
                        <artwork align="left">
<netconf:rpc message-id="101" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <create-subscription 
        xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
    </create-subscription>
</netconf:rpc>
                        </artwork>
                    </figure>
                </section>
                
                <section title="Positive Response">
                    <t>If the NETCONF server can satisfy the request, the server sends an <ok> element.</t>
                    <figure align="center" anchor="positive-create-subs" title="Successful create subscription">       
                        <artwork align="left">
<netconf:rpc netconf:message-id="102" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <create-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
        <filter netconf:type="xpath" 
                xmlns:ex="http://example.com/event/1.0"
             select="/ex:event[ex:eventClass='fault' and 
                      (ex:severity='minor' or ex:severity='major'
                       or ex:severity='critical')]"/>
    </create-subscription>
</netconf:rpc>

<rpc-reply message-id="102" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <ok/>
</rpc-reply>
                        </artwork>
                    </figure>                
                </section>
                
                <section title="Negative Response">
                    <t>If the request cannot be completed for any reason, an <rpc-error> element is included within the <rpc-reply>. Subscription requests can fail for several reasons including if a filter with invalid syntax is provided or if the name of a non-existent stream is provided. </t>
                    <t>If a stopTime is specified in a request without having specified a startTime, the following error is returned:</t>
                    <figure>
                        <artwork align="left">
Tag: missing-element
Error-type: protocol
Severity: error
Error-info: <bad-element>: startTime
Description: An expected element is missing.
                        </artwork>
                    </figure>
                    <t>If the optional replay feature is requested but the NETCONF server does not support it, the following error is returned:</t>
                    <figure>
                        <artwork align="left">
Tag: operation-failed
Error-type: protocol
Severity: error
Error-info: none
Description: Request could not be completed because the
             requested operation failed for some reason 
             not covered by any other error condition.
                        </artwork>
                    </figure>
                    <t>If a stopTime is requested that is earlier than the specified startTime, the following error is returned:</t>
                    <figure>
                        <artwork align="left">
Tag: bad-element
Error-type: protocol
Severity: error
Error-info: <bad-element>: stopTime
Description: An element value is not correct; 
             e.g., wrong type, out of range, pattern mismatch.
                        </artwork>
                    </figure>
                    <t>If a startTime is requested that is later than the current time, the following error is returned:</t>
                    <figure>
                        <artwork align="left">
Tag: bad-element
Error-type: protocol
Severity: error
Error-info: <bad-element>: startTime
Description: An element value is not correct; 
             e.g., wrong type, out of range, pattern mismatch.
                        </artwork>
                    </figure>
                </section>                    
            </section>
            
            <section title="Establishing a Subscription" anchor="sec_establish_subs">
                <t>This operation is an evolution of the create subscription operation. It allows a subscriber to request the creation of a subscription both via RPC and configuration operations. When invoking the RPC, establish-subscription permits negotiating the subscription terms, changing them dynamically and enabling multiple subscriptions overs a single NETCONF session (if interleaving <xref target="RFC6241"/> is supported), and canceling subscriptions without terminating the NETCONF session.</t>
                <section title="Parameters">
                    <t>The input parameters of the operation are those of create subscription plus:</t>
                    <t>filter-ref: filters that have been previously (and separately) configured can be referenced by a subscription. This mechanism enables the reuse of filters.</t>
                    <t>encoding: by default, updates are encoded using XML. Other encodings may be supported, such as JSON. </t>
                </section>
                
                <section title="Usage Example">
                    <t>The following demonstrates establishing a simple subscription. </t>
                    <figure align="center" anchor="simple-establish-subs" title="Establish subscription">       
                        <artwork align="left">
<netconf:rpc message-id="101" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <establish-subscription 
            xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
    </establish-subscription>
</netconf:rpc>
                        </artwork>
                    </figure>
                </section>
                
                <section title="Positive Response">
                    <t>If the NETCONF server can satisfy the request, the server sends a positive <subscription-result> element, and the subscription-id of the accepted subscription.</t>
                    <figure align="center" anchor="positive-establish-subs" title="Successful establish subscription">       
                        <artwork align="left">
<netconf:rpc netconf:message-id="102" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <establish-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <filter netconf:type="xpath" 
                xmlns:ex="http://example.com/event/1.0"
             select="/ex:event[ex:eventClass='fault' and 
                      (ex:severity='minor' or ex:severity='major'
                       or ex:severity='critical')]"/>
    </establish-subscription>
</netconf:rpc>

<rpc-reply message-id="102" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <subscription-result 
          xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
       ok
    </subscription-result>
    <subscription-id 
          xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
       52
    </subscription-id>
</rpc-reply>        
                        </artwork>
                    </figure>                
                </section>
                
                <section title="Negative Response">
                    <t>If the NETCONF server cannot satisfy the request, the server sends a negative <subscription-result> element.</t>
                    <t>If the client has no authorization to establish the subscription, the <subscription-result> indicates an authorization error. For instance:</t>
                    <figure align="center" anchor="negative-establish-subs" title="Unsuccessful establish subscription">       
                        <artwork align="left">
<netconf:rpc netconf:message-id="103" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <establish-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <stream>foo</stream>
    </establish-subscription>
</netconf:rpc>

<rpc-reply message-id="103" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <subscription-result 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        error-data-not-authorized
    </subscription-result>
</rpc-reply>
                        </artwork>
                    </figure>                
                    <t>If the request is rejected because the server is not able to serve it, the server SHOULD include in the returned error what subscription parameters would have been accepted for the request when it was processed.  However, they are no guarantee that subsequent requests with those parameters for this client or others will be accepted. For instance, consider a subscription from <xref target="netconf-yang-push"/>, which augments the establish-subscription with some additional parameters, including "period". If the client requests a period the NETCONF server cannot serve, the exchange may be:</t>
                    <figure align="center" anchor="negotiate-establish-subs" title="Subscription establishment negotiation">       
                        <artwork align="left">
<netconf:rpc message-id="101" 
         xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
      <establish-subscription 
            xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
         <stream>push-update</stream>
         <filter netconf:type="xpath"
                  xmlns:ex="http://example.com/sample-data/1.0"
               select="/ex:foo"/>
         <period 
             xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push:1.0">
            500
         </period>
         <encoding>encode-xml</encoding>
      </establish-subscription>
</netconf:rpc>


   <rpc-reply message-id="101"
         xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
      <subscription-result 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        error-insufficient-resources
      </subscription-result>
      <period 
           xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push:1.0">
        2000
      </period>
   </rpc-reply>
                        </artwork>
                    </figure>                
                    <t>Subscription requests will fail if a filter with invalid syntax is provided or if the name of a non-existent stream is provided. </t>
                </section>                    
            </section>
            
            <section title="Modifying a Subscription">
                <t>This operation permits modifying the terms of a subscription previously established. Statically created subscriptions cannot be modified. Dynamic subscriptions can be modified one or multiple times. If the server accepts the request, it immediately starts sending events based on the new terms, completely ignoring the previous ones. If the server rejects the request, the subscription remains as prior to the request. That is, the request has no impact whatsoever. The contents of negative responses to modify-subscription requests are the same as in establish subscription requests.</t>
                <t>Dynamic subscriptions established via RPC can only be modified (or deleted) via RPC using the same session used to establish it. Configuration-based (i.e., static) subscriptions cannot be modified (or deleted) using RPCs.  Instead, configured subscriptions are modified (or deleted) as part of regular configuration operations.  Servers MUST reject any attempts to modify (or delete) static subscriptions via RPC.</t>
                <section title="Parameters">
                    <t>The parameters to modify-subscription are those of establish-subscription plus a mandatory subscription-id.</t>
                </section>
                
                <section title="Usage Example">
                    <t>The following demonstrates modifying a subscription. Consider a subscription from <xref target="netconf-yang-push"/>, which augments the establish-subscription with some additional parameters, including "period". A subscription may be established as follows.</t>
                    
                    <figure align="center" anchor="simple-create-to-modify-subs" title="Establish subscription to be modified">       
                        <artwork align="left">
<netconf:rpc message-id="101" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <establish-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <stream>push-update</stream>
        <filter netconf:type="xpath" 
            xmlns:ex="http://example.com/sample-data/1.0" 
            select="/ex:foo"/>
        <period 
              xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push:1.0">
            500
        </period>
        <encoding>encode-xml</encoding>
    </establish-subscription>
</netconf:rpc>

<rpc-reply message-id="101" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <subscription-result 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        ok
    </subscription-result>
    <subscription-id 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        1922
    </subscription-id>
</rpc-reply>
                        </artwork>
                    </figure>
                    <t>The subscription may be modified with:</t>
                    <figure align="center" anchor="simple-modify-subs" title="Modify subscription">       
                        <artwork align="left">
<netconf:rpc message-id="102" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <modify-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <subscription-id>1922</subscription-id>
        <period>1000</period>
    </modify-subscription >
</netconf:rpc>

<rpc-reply message-id="102" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <subscription-result 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        ok
    </subscription-result>
    <subscription-id 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        1922
    </subscription-id>
</rpc-reply>
                        </artwork>
                    </figure>
                </section>
                
                <section title="Positive Response">
                    <t>If the NETCONF server can satisfy the request, the server sends a positive <subscription-result> element. This response is like that to an establish-subscription request. but without the subscription-id, which would be redundant.</t>
                    <figure align="center" anchor="positive-modify-subs" title="Successful modify subscription">       
                        <artwork align="left">
<netconf:rpc message-id="102" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <modify-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <subscription-id>1922</subscription-id>
        <period 
              xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push:1.0">
            1000
        </period>
    </modify-subscription >
</netconf:rpc>

<rpc-reply message-id="102" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <subscription-result 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        ok
    </subscription-result>
</rpc-reply>
                        </artwork>
                    </figure>                
                </section>
                
                <section title="Negative Response">
                    <t>If the NETCONF server cannot satisfy the request, the server sends a negative <subscription-result> element. Its contents and semantics are identical to those to an establish-subscription request. For instance:</t>
                    <figure align="center" anchor="negative-modify-subs" title="Unsuccessful modify subscription">       
                        <artwork align="left">
<netconf:rpc message-id="102" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <modify-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <subscription-id>1922</subscription-id>
        <period 
              xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push:1.0">
            100
        </period>
    </modify-subscription>
</netconf:rpc>

<rpc-reply message-id="102" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <subscription-result 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        error-insufficient-resources
    </subscription-result>
    <period>500</period>
</rpc-reply>
                        </artwork>
                    </figure>                
                </section>                    
            </section>
            
            
            
            <section title="Deleting a Subscription">
                <t>This operation permits canceling a subscription previously established. Created subscriptions cannot be explicitly deleted. If the server accepts the request, it immediately stops sending events for the subscription. If the server rejects the request, all subscriptions remain as prior to the request. That is, the request has no impact whatsoever. A request may be rejected because the provided subscription identifier is incorrect.</t>
                <t>Subscriptions created via RPC can only be deleted via RPC using the same session used for establishment. Static subscriptions cannot be deleted using RPCs.  Instead, configured subscriptions are deleted as part of regular configuration operations. Servers MUST reject any RPC attempt to delete static subscriptions.</t>
                <section title="Parameters">
                    <t>The only parameter to delete-subscription is the identifier of the subscription to delete.</t>
                </section>
                
                <section title="Usage Example">
                    <t>The following demonstrates deleting a subscription.</t>
                    
                    <figure align="center" anchor="simple-delete-subs" title="Delete subscription">       
                        <artwork align="left">
<netconf:rpc message-id="101" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <delete-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <subscription-id>1922</subscription-id>
    </delete-subscription>
</netconf:rpc>    
                        </artwork>
                    </figure>
                </section>
                
                <section title="Positive Response">
                    <t>If the NETCONF server can satisfy the request, the server sends an OK element. For example:</t>
                    <figure align="center" anchor="positive-delete-subs" title="Successful delete subscription">       
                        <artwork align="left">
<netconf:rpc message-id="103" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <delete-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <subscription-id>1922</subscription-id>
    </delete-subscription>
</netconf:rpc>

<rpc-reply message-id="103" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <ok/>
</rpc-reply>
                        </artwork>
                    </figure>                
                </section>
                
                <section title="Negative Response">
                    <t>If the NETCONF server cannot satisfy the request, the server sends an error-rpc element. For example:</t>
                    <figure align="center" anchor="negative-delete-subs" title="Unsuccessful delete subscription">       
                        <artwork align="left">
<netconf:rpc message-id="103" 
       xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
    <delete-subscription 
           xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
        <subscription-id>2017</subscription-id>
    </delete-subscription>
</netconf:rpc>
                            
<rpc-reply message-id="101" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <rpc-error>
        <error-type>application</error-type>
        <error-tag>invalid-value</error-tag>
        <error-severity>error</error-severity>
        <error-path 
           xmlns:t="urn:ietf:params:xml:ns:netconf:notification:1.1">
          /t:subscription-id
        </error-path>
        <error-message xml:lang="en">
            Subscription-id 2017 does not exist
        </error-message>
    </rpc-error>
</rpc-reply>
                        </artwork>
                    </figure>                
                </section>                    
            </section>
            
            <section title="Static Subscriptions">
                <t>A static subscription is a subscription installed via a configuration interface.</t>                
                <t>Static subscriptions persist across reboots, and persist even when transport is unavailable.  This also means static subscriptions do not support negotiation.</t>
                <t>Static subscriptions can be modified by any configuration client with write rights on the configuration of the subscription. Subscriptions can be modified or terminated at any point of their lifetime.</t>
                <t>Supporting static subscriptions is optional and advertised using the "configured-subscriptions" feature.</t> 
   
                <section title="Creating a Static Subscription">
                    <t>Static subscriptions cannot be created via configuration operations. New clients should use the mechanisms described in <xref target="sec_establish_static_subs"/> for establishing static subscriptions.</t>
                </section>
                
                <section title="Establishing a Static Subscription" anchor="sec_establish_static_subs">
                    <t>Subscriptions can be established using configuration operations against the top-level subtree subscription-config. There are two key differences between RPC and configuration operations for subscription establishment. Firstly, configuration operations do not support negotiation while RPCs do. Secondly, while RPCs mandate that the client establishing the subscription is the only receiver of the notifications, configuration operations permit specifying receivers independent of any tracked subscriber. Immediately after a subscription is successfully established, the server sends to the receivers a control-plane notification stating the subscription has been established (subscription-started).</t>
                    <t>Because there is no explicit association with an existing transport session, static configuration operations require additional parameters to indicate the receivers of the notifications and possibly the source of the notifications (i.e., a specific interface or server address).</t>
                    <t>For example at subscription establishment, a NETCONF client may send:</t>
                    <figure align="center" anchor="establish-static-subs" title="Establish static subscription">       
                        <artwork align="left">
<rpc message-id="101" 
       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>
        <subscription-config 
            xmlns="urn:ietf:params:xml:ns:netconf:notification:1.1">
            <subscription>
                <subscription-id>
                    1922
                </subscription-id>
                <stream>
                    foo
                </stream>
                <receiver>
                    <address>
                        1.2.3.4
                    </address>
                    <port>
                        1234
                    </port>
                </receiver>
            </subscription>
        </subscription-config>
    </edit-config>
</rpc>
                        </artwork>
                    </figure>
                    <t>if the request is accepted, the server would reply:</t>
                    <figure align="center" anchor="success-establish-static-subs" title="Response to a successful static subscription establishment">       
                        <artwork align="left">
<rpc-reply message-id="101" 
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <ok/>
</rpc-reply>
                        </artwork>
                    </figure>
                    <t>if the request is not accepted because the server cannot serve it, the server may reply:</t>
                    <figure align="center" anchor="failed-establish-static-subs" title="Response to a failed static subscription establishment">       
                        <artwork align="left">
<rpc-reply 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 server cannot serve this 
            subscription due to the current workload.
        </error-message>       
    </rpc-error>
</rpc-reply>
                        </artwork>
                    </figure>

                </section>
                
                <section title="Modifying a Static Subscription">
                    <t>Static subscriptions can be modified using configuration operations against the top-level subtree subscription-config.</t>
                    <t>Immediately after a subscription is successfully modified, the server sends to the existing receivers a control-plane notification stating the subscription has been modified (i.e., subscription-modified).</t>
                    <t>If the modification involved adding and/or removing receivers, those modified receivers are sent control-plane notifications, indicating they have been added (i.e, added-to-subscription, with the same contents as a modified-subscription) or removed (i.e., removed-from-subscription)</t>
                </section>
                    
                <section title="Deleting a Static Subscription">
                    <t>Subscriptions can be deleted using configuration operations against the top-level subtree subscription-config. For example:</t>
                    <figure align="center" anchor="delete-static-subs" title="Deleting a static subscription">       
                        <artwork align="left">
<rpc message-id="101" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <edit-config>
        <target>
            <running/>
        </target>
        <subscription-config 
        xmlns:xc="urn:ietf:params:xml:ns:netconf:notification:1.1">
            <subscription xc:operation="delete">
                <subscription-id>
                    1922
                </subscription-id >
           </subscription>
        </subscription-config>
    </edit-config>
</rpc>

<rpc-reply message-id="101" 
       xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <ok/>
</rpc-reply>

                        </artwork>
                    </figure>
                    <t>Immediately after a subscription is successfully deleted, the server sends to the receivers a control-plane notification stating the subscription has been terminated (subscription-terminated).</t>                    
                </section>
            </section>
        
            <section title="Event (Data Plane) Notifications">
                <t>Once a subscription has been set up, the NETCONF server sends (asynchronously) the event notifications from the subscribed stream. We refer to these as data plane notifications. For dynamic subscriptions set up via RPC operations, event notifications are sent over the NETCONF session used to create or establish the subscription.  For static subscriptions, event notifications are sent over the specified connections.</t>
                <t>An event notification is sent to the receiver(s) when an event of interest (i.e., meeting the specified filtering criteria) has occurred.  An event notification is a complete and well-formed XML document.  Note that <notification> is not a Remote Procedure Call (RPC) method but rather the top-level element identifying the one-way message as a notification. Note that event notifications never trigger responses.</t>
                <t>The event notification always includes an <eventTime> element. It is the time the event was generated by the event source. This parameter is of type dateTime and compliant to <xref target="RFC3339"/>. Implementations must support time zones.</t>
                <t>The event notification also contains notification-specific tagged content, if any.  With the exception of <eventTime>, the content of the notification is beyond the scope of this document.</t>
                <t>For the encodings other than XML, notifications include an additional XML element so that the notification is a well-formed XML. The element is <notification-contents-{encoding}>, E.g., <notification-contents-json>. That element contains the notification contents in the desired encoding</t>
                <t>The following is an example of an event notification from <xref target="RFC6020"/>:</t>
                <figure align="center" anchor="link-failure-notif" title="Definition of a data plane notification">       
                    <artwork align="left">
notification link-failure {
  description "A link failure has been detected";
    leaf if-name {
      type leafref {
        path "/interface/name";
      }
    }
    leaf if-admin-status {
      type admin-status;
    }
    leaf if-oper-status {
      type oper-status;
    }
}
                    </artwork>
                </figure>
                
                <figure align="center" anchor="simple-data-plane-notif" title="Data plane notification">       
                    <artwork align="left">
<notification 
       xmlns=" urn:ietf:params:xml:ns:netconf:notification:1.0">
    <eventTime>2007-09-01T10:00:00Z</eventTime>
    <link-failure xmlns="http://acme.example.com/system">
        <if-name>so-1/2/3.0</if-name>
        <if-admin-status>up</if-admin-status>
        <if-oper-status>down</if-oper-status>
    </link-failure>
</notification>
                    </artwork>
                </figure>
                
                <t>The equivalent using json encoding would be</t>
                <figure align="center" anchor="simple-data-plane-notif-json" title="Data plane notification using JSON encoding">       
                    <artwork align="left">
<notification 
       xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
    <eventTime>2007-09-01T10:00:00Z</eventTime>
    <notification-contents-json>
       {
          "acme-system:link-failure": {
            "if-name": "so-1/2/3.0",
            "if-admin-status": "up",
            "if-oper-status": "down "
          }
        }      
    </notification-contents-json>
 </notification>
                    </artwork>
                </figure>
            </section>
        
            <section title="Control Plane Notifications">
                <t>In addition to data plane notifications, a server may send control plane notifications to indicate to receivers that an event related to the subscription management has occurred. Control plane notifications cannot be filtered out. Types of control plane notifications include: </t>
                <section title="replayComplete">
                    <t>This notification is originally defined in <xref target="RFC5277"/>. It is sent to indicate that all of the replay notifications have been sent and must not be sent for any other reason. </t>
                    <t>In the case of a subscription without a stop time, after the <replayComplete> notification has been sent, it can be expected that any notifications generated since the start of the subscription creation will be sent, followed by notifications as they arise naturally within the system.</t>
                </section>
                
                <section title="notificationComplete">
                    <t>This notification is originally defined in <xref target="RFC5277"/>. It is sent to indicate that a subscription, which includes a stop time has finished passing events.</t>
                </section>
                
                <section title="subscription-started">
                    <t>This notification indicates that a static subscription has started and data updates are beginning to be sent. This notification includes the parameters of the subscription, except for the receiver(s) addressing information and push-source information. Note that for RPC-based subscriptions, no such notifications are sent.</t>
                </section>
                
                <section title="subscription-modified">
                    <t>This notification indicates that a static subscription has been modified successfully. This notification includes the parameters of the subscription, except for the receiver(s) addressing information and push-source information. Note that for RPC-based subscriptions, no such notifications are sent.</t>
                </section>
                
                <section title="subscription-terminated">
                    <t>This notification indicates that a subscription has been terminated. The notification includes the reason for the termination. A subscription may be terminated by a server or by a client. The server may decide to terminate a subscription when it is running out of resources for serving it, an internal error occurs, etc. Server-driven terminations are notified to all receivers. The management plane can also terminate static subscriptions using configuration operations.</t>
                    <t>Clients can terminate via RPC subscriptions established via RPC. In such cases, no subscription-terminated notifications are sent. </t>
                </section>
                
                <section title="subscription-suspended">
                    <t>This notification indicates that a server has suspended a subscription. The notification includes the reason for the suspension. A possible reason is the lack of resources to serve it. No further data plane notifications will be sent until the subscription resumes. Suspensions are notified to the subscriber (in the case of dynamic subscriptions) and all receivers (in the case of static subscriptions). </t>
                </section>
                
                <section title="subscription-resumed">
                    <t>This notification indicates that a previously suspended dubscription has been resumed. Data plane notifications generated in the future will be sent after the subscription terms. Resumptions are notified to the subscriber (in the case of dynamic subscriptions) and all receivers (in the case of static subscriptions).</t>
                </section>
            </section>
            
            <section title="Subscription Management">
                <t>Below is the state machine for the server.  It is important to note that a subscription does not exist at the agent until it is accepted and made active.</t>
                <figure>
                    <artwork><![CDATA[                 .-------.
                 | start |
                 '-------'
                     |
            create   |  establish
                     |
                     |   .----------modify-------------.
                     v   v                              '
               .-----------.                      .-----------.
    .--------. |           |------>suspend------->|           |
  modify      '|  active   |                      | suspended |
    '--------->|           |<----reactivate<------|           |
               '-----------'                      '-----------'
                     |                                  |
                  delete                             delete
                     |                                  |
                     v                                  |
                 .-------.                              |
                 |  end  |<-----------------------------'
                 '-------']]></artwork>
                </figure>
                <t>Of interest in this state machine are the following:</t>
                <t><list style="symbols">
                    <t>Successful <create-subscription>, <establish-subscription> or <modify-subscription> actions must put the subscription into an active state.</t>
                    <t>Failed <modify-subscription> actions will leave the subscription in its previous state, with no visible change to any notifications.</t>
                    <t>A <delete-subscription> action will delete the entire subscription.</t>
                </list></t>                
            </section>
        </section>

        <section title="Data Models for Event Notifications">
            <section title="Data Model for RFC5277 (netmod namespace)">
                <figure>
                    <artwork>
<CODE BEGINS>
file "ietf-5277-netmod@2016-03-21.yang"
module ietf-5277-netmod {
  namespace 
    "urn:ietf:params:xml:ns:yang:ietf-5277-netmod";
    // TODO: examples in the draft consider the namespace below
    //       which follows the namespace format in 5277 
    // "urn:ietf:params:xml:ns:netmod:notification";
  prefix netmod-notif;

  import ietf-yang-types {
    prefix yang;
  }

  organization "IETF";
  contact
    "WG Web:   <http://tools.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>
     
     
     WG Chair: Juergen Schoenwaelder
               <mailto:j.schoenwaelder@jacobs-university.de>
     WG Chair: Tom Nadeau
                <mailto:tnadeau@lucidvision.com>
     
     Editor:   Alberto Gonzalez Prieto
               <mailto:albertgo@cisco.com>

     Editor:   Alexander Clemm
               <mailto:alex@cisco.com>

     Editor:   Eric Voit
               <mailto:evoit@cisco.com>

     Editor:   Einar Nilsen-Nygaard
               <mailto:einarnn@cisco.com>

     Editor:   Ambika Prasad Tripathy
               <mailto:ambtripa@cisco.com>";

  description
    "Model for RPC in RFC 5277: NETCONF Event Notifications";
  
  revision 2016-03-21 {
    description
      "Model for data nodes and notifications in RFC 5277: 
       NETCONF Event Notifications";
    reference 
      "RFC 5277: NETCONF Event Notifications";
  }


  /*
   * EXTENSIONS
   */
   
  extension control-plane-notif {
    description
      "This statement applies only to notifications.
       It indicates that the notification is a control-plane
       notification and therefore it does not generate an 
       event stream.";
  }

           
  /*
   * DATA NODES
   */
  container netconf {
    description
      "Netconf container as defined in RFC 5277.";
    reference
      "RFC 5277: NETCONF Event Notifications";

    container streams {
      // TODO: should be config false?. That breaks the leafref 
      // from the config subscriptions config false;
      description
        "The container with the set of available event streams.";
      reference
        "RFC 5277: NETCONF Event Notifications";

      list stream {
        must "1 = count(./name == 'NETCONF')" {
          description
            "The list must contain a NETCONF stream.
             A NETCONF server implementation supporting the 
             notification capability MUST support the 
             'NETCONF' notification event stream. This stream 
             contains all NETCONF XML event notifications supported 
             by the NETCONF server.  
             The exact string 'NETCONF' is used during the 
             advertisement of stream support during the <get> 
             operation on <streams> and during the 
             <create-subscription> operation.";
        }
        key "name";
        description
          "The list available event streams.";
        leaf name {
          type string;
          description
            "The name of the event stream.  
             If this is the default NETCONF stream, this must have
             the value 'NETCONF'.";
        }
        leaf description {
          type string;
          mandatory true;
          description
            "A description of the event stream, including such 
             information as the type of events that are sent over 
             this stream.";
        }
        leaf replaySupport {
          type boolean;
          mandatory true;
          description 
            "An indication of whether or not event replay is 
             available on this stream.";
        }
        leaf replayLogCreationTime {
          when "../replaySupport" {
            description
              "This object MUST be present if replay is supported.";
          }
          type yang:date-and-time;
          mandatory true;
          description
            "The timestamp of the creation of the log used to 
             support the replay function on this stream.
             Note that this might be earlier then the earliest 
             available notification in the log.  This object
             is updated if the log resets for some reason.  
             This object MUST be present if replay is supported.";
        }
        leaf replayLogAgedTime {
          when "current()/../replaySupport" {
            description 
              "This object MUST be present if replay is supported 
              and any notifications have been aged out of the log.";
          }
          type yang:date-and-time;
          mandatory true;
          description
            "The timestamp of the last notification aged 
             out of the log. This object MUST be present 
             if replay is supported and any notifications
             have been aged out of the log.";
        }
      } // list stream
    } // container streams
  } // container netconf
  
  
  /*
   * NOTIFICATIONS
   */
   
  notification replayComplete {
    netmod-notif:control-plane-notif;
    description
      "This notification is sent to signal the end of a replay
       portion of a subscription.";
  }
  
  notification notificationComplete {
    netmod-notif:control-plane-notif;
    description
      "This notification is sent to signal the end of a notification 
       subscription.  It is sent in the case that stopTime was 
       specified during the creation of the subscription.";
  }
}

<CODE ENDS> 
                    </artwork>
                </figure>
            </section>
            
            <section title="Data Model for RFC5277 (netconf namespace)">
                <figure>
                    <artwork>
<CODE BEGINS>
file "ietf-5277-netconf@2016-03-21.yang"
module ietf-5277-netconf {
  namespace 
    "urn:ietf:params:xml:ns:yang:ietf-5277-netconf";
    // TODO: examples in the draft consider the namespace below
    //       which follows the namespace format in 5277 
    // "urn:ietf:params:xml:ns:netconf:notification:1.0";
  prefix notif;


  import ietf-yang-types {
    prefix yang;
  }

  organization "IETF";
  contact
    "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
     
     WG Chair: Mahesh Jethanandani
               <mailto:mjethanandani@gmail.com>
     
     WG Chair: Mehmet Ersue
               <mailto:mehmet.ersue@nokia.com>

     Editor:   Alberto Gonzalez Prieto
               <mailto:albertgo@cisco.com>

     Editor:   Alexander Clemm
               <mailto:alex@cisco.com>

     Editor:   Eric Voit
               <mailto:evoit@cisco.com>

     Editor:   Einar Nilsen-Nygaard
               <mailto:einarnn@cisco.com>

     Editor:   Ambika Prasad Tripathy
               <mailto:ambtripa@cisco.com>";

  description
    "Model for RPCs and Notifications in RFC 5277: NETCONF Event 
     Notifications";
  
  revision 2016-03-21 {
    description
      "Model for RPC in RFC 5277: NETCONF Event Notifications";
    reference 
      "RFC 5277: NETCONF Event Notifications";
  }
  

  /*
   * GROUPINGS
   */
   
  grouping base-filter {
    description
      "This grouping defines the base for filters for 
       notification events.
       It includes the filter defined in 5277 and
       it enables extending filtering to other 
       types of filters";
    choice filter-type {
      description
        "A filter needs to be a single filter of a given type.
         Mixing and matching of multiple filters does not occur
         at the level of this grouping.";
      case rfc5277 {
        anyxml filter {
          description
            "Filter per RFC 5277. Notification filter.
            If a filter element is specified to look for data of a 
            particular value, and the data item is not present 
            within a particular event notification for its value to 
            be checked against, the notification will be filtered 
            out. For example, if one were to check for
            'severity=critical' in a configuration event 
            notification where this field was not supported, then 
            the notification would be filtered out. For subtree 
            filtering, a non-empty node set means that the filter 
            matches.  For XPath filtering, the mechanisms defined 
            in [XPATH] should be used to convert the returned 
            value to boolean.";
        }
      }
    }
  }
  
  grouping subscription-info-5277 {
    description
      "This grouping describes the information in a 5277 
       subscription.";
    leaf stream {
      type string;
      default "NETCONF";
      description
        "Indicates which stream of events is of interest.  
         If not present, events in the default NETCONF stream 
         will be sent.";
    }
    uses base-filter;
    leaf startTime {
      type yang:date-and-time;
      description
        "Used to trigger the replay feature
         and indicate that the replay should start at the time
         specified.  If <startTime> is not present, this is 
         not a replay subscription.  
         It is not valid to specify start 
         times that are later than the current time.  If the 
         <startTime> specified is earlier than the log can 
         support, the replay will begin with the earliest available 
         notification.  This parameter is of type dateTime and 
         compliant to [RFC3339].  Implementations must
         support time zones.";
    }
    leaf stopTime {
      type yang:date-and-time;
      must "current()  > ../startTime" {
        description 
          "stopTime must be used with and be later than 
           <startTime>";
      }
      description
        "Used with the optional replay feature to indicate the 
         newest notifications of interest. If <stopTime> is 
         not present, the notifications will continue until the 
         subscription is terminated.  Must be used with and be 
         later than <startTime>.  Values of <stopTime> 
         in the future are valid. This parameter is of type dateTime 
         and compliant to [RFC3339].  Implementations must support 
         time zones.";
    }
  }


  /*
   * RPCs
   */
   
  rpc create-subscription {
    description
      "This operation initiates an event notification subscription 
       that will send asynchronous event notifications to the 
       initiator of the command until the subscription terminates.";
    input {
      uses subscription-info-5277;
    }
  }  
}
               
<CODE ENDS> 
                    </artwork>
                </figure>
            </section>
            
            <section title="Data Model for RFC5277-bis Extensions">
                <figure>
                    <artwork>
<CODE BEGINS>
file "ietf-event-notifications@2016-03-21.yang"
module ietf-event-notifications {
  namespace 
    "urn:ietf:params:xml:ns:yang:ietf-event-notifications";
    // TODO: examples in the draft consider the namespace below
    //       which follows the namespace format in 5277 
    // "urn:ietf:params:xml:ns:netconf:notification:1.1";
  prefix notif-bis;


  import ietf-inet-types {
    prefix inet;
  }
  import ietf-5277-netmod {
    prefix netmod-notif;
  }
  import ietf-5277-netconf {
    prefix notif;
  }
  import ietf-interfaces {
    prefix if;
  }

  organization "IETF";
  contact
    "WG Web:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>
     
     WG Chair: Mahesh Jethanandani
               <mailto:mjethanandani@gmail.com>
     
     WG Chair: Mehmet Ersue
               <mailto:mehmet.ersue@nokia.com>

     Editor:   Alberto Gonzalez Prieto
               <mailto:albertgo@cisco.com>

     Editor:   Alexander Clemm
               <mailto:alex@cisco.com>

     Editor:   Eric Voit
               <mailto:evoit@cisco.com>

     Editor:   Einar Nilsen-Nygaard
               <mailto:einarnn@cisco.com>

     Editor:   Ambika Prasad Tripathy
               <mailto:ambtripa@cisco.com>";

  description
    "This module contains conceptual YANG specifications
     for NETCONF Event Notifications.";
  
  revision 2016-03-21 {
    description
      "Initial version. Model for NETCONF Notifications (bis)";
    reference 
      "RFC XXXX: NETCONF Event Notifications";
  }
  
  
  /*
   * FEATURES
   */
  
  feature json {
    description
      "This feature indicates that JSON encoding of notifications
       is supported.";
  }

  feature configured-subscriptions {
    description
      "This feature indicates that management plane configuration 
       of subscription is supported.";
  }

  /*
   * IDENTITIES
   */

  /* Identities for subscription results */
  identity subscription-result {
    description
      "Base identity for RPC responses to requests surrounding
       management (e.g. creation, modification) of 
       subscriptions.";
  }

  identity ok {
    base subscription-result;
    description
      "OK - RPC was successful and was performed as requested.";
  }

  identity error {
    base subscription-result;
    description
      "RPC was not successful.
       Base identity for error return codes.";
  }

  identity error-no-such-subscription {
    base error;
    description
      "A subscription with the requested subscription ID
       does not exist.";
  }

  identity error-no-such-option {
    base error;
    description
      "A requested parameter setting is not supported.";
  }

  identity error-insufficient-resources {
    base error;
    description
      "The server has insufficient resources to support the 
       subscription as requested.";
  }

  /* Identities for subscription stream status */
  identity subscription-stream-status {
    description
      "Base identity for the status of subscriptions and
       datastreams.";
  }

  identity active {
    base subscription-stream-status;
    description
      "Status is active and healthy.";
  }

  identity inactive {
    base subscription-stream-status;
    description
      "Status is inactive, for example outside the
       interval between start time and stop time.";
  }

  identity in-error {
    base subscription-stream-status;
    description
      "The status is in error or degraded, meaning that
       stream and/or subscription is currently unable to provide
       the negotiated notifications.";
  }

  /* Identities for subscription errors */
  identity subscription-errors {
    description
      "Base identity for subscription error status.
       This identity is not to be confused with error return 
       codes for RPCs";
  }

  identity internal-error {
    base subscription-errors;
    description
      "Subscription failures caused by server internal error.";
  }

  identity no-resources {
    base subscription-errors;
    description
      "Lack of resources, e.g. CPU, memory, bandwidth";
  }

  identity subscription-deleted {
    base subscription-errors;
    description
      "The subscription was terminated because the subscription
       was deleted.";
  }

  /* Identities for encodings */
  identity encodings {
    description
      "Base identity to represent data encodings";
  }

  identity encode-xml {
    base encodings;
    description
      "Encode data using XML";
  }

  identity encode-json {
    base encodings;
    description
      "Encode data using JSON";
  }

  /* Identities for transports */
  identity transport {
    description
      "An identity that represents a transport protocol for event 
       notifications";
  }

  identity netconf {
    base transport;
    description
      "Netconf notifications as a transport.";
  }

  /*
   * TYPEDEFs
   */

  typedef subscription-id {
    type uint32;
    description
      "A type for subscription identifiers.";
  }

  typedef filter-id {
    type uint32;
    description
      "A type to identify filters which can be associated with a 
       subscription.";
  }

  typedef subscription-result {
    type identityref {
      base subscription-result;
    }
    description
      "The result of a subscription operation";
  }

  typedef subscription-term-reason {
    type identityref {
      base subscription-errors;
    }
    description
      "Reason for a server to terminate a subscription.";
  }

  typedef subscription-susp-reason {
    type identityref {
      base subscription-errors;
    }
    description
      "Reason for a server to suspend a subscription.";
  }

  typedef encoding {
    type identityref {
      base encodings;
    }
    description
      "Specifies a data encoding, e.g. for a data subscription.";
  }

  typedef transport-protocol {
    type identityref {
      base transport;
    }
    description
      "Specifies transport protocol used to send notifications to a
       receiver.";
  }

  typedef push-source {
    type enumeration {
      enum "interface-originated" {
        description
          "Notifications will be sent from a specific interface on a 
           NETCONF server";
      }
      enum "address-originated" {
        description
          "Notifications will be sent from a specific address on a 
           NETCONF server";
      }
    }
    description
      "Specifies from where notifications will be sourced when 
       being sent by the NETCONF server.";
  }

  typedef stream-ref {
    type leafref {
      path "/netmod-notif:netconf/netmod-notif:streams/" +
            "netmod-notif:stream/netmod-notif:name";
    }
    description
      "This type is used to reference a stream.";
  }
  
  typedef filter-ref {
    type leafref {
      path "/notif-bis:filters/notif-bis:filter/notif-bis:filter-id";
    }
    description
      "This type is used to reference a filter.";
  }


  /*
   * GROUPINGS
   */
   
  grouping subscription-info {
    description
      "This grouping describes basic information concerning a
       subscription.";
    uses notif:subscription-info-5277 {
      augment "filter-type" {
        description
          "Post-5277 subscriptions allow references to existing 
           filters";
        case by-reference {
          description
            "Incorporate a filter that has been configured
             separately.";
          leaf filter-ref {
            type filter-ref;
            description
              "References filter which is associated with the
               subscription.";
          }
        }
      }
    }
    leaf encoding {
      type encoding;
      default "encode-xml";
      description
        "The type of encoding for the subscribed data.
         Default is XML";
    }
  }

  grouping push-source-info {
    description
      "Defines the sender source from which notifications 
       for a configured subscription are sent.";
    choice push-source {
      description
        "Identifies the egress interface on the Publisher from
         which notifications will or are being sent.";
      case interface-originated {
        description
          "When the push source is out of an interface on the 
           Publisher established via static configuration.";
        leaf source-interface {
          type if:interface-ref;
          description
            "References the interface for notifications.";
        }
      }
      case address-originated {
        description
          "When the push source is out of an IP address on the 
           Publisher established via static configuration.";
        leaf source-vrf {
          type uint32 {
            range "16..1048574";
          }
          description
            "Label of the vrf.";
        }
        leaf source-address {
          type inet:ip-address-no-zone;
          mandatory true;
          description
            "The source address for the notifications.";
        }
      }
    }
  }

  grouping receiver-info {
    description
      "Defines where and how to deliver notifications for a 
       configured subscription.  This includes
       specifying the receiver, as well as defining  
       any network and transport aspects when sending of 
       notifications occurs outside of Netconf.";
    container receivers {
      description
        "Set of receivers in a subscription.";
      list receiver {
        key "address";
        min-elements 1;
        description
          "A single host or multipoint address intended as a target
           for the notifications for a subscription.";
        leaf address {
          type inet:host;
          mandatory true;
          description
            "Specifies the address for the traffic to reach a
             remote host. One of the following must be
             specified: an ipv4 address, an ipv6 address,
             or a host name.";
        }
        leaf port {
          type inet:port-number;
          mandatory true;
          description
            "This leaf specifies the port number to use for messages
             destined for a receiver.";
        }
        leaf protocol {
          type transport-protocol;
          default "netconf";
          description
            "This leaf specifies the transport protocol used
             to deliver messages destined for the receiver.";
        }
      }
    }
  }

  grouping subscription-response {
    description
      "Defines the output to the rpc's establish-subscription
       and modify-subscription.";
    leaf subscription-result {
      type subscription-result;
      mandatory true;
      description
        "Indicates whether subscription is operational, 
         or if a problem was encountered.";
    }
    choice result {
      description
        "Depending on the subscription result, different
         data is returned.";
      case success {
        description
          "This case is used when the subscription request
           was successful and a subscription was created/modified 
           as a result";
        leaf subscription-id {
          type subscription-id;
          mandatory true;
          description
            "Identifier used for this subscription.";
        }
      }
      case no-success {
        description
          "This case applies when a subscription request
           was not successful and no subscription was 
           created (or modified) as a result.  In this case, 
           information MAY be returned that indicates 
           suggested parameter settings that would have a 
           high likelihood of succeeding in a subsequent 
           establish-subscription or modify-subscription
           request.";
        uses subscription-info;
      }
    }
  }

  /*
   * RPCs
   */
   
  rpc establish-subscription {
    description
      "This RPC allows a subscriber to create 
       (and possibly negotiate) a subscription on its own behalf.  
       If successful, the subscription
       remains in effect for the duration of the subscriber's
       association with the publisher, or until the subscription
       is terminated by virtue of a delete-subscription request.
       In case an error (as indicated by subscription-result)
       is returned, the subscription is 
       not created.  In that case, the RPC output   
       MAY include suggested parameter settings
       that would have a high likelihood of succeeding in a 
       subsequent create-subscription request.";
    input {
      uses subscription-info;
    }
    output {
      uses subscription-response;
    }
  }
  
  rpc modify-subscription {
    description
      "This RPC allows a subscriber to modify a subscription
       that was previously created using create-subscription.
       If successful, the subscription
       remains in effect for the duration of the subscriber's
       association with the publisher, or until the subscription
       is terminated by virtue of a delete-subscription request.
       In case an error is returned (as indicated by 
       subscription-result), the subscription is 
       not modified and the original subscription parameters 
       remain in effect.  In that case, the rpc error response 
       MAY include suggested parameter settings
       that would have a high likelihood of succeeding in a 
       subsequent modify-subscription request.";
    input {
      leaf subscription-id {
        type subscription-id;
        description
          "Identifier to use for this subscription.";
      }
      uses subscription-info;
    }
    output {
      leaf subscription-result {
        type subscription-result;
        mandatory true;
        description
          "Indicates whether subscription was modified 
           or if a problem was encountered.  
           In case the subscription-result has a value 
           other than OK, the original subscription was not 
           changed.";
      }
      uses subscription-info;
    }
  }
  
  rpc delete-subscription {
    description
      "This RPC allows a subscriber to delete a subscription that
       was previously created using create-subscription.";
    input {
      leaf subscription-id {
        type subscription-id;
        description
          "Identifier of the subscription that is to be deleted.
           Only subscriptions that were created using
           create-subscription can be deleted via this RPC.";
      }
    }
  }
  
  
  /*
   * NOTIFICATIONS
   */
   
  notification subscription-started {
    netmod-notif:control-plane-notif;
    description
      "This notification indicates that a subscription has
       started and notifications are beginning to be sent.
       This notification shall only be sent to receivers
       of a subscription; it does not constitute a general-purpose
       notification.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    uses subscription-info;
  }
  
  notification subscription-suspended {
    netmod-notif:control-plane-notif;
    description
      "This notification indicates that a suspension of the
       subscription by the server has occurred.  No further
       notifications will be sent until subscription
       resumes.
       This notification shall only be sent to receivers
       of a subscription; it does not constitute a general-purpose
       notification.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    leaf reason {
      type subscription-susp-reason;
      description
        "Provides a reason for why the subscription was
         suspended.";
    }
  }

  notification subscription-resumed {
    netmod-notif:control-plane-notif;
    description
      "This notification indicates that a subscription that had
       previously been suspended has resumed. Notifications
       will once again be sent.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
  }
  
  notification subscription-modified {
    netmod-notif:control-plane-notif;
    description
      "This notification indicates that a subscription has
       been modified.  Notifications sent from this point
       on will conform to the modified terms of the
       subscription.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    uses subscription-info;
  }
  
  notification subscription-terminated {
    netmod-notif:control-plane-notif;
    description
      "This notification indicates that a subscription has been
       terminated.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    leaf reason {
      type subscription-term-reason;
      description
        "Provides a reason for why the subscription was
         terminated.";
    }
  }
  
  notification added-to-subscription {
    netmod-notif:control-plane-notif;
    description
      "This notification is sent to a receiver when it has been
       added to an existing subscription.
       Note that if the receiver is added when the subscription
       is created, it will receive a subscription-started
       notification and no added-to-subscription.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    uses subscription-info;
  }
  
  notification removed-from-subscription {
    netmod-notif:control-plane-notif;
    description
      "This notification is sent to a receiver when it has been
       removed from an existing subscription.
       Note that if the subscription is terminated, the receiver 
       will receive a subscription-terminated notification
       and no removed-from-subscription.";
    leaf subscription-id {
      type subscription-id;
      mandatory true;
      description
        "This references the affected subscription.";
    }
  }
  
  augment /netmod-notif:replayComplete {
    description
      "Augmenting the definition in RFC-5277 to include the 
       subscription identifier defined in 5277-bis";
    leaf subscription-id {
      type subscription-id;
      description
        "This references the affected subscription.
         Not present for created subscriptions for backwards 
         compatibility.";
    }  
  }
  
  augment /netmod-notif:notificationComplete {
    description
      "Augmenting the definition in RFC-5277 to include the 
       subscription identifier defined in 5277-bis";
    leaf subscription-id {
      type subscription-id;
      description
        "This references the affected subscription.
         Not present for created subscriptions for backwards 
         compatibility.";
    }  
  }
  
  
  
             
  /*
   * DATA NODES
   */

  container filters {
    description
      "This container contains a list of configurable filters
       that can be applied to subscriptions.  This facilitates
       the reuse of complex filters once defined.";
    list filter {
      key "filter-id";
      description
        "A list of configurable filters that can be applied to
         subscriptions.";
      leaf filter-id {
        type filter-id;
        description
          "An identifier to differentiate between filters.";
      }
      uses notif:base-filter;
    }
  }
  container subscription-config {
    if-feature "configured-subscriptions";
    description
      "Contains the list of subscriptions that are configured,
       as opposed to established via RPC or other means.";
    list subscription {
      key "subscription-id";
      description
        "Content of a subscription.";
      leaf subscription-id {
        type subscription-id;
        description
          "Identifier to use for this subscription.";
      }
      uses subscription-info;
      uses receiver-info {
        if-feature "configured-subscriptions";
      }
      uses push-source-info {
        if-feature "configured-subscriptions";
      }
    }
  }
  container subscriptions {
    config false;
    description
      "Contains the list of currently active subscriptions,
       i.e. subscriptions that are currently in effect,
       used for subscription management and monitoring purposes.
       This includes subscriptions that have been setup via RPC
       primitives, e.g. create-subscription, delete-subscription,
       and modify-subscription, as well as subscriptions that
       have been established via configuration.";
    list subscriptions {
      key "subscription-id";
      config false;
      description
        "Content of a subscription.
         Subscriptions can be created using a control channel
         or RPC, or be established through configuration.";
      leaf subscription-id {
        type subscription-id;
        description
          "Identifier of this subscription.";
      }
      choice subscription-type {
        description 
          "This choice contains a set of flags to indicate
           the type of subscription.";
        case via-configuration {
          leaf configured-subscription {
            if-feature "configured-subscriptions";
            type empty;
            description
              "The presence of this leaf indicates that the
               subscription originated from configuration, not 
               through a control channel or RPC.";
          }
        }
        case created-via-RPC {
          leaf created-subscription {
            type empty;
            description
              "The presence of this leaf indicates that the
               subscription originated via RPC using RFC5277 
               mechanisms and semantics.";
          }
        }
      }
      leaf subscription-status {
        type identityref {
          base subscription-stream-status;
        }
        description
          "The status of the subscription.";
      }
      uses subscription-info;
      uses receiver-info {
        if-feature "configured-subscriptions";
      }
      uses push-source-info {
        if-feature "configured-subscriptions";
      }
    }
  }
   
  augment /netmod-notif:netconf/netmod-notif:streams {
    description
      "Augmenting the definition in RFC-5277 to so that streams 
       can opt out the default stream.";
    leaf exclude-from-NETCONF-stream {
        type empty;
        description
          "Indicates that the stream should not be part of the 
           default stream.";        
    }
  }

}

<CODE ENDS> 
                    </artwork>
                </figure>                
            </section>
        </section>
        
        
        <section title="Backwards Compatibility">
            <t>Capabilities are advertised in messages sent by each peer during session establishment <xref target="RFC6241"/>. Servers supporting the features in this document must advertise both capabilities "urn:ietf:params:netconf:capability:notification:1.0"  and "urn:ietf:params:netconf:capability:notification:1.1".</t>
            <t>An example of a hello message by a server during session establishment would be:</t>
            <figure align="center" anchor="simple-hello" title="Hello message">       
                <artwork align="left">
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <capabilities>
        <capability>
            urn:ietf:params:xml:ns:netconf:base:1.0
        </capability>
        <capability>
            urn:ietf:params:netconf:capability:startup:1.0
        </capability>
        <capability>
            urn:ietf:params:netconf:capability:notification:1.0
        </capability>
        <capability>
            urn:ietf:params:netconf:capability:notification:1.1
        </capability>
    </capabilities>
    <session-id>4</session-id>
</hello>
                </artwork>
            </figure>
            <t>Clients that only support <xref target="RFC5277"/> recognize capability "urn:ietf:params:netconf:capability:notification:1.0" and ignore capability "urn:ietf:params:netconf:capability:notification:1.1". This allows them interacting with the server as per [RFC5277]. Clients that support the features in this document recognize both capabilities. This allows them interacting with the server as per this document.</t>
            <t>Note that to support backwards compatibility, the yang models in this document include two types of naming conventions. That used in <xref target="RFC5277"/>, e.g., replayComplete; and that commonly used in yang models, e.g., subscription-started.</t>

        </section>
        
        <section title="Security Considerations">
            <t>The security considerations from the base NETCONF document <xref target="RFC6241"/> also apply to the notification capability.</t>
            <t>The <notification> elements are never sent before the transport layer and the NETCONF layer, including capabilities exchange, have been established and the manager has been identified and authenticated.</t>
            <t>A secure transport must be used and the server must ensure that the user has sufficient authorization to perform the function they are requesting against the specific subset of NETCONF content involved.  When a <get> is received that refers to the content defined in this memo, clients should only be able to view the content for which they have sufficient privileges.  <create-subscriptiont> and <establish-subscriptiont> operations can be considered like deferred <get>, and the content that different users can access may vary. This different access is reflected in the <notificationt> that different users are able to subscribe to. </t>
            <t>The contents of notifications, as well as the names of event streams, may contain sensitive information and care should be taken to ensure that they are viewed only by authorized users.  The NETCONF server MUST NOT include any content in a notification that the user is not authorized to view.</t>
            <t>If a malicious or buggy NETCONF client sends a number of <create-subscription> requests, then these subscriptions accumulate and may use up system resources.  In such a situation, subscriptions can be terminated by terminating the suspect underlying NETCONF sessions using the <kill-session> operation. If the client uses <establish-subscription>, the server can also suspend or terminate subscriptions with per-subscription granularity.</t>
            <t>A subscription could be configured on another receiver's behalf, with the goal of flooding that receiver with updates.  One or more publishers could be used to overwhelm a receiver, which doesn't even support subscriptions.  Clients that do not want pushed data need only terminate or refuse any transport sessions from the publisher. In addition, the NETCONF Authorization Control Model <xref target="RFC6536"/> SHOULD be used to control and restrict authorization of subscription configuration. This control models permits specifying per-user permissions to receive specific event notification types. The permissions are specified as a set of access control rules.</t>
            <t>Note that streams can define additional authorization requirements. For instance, in <xref target="netconf-yang-push"/> each of the elements in its data plane notifications must also go through access control.</t>
        </section>
    </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>
      <?rfc include="reference.RFC.3339"?>
      <?rfc include="reference.RFC.5277"?>
      <?rfc include="reference.RFC.6020"?>
      <?rfc include="reference.RFC.6241"?>
      <?rfc include="reference.RFC.6536"?>
    </references>

    <references title="Informative References">
      <reference anchor="netconf-yang-push"
                 target="https://datatracker.ietf.org/doc/draft-ietf-netconf-yang-push/">
        <front>
          <title>Subscribing to YANG datastore push updates</title>

          <author fullname="A Clemm" initials="Alexander" surname="Clemm">
            <organization>Cisco Systems</organization>
          </author>

          <author fullname="A Gonzalez Prieto" initials="Alberto"
                  surname="Gonzalez Prieto">
            <organization>Cisco Systems</organization>

          </author>

          <author fullname="E Voit" initials="Eric" surname="Voit">
              <organization>Cisco</organization>
          </author>

          <author fullname="Ambika Prasad Tripathy" initials="A" surname="Tripathy">
             <organization>Cisco Systems</organization>
          </author>
      
          <author fullname="Einar Nilsen-Nygaard" initials="E"
            surname="Nilsen-Nygaard">
            <organization>Cisco Systems</organization>
         </author>
         <date day="23" month="February" year="2016"/>
        </front>
      </reference>
    </references>
  </back>
</rfc>

PAFTECH AB 2003-20262026-04-24 07:13:38