NETCONF Support for Event NotificationsCisco Systemsevoit@cisco.comHuaweiludwig@clemm.orgMicrosoftalberto.gonzalez@microsoft.comCisco Systemseinarnn@cisco.comCisco Systemsambtripa@cisco.com
Operations & Management
NETCONFDraftThis document provides a NETCONF binding to the dynamic subscription capability of both subscribed notifications and YANG push.RFC Editor note: please replace the four references to pre-RFC normative drafts with the actual assigned RFC numbers.This document provides a binding for events streamed over the NETCONF protocol for dyanamic subscriptions as defined in . In addition, as is itself built upon , this document enables a NETCONF client to request via a dynamic subscription and receive updates from a YANG datastore located on a NETCONF server.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 when, and only when, they appear in all capitals, as shown here.The following terms are defined in : notification message, event stream, publisher, receiver, subscriber, subscription.A publisher is allowed to concurrently support dynamic subscription RPCs of at the same time as 's "create-subscription" RPC. However a single NETCONF transport session cannot support both this specification and a subscription established by 's "create-subscription" RPC. To protect against any attempts to use a single NETCONF transport session in this way:A solution must reply with the error "operation-not-supported" if a "create-subscription" RPC is received on a NETCONF session where an established subscription exists.A solution must reply with the error "operation-not-supported" if an "establish-subscription" request is been received on a NETCONF session where the "create-subscription" RPC has successfully created a subscription. If a publisher supports this specification but not subscriptions via , the publisher MUST NOT advertise "urn:ietf:params:netconf:capability:notification:1.0".The "encode-xml" feature of is mandatory to support. This indicates that XML is a valid encoding for RPCs, state change notifications, and subscribed content.A NETCONF publisher supporting event stream subscription via MUST support the "NETCONF" event stream identified in that draft.For a dynamic subscription, if the NETCONF session involved with the "establish-subscription" terminates, the subscription MUST be terminated.For a dynamic subscription a "modify-subscription", "delete-subscription", or "resynch-subscription" RPC MUST be sent using same the NETCONF session upon which the referenced subscription was established.Notification messages transported over the NETCONF protocol will use the "notification" message defined within , section 4.For dynamic subscriptions, all notification messages MUST use the NETCONF transport session used by the "establish-subscription" RPC.Management of dynamic subscriptions occurs via RPCs as defined in
and . When an RPC error occurs, the NETCONF RPC reply MUST include an "rpc-error" element per with the error information populated as follows:
an "error-type" node of "application".an "error-tag" node of "operation-failed".an "error-severity" of "error" (this MAY but does not
have to be included). 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 identityname 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 XML-encoded data with hints for parameter settings that might lead to successful RPC requests in the future. Following are the yang-data structures which may be returned:If a malicious or buggy NETCONF subscriber sends a number of establish-subscription requests, then these subscriptions accumulate and may use up system resources. In such a situation, subscriptions MAY be terminated by terminating the underlying NETCONF session. The publisher MAY also suspend or terminate a subset of the active subscriptions on that NETCONF session.We wish to acknowledge the helpful contributions, comments, and suggestions that were received from: Andy Bierman, Yan Gang, Sharon Chisholm, Hector Trevino, Peipei Guo, Susan Hares, Tim Jenkins, Balazs Lengyel, Martin Bjorklund, Mahesh Jethanandani, Kent Watsen, and Guangying Zheng.YANG Datastore SubscriptionCustomized Subscriptions to a Publisher's Event StreamsThis section is non-normative.As defined in an event stream exposes a continuous set of events available for subscription. A NETCONF client can retrieve the list of available event streams from a NETCONF publisher using the "get" operation against the top-level container "/streams" defined in Section 3.1.The following example illustrates the retrieval of the list of available event streams:After such a request, the NETCONF publisher returns a list of event streams available, as well as additional information which might exist in the container. 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 (a) and (b) in are detailed below:As NETCONF publisher was able to fully satisfy the request (a), the publisher sends the subscription identifier of the accepted subscription within message (b):If the NETCONF 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 (c) 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 NETCONF publisher can satisfy both changes, the publisher sends a positive result for the RPC. If the NETCONF publisher cannot satisfy either of the proposed changes, the publisher sends an RPC error response (d). The following is an example RPC error response for (d) 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 NETCONF publisher can satisfy the request, the publisher replies with success to the RPC request.If the NETCONF 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 NETCONF transport session:A publisher will send subscription state notifications for dynamic subscriptions according to the definitions within ).As per Section 2.7.2 of , a "subscription-modified" might be sent if over NETCONF if the definition of a configured filter changes. A subscription state notification encoded in XML would look like:A "subscription-resumed" would look like:The "replay-complete" is virtually identical, with "subscription-resumed" simply being replaced by "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)Configured removed.Tweaks to examples and text.Downshifted state names.Removed address from examples.Tweaks based on Kent's comments.Updated examples in Appendix A. And updates to some object names based on changes in the subscribed-notifications draft.Added a YANG model for the NETCONF identity.Tweaks and clarification on :interleave.XML encoding and operational datastore mandatory.Error mechanisms and examples updated.Moved examples to appendicesAll examples rewritten based on namespace learningsNormative text consolidated in frontRemoved all mention of JSONCall home process detailedNote: this is a major revision attempting to cover those comments received from two week review.Added additional detail to "configured subscriptions"Added interleave capabilityAdjusted terminology to that in draft-ietf-netconf-subscribed-notificationsCorrected namespaces in examplesText simplifications throughoutv02 had no meaningful changesAdded Call Home in solution for configured subscriptions.Clarified support for multiple subscription on a single session. No need to support multiple create-subscription.Added mapping between terminology in yang-push and (the one followed in this document).Editorial improvements.