NETCONF | E. Voit |
Internet-Draft | Cisco Systems |
Intended status: Standards Track | A. Clemm |
Expires: October 8, 2018 | Huawei |
A. Gonzalez Prieto | |
VMWare | |
E. Nilsen-Nygaard | |
A. Tripathy | |
Cisco Systems | |
April 6, 2018 |
Customized Subscriptions to a Publisher's Event Streams
draft-ietf-netconf-subscribed-notifications-11
This document defines mechanisms and a YANG Data Model enabling subscriber-specific subscriptions to a publisher's event streams. Applying these elements allows a subscriber to request for and receive a continuous, custom feed of publisher generated information.
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 https://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 October 8, 2018.
Copyright (c) 2018 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 (https://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.
This document defines mechanisms and a YANG Data Model enabling subscriber-specific subscriptions to a publisher's event streams. Effectively this enables a 'subscribe then publish' capability where the customized information needs and access permissions of each target receiver are understood by the publisher before subscribed event records are marshaled and pushed. The receiver then gets a continuous, custom feed of publisher generated information.
While the functionality defined in this document is transport-agnostic, transports like NETCONF [RFC6241] or RESTCONF [RFC8040] can be used to configure or dynamically signal subscriptions, and there are bindings defined for subscribed event record delivery for NETCONF within [I-D.draft-ietf-netconf-netconf-event-notifications], and for HTTP2 or HTTP1.1 within [I-D.draft-ietf-netconf-restconf-notif].
The YANG model in this document conforms to the Network Management Datastore Architecture defined in [I-D.draft-ietf-netmod-revised-datastores].
Various limitations in [RFC5277] are discussed in [RFC7923]. Resolving these issues is the primary motivation for this work. Key capabilities supported by this document include:
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Configuration: defined in [I-D.draft-ietf-netmod-revised-datastores].
Configuration datastore: defined in [I-D.draft-ietf-netmod-revised-datastores].
Configured subscription: A subscription installed via configuration into a configuration datastore.
Dynamic subscription: A subscription agreed between subscriber and publisher created via an "establish-subscription" RPC.
Event: An occurrence of something that may be of interest. Examples include, a configuration change, a fault, a change in status, crossing a threshold, or an external input to the system.
Event record: A set of information detailing an event.
Notification message: Information intended for a receiver indicating that one or more event(s) have occurred.
Publisher: An entity responsible for streaming notification messages per the terms of a subscription.
Receiver: A target to which a publisher pushes subscribed event records. For dynamic subscriptions, the receiver and subscriber are the same entity.
Stream (also referred to as "event stream"): A continuous, chronologically ordered set of events aggregated under some context.
Stream filter: Evaluation criteria which may be applied against event records within a stream. Event records pass the filter when specified criteria are met.
Subscriber: An entity able to request and negotiate a contract for the generation and push of event records from a publisher. For dynamic subscriptions, the receiver and subscriber are the same entity.
Subscription: A contract with a publisher, stipulating which information one or more receivers wish to have pushed from the publisher without the need for further solicitation.
All YANG tree diagrams used in this document follow the notation defined in [I-D.ietf-netmod-yang-tree-diagrams].
This document describes a transport agnostic mechanism for subscribing to and receiving content from a stream within a publisher. This mechanism is through the use of a subscription.
Two types of subscriptions are supported:
Additional characteristics differentiating configured from dynamic subscriptions include:
Note that there is no mixing-and-matching of dynamic and configured operations on a single subscription. Specifically, a configured subscription cannot be modified or deleted using RPCs defined in this document. Similarly, a subscription established via RPC cannot be modified through configuration operations. Also note that transport specific transport drafts based on this specification MUST detail the life cycles of both dynamic and configured subscriptions.
A publisher MAY terminate a dynamic subscription at any time. Similarly, it MAY decide to temporarily suspend the sending of notification messages for any dynamic subscription, or for one or more receivers of a configured subscription. Such termination or suspension is driven by internal considerations of the publisher.
This document is intended to provide a superset of the subscription capabilities initially defined within [RFC5277]. Especially when extending an existing [RFC5277] implementation, it is important to understand what has been reused and what has been replaced. Key relationships between these two documents include:
An event stream is a named entity on a publisher which exposes a continuously updating set of event records. Each event stream is available for subscription. It is out of the scope of this document to identify a) how streams are defined (other than the NETCONF stream), b) how event records are defined/generated, and c) how event records are assigned to streams.
There is only one reserved event stream name within this document: "NETCONF". The "NETCONF" event stream contains all NETCONF XML event record information supported by the publisher, except for where it has been explicitly indicated that this the event record MUST be excluded from the "NETCONF" stream. The "NETCONF" stream will include individual notifications as per [RFC7950] section 7.16. Each of these notifications will be treated as a distinct event record. Beyond the "NETCONF" stream, implementations MAY define additional event streams.
As event records are created by a system, they may be assigned to one or more streams. The event record is distributed to a subscription's receiver(s) where: (1) a subscription includes the identified stream, and (2) subscription filtering does not exclude the event record from that receiver.
Access control permissions may be used to silently exclude event records from within a stream for which the receiver has no read access. As an example of how this might be accomplished, see [RFC8341] section 3.4.6. Note that per Section 2.7 of this document, subscription state change notifications are never filtered out.
If no access control permissions are in place for event records on a stream, then a receiver MUST be allowed access to all the event records. If subscriber permissions change during the lifecycle of a subscription and stream access is no longer permitted, then the subscription MUST be terminated.
This document defines an extensible filtering mechanism. The filter itself is a boolean test which is placed on the content of an event record. A 'false' filtering result causes the event message to be excluded from delivery to a receiver. A filter never results in information being stripped from within an event record prior to that event record being encapsulated within a notification message. The two optional stream filtering syntaxes supported are [XPATH] and subtree [RFC6241].
If no stream filter is provided within a subscription, all event records on a stream are to be sent.
This document provide for several QoS parameters. These parameters indicate the treatment of a subscription relative to other traffic between publisher and receiver. Included are:
For the "weighting" parameter, the dequeuing of notification messages across independent subscriptions to a receiver MUST be allocated bandwidth proportionally to each other based on each subscription's weight. "Weigting" is an is an optional capability of the publisher; support for it is identified via the "QoS" feature.
If a subscription has the "dependency" parameter set, then any buffered notification messages containing event records selected by the parent subscription MUST be dequeued prior to the notification messages of the dependent subscription. If notification messages have dependencies on each other, the notification message queued the longest MUST go first. If a "dependency" included within an RPC references a subscription which does not exist or is no longer accessible to that subscriber, that "dependency" MUST be silently removed. "Dependency" is an is an optional capability of the publisher; support for it is identified via the "QoS" feature.
Dynamic subscriptions are managed via protocol operations (in the form of [RFC7950], Section 7.14 RPCs) made against targets located within the publisher. These RPCs have been designed extensibly so that they may be augmented for subscription targets beyond event streams. For examples of such augmentations, see the RPC augmentations within [I-D.ietf-netconf-yang-push]'s YANG model.
Below is the publisher's state machine for a dynamic subscription. Each state is shown in its own box. It is important to note that such a subscription doesn't exist at the publisher until an "establish-subscription" RPC is accepted. The mere request by a subscriber to establish a subscription is insufficient for that subscription to be externally visible. States that are reflected in the YANG model appear in upper-case letters; in addition, start and end states are depicted to reflect subscription creation and deletion events.
......... : start : :.......: | establish-subscription | | .------modify-subscription-------. v v | .-----------. .-----------. .--------. | receiver |-subscription-suspended*->| receiver | modify- '| ACTIVE | | SUSPENDED | subscription | |<--subscription-resumed*--| | ---------->'-----------' '-----------' | | delete/kill-subscription delete/kill- | subscription v | ......... | : end :<-------------------------------' :.......: * indicates a state change notification
Figure 1: Publisher's state for a dynamic subscription
Of interest in this state machine are the following:
The "establish-subscription" RPC allows a subscriber to request the creation of a subscription. The transport selected by the subscriber to reach the publisher MUST be able to support multiple "establish-subscription" requests made within the same transport session.
The input parameters of the operation are:
If the publisher can satisfy the "establish-subscription" request, it replies with an identifier for the subscription, and then immediately starts streaming notification messages.
Below is a tree diagram for "establish-subscription". All objects contained in this tree are described within the included YANG model within Section 4.
+---x establish-subscription +---w input | +---w (target) | | +--:(stream) | | +---w (stream-filter)? | | | +--:(by-reference) | | | | +---w stream-filter-ref | | | | stream-filter-ref | | | +--:(within-subscription) | | | +---w (filter-spec)? | | | +--:(stream-subtree-filter) | | | | +---w stream-subtree-filter? <anydata> | | | | {subtree}? | | | +--:(stream-xpath-filter) | | | +---w stream-xpath-filter? | | | yang:xpath1.0 {xpath}? | | +---w stream stream-ref | | +---w replay-start-time? yang:date-and-time {replay}? | +---w stop-time? yang:date-and-time | +---w dscp? inet:dscp | +---w weighting? uint8 {qos}? | +---w dependency? subscription-id {qos}? | +---w encoding? encoding +--ro output +--ro identifier subscription-id +--ro replay-start-time-revision? yang:date-and-time {replay}?
Figure 2: establish-subscription RPC tree diagram
A publisher MAY reject the "establish-subscription" RPC for many reasons as described in Section 2.4.6. The contents of the resulting RPC error response MAY include details on input parameters which if considered in a subsequent "establish-subscription" RPC, may result in a successful subscription establishment. Any such hints MUST be transported within a yang-data "establish-subscription-stream-error-info" container included within the RPC error response.
yang-data establish-subscription-stream-error-info +--ro establish-subscription-stream-error-info +--ro reason? identityref +--ro filter-failure-hint? string
Figure 3: establish-subscription RPC yang-data tree diagram
Replay provides the ability to establish a subscription which is also capable of passing recently generated event records. In other words, as the subscription initializes itself, it sends any previously generated content from within target event stream which meets the filter and timeframe criteria. The end of these historical event records is identified via a "replay-completed" state change notification. Any event records generated since the subscription establishment may then follow. All event records will be delivered in the order they are placed into the stream.
Replay is an optional feature which is dependent on an event stream supporting some form of logging. This document puts no on the size or form of the log, or where it resides within the publisher.
The inclusion of a "replay-start-time" within an "establish-subscription" RPC indicates a replay request. If the "replay-start-time" contains a value that is earlier than what a publisher's retained history supports, then if the subscription is accepted, the actual publisher's revised start time MUST be set in the returned "replay-start-time-revision" object.
A "stop-time" parameter may be included in a replay subscription. For a replay subscription, the "stop-time" MAY be earlier than the current time, but MUST be later than the "replay-start-time".
If the time the replay starts is later than the time marked within any event records retained within the replay buffer, then the publisher MUST send a "replay-completed" notification immediately after a successful establish-subscription RPC response.
If a stream supports replay, the "replay-support" leaf is present in the "/streams/stream" list entry for the stream. An event stream that does support replay is not expected to have an unlimited supply of saved notifications available to accommodate any given replay request. To assess the timeframe available for replay, subscribers can read the leafs "replay-log-creation-time" and "replay-log-aged-time". See Figure 18 for the tree describing these elements. The actual size of the replay log at any given time is a publisher specific matter. Control parameters for the replay log are outside the scope of this document.
The "modify-subscription" operation permits changing the terms of an existing dynamic subscription established on that transport session via "establish-subscription". Dynamic subscriptions can be modified any number of times. If the publisher accepts the requested modifications, it acknowledges success to the subscriber, then immediately starts sending event records based on the new terms.
Subscriptions created by configuration cannot be modified via this RPC. However configuration may be used to modify objects referenced by the subscription (such as a referenced filter).
Below is a tree diagram for "modify-subscription". All objects contained in this tree are described within the included YANG model within Section 4.
+---x modify-subscription +---w input +---w identifier subscription-id +---w (target) | +--:(stream) | +---w (stream-filter)? | +--:(by-reference) | | +---w stream-filter-ref | | stream-filter-ref | +--:(within-subscription) | +---w (filter-spec)? | +--:(stream-subtree-filter) | | +---w stream-subtree-filter? <anydata> | | {subtree}? | +--:(stream-xpath-filter) | +---w stream-xpath-filter? | yang:xpath1.0 {xpath}? +---w stop-time? yang:date-and-time
Figure 4: modify-subscription RPC tree diagram
If the publisher accepts the requested modifications on a currently suspended subscription, the subscription will immediately be resumed (i.e., the modified subscription is returned to the ACTIVE state.) The publisher MAY immediately suspend this newly modified subscription through the "subscription-suspended" notification before any event records are sent.
If the publisher rejects the RPC request, the subscription remains as prior to the request. That is, the request has no impact whatsoever. Rejection of the RPC for any reason is indicated by via RPC error as described in Section 2.4.6. The contents of such a rejected RPC MAY include hints on inputs which (if considered) may result in a successfully modified subscription. These hints MUST be transported within a yang-data "modify-subscription-stream-error-info" container inserted into the RPC error response.
Below is a tree diagram for "modify-subscription-RPC-yang-data". All objects contained in this tree are described within the included YANG model within Section 4.
yang-data modify-subscription-stream-error-info +--ro modify-subscription-stream-error-info +--ro reason? identityref +--ro filter-failure-hint? string
Figure 5: modify-subscription RPC yang-data tree diagram
The "delete-subscription" operation permits canceling an existing subscription established on that transport session. If the publisher accepts the request, and the publisher has indicated success, the publisher MUST NOT send any more notification messages for this subscription. If the delete request matches a known subscription established on the same transport session, then it MUST be deleted; otherwise it MUST be rejected with no changes to the publisher.
Below is a tree diagram for "delete-subscription". All objects contained in this tree are described within the included YANG model within Section 4.
+---x delete-subscription +---w input +---w identifier subscription-id
Figure 6: delete-subscription RPC tree diagram
Dynamic subscriptions can only be deleted via this RPC using the same transport session previously used for subscription establishment. Configured subscriptions cannot be deleted using RPCs.
The "kill-subscription" operation permits an operator to end a dynamic subscription which is not associated with the transport session used for the RPC. A publisher MUST terminate any dynamic subscription identified by RPC request. An operator may find subscription identifiers which may be used with "kill-subscription" by searching for the IP address of a receiver within "subscriptions/subscription/receivers/receiver/address".
Configured subscriptions cannot be killed 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.
Below is a tree diagram for "kill-subscription". All objects contained in this tree are described within the included YANG model within Section 4.
+---x kill-subscription +---w input +---w identifier subscription-id
Figure 7: kill-subscription RPC tree diagram
Whenever an RPC is unsuccessful, the publisher returns relevant information as part of the RPC error response. Transport level error processing MUST be done before RPC error processing described in this section. In all cases, RPC error information returned will use existing transport layer RPC structures, such as those seen with NETCONF in [RFC6241] Appendix A, or with RESTCONF in [RFC8040] Section 7.1. These structures MUST be able to encode subscription specific errors identified below and defined within this document's YANG model.
As a result of this mixture, how subscription errors are encoded within an RPC error response is transport dependent. Following are valid errors which can occur for each RPC:
establish-subscription modify-subscription ---------------------- ------------------- dscp-unavailable filter-unsupported filter-unsupported insufficient-resources history-unavailable no-such-subscription insufficient-resources replay-unsupported delete-subscription kill-subscription ---------------------- ---------------------- no-such-subscription no-such-subscription
To see a NETCONF based example of an error response from above, see [I-D.draft-ietf-netconf-netconf-event-notifications], Figure 10.
There is one final set of transport independent RPC error elements included in the YANG model. These are the following three yang-data structures for failed event stream subscriptions:
A configured subscription is a subscription installed via configuration. Configured subscriptions may be modified by any configuration client with the proper permissions. Subscriptions can be modified or terminated via configuration at any point of their lifetime.
Configured subscriptions have several characteristics distinguishing them from dynamic subscriptions:
Supporting configured subscriptions is optional and advertised using the "configured" feature.
In addition to the subscription parameters available to dynamic subscriptions described in Section 2.4.2, the following additional parameters are also available to configured subscriptions:
If none of the above parameters are set, notification messages MUST egress the publisher's default interface.
A tree diagram describing these parameters is shown in Figure 20. All parameters are described within the YANG model in Section 4.
Below is the state machine for a configured subscription on the publisher. This state machine describes the three states (VALID, INVALID, and CONCLUDED), as well as the transitions between these states. The creation or modification of a configured subscription initiates an evaluation by the publisher to determine if the subscription is in VALID or INVALID states. The publisher uses its own criteria in making this determination. If in the VALID state, the subscription becomes operational.
......... : start :-. :.......: | create .---modify-----.----------------------------------. | | | | V V .-------. ....... .---------. .----[evaluate]--no--->|INVALID|-delete->: end :<-delete-|CONCLUDED| | '-------' :.....: '---------' |----[evaluate]--no-. ^ ^ ^ | ^ | | | | yes | '->unsupportable delete stop-time | modify (subscription- (subscription- (subscription- | | terminated*) terminated*) concluded*) | | | | | | (1) (2) (3) (4) | .---------------------------------------------------------------. '-->| VALID | '---------------------------------------------------------------' Legend: dotted boxes: subscription creation and deletion events dashed boxes with uppercase letters: states for a subscription [evaluate]: decision point on whether the subscription is supportable (*): resulting subscription state change notification
Figure 8: Publisher state model for a configured subscription
A subscription in the VALID state may move to the INVALID state in one of two ways. First, it may be modified in a way which fails a re-evaluation. See (1) in the diagram. Second, the publisher might determine that the subscription is no longer supportable. This could be for reasons of an unexpected but sustained increase in stream events, degraded CPU capacity, a more complex referenced filter, or other higher priority subscriptions which have usurped resources. See (2) in the diagram. No matter the case, a "subscription-terminated" notification is sent to any receivers in an ACTIVE or SUSPENDED state. A subscription in the VALID state may also transition to the CONCLUDED state via (4) if a configured stop time has been reached. In this case, a "subscription-concluded" notification is sent to any receivers in ACTIVE or SUSPENDED states. Finally, a subscription may be deleted by configuration (3).
When a subscription is in the VALID state, a publisher will attempt to connect with all configured receivers and deliver notification messages. Below is the state machine for each receiver of a configured subscription. This receiver state machine is fully contained within the state machine of the configured subscription, and is only relevant when the configured subscription is in the VALID state.
.-----------------------------------------------------------------. | VALID | | .----------. .--------. | | | receiver |------------------timeout->|receiver| | | |CONNECTING|<----------------reset--(4)|TIMEOUT | | | | |<-transport---. '--------' | | '----------' loss,reset | | | (1) | | | | subscription- (3) | | | started* .--------. | .---------. | | '----->| | '--------------------(3)| | | | |receiver|(2)-subscription-suspended*->|receiver | | | subscription-| ACTIVE | |SUSPENDED| | | modified* | |<--subscription-resumed*,----| | | | '---->'--------' subscription-modified* '---------' | '-----------------------------------------------------------------' Legend: dashed boxes which include the word 'receiver' show the possible states for an individual receiver of a VALID configured subscription. * indicates a state change notification
Figure 9: Receiver state for a configured subscription
When a configured subscription first moves the VALID state, the "state" leaf of each receiver is initialized to "CONNECTING". If transport connectivity is not available to any receiver, a transport session is established (e.g., through [RFC8071]). Individual receivers are moved to the ACTIVE state when a "subscription-started" state change notification is successfully passed to that receiver (1). Event records are only sent to ACTIVE receivers. Configured receivers remain ACTIVE if both transport connectivity can be verified to the receiver, and event records are not being dropped due to a publisher buffer overflow. The result is that a receiver will remain ACTIVE on the publisher as long as events aren't being lost, or the receiver cannot be reached. However if there is buffer overflow, or the publisher cannot generate notification messages for a receiver, the receiver MUST be moved to SUSPENDED (2). In addition, a configured subscription's receiver MUST be moved to CONNECTING if transport connectivity cannot be achieved, or if the receiver is reset via the "reset" action (3), (4). For more on reset, see Section 2.5.5.
A configured subscription's receiver MUST be moved to the SUSPENDED state if there is transport connectivity between the publisher and receiver, but notification messages are not able to be generated for that receiver. A configured subscription receiver MUST be returned to the ACTIVE state from the SUSPENDED state when notification messages are again being generated and a receiver has successfully been sent a "subscription-resumed" or "subscription-modified" notification.
Modification of a configured subscription is possible at any time. A "subscription-modified" state change notification will be sent to all active receivers, immediately followed by notification messages conforming to the new parameters. Suspended receivers will also be informed of the modification. However this notification will await the end of the suspension for that receiver.
The mechanisms described above are mirrored in the RPCs and notifications within the document. It should be noted that these RPCs and notifications have been designed to be extensible and allow subscriptions into targets other than event streams. The YANG model of [I-D.ietf-netconf-yang-push] Section 4.1 provides many such extensions; this includes the augmentation of "/modify-subscription/input/target".
Configured subscriptions are established using configuration operations against the top-level "subscriptions" subtree.
Because there is no explicit association with an existing transport session, configuration operations require additional parameters beyond those of dynamic subscriptions to indicate receivers, and possibly whether the notification messages need to come from a specific egress interface on the publisher.
After a subscription is successfully established, the publisher immediately sends a "subscription-started" state change notification to each receiver. It is quite possible that upon configuration, reboot, or even steady-state operations, a transport session may not be currently available to the receiver. In this case, when there is something to transport for an active subscription, transport specific call-home operations will be used to establish the connection. When transport connectivity is available, notification messages may then be pushed.
With active configured subscriptions, it is allowable to buffer event records even after a "subscription-started" has been sent. However if events are lost (rather than just delayed) due to replay buffer overflow, a new "subscription-started" must be sent. This new "subscription-started" indicates an event record discontinuity.
To see an example at subscription creation using configuration operations over NETCONF, see Appendix A of [I-D.draft-ietf-netconf-netconf-event-notifications].
Note that is possible to configure replay on a configured subscription. This capability is to allow a configured subscription to exist on a system so that event records generated during boot can be buffered and pushed as soon as the transport session is established.
Configured subscriptions can be modified using configuration operations against the top-level "subscriptions" subtree.
If the modification involves adding receivers, added receivers are placed in the CONNECTING state. If a receiver is removed, the state change notification "subscription-terminated" is sent to that receiver if that receiver is ACTIVE or SUSPENDED.
If the modification involves changing the policies for the subscription, the publisher sends to currently active receivers a "subscription-modified" notification. For any suspended receivers, a "subscription-modified" notification will be delayed until the receiver is resumed. (Note: in this case, the "subscription-modified" notification informs the receiver that the subscription has been resumed, so no additional "subscription-resumed" need be sent. Also note that if multiple modifications have occurred during the suspension, only the latest one need be sent to the receiver.)
Subscriptions can be deleted through configuration against the top-level "subscriptions" subtree.
Immediately after a subscription is successfully deleted, the publisher sends to all receivers of that subscription a state change notification stating the subscription has ended (i.e., "subscription-terminated").
It is possible that a configured subscription to a receiver needs to be reset. This is accomplished via the "reset" action within the YANG model at "/subscriptions/subscription/receivers/receiver/reset". This re-initialization may be useful in cases where a publisher has timed out trying to reach a receiver. When such a reset occurs, a transport session will be initiated if necessary, and a new "subscription-started" notification will be sent.
It is possible to place a start time on a configured subscription. This enables functionality like immediately streaming boot log information off of a publisher immediately after restart.
When any such configured subscription receivers become ACTIVE, buffered event records (if any) will be sent immediately after the "subscription-started" notification. The first event sent will be the most recent following the latest of four different times: the "replay-log-creation-time", "replay-log-aged-time", "replay-start-time", or the most recent publisher boot time.
All other replay functionality remains the same as with dynamic subscriptions as described in Section 2.4.2.1.
Whether dynamic or configured, once a subscription has been set up, the publisher streams event records via notification messages per the terms of the subscription. For dynamic subscriptions, notification messages are sent over the session used to establish the subscription. For configured subscriptions, notification messages are sent over the connections specified by the transport and each configured receiver. In all cases, a single transport session MUST be capable of supporting the intermixing of RPCs and notifications from different subscriptions.
A notification message is sent to a receiver when an event record is not blocked by either the specified filter criteria or receiver permissions. This notification message MUST be encoded in a <notification> message as defined in [RFC5277], Section 4.
The following example within [RFC7950] section 7.16.3 is an example of a compliant message:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2007-09-01T10:00:00Z</eventTime> <link-failure xmlns="http://acme.example.com/system"> <if-name>so-1/2/3.0</if-name> <if-admin-status>up</if-admin-status> <if-oper-status>down</if-oper-status> </link-failure> </notification>
Figure 10: subscribed notification message
In the figure above, the "eventTime" is populated with a timestamp matching the time some originating process identified as when this event occurred.
When a dynamic subscription has been started or modified, with "establish-subscription" or "modify-subscription" respectively, event records matching the newly applied filter criteria MUST NOT be sent until after the RPC reply has been sent.
When a configured subscription has been started or modified, event records matching the newly applied filter criteria MUST NOT be sent until after the "subscription-started" or "subscription-modified" notifications has been sent, respectively.
In addition to sending event records to receivers, a publisher MUST also send subscription state notifications when events related to subscription management has occurred.
Subscription state notifications are unlike other notifications in that they are never included in any stream. Instead, they are inserted (as defined in this section) within the sequence of notification messages sent to a particular receiver. Subscription state notifications cannot be filtered out, they cannot be stored in replay buffers, and they are delivered only to impacted receiver(s) of a subscription. The identification of subscription state notifications is easy to separate from other notification messages through the use of the YANG extension "subscription-state-notif". This extension tags a notification as subscription state notification.
The complete set of subscription state notifications is described in the following subsections.
This notification indicates that a configured subscription has started, and event records may be sent. Included in this state change notification are all the parameters of the subscription, except for the receiver(s) addressing information and origin information indicating where notification messages will egress the publisher. Note that if a referenced filter from the "filters" container has been used within the subscription, the notification will still provide the contents of that referenced filter under the "within-subscription" subtree.
Note that for dynamic subscriptions, no "subscription-started" notifications are ever sent.
Below is a tree diagram for "subscription-started". All objects contained in this tree are described within the included YANG model within Section 4.
+---n subscription-started {configured}? +--ro identifier subscription-id +--ro transport transport {configured}? +--ro encoding? encoding +--ro (target) | +--:(stream) | +--ro (stream-filter)? | | +--:(by-reference) | | | +--ro stream-filter-ref stream-filter-ref | | +--:(within-subscription) | | +--ro (filter-spec)? | | +--:(stream-subtree-filter) | | | +--ro stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--ro stream-xpath-filter? yang:xpath1.0 | | {xpath}? | +--ro stream stream-ref | +--ro replay-start-time? yang:date-and-time | {replay}? +--ro stop-time? yang:date-and-time +--ro dscp? inet:dscp +--ro weighting? uint8 {qos}? +--ro dependency? subscription-id {qos}?
Figure 11: subscription-started notification tree diagram
This notification indicates that a subscription has been modified by configuration operations. It is delivered directly after the last event records processed using the previous subscription parameters, and before any event records processed after the modification.
Below is a tree diagram for "subscription-modified". All objects contained in this tree are described within the included YANG model within Section 4.
+---n subscription-modified +--ro identifier subscription-id +--ro transport transport {configured}? +--ro encoding? encoding +--ro (target) | +--:(stream) | +--ro (stream-filter)? | | +--:(by-reference) | | | +--ro stream-filter-ref stream-filter-ref | | +--:(within-subscription) | | +--ro (filter-spec)? | | +--:(stream-subtree-filter) | | | +--ro stream-subtree-filter? <anydata> | | | {subtree}? | | +--:(stream-xpath-filter) | | +--ro stream-xpath-filter? yang:xpath1.0 | | {xpath}? | +--ro stream stream-ref | +--ro replay-start-time? yang:date-and-time | {replay}? +--ro stop-time? yang:date-and-time +--ro dscp? inet:dscp +--ro weighting? uint8 {qos}? +--ro dependency? subscription-id {qos}?
Figure 12: subscription-modified notification tree diagram
A publisher most often sends this notification directly after the modification of any configuration parameters impacting a configured subscription. But it may also be sent at two other times:
This notification indicates that no further event records for this subscription should be expected from the publisher. A publisher may terminate the sending event records to a receiver for the following reasons:
Each of the reasons above correspond one-to-one with a "reason" identityref specified within the YANG model.
Below is a tree diagram for "subscription-terminated". All objects contained in this tree are described within the included YANG model within Section 4.
+---n subscription-terminated +--ro identifier subscription-id +--ro reason identityref
Figure 13: subscription-terminated notification tree diagram
Note: this state change notification MUST be sent to a dynamic subscription's receiver when the "kill-subscription" RPC is successful, or other event other than reaching the subscription's "stop-time" results in the end of a subscription.
This notification indicates that a publisher has suspended the sending of event records to a receiver, and also indicates the possible loss of events. Suspension happens when capacity constraints stop a publisher from serving a valid subscription. The two conditions where is this possible are:
These conditions are encoded within the "reason" object. No further notification will be sent until the subscription resumes or is terminated.
Below is a tree diagram for "subscription-suspended". All objects contained in this tree are described within the included YANG model within Section 4.
+---n subscription-suspended +--ro identifier subscription-id +--ro reason identityref
Figure 14: subscription-suspended notification tree diagram
This notification indicates that a previously suspended subscription has been resumed under the unmodified terms previously in place. Subscribed event records generated after the issuance of this state change notification may now be sent.
Below is the tree diagram for "subscription-resumed". All objects contained in this tree are described within the included YANG model within Section 4.
+---n subscription-resumed +--ro identifier subscription-id
Figure 15: subscription-resumed notification tree diagram
This notification indicates that a subscription, which includes a "stop-time", has successfully finished passing event records upon the reaching of that time.
Below is a tree diagram for "subscription-completed". All objects contained in this tree are described within the included YANG model within Section 4.
+---n subscription-completed +--ro identifier subscription-id
Figure 16: subscription-completed notification tree diagram
This notification indicates that all of the event records prior to the current time have been passed to a receiver. It is sent before any notification message containing an event record with a timestamp later than (1) the "stop-time" or (2) the subscription's start time.
If a subscription contains no "stop-time", or has a "stop-time" that has not been reached, then after the "replay-completed" notification has been sent, additional event records will be sent in sequence as they arise naturally on the publisher.
Below is a tree diagram for "subscription-completed". All objects contained in this tree are described within the included YANG model within Section 4.
+---n replay-completed +--ro identifier subscription-id
Figure 17: replay-completed notification tree diagram
In the operational datastore, the container "subscriptions" maintains the state of all known subscriptions. This includes subscriptions that were established (and have not yet been deleted) using RPCs, as well as subscriptions that have been configured. Using datastore retrieval operations, or subscribing to this information via [I-D.ietf-netconf-yang-push] allows the state of subscriptions and their connectivity to receivers to be monitored.
Each subscription is represented as a list element. While many subscription objects are shown as configurable, dynamic subscriptions are only included within the operational datastore and as a result are not configurable. Information for both dynamic and configured subscriptions may be monitored within the operational datastore. This information includes receiver event counters, the state of the receiver (e.g., is currently active or suspended), as well as the various subscription parameters that are in effect. The appearance of the leaf "configured-subscription-state" indicates both that the subscription came into being via configuration, and the current state of that configured subscription.
Dynamic subscriptions are removed from the operational datastore once they expire (reaching stop-time) or when they are terminated. Configured subscriptions need to be deleted from the configuration by a configuration editing operation, even after the "stop-time" has been passed.
Publishers supporting this document MUST indicate support of the YANG model "ietf-subscribed-notifications" within the YANG library of the publisher. In addition support for optional features "encode-xml", "encode-json", "configured" "supports-vrf", "qos", "xpath", "subtree", "interface-designation", and "replay" MUST be indicated if supported.
This section contains tree diagrams for nodes defined in Section 4. For tree diagrams of state change notifications, see Section 2.7. Or for the tree diagrams for the RPCs, see Section 2.4.
A publisher maintains a list of available event streams as operational data. This list contains both standardized and vendor-specific event streams. This enables subscribers to discover what streams a publisher supports.
+--ro streams +--ro stream* [name] +--ro name string +--ro description string +--ro replay-support? empty {replay}? +--ro replay-log-creation-time yang:date-and-time {replay}? +--ro replay-log-aged-time? yang:date-and-time {replay}?
Figure 18: Stream Container tree diagram
Above is a tree diagram for the streams container. All objects contained in this tree are described within the included YANG model within Section 4.
The "filters" container maintains a list of all subscription filters that persist outside the life-cycle of a single subscription. This enables pre-defined filters which may be referenced by more than one subscription.
+--rw filters +--rw stream-filter* [identifier] +--rw identifier filter-id +--rw (filter-spec)? +--:(stream-subtree-filter) | +--rw stream-subtree-filter? <anydata> {subtree}? +--:(stream-xpath-filter) +--rw stream-xpath-filter? yang:xpath1.0 {xpath}?
Figure 19: Filter Container tree diagram
Above is a tree diagram for the filters container. All objects contained in this tree are described within the included YANG model within Section 4.
The "subscriptions" container maintains a list of all subscriptions on a publisher, both configured and dynamic. It can be used to retrieve information about the subscriptions which a publisher is serving.
+--rw subscriptions +--rw subscription* [identifier] +--rw identifier subscription-id +--ro configured-subscription-state? enumeration | {configured}? +--rw purpose? string {configured}? +--rw transport transport | {configured}? +--rw encoding? encoding +--rw (target) | +--:(stream) | +--rw (stream-filter)? | | +--:(by-reference) | | | +--rw stream-filter-ref | | | stream-filter-ref | | +--:(within-subscription) | | +--rw (filter-spec)? | | +--:(stream-subtree-filter) | | | +--rw stream-subtree-filter? | | | <anydata> {subtree}? | | +--:(stream-xpath-filter) | | +--rw stream-xpath-filter? | | yang:xpath1.0 {xpath}? | +--rw stream stream-ref | +--rw replay-start-time? | yang:date-and-time {replay}? +--rw stop-time? yang:date-and-time +--rw dscp? inet:dscp +--rw weighting? uint8 {qos}? +--rw dependency? subscription-id | {qos}? +--rw (notification-message-origin)? {configured}? | +--:(interface-originated) | | +--rw source-interface? | | if:interface-ref {interface-designation}? | +--:(address-originated) | +--rw source-vrf? | | -> /ni:network-instances/network-instance/name | | {supports-vrf}? | +--rw source-address? | inet:ip-address-no-zone +--rw receivers +--rw receiver* [name] +--rw name string +--rw address? inet:host +--ro pushed-notifications? yang:counter64 +--ro excluded-notifications? yang:counter64 +--ro state enumeration +---x reset +--ro output +--ro time yang:date-and-time
Figure 20: Subscriptions tree diagram
Above is a tree diagram for the subscriptions container. All objects contained in this tree are described within the included YANG model within Section 4.
<CODE BEGINS> file "ietf-subscribed-notifications@2018-04-05.yang" module ietf-subscribed-notifications { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"; prefix sn; import ietf-yang-types { prefix yang; reference "RFC 6991: Common YANG Data Types"; } import ietf-inet-types { prefix inet; reference "RFC 6991: Common YANG Data Types"; } import ietf-interfaces { prefix if; reference "RFC 7223: A YANG Data Model for Interface Management"; } import ietf-network-instance { prefix ni; reference "draft-ietf-rtgwg-ni-model-11: YANG Model for Network Instances"; } import ietf-restconf { prefix rc; reference "RFC 8040 - RESTCONF Protocol"; } organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: <http:/tools.ietf.org/wg/netconf/> WG List: <mailto:netconf@ietf.org> Author: Alexander Clemm <mailto:ludwig@clemm.org> Author: Eric Voit <mailto:evoit@cisco.com> Author: Alberto Gonzalez Prieto <mailto:agonzalezpri@vmware.com> Author: Einar Nilsen-Nygaard <mailto:einarnn@cisco.com> Author: Ambika Prasad Tripathy <mailto:ambtripa@cisco.com>"; description "Contains a YANG specification for subscribing to event records and receiving matching content within notification messages."; revision 2018-04-05 { description "Initial version"; reference "RFC XXXX: Customized Subscriptions to a Publisher's Event Streams"; } /* * FEATURES */ feature encode-json { description "This feature indicates that JSON encoding of notification messages is supported."; } feature encode-xml { description "This feature indicates that XML encoding of notification messages is supported."; } feature configured { description "This feature indicates that configuration of subscription is supported."; } feature replay { description "This feature indicates that historical event record replay is supported. With replay, it is possible for past event records to be streamed in chronological order."; } feature xpath { description "This feature indicates support for xpath filtering."; reference "http://www.w3.org/TR/1999/REC-xpath-19991116"; } feature subtree { description "This feature indicates support for YANG subtree filtering."; reference "RFC 6241, Section 6."; } feature supports-vrf { description "This feature indicates a publisher supports VRF configuration for configured subscriptions. VRF support for dynamic subscriptions does not require this feature."; reference "draft-ietf-rtgwg-ni-model"; } feature interface-designation { description "This feature indicates a publisher supports sourcing all receiver interactions for a configured subscription from a single designated egress interface."; } feature qos { description "This feature indicates a publisher supports absolute dependencies of one subscription's traffic over another, as well as weighted bandwidth sharing between subscriptions. Both of these are Quality of Service (QoS) features which allow differentiated treatment of notification messages between a publisher and a specific receiver."; } /* * EXTENSIONS */ extension subscription-state-notification { description "This statement applies only to notifications. It indicates that the notification is a subscription state notification. Therefore it does not participate in a regular event stream and does not need to be specifically subscribed to in order to be received. This statement can only occur as a substatement to the YANG 'notification' statement."; } /* * IDENTITIES */ /* Identities for RPC and Notification errors */ identity establish-subscription-error { description "Problem found while attempting to fulfill an 'establish-subscription' rpc request. "; } identity modify-subscription-error { description "Problem found while attempting to fulfill a 'modify-subscription' rpc request. "; } identity delete-subscription-error { description "Problem found while attempting to fulfill either a 'delete-subscription' rpc request or a 'kill-subscription' rpc request. "; } identity subscription-terminated-reason { description "Problem condition communicated to a receiver as part of a 'subscription-terminated' notification. "; } identity subscription-suspended-reason { description "Problem condition communicated to a receiver as part of a 'subscription-terminated' notification. "; } identity dscp-unavailable { base establish-subscription-error; description "The publisher is unable mark notification messages with a prioritization information in a way which will be respected during network transit."; } identity filter-unavailable { base subscription-terminated-reason; description "Referenced filter does not exist. This means a receiver is referencing a filter which doesn't exist, or to which they do not have access permissions."; } identity filter-unsupported { base establish-subscription-error; base modify-subscription-error; description "Cannot parse syntax within the filter. This failure can be from a syntax error, or a syntax too complex to be processed by the publisher."; } identity history-unavailable { base establish-subscription-error; description "Replay request too far into the past. This means the publisher does store historic information for the requested stream, but not back to the requested timestamp."; } identity insufficient-resources { base establish-subscription-error; base modify-subscription-error; base subscription-suspended-reason; description "The publisher has insufficient resources to support the requested subscription. An example might be that allocated CPU is too limited to generate the desired set of notification messages."; } identity no-such-subscription { base modify-subscription-error; base delete-subscription-error; base subscription-terminated-reason; description "Referenced subscription doesn't exist. This may be as a result of a non-existent subscription ID, an ID which belongs to another subscriber, or an ID for configured subscription."; } identity replay-unsupported { base establish-subscription-error; description "Replay cannot be performed for this subscription. This means the publisher will not provide the requested historic information from the stream via replay to this receiver."; } identity stream-unavailable { base subscription-terminated-reason; description "Not a subscribable stream. This means the referenced stream is not available for subscription by the receiver."; } identity suspension-timeout { base subscription-terminated-reason; description "Termination of previously suspended subscription. The publisher has eliminated the subscription as it exceeded a time limit for suspension."; } identity unsupportable-volume { base subscription-suspended-reason; description "The publisher does not have the network bandwidth needed to get the volume of generated information intended for a receiver."; } /* Identities for encodings */ identity configurable-encoding { description "If a transport identity derives from this identity, it means that it supports configurable encodings."; } identity encoding { description "Base identity to represent data encodings"; } identity encode-xml { base encoding; if-feature "encode-xml"; description "Encode data using XML as described in RFC 7950"; reference "RFC 7950 - The YANG 1.1 Data Modeling Language"; } identity encode-json { base encoding; if-feature "encode-json"; description "Encode data using JSON as described in RFC 7951"; reference "RFC 7951 - JSON Encoding of Data Modeled with YANG"; } /* Identities for transports */ identity transport { description "An identity that represents a the underlying mechanism for passing notification messages."; } identity inline-address { description "A transport identity can derive can derive from this identity in order to allow inline definition of the host address in the 'receiver' list"; } /* * TYPEDEFs */ typedef subscription-id { type uint32; description "A type for subscription identifiers."; } typedef filter-id { type string; description "A type to identify filters which can be associated with a subscription."; } typedef encoding { type identityref { base encoding; } description "Specifies a data encoding, e.g. for a data subscription."; } typedef transport { type identityref { base transport; } description "Specifies transport used to send notification messages to a receiver."; } typedef stream-ref { type leafref { path "/sn:streams/sn:stream/sn:name"; } description "This type is used to reference a system-provided stream."; } typedef stream-filter-ref { type leafref { path "/sn:filters/sn:stream-filter/sn:identifier"; } description "This type is used to reference a stream filter."; } /* * GROUPINGS */ grouping stream-filter-elements { description "This grouping defines the base for filters applied to event streams."; choice filter-spec { description "The content filter specification for this request."; anydata stream-subtree-filter { if-feature "subtree"; description "Event stream evaluation criteria encoded in the syntax of a subtree filter as defined in RFC 6241, Section 6. The subtree filter is applied to the representation of individual, delineated event records as contained within the event stream. For example, if the notification message contains an instance of a notification defined in YANG, then the top-level element is the name of the YANG notification. If the subtree filter returns a non-empty node set, the filter matches the event record, and the it is included in the notification message sent to the receivers."; reference "RFC 6241, Section 6."; } leaf stream-xpath-filter { if-feature "xpath"; type yang:xpath1.0; description "Event stream evaluation criteria encoded in the syntax of an XPath 1.0 expression. The XPath expression is evaluated on the representation of individual, delineated event records as contained within the event stream. For example, if the notification message contains an instance of a notification defined in YANG, then the top-level element is the name of the YANG notification, and the root node has this top-level element as the only child. The result of the XPath expression is converted to a boolean value using the standard XPath 1.0 rules. If the boolean value is 'true', the filter matches the event record, and the it is included in the notification message sent to the receivers. The expression is evaluated in the following XPath context: o The set of namespace declarations are those in scope on the 'xpath-filter' leaf element o The set of variable bindings is empty. o The function library is the core function library, and the XPath functions defined in section 10 in RFC 7950. o The context node is the root node."; reference "http://www.w3.org/TR/1999/REC-xpath-19991116 RFC 7950, Section 10."; } } } grouping update-qos { description "This grouping describes Quality of Service information concerning a subscription. This information is passed to lower layers for transport prioritization and treatment"; leaf dscp { type inet:dscp; default "0"; description "The desired network transport priority level. This is the priority set on notification messages encapsulating the results of the subscription. This transport priority is shared for all receivers of a given subscription."; } leaf weighting { if-feature "qos"; type uint8 { range "0 .. 255"; } description "Relative weighting for a subscription. Allows an underlying transport layer perform informed load balance allocations between various subscriptions"; reference "RFC-7540, section 5.3.2"; } leaf dependency { if-feature "qos"; type subscription-id; description "Provides the Subscription ID of a parent subscription which has absolute precedence should that parent have push updates ready to egress the publisher. In other words, there should be no streaming of objects from the current subscription if the parent has something ready to push. If a dependency is asserted via configuration or via RPC, but the referenced subscription-id does not exist, the dependency is silently discarded. If a referenced subscription is deleted this dependency is removed."; reference "RFC-7540, section 5.3.1"; } } grouping subscription-policy-modifiable { description "This grouping describes all objects which may be changed in a subscription via an RPC."; choice target { mandatory true; description "Identifies the source of information against which a subscription is being applied, as well as specifics on the subset of information desired from that source."; case stream { choice stream-filter { description "An event stream filter can be applied to a subscription. That filter will come either referenced from a global list, or be provided within the subscription itself."; case by-reference { description "Apply a filter that has been configured separately."; leaf stream-filter-ref { type stream-filter-ref; mandatory true; description "References an existing stream-filter which is to be applied to stream for the subscription."; } } case within-subscription { description "Local definition allows a filter to have the same lifecycle as the subscription."; uses stream-filter-elements; } } } } leaf stop-time { type yang:date-and-time; description "Identifies a time after which notification messages for a subscription should not be sent. If stop-time is not present, the notification messages will continue until the subscription is terminated. If replay-start-time exists, stop-time must be for a subsequent time. If replay-start-time doesn't exist, stop-time when established must be for a future time."; } } grouping subscription-policy-dynamic { description "This grouping describes information concerning a subscription which can just be passed over the RPCs defined in this model."; uses subscription-policy-modifiable { augment target/stream { description "Adds additional objects which can be modified by RPC."; leaf stream { type stream-ref { require-instance false; } mandatory true; description "Indicates the stream of event records to be considered for this subscription."; } leaf replay-start-time { if-feature "replay"; type yang:date-and-time; description "Used to trigger the replay feature and indicate that the replay should start at the time specified. If replay-start-time is not present, this is not a replay subscription and event record push should start immediately. It is never valid to specify start times that are later than or equal to the current time."; } } } uses update-qos; } grouping subscription-policy { description "This grouping describes the full set of policy information concerning both dynamic and configured subscriptions, except for configured receivers."; leaf transport { if-feature "configured"; type transport; mandatory true; description "This leaf specifies the transport used to deliver messages destined to all receivers of a subscription."; } leaf encoding { when 'derived-from(../transport, "sn:configurable-encoding")'; type encoding; description "The type of encoding for the subscribed data. If not included as part of the RPC, the encoding MUST be set by the publisher to be the encoding used by this RPC."; } uses subscription-policy-dynamic; } /* * RPCs */ rpc establish-subscription { description "This RPC allows a subscriber to create (and possibly negotiate) a subscription on its own behalf. If successful, the subscription remains in effect for the duration of the subscriber's association with the publisher, or until the subscription is terminated. In case an error occurs, or the publisher cannot meet the terms of a subscription, and RPC error is returned, the subscription is not created. In that case, the RPC reply's error-info MAY include suggested parameter settings that would have a higher likelihood of succeeding in a subsequent establish-subscription request."; input { uses subscription-policy-dynamic; leaf encoding { type encoding; description "The type of encoding for the subscribed data. If not included as part of the RPC, the encoding MUST be set by the publisher to be the encoding used by this RPC."; } } output { leaf identifier { type subscription-id; mandatory true; description "Identifier used for this subscription."; } leaf replay-start-time-revision { if-feature "replay"; type yang:date-and-time; description "If a replay has been requested, this represents the earliest time covered by the event buffer for the requested stream. The value of this object is the 'replay-log-aged-time' if it exists. Otherwise it is the 'replay-log-creation-time'. All buffered event records after this time will be replayed to a receiver. Note that this object will only be sent if the start time has been revised to be later than the time requested by the subscriber."; } } } rc:yang-data establish-subscription-stream-error-info { container establish-subscription-stream-error-info { description "If any 'establish-subscription' RPC parameters are unsupportable against the event stream, a subscription is not created and the RPC error response MUST indicate the reason why the subscription failed to be created. This yang-data MAY be inserted as structured data within a subscription's RPC error response to indicate the failure reason. This yang-data MUST be inserted if hints are to be provided back to the subscriber."; leaf reason { type identityref { base establish-subscription-error; } description "Indicates the reason why the subscription has failed to be created to a targeted stream."; } leaf filter-failure-hint { type string; description "Information describing where and/or why a provided filter was unsupportable for a subscription."; } } } rpc modify-subscription { description "This RPC allows a subscriber to modify a dynamic subscription's parameters. If successful, the changed subscription parameters remain in effect for the duration of the subscription, until the subscription is again modified, or until the subscription is terminated. In case of an error or an inability to meet the modified parameters, the subscription is not modified and the original subscription parameters remain in effect. In that case, the rpc error MAY include error-info suggested parameter hints that would have a high likelihood of succeeding in a subsequent modify-subscription request. A successful modify-subscription will return a suspended subscription to an active state."; input { leaf identifier { type subscription-id; mandatory true; description "Identifier to use for this subscription."; } uses subscription-policy-modifiable; } } rc:yang-data modify-subscription-stream-error-info { container modify-subscription-stream-error-info { description "This yang-data MAY be provided as part of a subscription's RPC error response when there is a failure of a 'modify-subscription' RPC which has been made against a stream. This yang-data MUST be used if hints are to be provides back to the subscriber."; leaf reason { type identityref { base modify-subscription-error; } description "Information in a modify-subscription RPC error response which indicates the reason why the subscription to an event stream has failed to be modified."; } leaf filter-failure-hint { type string; description "Information describing where and/or why a provided filter was unsupportable for a subscription."; } } } rpc delete-subscription { description "This RPC allows a subscriber to delete a subscription that was previously created from by that same subscriber using the establish-subscription RPC. If an error occurs, the server replies with an 'rpc-error' where the 'error-info' field MAY contain an 'delete-subscription-error-info' structure."; input { leaf identifier { type subscription-id; mandatory true; description "Identifier of the subscription that is to be deleted. Only subscriptions that were created using establish-subscription can be deleted via this RPC."; } } } rpc kill-subscription { description "This RPC allows an operator to delete a dynamic subscription without restrictions on the originating subscriber or underlying transport session. If an error occurs, the server replies with an 'rpc-error' where the 'error-info' field MAY contain an 'delete-subscription-error-info' structure."; input { leaf identifier { type subscription-id; mandatory true; description "Identifier of the subscription that is to be deleted. Only subscriptions that were created using establish-subscription can be deleted via this RPC."; } } } rc:yang-data delete-subscription-error-info { container delete-subscription-error-info { description "If a 'delete-subscription' RPC or a 'kill-subscription' RPC fails, the subscription is not deleted and the RPC error response MUST indicate the reason for this failure. This yang-data MAY be inserted as structured data within a subscription's RPC error response to indicate the failure reason."; leaf reason { type identityref { base delete-subscription-error; } mandatory true; description "Indicates the reason why the subscription has failed to be deleted."; } } } /* * NOTIFICATIONS */ notification replay-completed { sn:subscription-state-notification; if-feature "replay"; description "This notification is sent to indicate that all of the replay notifications have been sent. It must not be sent for any other reason."; leaf identifier { type subscription-id; mandatory true; description "This references the affected subscription."; } } notification subscription-completed { sn:subscription-state-notification; description "This notification is sent to indicate that a subscription has finished passing event records, as the stop-time has been reached."; leaf identifier { type subscription-id; mandatory true; description "This references the gracefully completed subscription."; } } notification subscription-started { sn:subscription-state-notification; if-feature "configured"; description "This notification indicates that a subscription has started and notifications are beginning to be sent. This notification shall only be sent to receivers of a subscription; it does not constitute a general-purpose notification."; leaf identifier { type subscription-id; mandatory true; description "This references the affected subscription."; } uses subscription-policy { refine "target/stream/replay-start-time" { description "Indicates the time that a replay using for the streaming of buffered event records. This will be populated with the most recent of the following: replay-log-creation-time, replay-log-aged-time, replay-start-time, or the most recent publisher boot time."; } refine "target/stream/stream-filter/within-subscription" { description "Filter applied to the subscription. If the 'stream-filter-ref' is populated, the filter within the subscription came from the 'filters' container. Otherwise it is populated in-line as part of the subscription."; } } } notification subscription-resumed { sn:subscription-state-notification; description "This notification indicates that a subscription that had previously been suspended has resumed. Notifications will once again be sent. In addition, a subscription-resumed indicates that no modification of parameters has occurred since the last time event records have been sent."; leaf identifier { type subscription-id; mandatory true; description "This references the affected subscription."; } } notification subscription-modified { sn:subscription-state-notification; description "This notification indicates that a subscription has been modified. Notification messages sent from this point on will conform to the modified terms of the subscription. For completeness, this state change notification includes both modified and non-modified aspects of a subscription."; leaf identifier { type subscription-id; mandatory true; description "This references the affected subscription."; } uses subscription-policy { refine "target/stream/stream-filter/within-subscription" { description "Filter applied to the subscription. If the 'stream-filter-ref' is populated, the filter within the subscription came from the 'filters' container. Otherwise it is populated in-line as part of the subscription."; } } } notification subscription-terminated { sn:subscription-state-notification; description "This notification indicates that a subscription has been terminated."; leaf identifier { type subscription-id; mandatory true; description "This references the affected subscription."; } leaf reason { type identityref { base subscription-terminated-reason; } mandatory true; description "Identifies the condition which resulted in the termination ."; } } notification subscription-suspended { sn:subscription-state-notification; description "This notification indicates that a suspension of the subscription by the publisher has occurred. No further notifications will be sent until the subscription resumes. This notification shall only be sent to receivers of a subscription; it does not constitute a general-purpose notification."; leaf identifier { type subscription-id; mandatory true; description "This references the affected subscription."; } leaf reason { type identityref { base subscription-suspended-reason; } mandatory true; description "Identifies the condition which resulted in the suspension."; } } /* * DATA NODES */ container streams { config false; description "This container contains information on the built-in streams provided by the publisher."; list stream { key "name"; description "Identifies the built-in streams that are supported by the publisher."; leaf name { type string; description "A handle for a system-provided stream made up of a sequential set of event records, each of which is characterized by its own domain and semantics."; } leaf description { type string; mandatory true; description "A description of the event stream, including such information as the type of event records that are available within this stream."; } leaf replay-support { if-feature "replay"; type empty; description "Indicates that event record replay is available on this stream."; } leaf replay-log-creation-time { when "../replay-support"; if-feature "replay"; type yang:date-and-time; mandatory true; description "The timestamp of the creation of the log used to support the replay function on this stream. This time might be earlier than the earliest available information contained in the log. This object is updated if the log resets for some reason."; } leaf replay-log-aged-time { if-feature "replay"; type yang:date-and-time; description "The timestamp associated with last event record which has been aged out of the log. This timestamp identifies how far back into history this replay log extends, if it doesn't extend back to the 'replay-log-creation-time'. This object MUST be present if replay is supported and any event records have been aged out of the log."; } } } container filters { description "This container contains a list of configurable filters that can be applied to subscriptions. This facilitates the reuse of complex filters once defined."; list stream-filter { key "identifier"; description "A list of pre-configured filters that can be applied to subscriptions."; leaf identifier { type filter-id; description "An identifier to differentiate between filters."; } uses stream-filter-elements; } } container subscriptions { description "Contains the list of currently active subscriptions, i.e. subscriptions that are currently in effect, used for subscription management and monitoring purposes. This includes subscriptions that have been setup via RPC primitives as well as subscriptions that have been established via configuration."; list subscription { key "identifier"; description "The identity and specific parameters of a subscription. Subscriptions within this list can be created using a control channel or RPC, or be established through configuration. If configuration operations or the 'kill-subscription' rpc are used to delete a subscription, a 'subscription-terminated' message is sent to any ACTIVE or SUSPENDED receivers."; leaf identifier { type subscription-id; description "Identifier of a subscription; unique within a publisher"; } leaf configured-subscription-state { if-feature "configured"; type enumeration { enum VALID { value 1; description "Connection is active and healthy."; } enum INVALID { value 2; description "The subscription as a whole is unsupportable with its current parameters."; } enum CONCLUDED { value 3; description "A subscription is inactive as it has hit a stop time, but not yet been removed from configuration."; } } config false; description "The presence of this leaf indicates that the subscription originated from configuration, not through a control channel or RPC. The value indicates the system established state of the subscription."; } leaf purpose { if-feature "configured"; type string; description "Open text allowing a configuring entity to embed the originator or other specifics of this subscription."; } uses subscription-policy { refine "target/stream/stream" { description "Indicates the stream of event records to be considered for this subscription. If a stream has been removed, and no longer can be referenced by an active subscription, send a 'subscription-terminated' notification with 'stream-unavailable' as the reason. If a configured subscription refers to a non-existent stream, move that subscription to the 'invalid' state."; } } choice notification-message-origin { if-feature "configured"; description "Identifies the egress interface on the Publisher from which notification messages are to be sent."; case interface-originated { description "When notification messages to egress a specific, designated interface on the Publisher."; leaf source-interface { if-feature "interface-designation"; type if:interface-ref; description "References the interface for notification messages."; } } case address-originated { description "When notification messages are to depart from a publisher using specific originating address and/or routing context information."; leaf source-vrf { if-feature "supports-vrf"; type leafref { path "/ni:network-instances/ni:network-instance/ni:name"; } description "VRF from which notification messages should egress a publisher."; } leaf source-address { type inet:ip-address-no-zone; description "The source address for the notification messages. If a source VRF exists, but this object doesn't, a publisher's default address for that VRF must be used."; } } } container receivers { description "Set of receivers in a subscription."; list receiver { key "name"; min-elements 1; description "A host intended as a recipient for the notification messages of a subscription. For configured subscriptions the 'address' may identify a receiver. Additional ways of specifying configured receivers may be added through an augmentation to the objects within this list."; leaf name { type string; description "Identifies a unique receiver for a subscription."; } leaf address { when 'derived-from(../../../transport, "sn:inline-address")'; type inet:host; description "Specifies the address for the traffic to reach a remote host using the subscription's transport. One of the following must be specified: an ipv4 address, an ipv6 address, or a host name."; } leaf pushed-notifications { type yang:counter64; config false; description "Operational data which provides the number of update notification messages pushed to a receiver."; } leaf excluded-notifications { type yang:counter64; config false; description "Operational data which provides the number of event records from a stream explicitly removed either via a stream filter or an access control filter so that they are not passed to a receiver."; } leaf state { type enumeration { enum ACTIVE { value 1; description "Receiver is currently being sent any applicable notification messages for the subscription."; } enum SUSPENDED { value 2; description "Receiver state is SUSPENDED, so the publisher is currently unable to provide notification messages for the subscription."; } enum CONNECTING { value 3; if-feature "configured"; description "A subscription has been configured, but a subscription-started state change notification needs to be successfully received before notification messages are sent. If the 'reset' action is invoked for a receiver of an active configured subscription, the state must be moved to CONNECTING."; } enum TIMEOUT { value 4; if-feature "configured"; description "A subscription has failed in sending a subscription started state change to the receiver. Additional attempts at connection attempts are not currently being made."; } } config false; mandatory true; description "Specifies the state of a subscription from the perspective of a particular receiver. With this info it is possible to determine whether a subscriber is currently generating notification messages intended for that receiver."; } action reset { description "Allows the reset of this configured subscription receiver to the 'connecting' state. This enables the connection process to be re-initiated."; output { leaf time { type yang:date-and-time; mandatory true; description "Time a publisher returned the receiver to a connecting state."; } } } } } } } } <CODE ENDS>
To support deployments including both configured and dynamic subscriptions, it is recommended to split subscription identifiers into static and dynamic halves. That way it eliminates the possibility of collisions if the configured subscriptions attempt to set a subscription-id which might have already been dynamically allocated. A best practice is to use lower half the "identifier" object's integer space when that "identifier" is assigned by an external entity (such as with a configured subscription). This leaves the upper half of subscription identifiers available to be dynamically assigned by the publisher.
If a subscription is unable to marshal a series of filtered event records into transmittable notification messages, the receiver should be suspended with the reason "unsupportable-volume".
For configured subscriptions, operations are against the set of receivers using the subscription identifier as a handle for that set. But for streaming updates, state change notifications are local to a receiver. In this specification it is the case that receivers get no information from the publisher about the existence of other receivers. But if a network operator wants to let the receivers correlate results, it is useful to use the subscription identifier handle across the receivers to allow that correlation.
This document registers the following namespace URI in the "IETF XML Registry" [RFC3688]:
URI: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications
Registrant Contact: The IESG.
XML: N/A; the requested URI is an XML namespace.
This document registers the following YANG module in the "YANG Module Names" registry [RFC6020]:
Name: ietf-subscribed-notifications
Namespace: urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications
Prefix: sn
Reference: draft-ietf-netconf-ietf-subscribed-notifications-11.txt (RFC form)
The YANG module specified in this document defines a schema for data that is designed to be accessed via network management transports such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC5246].
The NETCONF Access Control Model (NACM) [RFC8341] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF operations and content.
There are a number of data nodes defined in this YANG module that are writable/creatable/deletable (i.e., config true, which is the default). These data nodes may be considered sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) to these data nodes without proper protection can have a negative effect on network operations. These are the subtrees and data nodes and their sensitivity/vulnerability:
Container: "/filters"
Container: "/subscriptions"
The following considerations are only relevant for configuration operations made upon configured subscriptions:
Some of the readable data nodes in this YANG module may be considered sensitive or vulnerable in some network environments. It is thus important to control read access (e.g., via get, get-config, or notification) to these data nodes. These are the subtrees and data nodes and their sensitivity/vulnerability:
Container: "/streams"
Container: "/subscriptions"
Some of the RPC operations in this YANG module may be considered sensitive or vulnerable in some network environments. It is thus important to control access to these operations. These are the operations and their sensitivity/vulnerability:
RPC: all
RPC: "delete-subscription"
RPC: "establish-subscription"
RPC: "kill-subscription"
RPC: "modify-subscription"
For both configured and dynamic subscriptions the publisher MUST authenticate and authorize a receiver via some transport level mechanism before sending any updates.
A secure transport is highly recommended and the publisher MUST ensure that the receiver has sufficient authorization to perform the function they are requesting against the specific subset of content involved.
With configured subscriptions, one or more publishers could be used to overwhelm a receiver. Notification messages SHOULD NOT be sent to any receiver which does not support this specification. Receivers that do not want notification messages need only terminate or refuse any transport sessions from the publisher.
One subscription identifier can be used for two or more receivers of the same configured subscription. But due to the possibility of different access control permissions per receiver, it cannot be assumed that each receiver is getting identical updates.
For their valuable comments, discussions, and feedback, we wish to acknowledge Andy Bierman, Tim Jenkins, Martin Bjorklund, Kent Watsen, Balazs Lengyel, Robert Wilton, Sharon Chisholm, Hector Trevino, Susan Hares, Michael Scharf, and Guangying Zheng.
[I-D.draft-ietf-netmod-revised-datastores] | Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K. and R. Wilton, "Network Management Datastore Architecture", Internet-Draft draft-ietf-netmod-revised-datastores-10, February 2018. |
[I-D.draft-ietf-rtgwg-ni-model] | Berger, L., Hopps, C. and A. Lindem, "YANG Network Instances", Internet-Draft draft-ietf-rtgwg-ni-model-06, January 2018. |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[RFC3688] | Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004. |
[RFC5277] | Chisholm, S. and H. Trevino, "NETCONF Event Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008. |
[RFC6020] | Bjorklund, M., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, October 2010. |
[RFC8174] | Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. |
[RFC8341] | Bierman, A. and M. Bjorklund, "Network Configuration Access Control Model", STD 91, RFC 8341, DOI 10.17487/RFC8341, March 2018. |
[XPATH] | Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", November 1999. |
(To be removed by RFC editor prior to publication)
v10 - v11
v09 - v10
v08 - v09
v07 - v08
v06 - v07
v05 - v06
v04 - v05
v03 - v04
v03 - v04
v02 - v03
v01 - v02
v00 - v01
v01 5277bis - v00 subscribed notifications
v00 - v01 of 5277bis