RESTCONF and HTTP Transport for Event NotificationsCisco Systemsevoit@cisco.comCisco Systemsambtripa@cisco.comCisco Systemseinarnn@cisco.comHuaweiludwig@clemm.orgVMWareagonzalezpri@vmware.comYumaWorksandy@yumaworks.com
Operations & Management
NETCONFDraftThis document defines RESTCONF, HTTP2, and HTTP1.1 bindings for the transport of subscription requests and corresponding push updates. Being subscribed may be either publisher defined event streams or nodes/subtrees of YANG Datastores.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 these protocols over RESTCONF and HTTP. Driving these requirements is .The streaming of notifications encapsulating the resulting information push can be done with either HTTP1.1 and HTTP2. When using HTTP2 benefits which can be realized include:Elimination of head-of-line blockingWeighting and proportional dequeuing of Events from different subscriptionsExplicit precedence in subscriptions so that events from one subscription must be sent before another dequeuesThe 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 : configured subscription, dynamic subscription, notification message, publisher, receiver, subscriber, and subscription.Subscribing to event streams is defined in , YANG Datastore subscription is defined in . This section specifies transport mechanisms applicable to both.Dynamic subscriptions for both and its augmentations are configured and managed via signaling messages transported over . These interactions will be accomplished via a RESTCONF POST into RPCs located on the publisher. HTTP responses codes will indicate the results of the interaction with the publisher. An HTTP status code of 200 is the proper response to a successful <establish-subscription> RPC call. The successful <establish-subscription> will result in a HTTP message with returned subscription URI on a logically separate mechanism than was used for the original RESTCONF POST. This mechanism is via a parallel TCP connection in the case of HTTP 1.x, or in the case of HTTP2 via a separate HTTP stream within the HTTP connection. When a being returned by the publisher, failure will be indicated by 4xx range status codes transported in payload. Anytime hints are returned from the publisher status code 412 is used with the error-tag "operation-failed".Once established, the resulting stream of notification messages are then delivered via SSE for HTTP1.1 and via an HTTP2 DATA frame for HTTP2.Requests to or augmented RPCs are sent on one or more HTTP2 streams indicated by (a) in Figure 2. Notification messages related to a single subscription are pushed on a unique logical channel (b). In the case below, a newly established subscription has its associated messages pushed over HTTP2 stream (7).Requests to RPCs are sent on the TCP connection indicated by (a). Notification messages are pushed on a separate connection (b). This connection (b) will be used for all notification messages across all subscriptions.With a configured subscription, all information needed to establish a secure relationship with that receiver is available on the publisher. With this information, the publisher will establish a secure transport connection with the receiver and then begin pushing notification messages to the receiver. Since RESTCONF might not exist on the receiver, it is not desirable to require that subscribed content be pushed with any dependency on RESTCONF. Therefore in place of RESTCONF, a TLS secured HTTP2 Client connection must be established with an HTTP2 Server located on the receiver. Notification messages will then be sent as part of an extended HTTP POST to the receiver.POST messages will be addressed to HTTP augmentation code on the receiver capable of accepting and responding to state change notifications and subscribed content notification messages. The first POST message must be a subscription-started notification. Notifications which include any subscribed content must not be sent until the receipt of an HTTP 200 OK for this initial notification. The 200 OK will indicate that the receiver is ready for the delivery of subscribed content. At this point a subscription must be allocated its own HTTP2 stream. Figure 4 depicts this message flow.As the HTTP2 transport is available to the receiver, the publisher should:take any subscription-priority and copy it into the HTTP2 stream priority, andtake a subscription-dependency if it has been provided and map the HTTP2 stream for the parent subscription into the HTTP2 stream dependency.A publisher MUST support JSON encoding of RPCs and Notifications.A publisher supporting MUST support the "operational" datastore as defined by .Notification messages transported over NETCONF will be identical in format and content to those encoded using one-way operations defined within , section 4.One or more publishers of configured subscriptions could be used to overwhelm a receiver which doesn't even support subscriptions. There are two protections needing support on a publisher. First, notification messages for configured subscriptions MUST only be transmittable over encrypted transports. Clients which do not want pushed content need only terminate or refuse any transport sessions from the publisher. Second, the HTTP transport augmentation on the receiver must send an HTTP 200 OK to a subscription started notification before the publisher starts streaming any subscribed content.One or more publishers could overwhelm a receiver which is unable to control or handle the volume of Event Notifications received. In deployments where this might be a concern, HTTP2 transport such as HTTP2) should be selected.The NETCONF Authorization Control Model SHOULD be used to control and restrict authorization of subscription configuration.We wish to acknowledge the helpful contributions, comments, and suggestions that were received from: Susan Hares, Tim Jenkins, Balazs Lengyel, Kent Watsen, Michael Scharf, and Guangying Zheng.Custom Subscription to Event StreamsNetwork Management Datastore ArchitectureSubscribing to YANG datastore push updatesHuaweiCiscoVMWareCiscoCiscoYumaWorksEricssonServer-Sent Events, World Wide Web Consortium CR
CR-eventsource-20121211RPC framework that runs over HTTP2Several technologies are expected to be seen within a deployment to achieve security and ease-of-use requirements. These are not necessary for an implementation of this specification, but will be useful to consider when considering the operational context.Implementations should include the ability to transparently incorporate 'call home' so that secure TLS connections can originate from the desired device.HTTP sessions might not quickly allow a subscriber to recognize when the communication path has been lost from the publisher. To recognize this, it is possible for a receiver to establish a TLS heartbeat . In the case where a TLS heartbeat is included, it should be sent just from receiver to publisher. Loss of the heartbeat should result in any subscription related TCP sessions between those endpoints being torn down. The subscription can then attempt to re-establish. An initial goal for this document was to support transport seamlessly without any mapping or extra layering. However there is an incompatibility of RESTCONF and GRPC. RESTCONF uses HTTP GET, and GRPC uses HTTP2's POST rather than GET. As GET is used across RESTCONF for things like capabilities exchange, a seamless mapping depends on specification changes outside the scope of this document. If/when GRPC supports GET, or RESTCONF is updated to support POST, this should be revisited. It is hoped that the resulting fix will be transparent to this document.(Note: examples in this section need significant updates)Subscribers can dynamically learn whether a RESTCONF server supports various types of Event or Yang datastore subscription capabilities. This is done by issuing an HTTP request OPTIONS, HEAD, or GET on the stream. Some examples building upon the Call flow for HTTP1.1 from Section 3.2.2 are:If the server supports it, it may respondIf the server does not support any form of subscription, it may respondSubscribers can determine the URL to receive updates by sending an HTTP GET as a request for the "location" leaf with the stream list entry. The stream to use for may be selected from the Event Stream list provided in the capabilities exchange. Note that different encodings are supporting using different Event Stream locations. For example, the subscriber might send the following request:The publisher might send the following response:To subscribe and start receiving updates, the subscriber can then send an HTTP GET request for the URL returned by the publisher in the request above. The accept header must be "text/event-stream". The publisher uses the Server Sent Events transport strategy to push filtered events from the event stream.The publisher MUST support individual parameters within the POST request body for all the parameters of a subscription. The only exception is the encoding, which is embedded in the URI. An example of this is:Should the publisher not support the requested subscription, it may reply:The following is an example of a pushed content for the subscription above. It contains a subtree with root foo that contains a leaf called bar:Or with the equivalent YANG over JSON encoding representation as defined in :To modify a subscription, the subscriber issues another POST request on the provided URI using the same subscription-id as in the original request. For example, to modify the update period to 10 seconds, the subscriber may send:To delete a subscription, the subscriber issues a DELETE request on the provided URI using the same subscription-id as in the original requestThe basic encoding will look as below. It will consists of a JSON representation wrapped in an HTTP2 header.(To be removed by RFC editor prior to publication)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