| Internet-Draft | Stand-in Tags for YANG-CBOR | August 2025 |
| Bormann & Matejka | Expires 4 March 2026 | [Page] |
- Workgroup:
- CBOR (Concise Binary Object Representation) Maint. and Ext.
- Internet-Draft:
- draft-bormann-cbor-yang-standin-02
- Published:
- Intended Status:
- Standards Track
- Expires:
Stand-in Tags for YANG-CBOR
Abstract
YANG (RFC 7950) is a data modeling language used to model configuration data, state data, parameters and results of Remote Procedure Call (RPC) operations or actions, and notifications.¶
YANG-CBOR (RFC 9254) defines encoding rules for YANG in the Concise Binary Object Representation (CBOR) (RFC 8949). While the overall structure of YANG-CBOR is encoded in an efficient, binary format, YANG itself has its roots in XML and therefore traditionally encodes some information such as date/times and IP addresses/prefixes in a verbose text form.¶
This document defines how to use existing CBOR tags for this kind of information in YANG-CBOR as a "stand-in" for the text-based information that would be found in the original form of YANG-CBOR.¶
About This Document
This note is to be removed before publishing as an RFC.¶
Status information for this document may be found at https://datatracker.ietf.org/doc/draft-bormann-cbor-yang-standin/.¶
Discussion of this document takes place on the CBOR (Concise Binary Object Representation) Maintenance and Extensions 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/cabo/yang-standin.¶
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 4 March 2026.¶
Copyright Notice
Copyright (c) 2025 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.¶
1. Introduction
(see abstract)¶
2. Conventions and Definitions
The terminology of [RFC9254] applies.¶
- Legacy representation:
-
The (often text-based) representation for a YANG data item as used in YANG-XML, YANG-JSON, and (unchanged) YANG-CBOR.¶
- Stand-in tag:
-
A CBOR tag that can supply the information that is equivalent to a legacy representation in a more efficient format (e.g., using binary data).¶
- Encoder:
-
The party which generates (sends) CBOR data described by YANG.¶
- Intermediate Encoder:
-
An encoder which isn't the original author of the data, converting it from legacy representation.¶
- Aggressive Intermediate Encoder:
-
An intermediate encoder that might choose to discard some information of a legacy representation in order to be able to use a stand-in tag. Such a choice may be based on knowledge of the Decoder's handling of such information (e.g, to accommodate intolerant decoders), or it may be a general characteristic of the service provided by the intermediate encoder (e.g., in order to serve as a legacy-eschewing encoder).¶
- Legacy-Eschewing Encoder:
-
An encoder that does not generate legacy representations in places where a stand-in tag might instead be used. An intermediate encoder may need to be aggressive to achieve this.¶
- Decoder:
-
The party which receives and parses CBOR data described by YANG.¶
- Intolerant Decoder:
-
A decoder that does not accept legacy representations in places where a stand-in tag might instead be used. Such a decoder is designed to interoperate only with an legacy-eschewing encoder.¶
- Intermediate Decoder:
-
A decoder which isn't the final recipient of the data, converting it to legacy representation.¶
- Data Transfer:
-
A series of actions, generally beginning by data origination, encoding, continuing by optional intermediate transcoding, sending and receiving, and finally decoding and consuming.¶
- Round Trip:
-
Part of a data transfer between an encoder generating CBOR data with stand-in tags and a decoder parsing the data.¶
- Legacy Round Trip:
-
A Round Trip where the encoder is an intermediate encoder or the decoder is an intermediate decoder and any of these converts from or to the legacy representation.¶
- Unambiguous Round Trip:
-
A Legacy Round Trip that provides exactly the same legacy representation (not just semantically equivalent). The stand-in tag is also said to "unambiguously stand in" for the legacy representation.¶
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 [BCP14] (RFC2119) (RFC8174) when, and only when, they appear in all capitals, as shown here.¶
5. Negotiation
Introducing stand-in tags in YANG-CBOR requires some form of consent between the producer and the consumer of YANG-CBOR information:¶
-
A producer that creates YANG-CBOR containing stand-in tags needs to know whether the consumer supports stand-in tags, and, possibly, which specific stand-in tags it supports. We speak about the capability of a consumer to consume stand-in tags. A producer MUST NOT employ stand-in tags unless it knows about the capabilities of the consumer. A consumer SHOULD indicate its capabilities for consuming stand-in tags.¶
-
A consumer may not want to implement certain legacy text-based representations where more efficient (and easy to implement) stand-in tags are available, i.e., it may use an intolerant decoder. This places a requirement on the producer to use a legacy-eschewing encoder (which therefore needs to have the capability to produce YANG-CBOR where those stand-in tags are used, in place of legacy representations). Where the consumer employs an intolerant decoder, stand-in tags are required by the consumer: for interoperating with a producer's encoder, this MUST be legacy-eschewing, i.e. it MUST NOT employ legacy representations. A consumer that has requirements for only receiving stand-in tags in place of legacy representations, MUST indicate this to the producer.¶
ISSUE: Where do we put those two aspects of negotiation?¶
6. Security Considerations
TODO Security¶
7. IANA Considerations
7.1. New CBOR Tags
In the registry "CBOR Tags" [IANA.cbor-tags], IANA is requested to assign the tag in Table 4.¶
7.3. media-type parameters
ISSUE: Should the use of stand-in tags be mentioned in the various YANG-CBOR-based media types (as a media type parameter)?¶
Compare how application/yang-data+cbor can use id=name/id=sid to indicate another encoding decision.¶
8. References
8.1. Normative References
- [BCP14]
-
Best Current Practice 14, <https://www.rfc-editor.org/info/bcp14>.
At the time of writing, this BCP comprises the following:Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/info/rfc2119>.Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/info/rfc8174>. - [I-D.ietf-netmod-rfc6991-bis]
- Schönwälder, J., "Common YANG Data Types", Work in Progress, Internet-Draft, draft-ietf-netmod-rfc6991-bis-18, , <https://datatracker.ietf.org/doc/html/draft-ietf-netmod-rfc6991-bis-18>.
- IANA, "Concise Binary Object Representation (CBOR) Tags", <https://www.iana.org/assignments/cbor-tags>.
- [RFC5952]
- Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 Address Text Representation", RFC 5952, DOI 10.17487/RFC5952, , <https://www.rfc-editor.org/rfc/rfc5952>.
- [RFC6021]
- Schoenwaelder, J., Ed., "Common YANG Data Types", RFC 6021, DOI 10.17487/RFC6021, , <https://www.rfc-editor.org/rfc/rfc6021>.
- [RFC8943]
- Jones, M., Nadalin, A., and J. Richter, "Concise Binary Object Representation (CBOR) Tags for Date", RFC 8943, DOI 10.17487/RFC8943, , <https://www.rfc-editor.org/rfc/rfc8943>.
- [RFC9164]
- Richardson, M. and C. Bormann, "Concise Binary Object Representation (CBOR) Tags for IPv4 and IPv6 Addresses and Prefixes", RFC 9164, DOI 10.17487/RFC9164, , <https://www.rfc-editor.org/rfc/rfc9164>.
- [RFC9254]
- Veillette, M., Ed., Petrov, I., Ed., Pelov, A., Bormann, C., and M. Richardson, "Encoding of Data Modeled with YANG in the Concise Binary Object Representation (CBOR)", RFC 9254, DOI 10.17487/RFC9254, , <https://www.rfc-editor.org/rfc/rfc9254>.
- [RFC9562]
- Davis, K., Peabody, B., and P. Leach, "Universally Unique IDentifiers (UUIDs)", RFC 9562, DOI 10.17487/RFC9562, , <https://www.rfc-editor.org/rfc/rfc9562>.
- [STD94]
-
Internet Standard 94, <https://www.rfc-editor.org/info/std94>.
At the time of writing, this STD comprises the following:Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", STD 94, RFC 8949, DOI 10.17487/RFC8949, , <https://www.rfc-editor.org/info/rfc8949>.
8.2. Informative References
- Bormann, C., "Notable CBOR Tags", Work in Progress, Internet-Draft, draft-bormann-cbor-notable-tags-13, , <https://datatracker.ietf.org/doc/html/draft-bormann-cbor-notable-tags-13>.
- [RFC9542]
- Eastlake 3rd, D., Abley, J., and Y. Li, "IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters", BCP 141, RFC 9542, DOI 10.17487/RFC9542, , <https://www.rfc-editor.org/rfc/rfc9542>.
- [RFC9557]
- Sharma, U. and C. Bormann, "Date and Time on the Internet: Timestamps with Additional Information", RFC 9557, DOI 10.17487/RFC9557, , <https://www.rfc-editor.org/rfc/rfc9557>.
Acknowledgments
TODO acknowledge.¶