Subscribing to YANG-Defined Event NotificationsCisco Systemsalbertgo@cisco.comCisco Systemsalex@cisco.comCisco Systemsevoit@cisco.comCisco Systemseinarnn@cisco.comCisco Systemsambtripa@cisco.comCienaschishol@ciena.comCisco Systemshtrevino@cisco.com
Operations & Management
NETCONFDraftThis document defines capabilities and operations for providing asynchronous message notification delivery
for notifications defined using YANG. 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 along with their mapping onto NETCONF transport
(to be specified in a separate document, but still included in the current document version)
are intended to obsolete RFC 5277.This document defines mechanisms that provide an asynchronous message notification delivery service for the NETCONF protocol . This is an optional capability built on top of the base NETCONF definition.
This document defines capabilities and operations for providing asynchronous message notification delivery
for notifications defined using YANG, including capabilities and operations 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
and Restconf . The capabilities
and operations defined in this document along with their mapping onto NETCONF transport
(to be specified in a separate document, but still included in the current document version)
are intended to obsolete RFC 5277.
Editor's note: The current version of this document specifies both capabilities and operations
for providing asynchronous notification delivery, as well as mapping of those capabilities and
operations onto NETCONF. The transport mapping to NETCONF will be moved into a separate document and will
be removed in future revisions of this document.
The motivation for this work is to enable the sending of asynchronous notification messages that are consistent with the data model (content) and security model used within a NETCONF implementation. defines a notification mechanism for NETCONF. However, there are various limitations:Each subscription requires a separate NETCONF connection, which is wasteful.The only mechanism to terminate a subscription is terminating the underlying NETCONF connection.No ability to modify subscriptions once they have been created.No ability to notify the receiver of a subscription if the server is dropping events.No mechanism to monitor subscriptions.No alternative mechanism to create subscriptions via RPCs. Thus the lifetime of the subscription is limited by that of the underlaying NETCONF session.Predates YANG and defines RPCs, notifications, and data nodes outside of the YANG framework.The scope of the work aims at meeting the following operational needs:Ability to dynamically or statically subscribe to event notifications available on a NETCONF agent.Ability to negotiate acceptable dynamic subscription parameters.Ability to support multiple subscriptions over a single NETCONF session.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 NETCONF transport protocol. (In other words, the encoded notification fully describes itself.) Mechanism to communicate the notifications.Ability to replay locally logged notifications.Backwards compatible with RFC 5277 implementations.Define in YANG, the RPCs, notifications, and data nodes in RFC 5277.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.Event: Something that happens that may be of interest. (e.g., a configuration change, a fault, a change in status, crossing a threshold, or an external input to the system.)Event notification: A message sent by a server to a receiver indicating that an event (of interest to the subscriber) has occurred. Events can trigger notifications if an interested party has subscribed to the stream(s) it belongs to.Stream (also referred to as "event stream"): A continuous flow of event, status, state, or other information.Subscriber: An entity able to request and negotiate a contract for the receipt of event notifications from a NETCONF server.Receiver: A target to which a NETCONF server pushes event notifications. In many deployments, the receiver and subscriber will be the same entity.Subscription: A contract between a subscriber and a NETCONF server, stipulating which information the receiver wishes to have pushed from the server without the need for further solicitation.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.Dynamic subscription: A subscription agreed between subscriber and NETCONF server via create, establish, modify, and delete RPC control plane signaling messages.Configured subscription: A subscription installed via a configuration interface.Operation: In this document, this term refers to NETCONF protocol operations defined in support of NETCONF notifications.NACM: NETCONF Access Control Model.RPC: Remote Procedure Call.This document describes mechanisms for subscribing and receiving event notifications from a NETCONF server. This document enhances the capabilities of RFC 5277 while maintaining backwards capability with existing implementations. It is intended that a final version of this document might obsolete RFC 5277.The enhancements over include the ability to terminate subscriptions without terminating the client session, to modify existing subscriptions, and to have multiple subscriptions on a NETCONF session.These enhancements do not affect clients that do not support these particular subscription requirements.The solution supports subscribing to event notifications using two mechanisms.Dynamic subscriptions, where a NETCONF client initiates a subscription negotiation with a NETCONF server. Here a client initiates a negotiation by issuing a subscription request. If the agent wants to serve this request, it will accept it, and then start pushing event notifications as negotiated. If the agent does not wish to serve it as requested, it may respond with subscription parameters, which it would have accepted.Configured subscriptions, which is an optional mechanism that enables managing subscriptions via a configuration interface so that a NETCONF agent sends event notifications to given receiver(s).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. This also means configured subscriptions do not support negotiation.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.A NETCONF agent can support multiple dynamic subscriptions simultaneously in the context of a single NETCONF session. (This requires supporting interleaving.) The termination of any of those subscriptions does not imply the termination of NETCONF transport session. Note that there is no mixing-and-matching of RPC and configuration operations. Specifically, a configured subscription cannot be modified or deleted using RPC. Similarly, a subscription created via RPC cannot be modified through configuration operations.The NETCONF agent may decide to terminate a dynamic subscription at any time. Similarly the NETCONF agent may decide to temporarily suspend the sending of event notifications for either configured or dynamic subscriptions. Such termination or suspension may be driven by the agent running out of resources to serve the subscription, or by internal errors on the server. An event stream is a set of events available for subscription from a server. It is out of the scope of this document to identify a) how streams are defined, b) how events are defined/generated, and c) how events are assigned to streams. 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.A server maintains a list of available event streams as operational data. A client can retrieve this list like any other YANG-defined data, for example using the <get> operation when using NETCONF. A NETCONF server implementation supporting the notification capability MUST support the "NETCONF" notification event stream. This stream contains all NETCONF XML event notifications supported by the NETCONF server, except for those belonging only to streams that explicitly indicate that they must be excluded from the NETCONF stream. The exact string "NETCONF" is used during the advertisement of stream support during the <get> operation on <streams> and during the <create-subscription> and <establish-subscription> operations. A NETCONF Server implementation SHOULD support the ability to perform filtering of notification records per RFC 5277.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> request will delete the entire
subscription.The YANG data models for event notifications are depicted in the following sections. Editor's note: The following section needs updating. NETCONF mapping will move to a separate document.This operation is fully defined in . It allows a subscriber to request the creation of a dynamic subscription. If successful, the subscription remains in effect for the duration of the NETCONF session.This operation is included in the document for supporting backwards compatibility with clients. New clients are expected not to use this operation, but establish subscriptions as defined in The input parameters of the operation are:
stream: An optional parameter that indicates which stream of events is of interest. If not present, events in the default NETCONF stream will be sent.filter: An optional parameter that indicates which subset of all possible events is of interest. The format of this parameter is the same as that of the filter parameter in the NETCONF protocol operations. If not present, all events not precluded by other parameters will be sent. startTime: An optional parameter used to trigger the replay feature and indicate that the replay should start at the time specified. If startTime is not present, this is not a replay subscription. It is not valid to specify start times that are later than the current time. If the startTime specified is earlier than the log can support, the replay will begin with the earliest available notification. Implementations must support time zones.stopTime: An optional parameter used with the optional replay feature to indicate the newest notifications of interest. If stopTime is not present, the notifications will continue until the subscription is terminated. Must be used with and be later than startTime. Implementations must support time zones.
If the server can satisfy the request, it sends a positive acknowledgement.
If the request cannot be completed for any reason, an error is returned along with an error reason.
Subscription requests can fail for several reasons, including if a filter with invalid syntax is
provided or if the name of a non-existent stream is provided. Other errors include:
The optional replay feature is requested but the server does not support itA stopTime is requested that is earlier than the specified startTimeA startTime is requested that is later than the current timeEditor's note: The following section needs updating. NETCONF mapping will move to a separate document.This operation is an evolution of the create subscription operation.
It allows a subscriber to request the creation of a subscription both via RPC
and configuration operations.
When invoking the RPC, establish-subscription permits negotiating the subscription terms,
changing them dynamically and enabling multiple subscriptions
overs a single NETCONF session (if interleaving is supported),
and canceling subscriptions without terminating the NETCONF session.The input parameters of the operation are those of create subscription plus:
filter-ref: filters that have been previously (and separately) configured can be referenced by a subscription.
This mechanism enables the reuse of filters.encoding: by default, updates are encoded using XML. Other encodings may be supported, such as JSON. If the NETCONF server cannot satisfy the request, the server sends a negative <subscription-result> element.If the client has no authorization to establish the subscription,
the <subscription-result> indicates an authorization error.
If the request is rejected because the server is not able to serve it,
the server SHOULD include in the returned error what subscription parameters would have been accepted
for the request when it was processed.
However, they is no guarantee that subsequent requests with those parameters for this client or others will be accepted.
For instance, consider a subscription from ,
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. Editor's note: The following section needs updating. NETCONF mapping will move to a separate document.This operation permits modifying the terms of a subscription previously established. Subscriptions created
by configuration cannot be modified. Dynamic subscriptions can be modified one or multiple times. If the server accepts the request, it immediately starts sending events based on the new terms, completely ignoring the previous ones. If the server rejects the request, the subscription remains as prior to the request. That is, the request has no impact whatsoever. The contents of negative responses to modify-subscription requests are the same as in establish subscription requests.Dynamic subscriptions established via RPC can only be modified (or deleted) via RPC using the same session used to establish it. Configured subscriptions cannot be modified (or deleted) using RPCs. Instead, configured subscriptions are modified (or deleted) as part of regular configuration operations. Servers MUST reject any attempts to modify (or delete) configured subscriptions via RPC.The parameters to modify-subscription are those of establish-subscription plus a mandatory subscription-id.If the NETCONF server can satisfy the request, the server sends a positive subscription-result.
This response is like that to an establish-subscription request without the subscription-id, which would be redundant.If the NETCONF server cannot satisfy the request, the server sends a negative subscription-result.
Its contents and semantics are identical to those to an establish-subscription request. Editor's note: The following section needs updating. NETCONF mapping will move to a separate document.This operation permits canceling a subscription previously established. Created subscriptions cannot be explicitly deleted. If the server accepts the request, it immediately stops sending events for the subscription. If the server rejects the request, all subscriptions remain as prior to the request. That is, the request has no impact whatsoever. A request may be rejected because the provided subscription identifier is incorrect.Subscriptions created via RPC can only be deleted via RPC using the same session used for establishment. Configured subscriptions cannot be deleted using RPCs. Instead, configured subscriptions are deleted as part of regular configuration operations. Servers MUST reject any RPC attempt to delete configured subscriptions.The only parameter to delete-subscription is the identifier of the subscription to delete.If the NETCONF server can satisfy the request, the server sends an OK element. If the NETCONF server cannot satisfy the request, the server sends an error-rpc element.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 rights on 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:
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.Configured subscriptions cannot be created via configuration operations. New clients should use the mechanisms described in for establishing configured subscriptions.Subscriptions can be established using configuration operations against the
top-level subtree subscription-config. There are two key differences between RPC and
configuration operations for subscription establishment.
Firstly, configuration operations do not support negotiation while RPCs do.
Secondly, while RPCs mandate that the client establishing the subscription
is the only receiver of the notifications, configuration operations permit
specifying receivers independent of any tracked subscriber.
Immediately after a subscription is successfully established,
the server sends to the receivers a control-plane notification stating
the subscription has been established (subscription-started).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 (i.e., a specific interface or server address).For example at subscription establishment, a NETCONF client may send:if the request is accepted, the server would reply:if the request is not accepted because the server cannot serve it, the server 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 server 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, added-to-subscription, with the same contents as a modified-subscription) or removed (i.e., removed-from-subscription)Subscriptions can be deleted using configuration operations against the top-level subtree subscription-config. For example, in NETCONF:Immediately after a subscription is successfully deleted, the server sends to the receivers a control-plane notification stating the subscription has been terminated (subscription-terminated).Once a subscription has been set up, the NETCONF server sends (asynchronously) the event notifications from the subscribed stream. We refer to these as data plane notifications. For dynamic subscriptions set up via RPC operations, event notifications are sent over the NETCONF session used to create or establish the subscription. For 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 . Implementations must support time zones.The event notification also contains notification-specific tagged content, if any. With the exception of <eventTime>, the content of the notification is beyond the scope of this document.For the encodings other than XML, notifications include an additional XML element so that the notification is a well-formed XML. The element is <notification-contents-{encoding}>, E.g., <notification-contents-json>. That element contains the notification contents in the desired encodingThe following is an example of an event notification from :The equivalent using json encoding would beIn addition to data plane notifications, a server may send control plane notifications to indicate to receivers that an event related to the subscription management has occurred.
Control plane notifications are unlike other notifications in that they are not general-purpose
notifications. They cannot be filtered out,
and they are delivered only to the receiver of a subscription. They are thus not part of the
regular NETCONF event stream. The definition of control plane notifications is distinct from other notifications
by making use of a YANG extension tagging them as control plane notification.
Control plane 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 is originally defined in . It is sent to indicate that all of the replay notifications have been sent and must not be sent for any other reason. In the case of a subscription without a stop time, after the <replayComplete> notification has been sent, it can be expected that any notifications generated since the start of the subscription creation will be sent, followed by notifications as they arise naturally within the system.This notification is originally defined in . It is sent to indicate that a subscription, which includes a stop time, has finished passing events.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. The notification includes the reason for the termination. A subscription may be terminated by a server or by a client. The server may decide to terminate a subscription when it is running out of resources for serving it, an internal error occurs, etc. Server-driven terminations are notified to all receivers. The management plane can also terminate configured subscriptions using configuration operations.Clients can terminate via RPC subscriptions established via RPC. In such cases, no subscription-terminated notifications are sent. This notification indicates that a server has suspended a subscription. The notification includes the reason for the suspension. A possible reason is the lack of resources to serve it. No further data plane notifications will be sent until the subscription resumes. Suspensions are notified to the subscriber (in the case of dynamic subscriptions) and all receivers (in the case of 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).Below is the state machine for the server. It is important to note that a subscription does not exist at the agent until it is accepted and made active.Of interest in this state machine are the following:Successful <create-subscription>, <establish-subscription> or <modify-subscription> actions must put the subscription into an active state.Failed <modify-subscription> actions will leave the subscription in its previous state, with no visible change to any notifications.A <delete-subscription> action will delete the entire subscription.Capabilities are advertised in messages sent by each peer during session establishment . Servers supporting the features in this document must advertise both capabilities "urn:ietf:params:netconf:capability:notification:1.0" and "urn:ietf:params:netconf:capability:notification:1.1".An example of a hello message by a server during session establishment would be:Clients that only support recognize capability "urn:ietf:params:netconf:capability:notification:1.0" and ignore capability "urn:ietf:params:netconf:capability:notification:1.1". This allows them interacting with the server as per [RFC5277]. Clients that support the features in this document recognize both capabilities. This allows them interacting with the server as per this document.Note that to support backwards compatibility, the yang models in this document include two types of naming conventions. That used in , e.g., replayComplete; and that commonly used in yang models, e.g., subscription-started.The security considerations from the base NETCONF document also apply to the notification capability.The <notification> elements are never sent before the transport layer and the NETCONF layer, including capabilities exchange, have been established and the manager has been identified and authenticated.A secure transport must be used and the server must ensure that the user has sufficient authorization to perform the function they are requesting against the specific subset of NETCONF content involved. When a <get> is received that refers to the content defined in this memo, clients should only be able to view the content for which they have sufficient privileges. <create-subscriptiont> and <establish-subscriptiont> operations can be considered like deferred <get>, and the content that different users can access may vary. This different access is reflected in the <notificationt> that different users are able to subscribe to. The contents of notifications, as well as the names of event streams, may contain sensitive information and care should be taken to ensure that they are viewed only by authorized users. The NETCONF server MUST NOT include any content in a notification that the user is not authorized to view.If a malicious or buggy NETCONF client sends a number of <create-subscription> requests, then these subscriptions accumulate and may use up system resources. In such a situation, subscriptions can be terminated by terminating the suspect underlying NETCONF sessions using the <kill-session> operation. If the client uses <establish-subscription>, the server can also suspend or terminate subscriptions with per-subscription granularity.A subscription could be configured on another receiver's behalf, with the goal of flooding that receiver with updates. One or more publishers could be used to overwhelm a receiver, which doesn't even support subscriptions. Clients that do not want pushed data need only terminate or refuse any transport sessions from the publisher. In addition, the NETCONF Authorization Control Model 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.EN1 - Definition of basic set of Stream types.
What streams are provided and what do they contain
(includes default 5277 stream).EN2 - Clarify interplay between filter definitions and different streams.
Includes information in subtrees of event payloads.EN3 - Mechanisms for diagnostics, e.g. deal with dropped updates, monitoring when they occur, etcEN4 - How to allow for seamless integration with non-standard encodings and transports (like GPB/GRPC).
Specify requirements encoding and transport must meet, provide examples. EN5 - Along with Netconf-notif, should this draft obsolete 5277 or be in parallel with it? EN6 - Stream discovery. Are adjustments needed for maximal transport independence?EN7 - Detecting loss of a sequential update notification, and mechanisms to resend. Implications to transports must be thought through.EN8 - Should we have a mandatory transport?EN9 - Multiple receivers per Configured Subscription is ok.EN10 - Replay support will be provided for selected stream types (modify vs. delete)EN11 - Required layering security requirements/considerations will be added into the YANG model for Configured Subscriptions.
It will be up to the transport to meet these requirements.EN12 - Test-only option for a subscription is desired. But it still needs to be defined.EN13 - RFC6241 Subtree-filter definition in 5277bis cannot apply to elements of an event.
Must explicitly define how 6241 doesn't apply filtering within a 5277bis event.EN14 - Ensure that Configured Subscriptions are fully defined in YANG model.EN15 - Term for Dynamic and Static Subscriptions (move to "Configured")Update examples. Examples are not in synch with the current model.
Remove overlap with transport specifics, specifically NETCONF.
The current draft revision is "self-contained" and assumes NETCONF as a transport.
It does not yet reflect the breakout of transport mappings into a separate draft.
For their valuable comments, discussions, and feedback, we wish to acknowledge Andy Bierman, Yang Geng, Peipei Guo, Susan Hares, Tim Jenkins, Balazs Lengyel, Kent Watsen, and Guangying Zheng.
RESTCONF ProtocolSubscribing to YANG datastore push updatesCisco SystemsCisco SystemsCiscoCisco SystemsCisco Systems