Dynamic subscription to YANG Events and Datastores over NETCONFCisco Systemsevoit@cisco.comHuaweiludwig@clemm.orgMicrosoftalberto.gonzalez@microsoft.comCisco Systemseinarnn@cisco.comCisco Systemsambtripa@cisco.com
Operations & Management
NETCONFDraftThis document provides a Network Configuration Protocol (NETCONF) binding to the dynamic subscription capability of both subscribed notifications and YANG-Push.RFC Editor note: please replace the references to pre-RFC normative drafts with the actual assigned RFC numbers.This document specifies the binding of a stream of events which form part of a dynamic subscription to the NETCONF protocol . Dynamic subscriptions are 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.This document assumes that the reader is familiar with the terminology and concepts defined in .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 : dynamic subscription, event stream, notification message, publisher, receiver, subscriber, subscription. No additional terms are defined.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 MUST NOT 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 "rpc-error" element containing the "error-tag" value of "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 "rpc-error" element containing the "error-tag" value of "operation-not-supported" if an "establish-subscription" request has 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 MUST be supported. 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 document.Management of dynamic subscriptions occurs via RPCs as defined in
and . For a dynamic subscription, if the NETCONF session involved with the "establish-subscription" terminates, the subscription MUST be terminated.For a dynamic subscription, any "modify-subscription", "delete-subscription", or "resync-subscription" RPCs MUST be sent using the same NETCONF session upon which the referenced subscription was established.Notification messages transported over the NETCONF protocol MUST be encoded in a <notification> message as defined within , Section 4. And per 's "eventTime" object definition, the "eventTime" populated with the event occurrence time.For dynamic subscriptions, all notification messages MUST use the NETCONF transport session used by the "establish-subscription" RPC.When an RPC error occurs as defined in Section 2.4.6 and Appendix A, 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 with the value being a string that corresponds to an identity associated with the error. For the mechanisms specified in this document, this "error-tag" will come from one of two places. Either it will correspond to the error identities within section 2.4.6 for general subscription errors:Or this "error-tag" will correspond to the error identities within Appendix A.1 for subscription errors specific to YANG datastores:an "error-severity" of "error" (this MAY 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 specific identity to use depends on the RPC for which the error occurred. Each error identity will be inserted as the "error-app-tag" following the form <modulename>:<identityname>. An example of such as valid encoding would be "ietf-subscribed-notifications:no-such-subscription". Viable errors for different RPCs are as follows: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 from
and which may be returned:In case of an rpc error resulting from a "delete-subscription", "kill-subscription", or "resync-subscription" request, no "error-info" needs to be included, as the "subscription-id" is the only RPC input parameter and no hints regarding this RPC input parameters need to be provided.This document does not introduce additional Security Considerations for dynamic subscriptions beyond those discussed in . But there is one consideration worthy of more refinement based on the connection oriented nature of the NETCONF protocol. Specifically, if a buggy or compromised 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 in order to reclaim resources and preserve normal operation for the other subscriptions.This document has no actions for IANA.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, Qin Wu, and Guangying Zheng.YANG Datastore SubscriptionCustomized Subscriptions to a Publisher's Event StreamsXML Path Language (XPath) Version 1.0This section is non-normative. Additionally the subscription "id" values of 22, 23, and 39 used below are just examples. In production, the actual values of "id" may not be small integers.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 "id" of 22, the second, an "id" 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 "id" 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 "id", but that subscription "id" 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 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".This section provides examples which illustrate both XPath and subtree methods of filtering event record contents. The examples are based on the YANG notification "vrrp-protocol-error-event" as defined per the ietf-vrrp.yang model within . Event records based on this specification which are generated by the publisher might appear as:Suppose a subscriber wanted to establish a subscription which only passes instances of event records where there is a "checksum-error" as part of a VRRP protocol event. Also assume the publisher places such event records into the NETCONF stream. To get a continuous series of matching event records, the subscriber might request the application of an XPath filter against the NETCONF stream. An "establish-subscription" RPC to meet this objective might be:For more examples of XPath filters, see .Suppose the "establish-subscription" in was accepted. And suppose later a subscriber decided they wanted to broaden this subscription cover to all VRRP protocol events (i.e., not just those with a "checksum error"). The subscriber might attempt to modify the subscription in a way which replaces the XPath filter with a subtree filter which sends all VRRP protocol events to a subscriber. Such a "modify-subscription" RPC might look like:For more examples of subtree filters, see , section 6.4.(To be removed by RFC editor prior to publication)Including Tom Petch's text to resolve the meaning of 'binding'.A few small wording tweaks.Notes to RFC editor removed, consideration moved under Figure 10 in SN.Per Benjamin Kaduk's discuss on SN, adjusted IPR to pre5378Trust200902During the SN YANG Doctor review, a suggestion was made to update the error-tags to make the mechanism work with embedded NETCONF and RESTCONF error reporting.Minor text tweaks from review.During the shepherd review, two clarifications were requested which do not impact the technical details of this document. These clarifications were: (a) further describing that dynamic subscriptions can have state change notifications, and (b) more details about the recommended text refinement desired for RFC6241.Per Kent's request, added name attribute to artwork. This would be needed for an automated extraction.Title change.Subscription identifier renamed to id.Appendix A.4 for filter examplesfor v13, Tweak of example to /foo/barConfigured 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.