RFC 8640

Dynamic Subscription to YANG Events and Datastores over NETCONF

πŸ“… published September 2019, from ietf

RFC 8640: Dynamic Subscription to YANG Events and Datastores over NETCONF πŸŽ€

Part 1 of 3 ✨

Okay bestie, this is the one from the IETF (the Internet Engineering Task Force, the folks who write the rules for how the internet talks to itself 🌐). It's RFC 8640, published in September 2019, and it's on the Standards Track πŸ‘‘, which means it's an official Internet standard. The ISSN is 2070-1721 🧾.

The authors are E. Voit (Cisco Systems), A. Clemm (Futurewei), A. Gonzalez Prieto (Microsoft), E. Nilsen-Nygaard (Cisco Systems), and A. Tripathy (Cisco Systems). They're giving main character energy πŸ’…. The title block doesn't list any "Obsoletes" or "Updates" entries, so this RFC doesn't say it replaces or changes any earlier document πŸ™Œ.

Abstract 🌸

Okay so the whole point is this: this document gives the Network Configuration Protocol (NETCONF) a binding for the dynamic subscription capability of both subscribed notifications and YANG-Push πŸ¦‹. In plain English, it's the bridge that lets NETCONF use those subscription features. Iconic.

Status of This Memo πŸ“œ

This is an Internet Standards Track document πŸ”₯.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 7841 🧚.

Info about this document's current status, any errata, and how to give feedback lives at https://www.rfc-editor.org/info/rfc8640 πŸ’Œ.

Copyright (c) 2019 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) as they stood on the date this document was published. Please read these carefully, because they spell out your rights and restrictions for this document πŸ“–. Code Components pulled out of this document must include the Simplified BSD License text described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes 🌈.

This document may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008. The people who control the copyright in some of that material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process. Unless you get an adequate license from the people controlling the copyright in those materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process. The one exception is formatting it for publication as an RFC or translating it into languages other than English 🫢.

Table of Contents πŸ—‚οΈ

   1. Introduction ....................................................3
   2. Terminology .....................................................3
   3. Compatibility with <create-subscription> as Defined in
      RFC 5277 ........................................................4
   4. Mandatory XML, Event Stream, and Datastore Support ..............4
   5. NETCONF Connectivity and Dynamic Subscriptions ..................4
   6. Notification Messages ...........................................5
   7. Dynamic Subscriptions and RPC Error Responses ...................5
   8. Security Considerations .........................................7
   9. IANA Considerations .............................................7
   10. References .....................................................7
      10.1. Normative References ......................................7
      10.2. Informative References ....................................8
   Appendix A. Examples ...............................................9
     A.1. Event Stream Discovery ......................................9
     A.2. Dynamic Subscriptions ......................................10
     A.3. Subscription State Notifications ...........................15
     A.4. Filter Examples ............................................17
   Acknowledgments ...................................................19
   Authors' Addresses ................................................19

1. Introduction ✨

Okay so this document specifies how a stream of events that's part of a dynamic subscription gets bound to the Network Configuration Protocol (NETCONF) [RFC6241] πŸ¦‹. Dynamic subscriptions themselves are defined in [RFC8639] πŸ’–. Here's the bestie part: since [RFC8641] is built on top of [RFC8639], this document lets a NETCONF client set up a dynamic subscription and then receive updates from a YANG datastore sitting on a NETCONF server πŸ”₯. Literal glow-up for NETCONF.

This document assumes you already know the terminology and concepts from [RFC8639] 🧠.

2. Terminology πŸ“–

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 [RFC8639]: dynamic subscription, event stream, notification message, publisher, receiver, subscriber, and subscription. This document doesn't define any new terms πŸ™ˆ.

3. Compatibility with <create-subscription> as Defined in RFC 5277 πŸ™…β€β™€οΈ

A publisher is allowed to support dynamic subscription RPCs from [RFC8639] at the same time as the <create-subscription> RPC defined in [RFC5277]. But here's the tea β˜•: a single NETCONF transport session MUST NOT support both this specification and a subscription set up by the <create-subscription> RPC from [RFC5277]. To stop anyone from trying to use one NETCONF transport session both ways, there are two rules 🚫:

  • A solution MUST reply with the <rpc-error> element [RFC6241] containing the error-tag value of operation-not-supported if a <create-subscription> RPC is received on a NETCONF session where an established subscription per [RFC8639] already exists.
  • A solution MUST reply with the <rpc-error> element [RFC6241] 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 [RFC5277] has successfully created a subscription.

If a publisher supports this specification but doesn't support subscriptions via [RFC5277], the publisher MUST NOT advertise urn:ietf:params:netconf:capability:notification:1.0 🫠. No mixing the two, periodt πŸ’….

4. Mandatory XML, Event Stream, and Datastore Support 🧚

The encode-xml feature from [RFC8639] MUST be supported. This tells you that XML is a valid encoding for RPCs, state change notifications, and subscribed content πŸ“„βœ¨.

A NETCONF publisher that supports event stream subscription via [RFC8639] MUST support the "NETCONF" event stream identified in that document 🌊.

5. NETCONF Connectivity and Dynamic Subscriptions πŸ”Œ

Dynamic subscriptions are managed through RPCs defined in [RFC8641] and [RFC8639] πŸŽ€. For a dynamic subscription, if the NETCONF session that the establish-subscription went through ends, the subscription MUST be terminated. Bye bye, subscription πŸ‘‹.

For a dynamic subscription, any modify-subscription, delete-subscription, or resync-subscription RPCs MUST be sent over the same NETCONF session that the referenced subscription was established on. No hopping sessions, bestie πŸ¦‹.

6. Notification Messages πŸ’Œ

Notification messages sent over NETCONF MUST be encoded in a <notification> message as defined in [RFC5277], Section 4. And following the <eventTime> object definition from [RFC5277], <eventTime> gets filled in with the event occurrence time ⏰.

For dynamic subscriptions, all notification messages MUST use the NETCONF transport session that the establish-subscription RPC used 🫢.

7. Dynamic Subscriptions and RPC Error Responses 🚨✨

okay bestie, so when an RPC error happens (the stuff in [RFC8639], Section 2.4.6 and [RFC8641], Appendix A), the NETCONF RPC reply MUST include an <rpc-error> element per [RFC6241] πŸ’… and it needs its info filled in like this:

  • error-type is application πŸŽ€
  • error-tag is a string that matches an identity tied to the error πŸ¦‹ For the stuff in this doc, the tag lines up with the errors in either (1) [RFC8639], Section 2.4.6, for general subscription errors, or (2) [RFC8641], Appendix A.1, for errors that are specific to YANG datastores. Here's the general table:
error identity          uses error-tag
----------------------  -----------------------
dscp-unavailable        invalid-value
encoding-unsupported    invalid-value
filter-unsupported      invalid-value
insufficient-resources  resource-denied
no-such-subscription    invalid-value
replay-unsupported      operation-not-supported

And the datastore one:

error identity               uses error-tag
---------------------------  -----------------------
cant-exclude                 operation-not-supported
datastore-not-subscribable   invalid-value
no-such-subscription-resync  invalid-value
on-change-unsupported        operation-not-supported
on-change-sync-unsupported   operation-not-supported
period-unsupported           invalid-value
update-too-big               too-big
sync-too-big                 too-big
unchanging-selection         operation-failed
  • error-severity is error (this MAY be included) 🌸
  • error-app-tag is another string that matches an identity for the error. The general ones come from [RFC8639], Section 2.4.6 and the datastore ones come from [RFC8641], Appendix A.1. Which identity you use depends on which RPC blew up πŸ’€ Every identity gets written in the form <modulename>:<identityname>, so something like ietf-subscribed-notifications:no-such-subscription is a valid one ✨ Here's which base identity goes with which RPC:
RPC                     has base identity
----------------------  ----------------------------
establish-subscription  establish-subscription-error
modify-subscription     modify-subscription-error
delete-subscription     delete-subscription-error
kill-subscription       delete-subscription-error
resync-subscription     resync-subscription-error
  • error-info is an optional extra for error replies to an establish-subscription or modify-subscription request 🧚 It can carry XML-encoded hints about parameter settings that could make a future RPC work. These are the yang-data structures from [RFC8639] and [RFC8641] that can come back:

establish-subscription returns hints in this yang-data structure:

target: event stream   establish-subscription-stream-error-info
target: datastore      establish-subscription-datastore-error-info

modify-subscription returns hints in this yang-data structure:

target: event stream   modify-subscription-stream-error-info
target: datastore      modify-subscription-datastore-error-info

Real talk: the yang-data inside error-info SHOULD NOT include the optional leaf reason πŸ™ˆ That's because it would just repeat what's already sitting in the error-app-tag 🫢

When an RPC error comes from a delete-subscription, kill-subscription, or resync-subscription request, you don't need to include any error-info πŸ’œ The only RPC input parameter there is the subscription-id, and there aren't any hints that need to be given for it.

8. Security Considerations πŸ”

okay this part is serious, so let's go 😭 This document doesn't add any new security considerations for dynamic subscriptions beyond what's already covered in [RFC8639]. BUT there's one extra thing that needs more attention, and it comes from how connection-oriented NETCONF is. If a buggy or compromised NETCONF subscriber keeps sending "establish-subscription" requests, those subscriptions pile up and can eat through system resources πŸ”₯ In that kind of situation, subscriptions MAY be terminated by ending the underlying NETCONF session. The publisher MAY also suspend or terminate some of the active subscriptions on that NETCONF session, so it can reclaim resources and keep things running normally for everyone else πŸ‘‘

9. IANA Considerations 🌈

This document has no IANA actions. Nothing to register here, bestie 🧚

10. References πŸ“š

10.1. Normative References

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008, <https://www.rfc-editor.org/info/rfc5277>.

[RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, <https://www.rfc-editor.org/info/rfc6241>.

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC8639] Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard, E., and A. Tripathy, "Subscription to YANG Notifications", RFC 8639, DOI 10.17487/RFC8639, September 2019, <https://www.rfc-editor.org/info/rfc8639>.

[RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, September 2019, <https://www.rfc-editor.org/info/rfc8641>.

[W3C.REC-xml-20081126] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", World Wide Web Consortium Recommendation REC-xml-20081126, November 2008, <https://www.w3.org/TR/2008/REC-xml-20081126>.

10.2. Informative References

[RFC8347] Liu, X., Ed., Kyparlis, A., Parikh, R., Lindem, A., and M. Zhang, "A YANG Data Model for the Virtual Router Redundancy Protocol (VRRP)", RFC 8347, DOI 10.17487/RFC8347, March 2018, <https://www.rfc-editor.org/info/rfc8347>.

[XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", November 1999, <https://www.w3.org/TR/1999/REC-xpath-19991116>.

Appendix A. Examples πŸŽ€

This appendix is non-normative, so it's just vibes 🌸 The subscription "id" values of 22, 23, 39, and 99 used below are only examples. In production, the actual values of "id" might not be small integers.

A.1. Event Stream Discovery πŸ¦‹

As defined in [RFC8639], an event stream is a continuous set of events you can subscribe to. A NETCONF client can grab the list of available event streams from a NETCONF publisher by using the <get> operation against the top-level "streams" container defined in [RFC8639], Section 3.1.

The following XML example [W3C.REC-xml-20081126] shows how to retrieve that list of 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> Request for Retrieval of Event Streams

After that request, the NETCONF publisher sends back the list of available event streams, plus any extra info that might be in the container ✨

A.2. Dynamic Subscriptions πŸ’–

A.2.1. Establishing Dynamic Subscriptions 🧚

Figure 2 shows two successful "establish-subscription" RPC requests as per [RFC8639]. The first request gets a subscription "id" of 22, and the second one gets an "id" 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

Here's how the info gets carried. These example messages cover interactions (a) and (b) in Figure 2 and are shown below (Figures 3 and 4):

<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-xpath-filter xmlns:ex="https://example.com/events">
      /ex:foo/
    </stream-xpath-filter>
    <stream>NETCONF</stream>
    <dscp>10</dscp>
  </establish-subscription>
</rpc>

Figure 3: "establish-subscription" Request (a) πŸŽ€

As the NETCONF publisher was able to fully satisfy the request (a), it sends back the subscription "id" of the accepted subscription in its reply message (b) πŸ¦‹:

<rpc-reply message-id="102"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <id
    xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    22
  </id>
</rpc-reply>

Figure 4: A Successful "establish-subscription" (b) ✨

Okay so, if the NETCONF publisher could NOT fully satisfy the request, or the subscriber isn't authorized to set up the subscription, the publisher would have sent back an RPC error response instead 😭. For example, if the "dscp" value of 10 that the subscriber asked for in Figure 3 was unacceptable, the publisher may have returned something like this:

<rpc-reply message-id="102"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
   <error-type>application</error-type>
   <error-tag>invalid-value</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 info in future attempts to set up a subscription. Main character energy, honestly πŸ’…πŸŒΈ

A.2.2. Modifying Dynamic Subscriptions

An existing subscription can be modified too 🧚 The exchange below shows a negotiation of that kind of modification between a subscriber and a publisher. It's made up of a failed RPC modification request/response, followed by a successful one. Iconic. πŸ‘‘

           +------------+                 +-----------+
           | 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 [RFC8641], the modification request made in (c) might look like Figure 7 πŸ¦‹. As you can see, the two changes being attempted are a new XPath filter and 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:yang:ietf-subscribed-notifications"
       xmlns:yp="urn:ietf:params:xml:ns:yang:ietf-yang-push">
    <id>23</id>
    <yp:datastore-xpath-filter xmlns:ex="https://example.com/datastore">
        /ex:foo/ex:bar
    </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, it sends a positive result for the RPC πŸ₯³. If it can't satisfy either of the proposed changes, it sends an RPC error response (d) πŸ™ˆ. Figure 8 shows an example RPC error response for (d) that includes a hint. The hint is an alternative time period value that might have led to a successful modification, which is lowkey so helpful πŸ“

<rpc-reply message-id="303"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>invalid-value</error-tag>
    <error-severity>error</error-severity>
    <error-app-tag>
        ietf-yang-push:period-unsupported
    </error-app-tag>
    <error-info>
      <modify-subscription-datastore-error-info
          xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push">
        <period-hint>
            3000
        </period-hint>
      </modify-subscription-datastore-error-info>
    </error-info>
  </rpc-error>
</rpc-reply>

Figure 8: "modify-subscription" Failure with Hint (d) πŸ’œ

A.2.3. Deleting Dynamic Subscriptions

Figure 9 shows how a subscription gets deleted. That subscription could have been to a stream or to a datastore, either one 🧚

<rpc message-id="103"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <delete-subscription
    xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    <id>22</id>
  </delete-subscription>
</rpc>

Figure 9: "delete-subscription" ✨

If the NETCONF publisher can satisfy the request, it returns a reply saying it worked πŸŽ‰

If it can't, the publisher sends an <rpc-error> element saying the modification didn't work 😬. Figure 10 shows a valid response for an existing, valid subscription "id". The catch is that this subscription "id" was created on a different NETCONF transport session, so it's a no-go here 🫠

<rpc-reply message-id="103"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>invalid-value</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: An Unsuccessful "delete-subscription" πŸ’”

A.3. Subscription State Notifications

A publisher sends subscription state notifications for dynamic subscriptions following the definitions in [RFC8639]. Bestie, these are the little status updates that keep everyone in the loop πŸ“£

A.3.1. "subscription-modified"

As per Section 2.7.2 of [RFC8639], 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 this πŸ’…

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2007-09-01T10:00:00Z</eventTime>
  <subscription-modified
      xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    <id>39</id>
    <stream-xpath-filter xmlns:ex="https://example.com/events">
      /ex:foo
    </stream-xpath-filter>
    <stream>NETCONF</stream>
  </subscription-modified>
</notification>

Figure 11: "subscription-modified" Subscription State Notification 🌸

A.3.2. "subscription-resumed" and "replay-complete"

A "subscription-resumed" would look like this πŸ¦‹

<notification
  xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2007-09-01T10:00:00Z</eventTime>
  <subscription-resumed
    xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    <id>39</id>
  </subscription-resumed>
</notification>

Figure 12: "subscription-resumed" Notification ✨

The "replay-complete" is basically identical, except "subscription-resumed" just gets swapped out for "replay-complete" πŸ”

A.3.3. "subscription-terminated" and "subscription-suspended"

A "subscription-terminated" would look like this πŸ₯€

<notification
  xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2007-09-01T10:00:00Z</eventTime>
  <subscription-terminated
    xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    <id>39</id>
    <reason>
       suspension-timeout
    </reason>
  </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" πŸ’œ

A.4. Filter Examples

This appendix has examples showing both XPath and subtree ways of filtering event record contents 🧚 They're based on the YANG notification "vrrp-protocol-error-event", as defined in the ietf-vrrp YANG data model in [RFC8347]. Event records generated by the publisher that follow this specification might look like this:

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2018-09-14T08:22:33.44Z</eventTime>
  <vrrp-protocol-error-event
       xmlns="urn:ietf:params:xml:ns:yang:ietf-vrrp">
     <protocol-error-reason>checksum-error</protocol-error-reason>
  </vrrp-protocol-error-event>
</notification>

Figure 14: Example VRRP Notification per RFC 8347 πŸ“

Say a subscriber wants a subscription that only passes event records where there's a "checksum-error" as part of a Virtual Router Redundancy Protocol (VRRP) protocol event πŸ‘€. Also assume the publisher puts those event records into the NETCONF stream. To get a continuous series of matching event records, the subscriber might ask for an XPath filter against the NETCONF stream. An "establish-subscription" RPC to make that happen might be:

<rpc message-id="601" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <establish-subscription
    xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    <stream>NETCONF</stream>
    <stream-xpath-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-vrrp">
      /vrrp-protocol-error-event[
         vrrp:protocol-error-reason="vrrp:checksum-error"]
    </stream-xpath-filter>
  </establish-subscription>
</rpc>

Figure 15: Establishing a Subscription Error Reason via XPath πŸ”₯

For more examples of XPath filters, see [XPATH] 🫢

Now suppose the "establish-subscription" in Figure 15 was accepted. Then, later on, the subscriber decides they want to broaden it to cover all VRRP protocol events, not just the ones with a "checksum-error" 😀 The subscriber might try to modify the subscription by replacing the XPath filter with a subtree filter that sends all VRRP protocol events to the subscriber. That "modify-subscription" RPC might look like this:

<rpc message-id="602" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <modify-subscription
     xmlns="urn:ietf:params:yang:ietf-subscribed-notifications">
    <id>99</id>
    <stream-subtree-filter>
     <vrrp-protocol-error-event
            xmlns="urn:ietf:params:xml:ns:yang:ietf-vrrp"/>
    </stream-subtree-filter>
  </modify-subscription>
</rpc>

Figure 16: Example "modify-subscription" RPC 🌈

For more examples of subtree filters, see [RFC6241], Section 6.4 πŸ“š

Acknowledgments

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 πŸ«ΆπŸ’–

Authors' Addresses

Eric Voit Cisco Systems

Email: evoit@cisco.com

Alexander Clemm Futurewei

Email: ludwig@clemm.org

Alberto Gonzalez Prieto Microsoft

Email: alberto.gonzalez@microsoft.com

Einar Nilsen-Nygaard Cisco Systems

Email: einarnn@cisco.com

Ambika Prasad Tripathy Cisco Systems

Email: ambtripa@cisco.com

πŸ“¦ where this page comes from