One document matched: draft-clemm-netconf-yang-push-00.xml


<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced.
    An alternate method (rfc include) is described in the references. -->
<!ENTITY RFC1157 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1157.xml">
<!ENTITY RFC6020 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml">
<!ENTITY RFC6241 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml">
<!ENTITY RFC6536 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6536.xml">
]>
<?rfc toc="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no" ?>
<?rfc symrefs="yes"?>
<rfc category="std" docName="draft-clemm-netconf-yang-push-00.txt"
     ipr="pre5378Trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

  <?rfc toc="yes" ?>

  <?rfc compact="yes" ?>

  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes"?>

  <?rfc iprnotified="no" ?>

  <?rfc strict="yes" ?>

  <front>
    <title abbrev="Datastore-Push">Subscribing to YANG datastore push
    updates</title>

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

      <address>
        <email>alex@cisco.com</email>
      </address>
    </author>

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

      <address>
        <email>albertgo@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>

    <date day="9" month="March" year="2015"/>

    <abstract>
      <t>This document defines a subscription and push mechanism for YANG
      datastores. This mechanism allows client applications to request updates
      from a YANG datastore, which are then pushed by the server to the client
      per a subscription policy, without requiring additional client
      requests.</t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>YANG <xref target="RFC6020"/> was originally designed for the Netconf
      protocol <xref target="RFC6241"/>, which originally put most emphasis on
      configuration. However, YANG is not restricted to configuration data.
      YANG datastores, i.e. datastores that contain data modeled according
      using YANG , can contain configuration as well as contain operational
      data. It is therefore reasonable to expect that data in YANG datastores
      will increasingly be used to support applications that are not focused
      on managing configurations but that are, for example, related to service
      assurance.</t>

      <t>Service assurance applications typically involve monitoring
      operational state of networks and devices; of particular interest are
      changes that this data undergoes over time. Likewise, there are
      applications in which data and objects from one datastore need to be
      made available both to applications in other systems and to remote
      datastores <xref target="peermount-req"/><xref target="peermount"/>.
      This requires mechanisms that allow remote systems to become quickly
      aware of any updates to allow to validate and maintain cross-network
      integrity and consistency.</t>

      <t>Traditional approaches rely heavily on polling, in which data is
      periodically explicitly retrieved by a client from a server to stay
      up-to-date.</t>

      <t>There are various issues associated with polling-based management:
      <list style="symbols">
          <t>It introduces additional load on network and devices. Each
          polling cycle requires a separate yet arguably redundant request
          that results in an interrupt, requires parsing, consumes
          bandwidth.</t>

          <t>It lacks robustness. Polling cycles may be missed, requests may
          be delayed or get lost, often particularly in cases when the network
          is under stress and hence exactly when the need for the data is the
          greatest.</t>

          <t>Data may be difficult to calibrate and compare. Polling requests
          may undergo slight fluctuations, resulting in intervals of different
          lengths which makes data hard to compare. Likewise, pollers may have
          difficulty issuing requests that reach all devices at the same time,
          resulting in offset polling intervals which again make data hard to
          compare.</t>
        </list> More effective is an alternative in which an application can
      request to be automatically updated of current content of the datastore
      (such as a subtree, or data in a subtree that meets a certain filter
      condition), and in which the server that maintains the datastore
      subsequently pushes those updates. However, such a solution does not
      currently exist.</t>

      <t>The need to perform polling-based management is typically considered
      an important shortcoming of management applications that rely on MIBs
      polled using SNMP <xref target="RFC1157"/>. However, without a provision
      to support a push-based alternative, there is no reason to believe that
      management applications that operate on YANG datastores using protocols
      such as NETCONF <xref target="RFC6241"/> or RESTconf <xref
      target="restconf"/> will be any more effective, as they would follow the
      same request/response pattern.</t>

      <t>While YANG allows the definition of notifications, such notifications
      are generally intended to indicate the occurrence of certain
      well-specified event conditions, such as a the onset of an alarm
      condition or the occurrence of an error. A capability to subscribe to
      and deliver event notifications has been defined in <xref
      target="RFC5277"/>. In addition, configuration change notifications have
      been defined in <xref target="RFC6470"/>. These change notifications
      pertain only to configuration information, not to operational state, and
      convey the root of the subtree to which changes were applied along with
      the edits, but not the modified data nodes and their values.</t>

      <t>Accordingly, there is a need for a service that allows client
      applications to subscribe to updates of a YANG datastore and that allows
      the server to push those updates. The requirements for such a service
      are documented in <xref target="pub-sub-reqs"/>. This document proposes
      a solution that addresses those requirements. The solution features the
      following: <list style="symbols">
          <t>A mechanism that allows clients to subscribe to automatic
          datastore updates, and the means to manage those subscription. The
          subscription allows clients to specify which data they are
          interested in, and to provide optional filters with criteria that
          data must meet for updates to be sent. Furthemore, subscription can
          specify a policy that directs when updates are provided. For
          example, a client may request to be updated periodically in certain
          intervals, or whenever data changes occur.</t>

          <t>The ability to negotiate subscription parameters. Because not
          every server may support every requested interval for every piece of
          data, it is necessary for a server to be able to indicate whether or
          not it is capable of supporting a requested subscription, and
          possibly allow to negotiate subscription parameters.</t>

          <t>A mechanism is to communicate the updates themselves. For this,
          the proposal leverages and extends existing YANG/Netconf/Restconf
          mechanisms, defining special notifications that carry updates.</t>
        </list> This document specifies a YANG data model to manage
      subscriptions to data in YANG datastores, and to configure associated
      filters and data streams. It defines extensions to RPCs defined in <xref
      target="RFC5277"/> that allow to extend notification subscriptions to
      subscriptions for datastore updates. It also defines a notification that
      can be used to carry data updates and thus serve as push mechanism.</t>
    </section>

    <section title="Definitions and Acronyms">
      <t>Data node: An instance of management information in a YANG
      datastore.</t>

      <t>Data record: A record containing a set of one or more data node
      instances and their associated values.</t>

      <t>Datastore: A conceptual store of instantiated management information,
      with individual data items represented by data nodes which are arranged
      in hierarchical manner.</t>

      <t>Datastream: A continuous stream of data records, each including a set
      of updates, i.e. data node instances and their associated values.</t>

      <t>Data subtree: An instantiated data node and the data nodes that are
      hierarchically contained within it.</t>

      <t>NACM: NETCONF Access Control Model</t>

      <t>NETCONF: Network Configuration Protocol</t>

      <t>Push-update stream: A conceptual data stream of a datastore that
      streams the entire datastore contents continuously and perpetually.</t>

      <t>RPC: Remote Procedure Call</t>

      <t>SNMP: Simple Network Management Protocol</t>

      <t>Subscription: A contract between a client ("subscriber") and a server
      ("publisher"), stipulating which information the client wishes to
      receive from the server (and which information the server has to provide
      to the client) without the need for further solicitation.</t>

      <t>Subscription filter: A filter that contains evaluation criteria which
      are evaluated against YANG objects of a subscription. An update is only
      published if the object meets the specified filter criteria.</t>

      <t>Subscription policy: A policy that specifies under what circumstances
      to push an update, e.g. whether updates are to be provided periodically
      or only whenever changes occur.</t>

      <t>Update: A data item containing the current value of a data node.</t>

      <t>Update trigger: A trigger, as specified by a subscription policy,
      that causes an update to be sent, respectively a data record to be
      generated. An example of a trigger is a change trigger, invoked when the
      value of a data node changes or a data node is created or deleted, or a
      time trigger, invoked after the laps of a periodic time interval.</t>

      <t>URI: Uniform Resource Identifier</t>

      <t>YANG: A data definition language for NETCONF</t>
    </section>

    <section title="Solution Overview">
      <t>This document specifies a solution that allows clients to subscribe
      to information updates in a YANG datastore, which are subsequently
      pushed from the server to the client.</t>

      <t>Subscriptions are initiated by clients. Servers respond to a
      subscription request explicitly positively or negatively. Negative
      responses include information about why the subscription was not
      accepted, in order to facilitate converging on an accepable set of
      subscription parameters. Once a subscription has been established,
      datastore push updates are pushed from the server to the subscribing
      client until the subscription ends.</t>

      <t>Accordingly, the solution encompasses several components: <list
          style="symbols">
          <t>The subscription model for configuration and management of the
          subscriptions, with a set of associated services.</t>

          <t>The ability to negotiate subscription parameters, in cases where
          a subscription desired by a client cannot currently be served.</t>

          <t>The stream of datastore push updates.</t>
        </list> In addition, there are a number of additional considerations,
      such as the tie-in of the mechanisms with security mechanisms. Each of
      those aspects will be discussed in the following subsections.</t>

      <section title="Subscription Model">
        <t>Yang-push subscriptions are defined using a data model. This model
        is based on the subscriptions defined in [RFC-5277], which is also
        reused in RESTconf. The model is extended with several parameters,
        including a subscription type and a subscription ID.</t>

        <t>A subscription refers to a datastream. The subscription model
        assumes the presence of a conceptual perpetual datastream
        "push-update" of continuous datastore updates of infinite time
        resolution. A subscription refers to this datastream and specifies
        filters that are to be applied to, it for example, to provide only
        those subsets of the information that match a filter criteria. In
        addition, a subscription specifies a subscription policy that defines
        the trigger when data records should be sent, for example at periodic
        intervals or whenever underlying data items change.</t>

        <t>The complete set of subscription parameters is as follows: <list
            style="symbols">
            <t>The name of the stream to subscribe to. The subscription model
            always assumes the presence of a perpetual and continuous stream
            of updates. The stream is called "push-update". However, as
            mentioned, it is possible to subscribe to other datastreams, such
            as custom datastreams which are separately configured.</t>

            <t>Optional filter(s), describing the subset of data items in the
            stream's data records that are of interest to the subscriber. The
            server should only send to the subscriber the data items that
            match the filter(s), when present. The absence of a filter
            indicates that all data items from the stream are of interest to
            the subscriber and all data records must be sent in their entirety
            to the subscriber. Two filtering mechanisms are provided: subtree
            filtering and Xpath filtering, with the semantics described in
            [RFC 5277 Section 3.6]. (Additional filter types can be added
            through extensions.)</t>

            <t>An identifier for the subscription.</t>

            <t>An optional start time. Used to trigger replays starting at the
            provided time. Its semantics are those in [RFC 5277].</t>

            <t>An optional stop time. Used to limit temporarily the events of
            interest. Its semantics are those in [RFC 5277].</t>

            <t>For subscriptions to "push-update", a subscription policy
            definition regarding the update trigger to send new updates. The
            trigger can be periodic or based on change. For periodic
            subscriptions, the trigger is defines by the interval with which
            to push updates. For on-change subscriptions, the trigger is
            defined using the dampening interval with which to push repeated
            changes, an indicator for the magnitude of changes, etc.</t>
          </list></t>

        <t>It is conceivable that additional subscription parameters might be
        added in the future. For example, a parameter might be introduced that
        allows to specify which encoding method for updates to use. The list
        could accordingly be extended and augmented in the future.</t>
      </section>

      <section title="Negotiation of Subscription Policies">
        <t>A subscription rejection can be caused by the inability of the
        server to provide a stream with the requested semantics. Providing
        "on-change" updates for operational data can be computationally
        expensive and an agent may decide not to support them or supporting
        them for a small number of subscribers or for a limited set of data
        nodes.</t>

        <t>Yang-push supports a simple negotiation between clients and servers
        for subscription parameters. The negotiation is limited to a single
        pair of subscription request and response. For negative responses, the
        server SHOULD include in the returned error what subscription
        parameters would have been accepted for the request. The returned
        acceptable parameters are no guarantee for subsequent requests for
        this client or others.</t>
      </section>

      <section title="Custom Datastreams">
        <t>Optionally, it is possible to introduce other datastreams (beyond
        the datastore-push datastream) with custom semantics. Some datastreams
        can be custom configured. The support of this is tied to a separate
        feature. The configuration of a custom datastream specifies the
        trigger conditions under which new data records for the stream are
        generated, and which updates the corresponding data records contain.
        For example, the configuration of a datastream can specify which
        subsets of data nodes in a datastore the datastream should contain,
        which filter criteria the updates need to meet, and under what
        conditions to create updates - for example, periodically or whenever a
        data item changes.</t>

        <t>A subscription that refers to a custom datastream can specify a set
        of filters, like for the "push-update" datastream. However, the policy
        as to when updates are triggered (periodically or on change) needs to
        be the same as the policy of the datastream and cannot be modified. It
        is not possible, for example, to define a custom datastream which
        creates on-change updates, yet subscribe to that datastream with
        periodic updates.</t>

        <t>While conceptually similar, the choice between subscribing to
        datastream "push-update" or configuring and subscribing to a custom
        datastream can be thought of as analogous to the choice between
        operating a nozzle that is connected to a hose, or controlling the
        faucet (custom datastream). Operating the nozzle is for most uses
        simpler; however, the option to operate the faucet instead can provide
        additional flexibility in some scenarios.</t>
      </section>

      <section title="Push Data Stream and Transport Mapping">
        <t>Pushing data based on a subscription could be considered analogous
        to a response to a data retrieval request, e.g. a "get" request.
        However, contrary to such a request, multiple responses to the same
        request may get sent over a longer period of time.</t>

        <t>A more suitable mechanism is therefore that of a notification.
        Contrary to notifications associated with alarms and unexpected event
        occurrences, push updates are solicited, i.e. tied tied to a
        particular subscription which triggered the notification. (An
        alternative conceptual model would consider a subscription an "opt-in"
        filter on a continuous stream of updates.)</t>

        <t>The notification contains several parameters: <list style="symbols">
            <t>A subscription correlator, referencing the name of the
            subscription on whose behalf the notification is sent.</t>

            <t>A data node that contains a representation of the datastore
            subtree containing the updates. The subtree is filtered per access
            control rules to contain only data that the subscriber is
            authorized to see. Also, depending on the subscription type, i.e.,
            specifically for on-change subscriptions, the subtree contains
            only the data nodes that contain actual changes. (This can be
            simply a node of type string or, for XML-based encoding,
            anyxml.)</t>
          </list> Notifications are sent using <notification> elements
        as defined in <xref target="RFC5277"/>. Alternative transports are
        conceivable but outside the scope of this specification.</t>

        <t>The solution specified in this document uses notifications to
        communicate datastore updates. The contents of the notification
        includes a set of explicitly defined data nodes. For this purpose, a
        new generic notification is introduced, "push-update" notification.
        This notification is used to carry a data record with updates of
        datastore contents as specified by a subscription.</t>

        <t>The update record consists of a data snippet that contains an
        instantiated datastore subtree with the subscribed contents. Data
        nodes that do not match filter criteria are removed. Likewise, in the
        case of a subscription with "on-change" subscription policy, data
        nodes that have not undergone change are omitted. The contents of the
        update record is equivalent to the contents that would be obtained had
        the same data been explicitly retrieved using e.g. a Netconf
        "get"-operation, with the same filters applied.</t>

        <t>The contents of the notification conceptually represents the union
        of all data nodes in the yang modules supported by the server,
        excluding the following statements: "mandatory", "must",
        "min-elements", "max-elements", "when", and "default". However, in a
        YANG data model, it is not practical to model the precise data
        contained in the updates as part of the notification, because the
        specific data nodes supported depends on the implementing system and
        may even vary dynamically. Therefore, to capture this data, a single
        parameter that can represent any datastore contents is used, not
        parameters that represent data nodes one at a time.</t>

        <t>The following is an example of push notification. It contains an
        update for subscription my-sub, including a subtree with root foo that
        contains a leaf, bar:</t>

        <figure align="center" anchor="push-example" title="Push example">
          <artwork align="left"> 
          
<?xml version="1.0" encoding="UTF-8"?>
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
   <subscription-id xmlns="urn:ietf:params:xml:ns:netconf:
       datastore-push:1.0">
         my-sub
   </subscription-id>
   <eventTime>2015-03-09T19:14:56Z</eventTime> 
   <datastore-contents xmlns="urn:ietf:params:xml:ns:netconf:
      datastore-push:1.0">
      <foo>
        <bar>some_string</bar>
      </foo>
   </datastore-contents>
</notification>

</artwork>
        </figure>
      </section>

      <section title="Subscription operations">
        <t>There are several operations associated with subscriptions. At the
        most basic level, clients need to be able to create subscriptions, as
        well as delete subscriptions when they are no longer needed.</t>

        <t>RFC 5277 specifies an operation to create subscriptions for event
        streams, <create-subscription>. This operation is leveraged and
        extended to create datastore-push subscriptions. Specifically, an
        additional parameter is added to allow for the specification of
        trigger policy.</t>

        <t>To support datastore push, a server MUST support the interleave
        capability specified in [RFC5277]. This is required to allow for
        modification of what data is being subscribed to without needing to
        establish a separate Netconf session.</t>

        <t>The example below illustrates a subscription for a periodic push of
        all data under a container called foo.</t>

        <figure align="center" anchor="subscription-example"
                title="Subscription example">
          <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">
           <stream>push-update</stream>
           <subscription-id xmlns="urn:ietf:params:xml:ns:netconf:
              datastore-push:1.0">
                     my-sub
          </subscription-id>
          <filter netconf:type="xpath"
                     xmlns:ex="http://example.com/foo/1.0"
                     select="/ex:foo"/>
          <period xmlns="urn:ietf:params:xml:ns:netconf:datastore-push:1.0">
                    500
          </period>
       </create-subscription>
   </netconf:rpc>
             </artwork>
        </figure>

        <t>The example below illustrates a subscription response, where an
        agent does not support frequent periodic updates, and suggests a
        different sampling rate to the client.</t>

        <figure align="center" anchor="subscription-negotiation-example"
                title="Subscription negotiation example">
          <artwork align="left">                 
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <rpc-error>
           <error-type>application</error-type>
           <error-tag>operation-not-supported</error-tag>
           <error-severity>error</error-severity>
           <error-info>
               <supported-subscription xmlns="urn:ietf:params:xml:ns:
                   netconf:datastore-push:1.0">
                   <period>3000</period>
               </supported-subscription>
           </error-info>
       </rpc-error>
</rpc-reply>
             </artwork>
        </figure>

        <t>RFC 5277 does not specify operations to delete subscriptions.
        Instead, it assumes that an event subscription is associated with its
        own Netconf session. When the session is torn down, the subscription
        is implicitly deleted. Likewise, there is no operation to modify a
        subscription. Modifying a subscription requires tearing down a Netconf
        session, starting a new one, and creating a new subscription.
        Furthermore, each session only supports a single subscription.
        Establishing multiple subscriptions requires multiple concurrent
        Netconf sessions.</t>

        <t>To facilitate datastore-push subscriptions, an additional RPC is
        introduced, <delete-subscription>.</t>

        <t>The <delete-subscription> operation takes as parameter a
        subscription ID. As a result of the operation, the subscription is
        removed and no more data records will be sent.</t>

        <figure align="center" anchor="subscription-deletion"
                title="Subscription deletion">
          <artwork align="left">                 

   <netconf:rpc message-id="102"
            xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
       <delete-subscription
              xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
          <subscription-id xmlns="urn:ietf:params:xml:ns:netconf:
            datastore-push:1.0">
                     my-sub
          </subscription-id>
     </delete-subscription>
   </netconf:rpc>
             </artwork>
        </figure>

        <t>Finally, a separate operation to modify a subscription is
        introduced, <modify-subscription>. This operation takes the same
        parameters as <create-subscription>, but refers to an existing
        subscription. Of course, a subscription could also be deleted and
        another be created. However, modify operation avoids issues regarding
        the synchronization of creation and deletion operations, such as
        potential loss or duplication of updates. Also, a modify operation
        allows to simply extend an existing subscription beyond the initial
        subscription end time.</t>

        <figure align="center" anchor="subscription-modification"
                title="Modify subscription">
          <artwork align="left">                 
   <netconf:rpc message-id="103"
            xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0">
       <create-subscription
              xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
           <stream>push-update</stream>
           <subscription-id 
              xmlns="urn:ietf:params:xml:ns:netconf:datastore-push:1.0">
                     my-sub
           </subscription-id>
           <filter netconf:type="xpath"
                     xmlns:ex="http://example.com/foo/1.0"
                     select="/ex:foo"/>
           <period xmlns="urn:ietf:params:xml:ns:netconf:
              datastore-push:1.0">
                    3000
       </period>
       </create-subscription>
   </netconf:rpc>
       </artwork>
        </figure>
      </section>

      <section title="A YANG data model for management of datastore push subscriptions">
        <t>Subscriptions as well as datastreams can be subjected to management
        themselves. For example, it is possible that a server may no longer be
        able to serve a subscription that it had previously accepted. Perhaps
        it has run out of resources, or internal errors may have occurred.
        When this is the case, a server needs to be able to temporarily
        suspend the subscription, or even to terminate it. More generally, the
        server should provide a means by which the status of subscriptions can
        be monitored. When custom datastreams are supported, those datastreams
        need to be configured and monitored as well.</t>

        <t>For this purpose, a YANG data model is introduced, which is
        depicted in the following figure.</t>

        <figure align="center" anchor="model-structure"
                title="Model structure">
          <artwork align="left">
module: ietf-datastore-push
   +--rw streams {custom-streams}?
   |  +--rw stream* [stream-name]
   |     +--rw stream-name         string
   |     +--ro stream-status?      identityref
   |     +--rw subtree-filter?     subtree-filter
   |     +--rw xpath-filter?       yang:xpath1.0
   |     +--rw (update-trigger)?
   |        +--:(periodic)
   |        |  +--rw period?             yang:timeticks
   |        +--:(on-change)
   |           +--rw dampening-period    yang:timeticks
   |           +--rw (change-policy)?
   |              +--:(delta-policy)
   |                 +--rw delta?              uint32
   +--rw subscriptions
      +--ro datastore-push-subscription* [subscription-id]
         +--ro subscription-id        subscription-identifier
         +--ro subscription-status?   identityref
         +--ro stream?                string
         +--ro start-time?            yang:date-and-time
         +--ro stop-time?             yang:date-and-time
         +--ro subtree-filter?        subtree-filter
         +--ro xpath-filter?          yang:xpath1.0
         +--ro (update-trigger)?
            +--:(periodic)
            |  +--ro period?                yang:timeticks
            +--:(on-change)
               +--ro dampening-period       yang:timeticks
               +--ro (change-policy)?
                  +--:(delta-policy)
                     +--ro delta?                 uint32          
		    </artwork>
        </figure>

        <t>Each subscription is represented as a list element
        "datastore-push-subscription". The associated information includes an
        identifier for the subscription, a subscription status, as well as the
        various subscription paramters. The subscription status indicates
        whether the subscription is currently active and healthy, or if it is
        degraded in some form. Subscriptions are automatically removed from
        the list once they expire or are terminated. Because subscriptions are
        managed using their own set of operation primitives, they are
        read-only.</t>

        <t>An optional feature, custom-streams, is introduced to allow for the
        configuration of custom datastreams. Custom datastreams are
        represented through a separate list, consisting of information used to
        configure those datastreams. This information consititutes mostly
        configuration information, with the exception of parameters used to
        indicate the status and health of the datastream.</t>

        <t>In addition, a server needs to indicate any changes in status to
        the subscriber through a notification. Specifically, subscribers need
        to be informed of the following: <list style="symbols">
            <t>A subscription has been temporarily suspended(including the
            reason)</t>

            <t>A subscription (that had been suspended earlier) is once again
            operational</t>

            <t>A subscription has been abnormally terminated (including the
            reason)</t>

            <t>A subscription has been modified (including the current set of
            subscription parameters in effect)</t>
          </list> Finally, a server might provide additional information about
        subscriptions, such as statistics about the number of data updates
        that were sent. However, such information is currently outside the
        scope of this specification.</t>
      </section>

      <section title="Other considerations">
        <section title="Authorization">
          <t>A client may only receive updates to data that the client has
          proper authorization for. Normal authorization rules apply. Data
          that is being pushed therefore needs to be subjected to a filter
          that applies the corresponding rules, removing any non-authorized
          data as applicable.</t>

          <t>The authorization model for data in YANG datastores is described
          in the Netconf Access Control Model <xref target="RFC6536"/>.</t>
        </section>

        <section title="Additional subscription primitives">
          <t>Other possible operations include the ability to suspend and
          resume subscriptions. However, those operations are not viewed as
          essential, as it is always possible to alternatively simply remove a
          subscription and recreate it when needed.</t>
        </section>

        <section title="Robustness and reliability considerations">
          <t>Particularly in the case of on-change push updates, it is
          important that push updates do not get lost. However, datastore-push
          uses a secure and reliable transport. Notifations are not getting
          reordered, and in addition contain a time stamp. For those reasons,
          we believe that additional reliability mechanisms at the application
          level, such as sequence numbers for push updates, are not
          required.</t>
        </section>

        <section anchor="implementation-considerations"
                 title="Implementation considerations">
          <t>Implementation specifics are outside the scope of this
          specification. That said,it should be noted that monitoring of
          operational state changes inside a system can be associated with
          significant implementation challenges.</t>

          <t>Even periodic retrieval of operational state alone, to be able to
          push it, can consume considerable system resources. Configuration
          data may in many cases be persisted in an actual database or a
          configuration file, where retrieval of the database content or the
          file itself is reasonably straightforward and computationally
          inexpensive. However, retrieval of operational data may, depending
          on the implementation, require invocation of APIs, possibly on an
          object-by-object basis, possibly involving additional internal
          interrupts, etc.</t>

          <t>For those reasons, if is important for an implementation to
          understand what subscriptions it can or cannot support. It is far
          preferrable to decline a subscription request, than to accept it
          only to result in subsequent failure later.</t>

          <t>Whether or not a subscription can be supported will in general be
          determined by a combination of several factors, including the
          subscription policy (on-change or periodic, with on-change in
          general being the more challenging of the two), the period in which
          to report changes (1 second periods will consume more resources than
          1 hour periods), the amount of data in the subtree that is being
          subscribed to, and the number and combination of other subscriptions
          that are concurrently being serviced.</t>
        </section>
      </section>
    </section>

    <section anchor="YANG-module" title="YANG module">
      <t><figure>
          <artwork>
<CODE BEGINS>
file "ietf-datastore-push@2014-03-09.yang"

module ietf-datastore-push {
  namespace "urn:XXXX:params:xml:ns:yang:ietf-datastore-push";
  prefix datastore-push;

  import ietf-yang-types {
    prefix yang;
  }

  organization "IETF";
  contact
    "Editor:   Alexander Clemm
               <mailto:alex@cisco.com>
     
     Editor:   Alberto Gonzalez Prieto
               <mailto:albertgo@cisco.com>
     
     Editor:   Eric Voit
               <mailto:evoit@cisco.com>";
  description
    "This module contains conceptual YANG specifications
     for datastore push.";

  revision 2014-03-09 {
    description
      "Initial revision.";
    reference "Datastore push.";
  }

  feature custom-streams {
    description
      "This feature allows users to configure datastore update 
       streams in addition to the stream provided by default,
       datastore-push.";
  }

  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 are currently unable to provide 
       the negotiated updates.";
  }

  identity subscription-errors {
    description
      "Base identity for subscription errors.";
  }

  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 other {
    base subscription-errors;
    description
      "Fallback reason - any other reason";
  }

  typedef datastore-contents {
    type string;
    description
      "This type is be used to represent datastore contents, 
       including a filtered datastore subtree per a set of 
       subscription parameters. ";
  }

  typedef subtree-filter {
    type string;
    description
      "This type is used to define a subtree filter.  
       Its precise syntax is TBD.";
  }

  typedef subscription-identifier {
    type string {
      length "1 .. max";
    }
    description
      "A client-provided identifier for the subscription.";
  }

  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.";
  }

  grouping subscription-stream-policy {
    description
      "This grouping contains the parameters which describe 
       the policy which data is pushed as part of a 
       subscription or a data stream.";
    leaf subtree-filter {
      description
        "Datastore subtree of interest.";
      type subtree-filter;
    }
    leaf xpath-filter {
      type yang:xpath1.0;
      description
        "Xpath defining the data items of interest.";
    }
    choice update-trigger {
      description
        "Defines necessary conditions for sending an event  to 
         the subscriber.";
      case periodic {
        description
          "The agent is requested to notify periodically the 
           current values of the datastore or the subset 
           defined by the filter.";
        leaf period {
          type yang:timeticks;
          description
            "Elapsed time between notifications.";
        }
      }
      case on-change {
        description
          "The agent is requested to notify changes in 
           values in the datastore or a subset of it defined 
           by a filter.";
        leaf dampening-period {
          type yang:timeticks;
          mandatory true;
          description
            "Minimum amount of time that needs to have 
             passed since the last time an update was 
             provided.";
        }
        choice change-policy {
          description
            "Policy describing necessary conditions for 
             sending an event  to the subscriber.";
          case delta-policy {
            leaf delta {
              type uint32;
              description
                "For integer, minimum difference 
                 between current and last reports 
                 values that can trigger an update.";
            }
          }
        }
      }
    }
  }

  grouping subscription-info {
    description
      "This grouping describes basic information concerning a 
       subscription, without the subscription policy which is 
       defined separately to be shareable with the definition 
       of a datastream.";
    leaf stream {
      type string;
      description
        "The name of the stream subscribed to.";
    }
    leaf start-time {
      type yang:date-and-time;
      description
        "Starting time for replays.";
      reference "RFC 5277, Section 2.1.1";
    }
    leaf stop-time {
      type yang:date-and-time;
      description
        "Time limit for events of interest.";
      reference "RFC 5277, Section 2.1.1";
    }
  }

  notification push-update {
    description
      "This notification contains an update from a datastore";
    leaf subscription-id {
      type subscription-identifier;
      mandatory true;
      description
        "This references the subscription because of which the 
         notification is sent.";
    }
    leaf datastore-contents {
      type datastore-contents;
      description
        "This contains datastore contents 
         per the subscription.";
    }
  }
  notification subscription-suspended {
    description
      "This notification indicates that a suspension of the 
       subscription by the server has occurred.  No further 
       datastore updates will be sent until subscription 
       resumes.";
    leaf subscription-id {
      type subscription-identifier;
      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 {
    description
      "This notification indicates that a subscription that had 
       previously been suspended has resumed. Datastore updates 
       will once again be sent.";
    leaf subscription-id {
      type subscription-identifier;
      mandatory true;
      description
        "This references the affected subscription.";
    }
  }
  notification subscription-modified {
    description
      "This notification indicates that a subscription has 
       been modified.  Datastore updates sent from this point 
       on will conform to the modified terms of the 
       subscription.";
    leaf subscription-id {
      type subscription-identifier;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    uses subscription-info;
    uses subscription-stream-policy;
  }
  notification subscription-terminated {
    description
      "This notification indicates that a subscription has been 
       terminated.";
    leaf subscription-id {
      type subscription-identifier;
      mandatory true;
      description
        "This references the affected subscription.";
    }
    leaf reason {
      type subscription-term-reason;
      description
        "Provides a reason for why the subscription was 
         terminated.";
    }
  }
  container streams {
    if-feature custom-streams;
    list stream {
      key "stream-name";
      description
        "A user-definable stream.";
      leaf stream-name {
        type string;
        mandatory true;
        description
          "The name assigned to the stream.";
      }
      leaf stream-status {
        type identityref {
          base subscription-stream-status;
        }
        config false;
      }
      uses subscription-stream-policy;
    }
  }
  container subscriptions {
    list datastore-push-subscription {
      description
        "Content of a yang-push subscription.  
         Subscriptions are created using a dedicated RPC, hence
         they do not constitute configuration information.";
      config false;
      key "subscription-id";
      leaf subscription-id {
        type subscription-identifier;
        description
          "Identifier to use for this subscription.";
      }
      leaf subscription-status {
        type identityref {
          base subscription-stream-status;
        }
        description
          "The status of the subscription.";
      }
      uses subscription-info;
      uses subscription-stream-policy;
    }
  }
}

<CODE ENDS> 
        </artwork>
        </figure></t>
    </section>

    <section title="Security Considerations">
      <t>Subscriptions could be used to attempt to overload servers of YANG
      datastores. For this reason, it is important that the server has the
      ability to decline a subscription request if it would deplete its
      resources. In addition, a server needs to be able to suspend an existing
      subscription when needed. When this occur, the subscription status is
      updated accordingly and the clients are notified. Likewise, requests for
      subscriptions need to be properly authorized.</t>

      <t>A subscription could be used to retrieve data in subtrees that a
      client has not authorized access to. Therefore it is important that data
      pushed based on subscriptions is authorized in the same way that regular
      data retrieval operations are. Data being pushed to a client needs
      therefore to be filtered accordingly, just like if the data were being
      retrieved on-demand. The Netconf Authorization Control Model
      applies.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &RFC1157;

      <reference anchor="RFC5277">
        <front>
          <title>NETCONF Event Notifications</title>

          <author fullname="Sharon Chisholm" initials="S" surname="Chisholm">
            <organization/>
          </author>

          <author fullname="Hector Trevino" initials="H" surname="Trevino">
            <organization/>
          </author>

          <date month="July" year="2008"/>
        </front>

        <seriesInfo name="RFC" value="5277"/>
      </reference>

      <reference anchor="RFC6470">
        <front>
          <title>Network Configuration Protocol (NETCONF) Base
          Notifications</title>

          <author fullname="Andy Bierman" initials="A" surname="Bierman">
            <organization/>
          </author>

          <date month="February" year="2012"/>
        </front>

        <seriesInfo name="RFC" value="5277"/>
      </reference>

      &RFC6020;

      &RFC6241;

      &RFC6536;
    </references>

    <references title="Informative References">
      <reference anchor="restconf">
        <front>
          <title>RESTCONF Protocol</title>

          <author fullname="A. Bierman" initials="A." surname="Bierman">
            <organization/>
          </author>

          <author fullname="M. Bjorklund" initials="M." surname="Bjorklund">
            <organization/>
          </author>

          <author fullname="K. Watsen" initials="K." surname="Watsen">
            <organization/>
          </author>

          <date month="October" year="2014"/>
        </front>

        <seriesInfo name="I-D" value="draft-ietf-netconf-restconf-03"/>
      </reference>

      <reference anchor="pub-sub-reqs">
        <front>
          <title>Requirements for Subscription to YANG Datastores</title>

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

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

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

          <date day="3" month="March" year="2015"/>
        </front>

        <seriesInfo name="Internet-Draft"
                    value="draft-ietf-i2rs-pub-sub-requirements-00"/>

        <format target="http://www.ietf.org/internet-drafts/draft-ietf-i2rs-pub-sub-requirements-00.txt"
                type="TXT"/>
      </reference>

      <reference anchor="peermount-req">
        <front>
          <title>Requirements for Peer Mounting of YANG subtrees from Remote
          Datastores</title>

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

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

          <author fullname="Shashi Kumar Bansal" initials="S" surname="Bansal">
            <organization/>
          </author>

          <author fullname="Ambika Tripathy" initials="A" surname="Tripathy">
            <organization/>
          </author>

          <author fullname="Prabhakara Yellai" initials="P" surname="Yellai">
            <organization/>
          </author>

          <date day="25" month="September" year="2014"/>
        </front>

        <seriesInfo name="Internet-Draft"
                    value="draft-voit-netmod-peer-mount-requirements-00"/>

        <format target="http://www.ietf.org/internet-drafts/draft-voit-netmod-peer-mount-requirements-00.txt"
                type="TXT"/>
      </reference>

      <reference anchor="peermount">
        <front>
          <title>Mounting YANG-defined information from remote
          datastores</title>

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

          <author fullname="Jan Medved" initials="J" surname="Medved">
            <organization/>
          </author>

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

          <date day="7" month="October" year="2014"/>
        </front>

        <seriesInfo name="Internet-Draft" value="draft-clemm-netmod-mount-02"/>

        <format target="http://www.ietf.org/internet-drafts/draft-clemm-netmod-mount-02.txt"
                type="TXT"/>
      </reference>

      <!--
    &I-D.draft-lhotka-netmod-yang-json;
    -->

      <!--
    &I-D.ietf-netmod-interfaces-cfg;
    -->
    </references>
  </back>
</rfc>

PAFTECH AB 2003-20262026-04-23 20:36:01