Subscribing to Event NotificationsCisco Systemsevoit@cisco.comHuaweiludwig@clemm.orgCisco Systemsalbertgo@cisco.comCisco Systemseinarnn@cisco.comCisco Systemsambtripa@cisco.com
Operations & Management
NETCONFDraftThis 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 obsolete RFC 5277.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
(defined in ) and Restconf (defined in ). The capabilities and operations defined in this document are intended to obsolete RFC 5277, along with their mapping onto NETCONF transport.
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 [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:Ability to dynamically or statically subscribe to event notifications available on a publisher.Ability to negotiate acceptable dynamic subscription parameters.Ability to filter the subset of notifications to be pushed with stream-specific semantics. Ability for the notification payload to be interpreted independently of the transport protocol. (In other words, the encoded notification fully describes itself.) Mechanism to communicate the notifications.Ability to replay locally logged notifications.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.Configured subscription: A subscription installed via a configuration interface which persists across reboots.Dynamic subscription: A subscription agreed between subscriber and publisher created via RPC subscription state 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 SubscriptionsReceiver: 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.This document describes mechanisms for subscribing and receiving event notifications from an event server publisher. This document has similarities to the capabilities orginally defined in . This document extends the supported capabilties, and generalizes functionality to be protocol-agnostic.Some enhancements over [RFC5277] 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. The solution supports subscribing to event notifications using two mechanisms:Dynamic subscriptions, where a subscriber initiates a subscription negotiation with a publisher via RPC. If the publisher wants to serve this request, it will accept it, and then start pushing event notifications. If the publisher does not wish to serve it as requested, then an error response is returned. This response may include hints at subscription parameters which would have been accepted.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: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.The lifetime of a configured subscription is driven by configuration being present on the running configuration. This implies configured subscriptions persist across reboots, and persists even when transport is unavailable.Subscriptions can be modified or terminated at any point of their lifetime. Configured subscriptions can be modified by any configuration client with write rights on the configuration of the subscription.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 established 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. 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, there is one standardized event stream, this is the "NETCONF" event stream. The NETCONF event stream contains all NETCONF XML event information supported by the publisher, except for where it has been explicitly indicate that this info must be excluded from the NETCONF stream.As events are raised by a system, they may be assigned to one or more streams. The event is distributed to receivers meeting all three critera: (1) a subscription includes the identified stream, (2) susbcription filtering allows the event to traverse, and (3) no access control rules prohibit the receiver from receiving the event.a publisher implementation SHOULD support the ability to perform filtering of notification records per [RFC5277]. (TODO: since 5277 is to be obsoleted, we should describe the filter here.)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.Of interest in this state machine are the following: Successful <establish-subscription> or
<modify-subscription> requests put the subscription into an
active state.Failed <modify-subscription> requests will leave the
subscription in its previous state, with no visible change to any
streaming updates.A <delete-subscription> or <kill-subscription> will end the
subscription.The YANG data model for event notifications is depicted in this section. The data model is structured as follows:
"Streams" contains a list of event streams that are supported by the publisher and that can be subscribed to."Filters" contains a configurable list of filters that can be applied
to a subscription. This allows users to reference an
existing filter definition as an alternative to defining a filter inline
for each subscription. "Subscription-config" contains the configuration of configured subscriptions. The parameters of each configured subscription are a superset of the parameters of a dynamic subscription and use the same groupings. In addition, the configured subscriptions must also specify intended receivers and may specify the push source from which to send the stream of notification messages."Subscriptions" contains a list of all subscriptions on a publisher, both
configured and dynamic. It can be used to retrieve information about the
subscriptions which an
publisher is serving.
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.
Dynamic subscriptions are managed via RPC.The <establish-subscription> operation allows a subscriber to request the creation of a subscription via RPC.The input parameters of the operation are:
A filter which identifies what is being subscribed to, as well as what should be included (or not) in the pushed results.An optional stream which may identify or reduce the domain of events against which the subscription is applied.The desired encoding for the returned events. By default, updates are encoded using XML. Other encodings may be supported, such as JSON. An optional stop time for the subscription.An optional start time which indicates that this subscription is requesting a replay push of events previously generated.If the publisher cannot satisfy the <establish-subscription> 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. Optionally, the <subscription-result> may include one or more hints on alternative input parameters and value which would have resulted in an accepted subscription.Subscription requests must fail if a filter with invalid syntax is provided or if the name of a non-existent stream is provided. The presence of a start time indicates that this is a replay subscription. The start time must be earlier than the current time. If the start time points earlier than the maintained history of Publisher's event buffer, then the subscription must be rejected. In this case the error response to the <establish-subscription> request should include a start time supportable by the Publisher.The <modify-subscription> operation permits changing the terms of an existing dynamic subscription previously established on that transport session. Subscriptions created by configuration operations cannot be modified via this RPC. Dynamic subscriptions can be modified one or multiple times. If the publisher accepts the requested modifications, 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 a such a rejected modification may include one or more hints on alternative input parameters and value which would have resulted in a successfully modified subscription.Dynamic subscriptions established via RPC can only be modified (or deleted) via RPC using the same transport session used to establish that subscription.The <delete-subscription> operation permits canceling an existing subscription previously established on that transport session. 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 established 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 <kill-subscription> operation permits an operator to end any dynamic subscription. The publisher must accept the request for any dynamic subscription, and immediately stop sending events.Configured subscriptions cannot be kill using this RPC. Instead, configured subscriptions are deleted as part of regular configuration operations. Publishers MUST reject any RPC attempt to kill a configured subscription.A configured subscription is a subscription installed via a configuration interface.Configured subscriptions persist across reboots, and persist even when transport is unavailable.Configured subscriptions can be modified by any configuration client with write permissions for the configuration of the subscription. Subscriptions can be modified or terminated via the configuration interface 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:
One or more receiver IP addresses (and corresponding ports)intended as the destination for push updates for each subscription. In addition, the transport protocol for each destination may be defined.Optional parameters to identify an egress interface or IP address / VRF where a subscription updates should be pushed from the publisher. If not included, push updates will go off a default interface for the device.Configured subscriptions are established using configuration operations against the top-level subtree subscription-config. There are two key differences between RPC and <edit-config> RPC operations for subscription establishment. Firstly, <edit-config> operations install a subscription without question, while RPCs may support negotiation and rejection of requests. Secondly, while RPCs mandate that the subscriber establishing the subscription is the only receiver of the notifications, <edit-config> operations permit specifying receivers independent of any tracked subscriber. Immediately after a subscription is successfully established, the publisher sends to any newly active receivers a control-plane notification stating the subscription has been established (subscription-started).Because there is no explicit association with an existing transport session, <edit-config> 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 if NETCONF transport is being used, a client may send:if the request is accepted, the publisher would reply:if the request is not accepted because the publisher cannot serve it, the publisher may reply: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.)Subscriptions can be deleted using configuration operations against the top-level subtree subscription-config. For example, in RESTCONF:Immediately after a subscription is successfully deleted, the publisher sends to all receivers of that subscription a control-plane notification stating the subscription has been terminated (subscription-terminated).Once a subscription has been set up, the publisher streams (asynchronously) notifications per the terms of the subscription. We refer to these as event notifications. For dynamic subscriptions set up via RPC operations, event notifications are sent over the session used to establish the subscription. For configured subscriptions, event notifications are sent over the specified connections.An event notification is sent to a receiver when something of interest occurs which is able to traverse all specified filtering and access control criteria. The event notification must include:a subscription-id element of type uint32 which corresponds to responsible subscription in the Publisher.an eventTime element which provides the time the event was generated by the event source. This event time parameter is of type dateTime and compliant to . Implementations must support time zones.the event notification content tagged and provided by a source in the publisher.The following is an example of a compliant event notification. This example extending the example within section 7.16.3 to include the mandatory information described above:While this extended section 7.16 notification provides a valid method of encapsulating subscribed notifications, other transport encapsulation methods are also viable. Improvements may be achieved in some implementations in the following ways:transport efficiency may be gained by allowing the encapsulation and bundled push of multiple events within the same event notification.identifiers to designate the current and previous event notification can be used to discover duplicated and dropped notificationsadditional header types can be used to pass relevant metadata.a signature or hash can be included to verify the efficacy of the PublisherThis is being explored in NETMOD Notifications 2.0 .In addition to data plane notifications, a publisher may send subscription state notifications to indicate to receivers that an event related to the subscription management has occurred. Subscription state notifications are unlike other notifications in that they are not general-purpose notifications. They cannot be filtered out, and they are delivered only to directly impacted receiver(s) of a subscription. The definition of subscription state notifications is distinct from other notifications by making use of a YANG extension tagging them as subscription state notification. Subscription state notifications include indications that a replay of notifications has been completed, that a subscription is done sending notifications because an end time has been reached, and that a subscription has started, been modified, been terminated, or been suspended. They are described in the following subsections. This notification indicates that a configured 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.This notification indicates that a configured 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.This notification indicates that a subscription has been terminated by the publisher. The notification includes the reason for the termination. The publisher may decide to terminate a subscription when it is running out of resources for serving it, an internal error occurs, etc. Publisher-driven terminations are notified to all receivers. The management plane can also terminate configured subscriptions using configuration operations.Subscribers can terminate via RPC subscriptions established via a delete-subscription RPC. In such cases, no subscription-terminated notifications are sent. However if a kill-subscription RPC is sent, or some other event results in the end of a susbcription, then there must be a notification that the subscription has been ended. This notification indicates that a publisher 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 configured subscriptions). 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 configured subscriptions).This notification is sent to indicate that a subscription, which includes a stop time, has finished passing events.This notification indicates that all of the notifications prior to the current time have been sent. This includes new notifications generated since the start of the subscription. This notification must not be sent for any other reason. If subscription contains no stop time, or has a stop time which has not been reached, then after the replay-complete notification has been sent notifications will be sent in sequence as they arise naturally within the system.Container "subscriptions" in the YANG module below contains the state of all subscriptions that are currently active. This includes subscriptions that were established (and have not yet been deleted) using RPCs, as well as subscriptions that have been configured as part of configuration. Using the <get> operation with NETCONF, or subscribing to this information via allows the status of subscriptions to be monitored.Each subscription is represented as a list element. The associated information includes an identifier for the subscription, a subscription status, as well as the various subscription parameters that are in effect. The subscription status indicates whether the subscription is currently active and healthy, or if it is degraded in some form. Leaf
"configured-subscription" indicates whether the subscription came into being via configuration or via RPC.Subscriptions that were established by RPC are removed from the list once they expire (reaching stop-time) or when they are terminated. Subscriptions that were established by configuration need to be deleted from the configuration by a configuration editing
operation even if the stop time has been passed.Capabilities are advertised in messages sent by each peer during session establishment . Publishers supporting the features in this document must advertise the capability "urn:ietf:params:netconf:capability:notification:2.0".The mechanism defined in this document is identified by "urn:ietf:params:netconf:capability:notification:2.0". If a subscriber only supports and not this specification, then they will recognize the capability "urn:ietf:params:netconf:capability:notification:1.0" and ignore the capability defined in this document.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. For a deployment including both configured and dynamic subscriptions, split subscription identifiers into static and dynamic halves. That way there should not be collisions if the configured subscriptions attempt to set a subscription-id which might have already been dynamically allocated.The <notification> elements are never sent before the transport layer, including capabilities exchange, has been established.A secure transport is highly recommended and the publisher must ensure that the user has sufficient authorization to perform the function they are requesting against the specific subset of content involved. When a <get> is received that refers to the content defined in this memo, recievers should only be able to view the content for which they have sufficient privileges. <establish-subscription> 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> to which different users are able to subscribe. 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 publisher MUST NOT include any content in a notification that the user is not authorized to view.If a malicious or buggy subscriber sends a number of <establish-subscription> requests, then these subscriptions accumulate and may use up system resources. In such a situation, subscriptions can be terminated by terminating the transport session. The publisher can also suspend or terminate subscriptions with per-subscription granularity.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. Subscribers that do not want pushed data need only terminate or refuse any transport sessions from the publisher. In addition, the NETCONF Authorization Control Model 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.Note that streams can define additional authorization requirements. For instance, in , each of the elements in its data plane notifications must also go through access control.It is recommended that the NACM "very-secure" tag is placed on the <kill-subscription> RPC so that only administrators can access.For their valuable comments, discussions, and feedback, we wish to acknowledge Andy Bierman, Tim Jenkins, Balazs Lengyel, Shaon Chisholm, Hector Trevino, Susan Hares, Kent Watsen, Michael Scharf, and Guangying Zheng.
Subscribing to YANG datastore push updatesNETCONF support for event notificationsRestconf and HTTP transport for event notificationsYANG Notification Headers and Bundles(To be removed by RFC editor prior to publication)Issue #9: validate that Subscription ID will only be relevant locally to a single receiverIssue #6: Data plane notifications and layered headersHow to allow for seamless integration with non-standard encodings and transports (like GPB/GRPC). Specify requirements encoding and transport must meet, provide examples.(To be removed by RFC editor prior to publication)v01 5277bis - v00 subscribed notificationsKill subscription RPC added.Renamed from 5277bis to Subscribed Notifications.Changed the notification capabilities version from 1.1 to 2.0 as this is not RFC-5277 compatible.Extracted create-subscription and other elements of RFC5277.Error conditions added, and made specific in return codes.Simplified yang model structure for removal of 'basic' grouping.Added a grouping for items which cannot be statically configured.Streams extracted if favor of more information in the filters section.Operational counters per receiver.Subscription-id and filter-id renamed to identifierSection for replay added. Replay-start and stop-time updated. Replay now cannot be configured.Control plane notification renamed to subscription state notificationSouce address: Source-vrf changed to string, default address option addedIn yang model: 'info' changed to 'policy'Scattered text clarificationsv00 - v01 of 5277bisYANG Model changes. New groupings for subscription info to allow restriction of what is changable via RPC. Removed notifications for adding and removing receivers of configured subscriptions.Expanded/renamed defintions from event server to publisher, and client to subscriber as applicable. Updated the definitions to include and expand on RFC 5277.Removal of redundant with other draftsMany other clean-ups of wording and terminology