NETCONF A. Clemm
Internet-Draft Sympotech
Intended status: Standards Track A. Gonzalez Prieto
Expires: April 30, 2017 E. Voit
E. Nilsen-Nygaard
A. Tripathy
Cisco Systems
S. Chisholm
Ciena
H. Trevino
Cisco Systems
October 27, 2016

Subscribing to Event Notifications
draft-ietf-netconf-rfc5277bis-01

Abstract

This document defines capabilities and operations for subscribing to content and providing asynchronous notification message delivery on that content. Notification delivery can occur over a variety of protocols used commonly in conjunction with YANG, such as NETCONF and RESTCONF. The capabilities and operations defined in this document when using in conjunction with draft-ietf-netconf-netconf-event-notifications are intended to replace RFC 5277.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on April 30, 2017.

Copyright Notice

Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.


Table of Contents

1. Introduction

This document defines mechanisms that provide an asynchronous message notification delivery service in a protocol-agnostic manner. This document defines capabilities and operations for providing asynchronous message notification delivery for notifications including those necessary to establish, monitor, and support subscriptions to notification delivery.

Notification delivery can occur over a variety of protocols used commonly in conjunction with YANG, such as NETCONF [RFC6241] (defined in [I-D.ietf-netconf-netconf-event-notif]) and Restconf [I-D.ietf-netconf-restconf] (defined in [I-D.ietf-netconf-restconf-notif]). The capabilities and operations defined in this document are intended to replace RFC 5277, along with their mapping onto NETCONF transport.

1.1. Motivation

The motivation for this work is to enable the sending of transport agnostic asynchronous notification messages driven by a YANG Subscription that are consistent with the data model (content) and security model. Predating this work was used within a NETCONF implementation. [RFC5277] which defined a limited defines a notification mechanism for for NETCONF. However, there are various [RFC5277] has limitations:, many of which have been exposed in [RFC7923].

The scope of the work aims at meeting the operational needs of network subscriptions:

1.2. Terminology

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 RFC 2119 [RFC2119].

Configured subscription: A subscription installed via a configuration interface which persists across reboots.

Dynamic subscription: A subscription agreed between subscriber and publisher via create, establish, modify, and delete RPC control plane signaling messages.

Event: An occurrence of something 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.)

Event notification: A set of information intended for a Receiver indicating that one or more Event(s) have occurred. Details of the Event(s) may be included within the Notification.

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.

NACM: NETCONF Access Control Model.

OAM: Operations, Administration, Maintenance.

Publisher: An entity responsible for streaming Event Notifications per the terms of a Subscriptions

Receiver: A target to which a publisher pushes event notifications. For dynamic subscriptions, the receiver and subscriber will often be the same entity.

RPC: Remote Procedure Call.

Stream (also referred to as "event stream"): A continuous ordered set of events grouped under an explicit criteria.

Subscriber: An entity able to request and negotiate a contract for the receipt of event notifications from a publisher.

Subscription: A contract with a publisher, stipulating which information receiver(s) wishes to have pushed from the publisher without the need for further solicitation.

1.3. Solution Overview

This document describes mechanisms for subscribing and receiving event notifications from an event server publisher. This document builds on top of the capabilities defined in [RFC5277], extending them, and generalizing them to be protocol-agnostic.

Some enhancements over RFC 5277 include the ability to have multiple subscriptions on a single transport session, to terminate a single subscriptions without terminating the transport session, and to modify existing subscriptions.

These enhancements do not affect existing RFC 5277 subscribers that do not support these particular subscription requirements.

The solution supports subscribing to event notifications using two mechanisms:

  1. Dynamic subscriptions, where a subscriber initiates a subscription negotiation with a publisher via RPC. A subscriber initiates a negotiation by issuing a subscription request. If the publisher wants to serve this request, it will accept it, and then start pushing event notifications as negotiated. If the publisher does not wish to serve it as requested, it may respond with subscription parameters which it would have accepted.
  2. Configured subscriptions, which is an optional mechanism that enables managing subscriptions via a configuration interface so that a publisher can send event notifications to configured receiver(s).

Some key characteristics of configured and dynamic subscriptions include:

Note that there is no mixing-and-matching of dynamic and configured subscriptions. Specifically, a configured subscription cannot be modified or deleted using RPC. Similarly, a subscription created via RPC cannot be modified through configuration operations.

The publisher may decide to terminate a dynamic subscription at any time. Similarly, it may decide to temporarily suspend the sending of event notifications for either configured or dynamic subscriptions. Such termination or suspension may be driven by the publisher running out of resources to serve the subscription, or by internal errors on the publisher.

2. Solution

2.1. Event Streams

An event stream is a set of events available for subscription from a publisher. 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.

That said, some event streams will be standardized whereas others may be vendor specific. One standardized event stream is the "NETCONF" notification event stream. The NETCONF event stream contains all NETCONF XML event notifications supported by the publisher, except for those belonging only to streams that explicitly indicate that they must be excluded from the NETCONF stream, such as notifications that serve OAM and signaling purposes.

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.

2.2. Event Stream Discovery

A publisher maintains a list of available event streams as operational data. This list contains both standardized and vendor-specific event streams. A client can retrieve this list like any other YANG-defined data, for example using the <get> operation when using NETCONF.

2.3. Filters

a publisher implementation SHOULD support the ability to perform filtering of notification records per RFC 5277. (TODO: since 5277 is to be obsoleted, we should describe the filter here.)

2.4. Subscription State Model at the Publisher

Below is the state machine of a subscription for the publisher. It is important to note that a subscription doesn't exist at the publisher until it is accepted and made active. The mere request by a subscriber to establish a subscription is insufficient for that asserted subscription to be externally visible via this state machine.

 
                    .-------.
                    | start |
                    '-------'
                        |
                     establish
                        |
                        |   .----------modify--------------.
                        v   v                              '
                  .-----------.                      .-----------.
       .--------. |           |------>suspend------->|           |
     modify      '|  active   |                      | suspended |
       '--------->|           |<----resume----<------|           |
                  '-----------'                      '-----------'
                        |                                  |
                     delete                             delete
                        |                                  |
                        v                                  |
                    .-------.                              |
                    |  end  |<-----------------------------'
                    '-------'
          

Figure 1: Subscription states at publisher

Of interest in this state machine are the following:

3. Data Model Trees for Event Notifications

The YANG data model for event notifications is depicted in this section.

               
module: ietf-event-notifications
    +--ro streams
    |  +--ro stream*   stream
    +--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?             stream
    |     +--rw encoding?           encoding
    |     +--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 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 subscription* [subscription-id]
          +--ro subscription-id            subscription-id
          +--ro configured-subscription?   
          |                 empty {configured-subscriptions}?
          +--ro subscription-status?       subscription-status
          +--ro stream?                    stream
          +--ro encoding?                  encoding
          +--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 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

  rpcs:
    +---x establish-subscription
    |  +---w input
    |  |  +---w stream?       stream
    |  |  +---w encoding?     encoding
    |  |  +---w (filter-type)?
    |  |  |  +--:(rfc5277)
    |  |  |  |  +---w filter?
    |  |  |  +--:(by-reference)
    |  |  |     +---w filter-ref?   filter-ref
    |  |  +---w startTime?    yang:date-and-time
    |  |  +---w stopTime?     yang:date-and-time
    |  +--ro output
    |     +--ro subscription-result    subscription-result
    |     +--ro (result)?
    |        +--:(success)
    |        |  +--ro subscription-id        subscription-id
    |        +--:(no-success)
    |           +--ro stream?                stream
    |           +--ro encoding?              encoding
    |           +--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
    +---x create-subscription
    |  +---w input
    |     +---w stream?      stream
    |     +---w encoding?    encoding
    |     +---w (filter-type)?
    |     |  +--:(rfc5277)
    |     |     +---w filter?
    |     +---w startTime?   yang:date-and-time
    |     +---w stopTime?    yang:date-and-time
    +---x modify-subscription
    |  +---w input
    |  |  +---w subscription-id?   subscription-id
    |  |  +---w (filter-type)?
    |  |  |  +--:(rfc5277)
    |  |  |  |  +---w filter?
    |  |  |  +--:(by-reference)
    |  |  |     +---w filter-ref?        filter-ref
    |  |  +---w startTime?         yang:date-and-time
    |  |  +---w stopTime?          yang:date-and-time
    |  +--ro output
    |     +--ro subscription-result    subscription-result
    |     +--ro (result)?
    |        +--:(success)
    |        |  +--ro subscription-id        subscription-id
    |        +--:(no-success)
    |           +--ro stream?                stream
    |           +--ro encoding?              encoding
    |           +--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
    +---x delete-subscription
       +---w input
       |  +---w subscription-id    subscription-id
       +--ro output
          +--ro subscription-result    subscription-result

  notifications:
    +---n replay-complete
    |  +--ro subscription-id    subscription-id
    +---n notification-complete
    |  +--ro subscription-id    subscription-id
    +---n subscription-started
    |  +--ro subscription-id    subscription-id
    |  +--ro stream?            stream
    |  +--ro encoding?          encoding
    |  +--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
    +---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?            stream
    |  +--ro encoding?          encoding
    |  +--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
    +---n subscription-terminated
       +--ro subscription-id    subscription-id
       +--ro reason?            subscription-term-reason
                    

The data model is structured as follows:

The data model also contains a number of notifications that allow a publisher to signal information about a subscription. Finally, the data model contains a number of RPC definitions that are used to manage dynamic subscriptions.

4. Dynamic Subscriptions

Dynamic subscriptions are managed via RPC.

4.1. Establishing a Subscription

This operation includes and extends the "create-subscription" operation defined in RFC 5277. 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.

The input parameters of the operation are those of create subscription plus:

If the publisher cannot satisfy the request, it sends a negative <subscription-result> element.

If the subscriber has no authorization to establish the subscription, the <subscription-result> indicates an authorization error. If the request is rejected because the publisher is not able to serve it, the publisher SHOULD include in the returned error what subscription parameters would have been accepted for the request when it was processed. However, they is no guarantee that subsequent requests with those parameters for this subscriber or others will be accepted. For instance, consider a subscription from [I-D.ietf-netconf-yang-push], which augments the establish-subscription with some additional parameters, including "period".

Subscription requests will fail if a filter with invalid syntax is provided or if the name of a non-existent stream is provided.

4.2. Modifying a Subscription

This operation permits modifying the terms of a dynamic subscription previously established. Subscriptions created by configuration cannot be modified. Dynamic subscriptions can be modified one or multiple times. If the publisher accepts the request, it immediately starts sending events based on the new terms, completely ignoring the previous ones. If the publisher 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 subset of the establish subscription request parameters which are allowed to be dynamically modified.

Dynamic subscriptions established via RPC can only be modified (or deleted) via RPC using the same transport session used to establish that subscription.

Configured subscriptions cannot be modified (or deleted) using RPCs. Instead, configured subscriptions are modified (or deleted) as part of regular configuration operations. Publishers MUST reject any attempts to modify (or delete) configured subscriptions via RPC.

4.3. Deleting a Subscription

This operation permits canceling a subscription previously established. If the publisher accepts the request, it immediately stops sending events for the subscription. If the publisher rejects the request, all subscriptions remain as prior to the request. That is, the request has no impact whatsoever.

Subscriptions created via RPC can only be deleted via RPC using the same transport session used for subscription establishment. Configured subscriptions cannot be deleted using RPCs. Instead, configured subscriptions are deleted as part of regular configuration operations. Publishers MUST reject any RPC attempt to delete configured subscriptions.

The only parameter to delete-subscription is the identifier of the subscription to delete.

If the publisher can satisfy the request, it sends an OK element.

If the publisher cannot satisfy the request, it sends an error-rpc element.

5. Configured Subscriptions

A configured subscription is a subscription installed via a configuration interface.

Configured subscriptions persist across reboots, and persist even when transport is unavailable. This also means configured subscriptions do not support negotiation.

Configured subscriptions can be modified by any configuration client with write permissions for the configuration of the subscription. Subscriptions can be modified or terminated at any point of their lifetime.

Supporting configured subscriptions is optional and advertised using the "configured-subscriptions" feature.

In addition to subscription parameters that apply to dynamic subscriptions, the following additional parameters apply to configured subscriptions:

5.1. Establishing a Configured Subscription

Configured subscriptions are 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 subscriber 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 publisher sends to its receivers a control-plane notification stating the subscription has been established (subscription-started).

Because there is no explicit association with an existing transport session, configured configuration operations require additional parameters to indicate the receivers of the notifications and possibly the source of the notifications such as a specific egress interface.

For example at subscription establishment, a client may send:

<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>
                        

Figure 2: Establish configured subscription

if the request is accepted, the publisher would reply:

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

Figure 3: Response to a successful configured subscription establishment

if the request is not accepted because the publisher cannot serve it, the publisher may reply:

<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 publisher cannot serve this 
            subscription due to the current workload.
        </error-message>       
    </rpc-error>
</rpc-reply>
                        

Figure 4: Response to a failed configured subscription establishment

5.2. Modifying a Configured Subscription

Configured subscriptions can be modified using configuration operations against the top-level subtree subscription-config.

Immediately after a subscription is successfully modified, the publisher sends to the existing receivers a control-plane notification stating the subscription has been modified (i.e., subscription-modified).

If the modification involved adding and/or removing receivers, those modified receivers are sent control-plane notifications, indicating they have been added (i.e, subscription-started to a specific receiver) or removed (i.e., subscription-terminated to a specific receiver.)

5.3. Deleting a Configured Subscription

Subscriptions can be deleted using configuration operations against the top-level subtree subscription-config. For example, in RESTCONF:

DELETE /subscription-config/subscription=1922 HTTP/1.1
Host: example.com

HTTP/1.1 204 No Content
Date: Sun, 24 Jul 2016 11:23:40 GMT
Server: example-server

                        

Figure 5: Deleting a configured subscription

Immediately after a subscription is successfully deleted, the publisher sends to all receivers a control-plane notification stating the subscription has been terminated (subscription-terminated).

6. Event (Data Plane) Notifications

Once a subscription has been set up, the publisher streams (asynchronously) the event notifications per the terms of the subscription. We refer to these as data plane notifications. For dynamic subscriptions set up via RPC operations, event notifications are sent over the session used to create or establish the subscription. For configured subscriptions, event notifications are sent over the specified connections.

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.

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 [RFC3339]. Implementations must support time zones.

The event notifications must also include the subscription-id if the establish-subscription was used in its establishment, or if it was configured via an operational interface.

The event notification also contains notification-specific tagged content, if any.

The following is an example of an event notification from [RFC7950]: