Internet-Draft | NETCONF Event Notification YANG | June 2024 |
Huang Feng, et al. | Expires 19 December 2024 | [Page] |
This document defines the structure of NETCONF Event Notification in a YANG model to be used in NETCONF environments. The definition of this YANG model allows the encoding of NETCONF Event Notifications in YANG compatible encodings such as JSON and CBOR.¶
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.¶
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 19 December 2024.¶
Copyright (c) 2024 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 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.¶
NETCONF Event Notifications [RFC5277] and YANG-Push [RFC8639] allow NETCONF [RFC6241] servers and YANG-Push publishers to send notifications to a data collection. The NETCONF client and the YANG-Push receiver decodes the message and optionally validates the header and the content before forward it to the next process. This schema validation process ensures to not break the data processing chain.¶
The structure of a NETCONF Event notification has been defined in [RFC5277] using a XML Schema [W3C.REC-xml-20001006] allowing NETCONF nodes to validate the header schema of the notification message when it is encoded in XML. However, when these notifications are sent using YANG-Push [RFC8639][RFC8641], they can be encoded in other encodings such as JSON [RFC7951] or CBOR [RFC9254]. In such cases, the model defined in [RFC5277] cannot be used to validate the notification header.¶
This document defines the content of the header of such notifications allowing implementations to validate the schema of the notifications when they are encoded in other encodings than XML. A YANG 1.1 [RFC7950] model is defined for such purposes.¶
This document updates [RFC5277], [RFC8639] and [RFC7951] specifying how a Notification header should be encoded. RESTCONF Notifications [RFC8040] are out of scope of this document.¶
This section exposes the relationship to [RFC5277], [RFC8639], [RFC7951] and [RFC9254].¶
[RFC5277] defines a mechanism for NETCONF nodes to send notifications to a collector. These are the key relationships between the current document and [RFC5277]:¶
Subscribed Notifications [RFC8639] defines a mechanism on top of [RFC5277] to stream notifications from the NETCONF node. These are the key relationships between the current document and [RFC8639]:¶
[RFC7951] defines how YANG data is encoded using JSON. These are the key relationship points between the current document and [RFC7951]:¶
[RFC9254] defines how YANG data is encoded using CBOR. These are the key relationship points between the current document and [RFC9254]:¶
Note to the RFC-Editor: Please remove this section before publishing.¶
[I-D.ietf-netconf-notification-messages] proposes a structure to send multiple notifications in a single message. Unlike [I-D.ietf-netconf-notification-messages], this document defines a YANG module to encode NETCONF Notifications with encodings other than XML, which is currently not existing. The structure for NETCONF notifications is defined in [RFC5277] using a XSD, but there is no YANG module defining the structure of the notification message sent by a server when the message is encoded in JSON [RFC7951] or CBOR [RFC9254].¶
This section defines how NETCONF YANG Notifications are structured in XML, JSON and CBOR encodings. The same namespace "ietf-notification" is used to be compliant with [RFC5277].¶
The same structure as defined in Section 4 of [RFC5277] is used. The structure uses the XML namespace that has been defined in [RFC5277]:¶
urn:ietf:params:xml:ns:netconf:notification:1.0¶
Two child nodes within the "notification" container are expected, representing the event time and the notification payload. The "eventTime" node is defined within the same XML namespace as the "notification" element and is compliant with [RFC3339].¶
The name and namespace of the payload element are determined by the YANG module containing the notification statement representing the notification message.¶
The following example shows a "push-update" notification defined in the YANG module of YANG-Push [RFC8641] encoded in XML:¶
A YANG notification encoded in JSON is structured as a root "notification" container. The namespace of this container is the name of the YANG module "ietf-notification" defined in Section 5.¶
Two child nodes within the "ietf-notification:notification" container are expected, representing the event time and the notification payload. The "eventTime" node is defined within the same namespace as the "ietf-notification:notification" container and is compliant with [RFC3339].¶
The following example shows a "push-update" notification defined in the YANG module of YANG-Push [RFC8641] encoded in JSON:¶
When Notifications are implemented within RESTCONF [RFC8040] environments, the namespace of a notification stays "ietf-restconf:notification" as defined in Section 6.4 of [RFC8040].¶
YANG data can be represented in CBOR using Names or SIDs in keys. The following sections shows how these messages are encoded in both cases.¶
Notifications encoded using keys is similar to JSON encoding as defined in Section 3.3 of [RFC9254]. The key of the element can be the element itself or be namespace-qualified. In the latter case, the namespace of the notification container uses the YANG module name "ietf-notification" defined in Section 5.¶
Two child nodes within the "ietf-notification:notification" container are expected, representing the event time and the notification payload. The "eventTime" node is defined within the same namespace as the "ietf-notification:notification" container and is compliant with [RFC3339].¶
The following example shows a "push-update" notification defined in the YANG module of YANG-Push [RFC8641] encoded in CBOR using names as keys. The example uses the CBOR diagnostic notation as defined in section 3.1 of [RFC9254]:¶
A Notification encoded using YANG-SIDs replaces the names of the keys of the CBOR encoded message for a 63 bit unsigned integer. This is defined in Section 3.2 of [RFC9254] and a process for SID allocation is defined in [I-D.ietf-core-sid].¶
Two child nodes within the root container are expected, representing the event time and the notification payload. The root container and the "eventTime" node uses a SID and the content of the "eventTime" is compliant with [RFC3339].¶
This is an example of YANG-CBOR encoded notification using YANG SIDs [RFC9254]. The Figure 4 shows the message using the CBOR diagnostic notation as defined in section 3.1 of [RFC9254]:¶
This YANG module adds a structure with one leaf for the datetime as defined in section 2.2.1 of [RFC5277]. The name of the leaf matches the definition of the XSD element name defined in Section 4 of [RFC5277].¶
module: ietf-notification structure notification: +-- eventTime yang:date-and-time¶
The YANG module uses the same namespace from the XML Schema defined in Section 4 of [RFC5277] allowing to use this YANG module to also validate already implemented XML encoded NETCONF Event Notifications.¶
<CODE BEGINS> file "ietf-notification@2024-06-17.yang" module ietf-notification { yang-version 1.1; namespace "urn:ietf:params:xml:ns:netconf:notification:1.0"; prefix inotif; import ietf-yang-types { prefix yang; reference "RFC 6991: Common YANG Data Types"; } import ietf-yang-structure-ext { prefix sx; reference "RFC 8791: YANG Data Structure Extensions"; } organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: <https://datatracker.ietf.org/group/netconf/> WG List: <mailto:netconf@ietf.org> Authors: Alex Huang Feng <mailto:alex.huang-feng@insa-lyon.fr> Pierre Francois <mailto:pierre.francois@insa-lyon.fr> Thomas Graf <mailto:thomas.graf@swisscom.com> Benoit Claise <mailto:benoit.claise@huawei.com>"; description "Defines NETCONF Event Notification structure as defined in RFC5277 and RFC7950. This YANG module uses the same namespace from the XML schema defined in Section 4 of RFC5277 to be able to validate already implemented XML encoded messages. This module can be used to validate XML encoded notifications [RFC7950], JSON encoded messages [RFC7951] and CBOR encoded messages [RFC9254]. Refer to Section 4 of RFC XXXX for more details. Copyright (c) 2024 IETF Trust and the persons identified as authors of the code. All rights reserved. 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 (https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself for full legal notices."; revision 2024-06-17 { description "First revision"; reference "RFC XXXX: NETCONF Event Notification YANG"; } sx:structure notification { leaf eventTime { type yang:date-and-time; mandatory true; description "The date and time the event was generated by the event source. This parameter is of type dateTime and compliant to [RFC3339]. Implementations must support time zones. The leaf name in camel case matches the name of the XSD element defined in Section 4 of RFC5277."; } } } <CODE ENDS>¶
The security considerations for the NETCONF Event notifications are described in [RFC5277]. This documents adds no additional security considerations.¶
This document describes the URI used for the IETF XML Registry and registers a new YANG module name.¶
IANA is requested to add this document as a reference in the following URI in the IETF XML Registry [RFC3688].¶
URI: urn:ietf:params:xml:ns:netconf:notification:1.0 Registrant Contact: The IESG. XML: N/A; the requested URI is an XML namespace. Reference: RFC5277; RFC-to-be¶
This document registers the following YANG module in the YANG Module Names Registry [RFC6020], within the "YANG Parameters" registry:¶
name: ietf-notification namespace: urn:ietf:params:xml:ns:netconf:notification:1.0 prefix: inotif reference: RFC-to-be¶
IANA is requested to register a new ".sid" file in the "IETF YANG SID Registry" [I-D.ietf-core-sid]:¶
SID range entry point: TBD SID range size: 50 YANG module name: ietf-notification reference: RFC-to-be¶
A ".sid" file is proposed in Appendix A.¶
The authors would like to thank Per Anderson, Andy Bierman, Carsten Bormann, Mohamed Boucadair, Tom Petch, Jason Sterne, Kent Watsen and Rob Wilton for their review and valuable comments.¶
Note to the RFC-Editor: Please remove this section before publishing.¶
For CBOR encoding using YANG-SIDs identifiers, a ".sid" file is requested to IANA in Section 7.3.¶