NETCONF | E. Voit |
Internet-Draft | Cisco Systems |
Intended status: Standards Track | A. Clemm |
Expires: February 4, 2019 | Huawei |
A. Gonzalez Prieto | |
Microsoft | |
E. Nilsen-Nygaard | |
A. Tripathy | |
Cisco Systems | |
August 3, 2018 |
NETCONF Support for Event Notifications
draft-ietf-netconf-netconf-event-notifications-11
This 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 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 February 4, 2019.
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 provides a binding for events streamed over the NETCONF protocol [RFC6241] for dyanamic subscriptions as defined in [I-D.draft-ietf-netconf-subscribed-notifications]. In addition, as [I-D.ietf-netconf-yang-push] is itself built upon [I-D.draft-ietf-netconf-subscribed-notifications], 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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
The following terms are defined in [I-D.draft-ietf-netconf-subscribed-notifications]: notification message, event stream, publisher, receiver, subscriber, subscription.
A publisher is allowed to concurrently support dynamic subscription RPCs of [I-D.draft-ietf-netconf-subscribed-notifications] at the same time as [RFC5277]'s "create-subscription" RPC. However a single NETCONF transport session cannot support both this specification and a subscription established by [RFC5277]'s "create-subscription" RPC. To protect against any attempts to use a single NETCONF transport session in this way:
If a publisher supports this specification but not subscriptions via [RFC5277], the publisher MUST NOT advertise "urn:ietf:params:netconf:capability:notification:1.0".
The "encode-xml" feature of [I-D.draft-ietf-netconf-subscribed-notifications] 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 [I-D.draft-ietf-netconf-subscribed-notifications] 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 [RFC5277], 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 [I-D.ietf-netconf-yang-push] and [I-D.draft-ietf-netconf-subscribed-notifications]. When an RPC error occurs, the NETCONF RPC reply MUST include an "rpc-error" element per [RFC6241] with the error information populated as follows:
RPC use base identity ---------------------- ---------------------------- establish-subscription establish-subscription-error modify-subscription modify-subscription-error delete-subscription delete-subscription-error kill-subscription kill-subscription-error resynch-subscription resynch-subscription-error
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".
establish-subscription returns hints in yang-data structure ---------------------- ------------------------------------ target: event stream establish-subscription-stream-error-info target: datastore establish-subscription-datastore-error-info modify-subscription returns hints in yang-data structure ---------------------- ------------------------------------ target: event stream modify-subscription-stream-error-info target: datastore modify-subscription-datastore-error-info The yang-data included within "error-info" SHOULD NOT include the optional leaf "error-reason", as such a leaf would be redundant with information that is already placed within the "error-app-tag". In case of an rpc error as a result of a "delete-subscription", a "kill-subscription", or a "resynch-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.
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.
[I-D.draft-ietf-netconf-subscribed-notifications] | Voit, E., Clemm, A., Gonzalez Prieto, A., Tripathy, A. and E. Nilsen-Nygaard, "Customized Subscriptions to a Publisher's Event Streams", Internet-Draft draft-ietf-netconf-subscribed-notifications-15, August 2018. |
[I-D.ietf-netconf-yang-push] | Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., Tripathy, A., Nilsen-Nygaard, E., Bierman, A. and B. Lengyel, "YANG Datastore Subscription", June 2018. |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[RFC5277] | Chisholm, S. and H. Trevino, "NETCONF Event Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008. |
[RFC6241] | Enns, R., Bjorklund, M., Schoenwaelder, J. and A. Bierman, "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011. |
[RFC8174] | Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. |
This section is non-normative.
As defined in [I-D.draft-ietf-netconf-subscribed-notifications] 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 [I-D.draft-ietf-netconf-subscribed-notifications] Section 3.1.
The following example illustrates the retrieval of the list of available event streams:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get> <filter type="subtree"> <streams xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"/> </filter> </get> </rpc>
Figure 1: Get streams request
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 [I-D.draft-ietf-netconf-subscribed-notifications]. The first request is given a subscription identifier of 22, the second, an identifier of 23.
+------------+ +-----------+ | Subscriber | | Publisher | +------------+ +-----------+ | | | Capability Exchange | |<---------------------------->| | | | | | establish-subscription | |----------------------------->| (a) | RPC Reply: OK, id = 22 | |<-----------------------------| (b) | | | notification message (for 22)| |<-----------------------------| | | | | | establish-subscription | |----------------------------->| | notification message (for 22)| |<-----------------------------| | RPC Reply: OK, id = 23 | |<-----------------------------| | | | | | notification message (for 22)| |<-----------------------------| | notification message (for 23)| |<-----------------------------| | |
Figure 2: Multiple subscriptions over a NETCONF session
To provide examples of the information being transported, example messages for interactions (a) and (b) in Figure 2 are detailed below:
<rpc message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <establish-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <stream>NETCONF</stream> <stream-xpath-filter xmlns:ex="http://example.com/events"> /ex:foo/ </stream-xpath-filter> <dscp>10</dscp> </establish-subscription> </rpc>
Figure 3: establish-subscription request (a)
As NETCONF publisher was able to fully satisfy the request (a), the publisher sends the subscription identifier of the accepted subscription within message (b):
<rpc-reply message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <identifier xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> 22 </identifier> </rpc-reply>
Figure 4: establish-subscription success (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 Figure 3 proved unacceptable, the publisher may have returned:
<rpc-reply message-id="102" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-app-tag> ietf-subscribed-notifications:dscp-unavailable </error-app-tag> </rpc-error> </rpc-reply>
Figure 5: an unsuccessful establish subscription
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.
+------------+ +-----------+ | Subscriber | | Publisher | +------------+ +-----------+ | | | notification message (for 23)| |<-----------------------------| | | | modify-subscription (id = 23)| |----------------------------->| (c) | RPC error (with hint) | |<-----------------------------| (d) | | | modify-subscription (id = 23)| |----------------------------->| | RPC Reply: OK | |<-----------------------------| | | | notification message (for 23)| |<-----------------------------| | |
Figure 6: Interaction model for successful subscription modification
If the subscription being modified in Figure 6 is a datastore subscription as per [I-D.ietf-netconf-yang-push], the modification request made in (c) may look like that shown in Figure 7. 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.
<rpc message-id="303" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <modify-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications" xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push"> <identifier>23</identifier> <yp:datastore-xpath-filter xmlns="http://example.com/datastore"> /interfaces-state/interface/oper-status </yp:datastore-xpath-filter> <yp:periodic> <yp:period>500</yp:period> </yp:periodic> </modify-subscription> </rpc>
Figure 7: Subscription modification request (c)
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:
<rpc-reply message-id="303" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-app-tag> ietf-yang-push:period-unsupported </error-app-tag> <error-info xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push"> <modify-subscription-datastore-error-info> <period-hint> 3000 </period-hint> </modify-subscription-datastore-error-info> </error-info> </rpc-error> </rpc-reply>
Figure 8: Modify subscription failure with Hint (d)
The following demonstrates deleting a subscription. This subscription may have been to either a stream or a datastore.
<rpc message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <delete-subscription xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <identifier>22</identifier> </delete-subscription> </rpc>
Figure 9: Delete subscription
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. Figure 10 shows a valid response for existing valid subscription identifier, but that subscription identifier was created on a different NETCONF transport session:
<rpc-reply message-id="103" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>application</error-type> <error-tag>operation-failed</error-tag> <error-severity>error</error-severity> <error-app-tag> ietf-subscribed-notifications:no-such-subscription </error-app-tag> </rpc-error> </rpc-reply>
Figure 10: Unsuccessful delete subscription
A publisher will send subscription state notifications for dynamic subscriptions according to the definitions within [I-D.draft-ietf-netconf-subscribed-notifications]).
As per Section 2.7.2 of [I-D.draft-ietf-netconf-subscribed-notifications], 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:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2007-09-01T10:00:00Z</eventTime> <subscription-modified xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <identifier>39</identifier> <transport xmlns:nsn= "urn:ietf:params:xml:ns:yang:ietf-netconf-subscribed-notifications"> nsn:netconf <transport> <stream-xpath-filter xmlns:ex="http://example.com/events"> /ex:foo </stream-xpath-filter> <stream>NETCONF</stream> </subscription-modified> </notification>
Figure 11: subscription-modified subscription state notification
A "subscription-resumed" would look like:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2007-09-01T10:00:00Z</eventTime> <subscription-resumed xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <identifier>39</identifier> </subscription-resumed> </notification>
Figure 12: subscription-resumed notification in XML
The "replay-complete" is virtually identical, with "subscription-resumed" simply being replaced by "replay-complete".
A "subscription-terminated" would look like:
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <eventTime>2007-09-01T10:00:00Z</eventTime> <subscription-terminated xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <identifier>39</identifier> <error-id> suspension-timeout </error-id> </subscription-terminated> </notification>
Figure 13: subscription-terminated subscription state notification
The "subscription-suspended" is virtually identical, with "subscription-terminated" simply being replaced by "subscription-suspended".
(To be removed by RFC editor prior to publication)