Network Working Group T. Graf Internet-Draft Swisscom Intended status: Standards Track B. Claise Expires: 16 July 2023 Huawei A. Huang Feng INSA-Lyon 12 January 2023 Support of Versioning in YANG Notifications Subscription draft-tgraf-netconf-yang-notifications-versioning-01 Abstract This document extends the YANG notifications subscription mechanism to specify the YANG module semantic version at the subscription. Then, a new extension with the revision and the semantic version of the YANG push subscription state change notification is proposed. Requirements Language 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. Status of This Memo 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 16 July 2023. Copyright Notice Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved. Graf, et al. Expires 16 July 2023 [Page 1] Internet-Draft YANG Notifications Versioning January 2023 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Extend the Datastore Selection . . . . . . . . . . . . . . . 3 3. Extend the Subscription State Change Notifications . . . . . 4 4. The "ietf-yang-push-revision" Module . . . . . . . . . . . . 5 4.1. Data Model Overview . . . . . . . . . . . . . . . . . . . 5 4.2. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 6 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 8.1. Normative References . . . . . . . . . . . . . . . . . . 8 8.2. Informative References . . . . . . . . . . . . . . . . . 9 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 1. Introduction In order to process the received YANG push notification messages described in section 3.7 of [RFC8641] at the YANG push receiver, a semantic reference to the YANG module and the XPath or subtree is needed to determine the data types for each field and which part of the YANG module the metrics are expose from. This specification applies to the YANG push configured subscriptions defined in Section 2.5 of [RFC8639], where a publisher is configured to stream notification out of band, as opposed to dynamic subscriptions defined in Section 2.4 of [RFC8639], where the subscriber can initiate and modify the subscription dynamically in- band. In the latter case, the subscriber knows already all the subscriber YANG-related information, which it has to know in order to configure the subscription. Graf, et al. Expires 16 July 2023 [Page 2] Internet-Draft YANG Notifications Versioning January 2023 This semantic reference is available when the subscription is being establish as described in Section 3.6 of [RFC8641] and being streamed from the publisher to receiver with the subscription state change notifications described in Section 2.7 of [RFC8639] where for each subscription a locally unique subscription ID described in Section 4.3.2 of [RFC8641] is being issued and streamed as metadata with the notification message in the YANG push message header. The semantics can change between different YANG module revisions. The YANG module version statement is specified in Section 7.1.2 of [RFC6020] and states that the newer revision needs to be backward compatible to the previous revision. Section 3.1 of [I-D.ietf-netmod-yang-module-versioning] specifies that newer semantic versions introduced in [I-D.ietf-netmod-yang-semver] MAY not be backward compatible to the previous version when indicated with non-backwards-compatible keyword. The YANG notifications subscription mechanism defined in [RFC8641] does not allow to specify the YANG module revision. When a network node is upgraded, the subscribed YANG module revision MAY have updated and might, consequently, break the data processing pipeline since the YANG push receiver may not be aware of this change. This documents extends the current YANG notifications subscription mechanism to allow to subscribe to a specific revision or latest YANG module semantic version to which the YANG module version needs to be backward compatible to. The subscription state change "subscription- started" and "subscription-modified" notification messages are also extended to include the revision and semantic version. 2. Extend the Datastore Selection The YANG notifications subscription OPTIONALLY can be restricted to the following YANG module revision for future capabilities: latest: Restricts the subscription to the latest YANG module revision. revision: Restricts the subscription to a specific YANG module revision. Example: "2014-05-08". latest-compatible-semversion: Restricts the subscription to the latest compatible YANG module semantic version referenced to. Example: "2.0.0". If nothing is specified, latest YANG module version is implied. Graf, et al. Expires 16 July 2023 [Page 3] Internet-Draft YANG Notifications Versioning January 2023 3. Extend the Subscription State Change Notifications Besides the Subscription ID and the xpath or sub-tree filter reference as described in Section 2.7 of [RFC8639], the following metadata objects are part of a "subscription-started" or "subscription-modified" subscription state change notification. revision: Describes the YANG module revision as specified in Section 7.1.9 of [RFC6020] for the related streamed content. revision-label: Describes the YANG module semantic version as specified in [I-D.ietf-netmod-yang-semver] for the related streamed content. Figure 1 provides an example of a "subscription-modified" subscription state change notification message with the YANG revision, revision label and datastore-xpath-filter for tracking the operational status of a single Ethernet interface (per [RFC8343]). This subscription state change notification message is encoded XML [W3C.REC-xml-20081126] over the Network Configuration Protocol (NETCONF) as per [RFC8640]. 2023-01-03T10:00:00Z 101 2014-05-08 1.0.0 /int:interfaces NETCONF Figure 1: XML Push Example for a subscription-modified notification message Figure 2 provides an example of a JSON encoded, [RFC8259], subscription state change notification message over HTTPS-based [I-D.ietf-netconf-https-notif] or UDP-based [I-D.ietf-netconf-udp-notif] transport for the same subscription. Graf, et al. Expires 16 July 2023 [Page 4] Internet-Draft YANG Notifications Versioning January 2023 { "ietf-restconf:notification" : { "eventTime": "2023-01-03T10:00:00Z", "ietf-subscribed-notifications:subscription-modified": { "id": 101, "revision": "2014-05-08", "revision-label": "1.0.0", "stream-xpath-filter": "/ietf-interfaces:interfaces", "stream": { "ietf-netconf-subscribed-notifications" : "NETCONF" } } } } Figure 2: JSON Push Example for a subscription-modified notification message 4. The "ietf-yang-push-revision" Module 4.1. Data Model Overview This YANG module augments the "ietf-yang-push" module with the revision and revision-label in the "subscription-started" and "subscription-modified" subscription state change notifications and the ability to define the "revision" and "revision-label" in the "establish-subscription" and "modify-subscription" RPCs in the datastore push subscription. module: ietf-yang-push-revision augment /sn:establish-subscription/sn:input/sn:target: +--rw revision? rev:revision-date-or-label +-- revision-label? ysver:version augment /sn:modify-subscription/sn:input/sn:target: +--rw revision? rev:revision-date-or-label +-- revision-label? ysver:version augment /sn:subscription-started/sn:target: +--ro revision rev:revision-date-or-label +-- revision-label? ysver:version augment /sn:subscription-modified/sn:target: +--ro revision rev:revision-date-or-label +-- revision-label? ysver:version augment /sn:subscriptions/sn:subscription/sn:target: +--ro revision rev:revision-date-or-label +--rw revision-label? ysver:version Graf, et al. Expires 16 July 2023 [Page 5] Internet-Draft YANG Notifications Versioning January 2023 4.2. YANG Module The YANG module has two leaves augmenting the model of Subscription to YANG Notifications [RFC8639]. file "ietf-yang-push-revision@2023-01-12.yang" module ietf-yang-push-revision { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-push-revision"; prefix ypm; import ietf-subscribed-notifications { prefix sn; reference "RFC 8639: Subscription to YANG Notifications"; } import ietf-yang-revisions { prefix rev; reference "RFC XXXX: draft-ietf-netmod-yang-module-versioning-06, Updated YANG Module Revision Handling"; } import ietf-yang-semver { prefix ysver; reference "RFC XXXX: draft-ietf-netmod-yang-semver-07, YANG Semantic Versioning"; } organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: WG List: Authors: Thomas Graf Benoit Claise Alex Huang Feng "; description "Defines YANG push event notification header with the revision and the revision-label. Adds the support of the revision and revision-label selection in the YANG push subscription RPCs. Copyright (c) 2023 IETF Trust and the persons identified as authors of the code. All rights reserved. Graf, et al. Expires 16 July 2023 [Page 6] Internet-Draft YANG Notifications Versioning January 2023 Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Revised BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; revision 2023-01-12 { description "First revision"; reference "RFC XXXX: Support of Versioning in YANG Notifications Subscription"; } feature yang-push-revision-supported { description "This feature indicates the YANG Subscription Notifications supports the revision and revision-label defined in this YANG module."; } grouping yang-push-module-version-config { leaf revision { type rev:revision-date-or-label; config true; description "This references the YANG module revision to be sent in the subscription."; } leaf revision-label { type ysver:version; description "This references the YANG module semversion to be sent in the subscription."; } } grouping yang-push-module-version { leaf revision { type rev:revision-date-or-label; config false; mandatory true; description "This references the YANG module revision of the sent notification message."; } leaf revision-label { type ysver:version; description "This references the YANG module semversion of the sent notification message."; Graf, et al. Expires 16 July 2023 [Page 7] Internet-Draft YANG Notifications Versioning January 2023 } } // Subscription parameters augment "/sn:establish-subscription/sn:input/sn:target" { uses ypm:yang-push-module-version-config; } augment "/sn:modify-subscription/sn:input/sn:target" { uses ypm:yang-push-module-version-config; } // Subscription notifications augment "/sn:subscription-started/sn:target" { uses ypm:yang-push-module-version; } augment "/sn:subscription-modified/sn:target" { uses ypm:yang-push-module-version; } // Subscription container augment "/sn:subscriptions/sn:subscription/sn:target" { uses ypm:yang-push-module-version; } } 5. Security Considerations The security considerations for the YANG notifications subscription mechanism are described in [RFC8641]. This documents adds no additional security considerations. 6. IANA Considerations This document has no IANA actions. 7. Acknowledgements The authors would like to thank xxx for their review and valuable comments. 8. References 8.1. Normative References [I-D.ietf-netmod-yang-module-versioning] Wilton, R., Rahman, R., Lengyel, B., Clarke, J., and J. Sterne, "Updated YANG Module Revision Handling", Work in Graf, et al. Expires 16 July 2023 [Page 8] Internet-Draft YANG Notifications Versioning January 2023 Progress, Internet-Draft, draft-ietf-netmod-yang-module- versioning-07, 24 October 2022, . [I-D.ietf-netmod-yang-semver] Clarke, J., Wilton, R., Rahman, R., Lengyel, B., Sterne, J., and B. Claise, "YANG Semantic Versioning", Work in Progress, Internet-Draft, draft-ietf-netmod-yang-semver- 08, 24 October 2022, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC6020] Bjorklund, M., Ed. and RFC Publisher, "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, October 2010, . [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., Bierman, A., Ed., and RFC Publisher, "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, . [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, . [RFC8641] Clemm, A. and E. Voit, "Subscription to YANG Notifications for Datastore Updates", RFC 8641, DOI 10.17487/RFC8641, September 2019, . 8.2. Informative References Graf, et al. Expires 16 July 2023 [Page 9] Internet-Draft YANG Notifications Versioning January 2023 [I-D.ietf-netconf-https-notif] Jethanandani, M. and K. Watsen, "An HTTPS-based Transport for YANG Notifications", Work in Progress, Internet-Draft, draft-ietf-netconf-https-notif-13, 4 November 2022, . [I-D.ietf-netconf-udp-notif] Zheng, G., Zhou, T., Graf, T., Francois, P., Feng, A. H., and P. Lucente, "UDP-based Transport for Configured Subscriptions", Work in Progress, Internet-Draft, draft- ietf-netconf-udp-notif-08, 12 September 2022, . [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, . [RFC8343] Bjorklund, M. and RFC Publisher, "A YANG Data Model for Interface Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, . [RFC8640] Voit, E., Clemm, A., Gonzalez Prieto, A., Nilsen-Nygaard, E., and A. Tripathy, "Dynamic Subscription to YANG Events and Datastores over NETCONF", RFC 8640, DOI 10.17487/RFC8640, September 2019, . [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, . Authors' Addresses Thomas Graf Swisscom Binzring 17 CH-8045 Zurich Switzerland Email: thomas.graf@swisscom.com Graf, et al. Expires 16 July 2023 [Page 10] Internet-Draft YANG Notifications Versioning January 2023 Benoit Claise Huawei Email: benoit.claise@huawei.com Alex Huang Feng INSA-Lyon Lyon France Email: alex.huang-feng@insa-lyon.fr Graf, et al. Expires 16 July 2023 [Page 11]