RESTCONF Transport for Event NotificationsCisco Systemsevoit@cisco.comCisco Systemsrrahman@cisco.comCisco Systemseinarnn@cisco.comHuaweiludwig@clemm.orgYumaWorksandy@yumaworks.com
Operations & Management
NETCONFDraftThis document defines a RESTCONF binding to the dynamic subscription capability of both subscribed notifications and YANG-Push. Subscriptions to publisher defined event streams or nodes/subtrees of YANG Datastores is supported.Mechanisms to support event subscription and push are defined in . Enhancements to which enable YANG datastore subscription and push are defined in . This document provides a transport specification for dynamic subscriptions over RESTCONF . Driving these requirements is .The streaming of notifications encapsulating the resulting information push can be done with either HTTP1.1 or HTTP2 . 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.The following terms use the definitions from : dynamic subscription, event stream, notification message, publisher, receiver, subscriber, and subscription.Other terms reused include datastore, which is defined in , and HTTP2 stream which maps to the definition of "stream" within , Section 2.[ note to the RFC Editor - please replace XXXX within this document with the number of this document ]This section provides specifics on how to establish and maintain dynamic subscriptions over HTTP 1.1 and HTTP2 via signaling messages transported over RESTCONF . Subscribing to event streams is accomplished in this way via a RESTCONF POST into RPCs defined within Section 2.4. YANG datastore subscription is accomplished via augmentations to as described within Section 4.4.Common across all HTTP based dynamic subscriptions is that a POST needs to be made against a specific URI on the Publisher. Subscribers cannot pre-determine the URI against which a subscription might exist on a publisher, as the URI will only exist after the "establish-subscription" has been accepted. The subscription URI will be determined and sent as part of the response to the "establish-subscription", and a subsequent POST to this URI will be done in order to start the flow of notification messages back to the subscriber. A subscription does not move to the active state as per Section 2.4.1. of until the POST is received.For a dynamic subscription, where an HTTP client session doesn't already exist, a new client session is initiated from the subscriber. If the subscriber is unsure if HTTP2 is supported by the publisher, HTTP1.1 will be used for initial messages, and these messages will include an HTTP version upgrade request as per , Section 6.7. If a publisher response indicates that HTTP2 is supported, HTTP2 will be used between subscriber and publisher for future HTTP interactions as per .A subscriber SHOULD establish the HTTP session over TLS in order to secure the content in transit.Without the involvement of additional protocols, neither HTTP1.1 nor HTTP2 sessions by themselves allow for a quick recognition of when the communication path has been lost with the publisher. Where quick recognition of the loss of a publisher is required, a subscriber SHOULD connect over TLS , and use a TLS heartbeat to track HTTP session continuity. In the case where a TLS heartbeat is included, it should be sent just from receiver to publisher. Loss of the heartbeat MUST result in any subscription related TCP sessions between those endpoints being torn down. A subscriber can then attempt to re-establish.Subscribers can learn what event streams a RESTCONF server supports by querying the "streams" container of ietf-subscribed-notification.yang. Subscribers can learn what datastores a RESTCONF server supports by following . Specific HTTP responses codes as defined in section 6 will indicate the result of RESTCONF RPC requests with publisher. An HTTP status code of 200 is the proper response to any successful RPC defined within or .If a publisher fails to serve the RPC request for one of the reasons indicated in Section 2.4.6 or Appendix A, this will be indicated by "406" status code transported in the HTTP response.When a "406" status code is returned, the RPC reply MUST include an "rpc-error" element per Section 7.1 with the following parameter values:
an "error-type" node of "application".an "error-tag" node of "operation-failed".an "error-app-tag" node with the value being a string that corresponds to an identity associated with the error, as defined in section 2.4.6 for general subscriptions, and Appendix A.1, for datastore subscriptions. The tag to use depends on the RPC for which the error occurred. Viable errors for different RPCs are as follows:Each error identity will be inserted as the "error-app-tag" using JSON encoding following the form <modulename>:<identityname>. An example of such as valid encoding would be "ietf-subscribed-notifications:no-such-subscription".In case of error responses to an "establish-subscription" or "modify-subscription" request there is the option of including an "error-info" node. This node may contain hints for parameter settings that might lead to successful RPC requests in the future. Following are the yang-data structures which may be returned:Note that "error-path" does not need to be included with the "rpc-error" element, as subscription errors are generally not associated with nodes in the datastore but with the choice of RPC input parameters. Requests to or augmented RPCs are sent on one or more HTTP2 streams indicated by (a) in . A successful "establish-subscription" will result in an RPC response returned with both a subscription identifier which uniquely identifies a subscription, as well as a URI which uniquely identifies the location of subscription on the publisher. This URI is defined via the "uri" leaf the Data Model in . An HTTP POST is then sent on a logically separate HTTP2 stream (b) to the URI on the publisher. This initiates to initiate the flow of notification messages which are sent in HTTP Data frames as a response to the POST. In the case below, a newly established subscription has its associated notification messages pushed over HTTP2 stream (7). These notification messages are placed into a HTTP2 Data frame (see [RFC7540] Section 6.1).Additional requirements for dynamic subscriptions over HTTP2 include:A unique HTTP2 stream MAY be used for each subscription.A single HTTP2 stream MUST NOT be used for subscriptions with different DSCP values.All subscription state notifications from a publisher MUST be returned in a separate HTTP Data frame within the HTTP2 stream used by the subscription to which the state change refers.In addition to an RPC response for a "modify-subscription" RPC traveling over (a), a "subscription-modified" state change notification must be sent within HTTP2 stream (b). This allows the receiver to know exactly when the new terms of the subscription have been applied to the notification messages. See arrow (c).Additional RPCs for a particular subscription MUST NOT use the HTTP2 stream currently providing notification messages subscriptions.An HTTP end of stream message MUST not be sent until all subscriptions using that HTTP2 stream have completed.The call flow is defined in . Requests to or augmented RPCs are sent on a TCP connection indicated by (a). A successful "establish-subscription" will result in an RPC response returned with both a subscription identifier which uniquely identifies a subscription, as well as a URI which uniquely identifies the location of subscription on the publisher (b). This URI is defined via the "uri" leaf the Data Model in . An HTTP POST is then sent on a logically separate TCP connection (b) to the URI on the publisher. This initiates to initiate the flow of notification messages which are sent in SSE as a response to the POST.Additional requirements for dynamic subscriptions over HTTP1.1 include:All subscription state notifications from a publisher MUST be returned in a separate SSE message used by the subscription to which the state change refers.Subscription RPCs MUST NOT use the TCP connection currently providing notification messages for that subscription.In addition to an RPC response for a "modify-subscription" RPC traveling over (a), a "subscription-modified" state change notification must be sent within stream (b). This allows the receiver to know exactly when the new terms of the subscription have been applied to the notification messages. See arrow (c).Open question, should we just eliminate this possibility of HTTP1.1 for subscriptions? It would make the design simpler.To meet subscription quality of service promises, the publisher MUST take any existing subscription "dscp" and apply it to the DSCP marking in the IP header.In addition, where HTTP2 transport is available to a notification message queued for transport to a receiver, the publisher MUST:take any existing subscription "priority" and copy it into the HTTP2 stream priority, and take any existing subscription "dependency" and map the HTTP2 stream for the parent subscription into the HTTP2 stream dependency.A publisher supporting MUST support the "operational" datastore as defined by .The "encode-json" feature of is mandatory to support. This indicates that JSON is a valid encoding for RPCs, state change notifications, and subscribed content.Notification messages transported over HTTP will be encoded using one-way operation schema defined within , section 4. The YANG model defined in has one leaf augmented into four places of , plus two identities. As the resulting full tree is large, it will only be inserted at later stages of this document.This module references .
This document registers the following namespace URI in the "IETF XML Registry" :
URI:
urn:ietf:params:xml:ns:yang:ietf-restconf-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 :
Name: ietf-restconf-subscribed-notifications
Namespace:
urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-notifications
Prefix: rsn
Reference: RFC XXXX: RESTCONF Transport for Event Notifications
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 or RESTCONF . The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) . The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS .The one new data node introduced 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 this data nodes. These are the subtrees and data nodes and their sensitivity/vulnerability:Container: "/subscriptions""uri": leaf will show where subscribed resources might be located on a publisher. Access control must be set so that only someone with proper access permissions, and perhaps even HTTP session has the ability to access this resource.We wish to acknowledge the helpful contributions, comments, and suggestions that were received from: Ambika Prasad Tripathy, Alberto Gonzalez Prieto, Susan Hares, Tim Jenkins, Balazs Lengyel, Kent Watsen, Michael Scharf, and Guangying Zheng.Custom Subscription to Event StreamsSubscribing to YANG datastore push updatesHuaweiCiscoVMWareCiscoCiscoYumaWorksEricssonServer-Sent Events, World Wide Web Consortium CR
CR-eventsource-20121211RESTCONF Extensions to Support the Network Management Datastore ArchitectureNETCONF support for event notificationsThis section is non-normative. To allow easy comparison, this section mirrors the functional examples shown with NETCONF over XML within . In addition, HTTP2 vs HTTP1.1 headers are not shown as the contents of the JSON encoded objects are identical within.The following figure shows two successful "establish-subscription" RPC requests as per . The first request is given a subscription identifier of 22, the second, an identifier of 23.To provide examples of the information being transported, example messages for interactions in are detailed below:As publisher was able to fully satisfy the request, the publisher sends the subscription identifier of the accepted subscription, and the URI:Upon receipt of the successful response, the subscriber POSTs to the provided URI to start the flow of notification messages. When the publisher receives this, the subscription is moved to the active state (c).While not shown in , if the publisher had not been able to fully satisfy the request, or subscriber has no authorization to establish the subscription, the publisher would have sent an RPC error response. For instance, if the "dscp" value of 10 asserted by the subscriber in proved unacceptable, the publisher may have returned:The subscriber can use this information in future attempts to establish a subscription.An existing subscription may be modified. The following exchange shows a negotiation of such a modification via several exchanges between a subscriber and a publisher. This negotiation consists of a failed RPC modification request/response, followed by a successful one.If the subscription being modified in is a datastore subscription as per , the modification request made in (d) may look like that shown in . As can be seen, the modifications being attempted are the application of a new xpath filter as well as the setting of a new periodic time interval.If the publisher can satisfy both changes, the publisher sends a positive result for the RPC. If the publisher cannot satisfy either of the proposed changes, the publisher sends an RPC error response (e). The following is an example RPC error response for (e) which includes a hint. This hint is an alternative time period value which might have resulted in a successful modification:The following demonstrates deleting a subscription. This subscription may have been to either a stream or a datastore.If the publisher can satisfy the request, the publisher replies with success to the RPC request.If the publisher cannot satisfy the request, the publisher sends an error-rpc element indicating the modification didn't work. shows a valid response for existing valid subscription identifier, but that subscription identifier was created on a different transport session:A publisher will send subscription state notifications according to the definitions within ).A "subscription-started" encoded in JSON would look like:The "subscription-modified" is identical to , with just the word "started" being replaced by "modified".A "subscription-completed" would look like:The "subscription-resumed" and "replay-complete" are virtually identical, with "subscription-completed" simply being replaced by "subscription-resumed" and "replay-complete".A "subscription-terminated" would look like:The "subscription-suspended" is virtually identical, with "subscription-terminated" simply being replaced by "subscription-suspended".(To be removed by RFC editor prior to publication)v06 - v07Removed configured subscriptions.Subscription identifier renamed to id.v05 - v06JSON examples updated by Reshad.v04 - v05Error mechanisms updated to match embedded RESTCONF mechanismsRestructured format and sections of document.Added a YANG data model for HTTP specific parameters.Mirrored the examples from the NETCONF transport draft to allow easy comparison.v03 - v04Draft not fully synched to new version of subscribed-notifications yet.References updatedv02 - v03Event notification reframed to notification message.Tweaks to wording/capitalization/format.v01 - v02Removed sections now redundant with and such as: mechanisms for subscription maintenance, terminology definitions, stream discovery.3rd party subscriptions are out-of-scope.SSE only used with RESTCONF and HTTP1.1 dynamic subscriptionsTimeframes for event tagging are self-defined.Clean-up of wording, references to terminology, section numbers.v00 - v01Removed the ability for more than one subscription to go to a single HTTP2 stream.Updated call flows. Extensively.SSE only used with RESTCONF and HTTP1.1 dynamic subscriptionsHTTP is not used to determine that a receiver has gone silent and is not Receiving Event NotificationsMany clean-ups of wording and terminology