Extending YANG modules at runtime
Internet-Draft draft-richardson-netmod-atrest-extensions-00
Michael Richardson
Sandelman Software Works
mcr+ietf@sandelman.ca
27 September 2024
Internet
NETMOD Working Group
Internet-Draft
This document describes a mechanism of signaling extensions to YANG modules that can be used when YANG is not used in an online fashion.
About This Document
Status information for this document may be found at https://datatracker.ietf.org/doc/draft-richardson-netmod-atrest-extensions/.
Discussion of this document takes place on the cbor Working Group mailing list (mailto:cbor@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/cbor/. Subscribe at https://www.ietf.org/mailman/listinfo/cbor/.
Source for this draft and an issue tracker can be found at https://github.com/mcr/yang-extensions-at-reset.
Introduction
In the process of revising [RFC8366] to accomodate needed extensions an effort was initially made to do this using augment (cite) and later augment-structure. [RFC8366] is a digitally signed voucher format used in onboarding of new devices. It is a file format that may be transmitted over CoAP, HTTP or via USB key, but it does not use RESTCONF. The contents of the file are not subject to negotiation as might be done with [RFC8528].
Rather than have each topic document define the relevant extensions needed, it turned out to be necessary to collect all the extensions necessary into a single revision to the YANG module, which is being produced as [I-D.ietf-anima-rfc8366bis].
[RFC8520] is like [RFC8366]: it is a file format. When [RFC8520] was defined, it anticipated that there would be future extensions, and defined a YANG leaf called "extensions" which is a list of subsequent YANG modules which are included. This is being used to define, for instance, [I-D.ietf-opsawg-ol].
When YANG is serialized to XML or JSON, the keys used in the attribute map are strings, and so it seems relatively straightforward for a human programmer to understand how to insert these new keys into the same attribute map. YANG however, is intended to be machine parseable, and [RFC9254] provides a way to serialize YANG to CBOR. While strings can be used if necessary, the preferred method is via YANG-SID values, allocated for instance, via [RFC9595]. It is not obvious how an extension mechanism as described by [RFC8520] can be efficiently encoded to CBOR, nor how YANG tooling should react to these ad-hoc extensions.
This document makes the [RFC8520] extension mechanism a generic mechanism that can be used by any YANG module, and explains how to efficiently encode this to CBOR using YANG-SID.
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.
Motivation
XXX - Do we need more details about the motivation?
Protocol
Extensions
A YANG module that expects to have extensions establishes an attribute called "extensions" This attribute value is a list of extensions that are included in this object. This set of available values is established as an IANA registry by the document defining the module.
(XXX- this assumes per-module extensions, vs a global set of extensions that could be used by many modules)
When encoding YANG as CBOR, in order to encode the additional attributes defined by that extension, a new sub-map is created. The key for this sub-map, in the parent map, consists of the YANG module SID, encoded using the CBOR Tag 47, the tag for an absolute SID. Within the sub-map, the normal delta-encoding is used, using the SID values allocated for that module.
(XXX- the submap should allow to XML and JSON too?)
Privacy Considerations
YYY
Security Considerations
ZZZ
IANA Considerations
Acknowledgements
Hello.
Changelog
References
Normative References
[RFC9254]

Encoding of Data Modeled with YANG in the Concise Binary Object Representation (CBOR)
M. Veillette, Ed.
I. Petrov, Ed.
A. Pelov
C. Bormann
M. Richardson
July 2022
RFC 9254
DOI 10.17487/RFC9254
[RFC9595]

YANG Schema Item iDentifier (YANG SID)
M. Veillette, Ed.
A. Pelov, Ed.
I. Petrov, Ed.
C. Bormann
M. Richardson
July 2024
RFC 9595
DOI 10.17487/RFC9595
[RFC2119]

Key words for use in RFCs to Indicate Requirement Levels
S. Bradner
March 1997
BCP 14
RFC 2119
DOI 10.17487/RFC2119
[RFC8174]

Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
B. Leiba
May 2017
BCP 14
RFC 8174
DOI 10.17487/RFC8174
Informative References
[RFC8366]

A Voucher Artifact for Bootstrapping Protocols
K. Watsen
M. Richardson
M. Pritikin
T. Eckert
May 2018
RFC 8366
DOI 10.17487/RFC8366
[RFC8528]

YANG Schema Mount
M. Bjorklund
L. Lhotka
March 2019
RFC 8528
DOI 10.17487/RFC8528
[I-D.ietf-anima-rfc8366bis]

A Voucher Artifact for Bootstrapping Protocols
Kent Watsen
Watsen Networks
Michael Richardson
Sandelman Software
Max Pritikin
Cisco Systems
Toerless Eckert
Futurewei Technologies Inc.
Qiufang Ma
Huawei
8 July 2024
Internet-Draft draft-ietf-anima-rfc8366bis-12
[RFC8520]

Manufacturer Usage Description Specification
E. Lear
R. Droms
D. Romascanu
March 2019
RFC 8520
DOI 10.17487/RFC8520
[I-D.ietf-opsawg-ol]

Ownership and licensing statements in YANG
Eliot Lear
Cisco Systems
Carsten Bormann
UniversitÃ¤t Bremen TZI
27 April 2024
Internet-Draft draft-ietf-opsawg-ol-06