Internet-Draft | YANG Schema Item iDentifier (YANG SID) | November 2021 |
Veillette, et al. | Expires 22 May 2022 | [Page] |
YANG Schema Item iDentifiers (YANG SID) are globally unique 63-bit unsigned integers used to identify YANG items, as a more compact method to identify YANG items that can be used for efficiency and in constrained environments (RFC 7228). This document defines the semantics, the registration, and assignment processes of YANG SIDs for IETF managed YANG modules. To enable the implementation of these processes, this document also defines a file format used to persist and publish assigned YANG SIDs.¶
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 22 May 2022.¶
Copyright (c) 2021 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.¶
Some of the items defined in YANG [RFC7950] require the use of a unique identifier. In both Network Configuration Protocol (NETCONF) [RFC6241] and RESTCONF [RFC8040], these identifiers are implemented using names. To allow the implementation of data models defined in YANG in constrained devices [RFC7228] and constrained networks, a more compact method to identify YANG items is required. This compact identifier, called YANG Schema Item iDentifier or YANG SID (or simply SID in this document and when the context is clear), is encoded using a 63-bit unsigned integer. The limitation to 63-bit unsigned integers allows SIDs to be manipulated more easily on platforms that might otherwise lack 64-bit unsigned arithmetic. The loss of a single bit of range is not significant given the size of the remaining space.¶
The following items are identified using SIDs:¶
It is possible that some protocols use only a subset of the assigned SIDs, for example, for protocols equivalent to NETCONF [RFC6241] like [I-D.ietf-core-comi] the transportation of YANG module SIDs might be unnecessary. Other protocols might need to be able to transport this information, for example protocols related to discovery such as Constrained YANG Module Library [I-D.ietf-core-yang-library].¶
SIDs are globally unique integers. A registration system is used in order to guarantee their uniqueness. SIDs are registered in blocks called "SID ranges".¶
SIDs are assigned permanently. Items introduced by a new revision of a YANG module are added to the list of SIDs already assigned. Assignment of SIDs to YANG items are usually automated as discussed in Appendix B, which also discusses some cases where manual interventions may be appropriate.¶
Section 3 provides more details about the registration process of YANG modules and associated SIDs. To enable the implementation of this registry, Section 4 defines a standard file format used to store and publish SIDs.¶
IETF managed YANG modules that need to allocate SIDs use the IANA mechanism specified in this document. YANG modules created by other parties allocate SID ranges using the IANA allocation mechanisms via Mega-Ranges (see Section 7.3); within the Mega-Range allocation, those other parties are free to make up their own mechanism.¶
At the time of writing, a tool for automated ".sid" file generation is available as part of the open-source project PYANG [PYANG].¶
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 [RFC7950]:¶
The following term is defined in [RFC8040]:¶
This specification also makes use of the following terminology:¶
YANG is a language designed to model data accessed using one of the compatible protocols (e.g. NETCONF [RFC6241], RESTCONF [RFC8040] and CORECONF [I-D.ietf-core-comi]). A YANG module defines hierarchies of data, including configuration, state data, RPCs, actions and notifications.¶
Many YANG modules are not created in the context of constrained applications. YANG modules can be implemented using NETCONF [RFC6241] or RESTCONF [RFC8040] without the need to assign SIDs.¶
As needed, authors of YANG modules can assign SIDs to their YANG modules. In order to do that, they should first obtain a SID range from a registry and use that range to assign or generate SIDs to items of their YANG module. The assignments can then be stored in a ".sid" file. For example on how this could be achieved, please refer to Appendix C.¶
Registration of the ".sid" file associated to a YANG module is optional but recommended to promote interoperability between devices and to avoid duplicate allocation of SIDs to a single YANG module. Different registries might have different requirements for the registration and publication of the ".sid" files. For a diagram of one of the possibilities, please refer to the activity diagram on Figure 4 in Appendix C.¶
Each time a YANG module or one of its imported module(s) or included sub-module(s) is updated, a new ".sid" file MAY be created if the new or updated items will need SIDs. All the SIDs present in the previous version of the ".sid" file MUST be present in the new version as well. The creation of this new version of the ".sid" file SHOULD be performed using an automated tool.¶
If a new revision requires more SIDs than initially allocated, a new SID range MUST be added to the 'assignment-range' as defined in Section 4. These extra SIDs are used for subsequent assignments.¶
For an example of this update process, see activity diagram Figure 5 in Appendix C.¶
".sid" files are used to persist and publish SIDs assigned to the different YANG items of a specific YANG module. It has the following structure.¶
The following YANG module defines the structure of this file, encoding is performed in JSON [RFC8259] using the rules defined in [RFC7951]. It references ietf-yang-types defined in [RFC6991] and ietf-restconf defined in [RFC8040].¶
RFC Ed.: please update the date of the module and Copyright if needed and remove this note.¶
The following Content-Type has been defined in [I-D.ietf-core-yang-cbor]:¶
This Content-Type represents a CBOR YANG document containing one or multiple data node values. Each data node is identified by its associated SID.¶
FORMAT: CBOR map of SID, instance-value¶
The message payload of Content-Type 'application/yang-data+cbor' is encoded using a CBOR map. Each entry within the CBOR map contains the data node identifier (i.e. SID) and the associated instance-value. Instance-values are encoded using the rules defined in Section 4 of [I-D.ietf-core-yang-cbor].¶
This document defines a new type of identifier used to encode data that are modeled in YANG [RFC7950]. This new identifier maps semantic concepts to integers, and if the source of this mapping is not trusted, then new security risks might occur if an attacker can control the mapping.¶
At the time of writing, it is expected that the SID files will be processed by a software developer, within a software development environment. Developers are advised to only import SID files from authoritative sources. IANA is the authoritative source for IETF managed YANG modules.¶
Conceptually, SID files could be processed by less-constrained target systems such as network management systems. Such systems need to take extra care to make sure that they are only processing SID files from authoritative sources, as authoritative as the YANG modules that they are using.¶
This document registers the following XML namespace URN in the "IETF XML Registry", following the format defined in [RFC3688]:¶
URI: please assign urn:ietf:params:xml:ns:yang:ietf-sid-file¶
Registrant Contact: The IESG.¶
XML: N/A, the requested URI is an XML namespace.¶
Reference: RFC XXXX¶
// RFC Ed.: please replace XXXX with RFC number and remove this note¶
This document registers one YANG module in the "YANG Module Names" registry [RFC6020]:¶
// RFC Ed.: please replace XXXX with RFC number and remove this note¶
The name of this registry is "YANG SID Mega-Range". This registry is used to record the delegation of the management of a block of SIDs to third parties (such as SDOs or registrars).¶
Each entry in this registry must include:¶
The IANA policy for future additions to this registry is "Expert Review" [RFC8126].¶
An organization requesting to manage a YANG SID Range (and thus have an entry in the YANG SID Mega-Range Registry), must ensure the following capacities:¶
The capacity to manage and operate a YANG SID Range Registry. A YANG SID Range Registry MUST provide the following information for all YANG SID Ranges allocated by the Registry:¶
Type: Public or Private¶
If a size of the allocation beyond 1 000 000 is desired, the organization must demonstrate the sustainability of the technical approach for utilizing this size of allocation and how it does not negatively impact the overall usability of the SID allocation mechanisms; such allocations are preferably placed in the space above 4 295 000 000 (64-bit space).¶
For a first allocation to be provided, the requesting organization must demonstrate a functional registry infrastructure.¶
On subsequent allocation request(s), the organization must demonstrate the exhaustion of the prior range. These conditions need to be asserted by the assigned expert(s).¶
If that extra-allocation is done within 3 years from the last allocation, the experts need to discuss this request on the CORE working group mailing list and consensus needs to be obtained before allocating a new Mega-Range.¶
The initial entry in this registry is allocated to IANA:¶
Entry Point | Size | Allocation | Organization name | URL |
---|---|---|---|---|
0 | 1000000 | Public | IANA | iana.org |
The first million SIDs assigned to IANA is sub-divided as follows:¶
The range of 1000 to 59,999 (size 59,000) is designated for YANG modules defined in RFCs.¶
Entry Point | Size | IANA policy |
---|---|---|
0 | 1,000 | IESG Approval |
1,000 | 59,000 | RFC Required |
60,000 | 40,000 | Experimental/Private use |
100,000 | 900,000 | Reserved |
The size of the SID range allocated for a YANG module is recommended to be a multiple of 50 and to be at least 33% above the current number of YANG items. This headroom allows assignment within the same range of new YANG items introduced by subsequent revisions. The SID range size SHOULD NOT exceed 1000; a larger size may be requested by the authors if this recommendation is considered insufficient. It is important to note that an additional SID range can be allocated to an existing YANG module if the initial range is exhausted; this then just leads to slightly less efficient representation.¶
In case a SID range is allocated for an existing RFC through the "Expert Review" policy, the Document reference field for the given allocation should point to the RFC that the YANG module is defined in.¶
In case a SID range is required before publishing the RFC due to implementations needing stable SID values, early allocation as defined in [BCP100] can be employed. As specified in Section 4.6 of [RFC8126], RFCs and by extension documents that are expected to become an RFC fulfill the requirement for "Specification Required" stated in Section 2 of [BCP100], which allows for the early allocation process to be employed.¶
For a YANG module approved for publication as an RFC, a ".sid" file SHOULD be included in the Internet-Draft as a source code block. This ".sid" file is to be extracted by IANA/the expert reviewer and put into the YANG SID Registry (Section 7.5) along with the YANG module. The ".sid" file MUST NOT be published as part of the RFC: the IANA Registry is authoritative and a link is to be inserted in the RFC.¶
Initial entries in this registry are as follows:¶
Entry Point | Size | Module name | Document reference |
---|---|---|---|
0 | 1 | (Reserved: not a valid SID) | RFCXXXX |
1000 | 100 | ietf-coreconf | [I-D.ietf-core-comi] |
1100 | 50 | ietf-yang-types | [RFC6991] |
1150 | 50 | ietf-inet-types | [RFC6991] |
1200 | 50 | iana-crypt-hash | [RFC7317] |
1250 | 50 | ietf-netconf-acm | [RFC8341] |
1300 | 50 | ietf-sid-file | RFCXXXX |
1500 | 100 | ietf-interfaces | [RFC8343] |
1600 | 100 | ietf-ip | [RFC8344] |
1700 | 100 | ietf-system | [RFC7317] |
1800 | 400 | iana-if-type | [RFC7224] |
2400 | 50 | ietf-voucher | [RFC8366] |
2450 | 50 | ietf-constrained-voucher | [I-D.ietf-anima-constrained-voucher] |
2500 | 50 | ietf-constrained-voucher-request | [I-D.ietf-anima-constrained-voucher] |
// RFC Ed.: replace XXXX with RFC number assigned to this draft.¶
For allocation, RFC publication of the YANG module is required as per [RFC8126]. The YANG module must be registered in the "YANG module Name" registry according to the rules specified in Section 14 of [RFC6020].¶
The name of this registry is "IETF YANG SID Registry". This registry is used to record the allocation of SIDs for individual YANG module items.¶
Each entry in this registry must include:¶
The allocation policy is Expert review. The Expert MUST ensure that the following conditions are met:¶
The ".sid" file has a valid structure:¶
The ".sid" file allocates individual SIDs ONLY in the YANG SID Ranges for this YANG module (as allocated in the IETF YANG SID Range Registry):¶
Due to the difficulty in changing SID values during IETF document processing, it is expected that most documents will ask for SID allocations using Early Allocations [BCP100]. The details of the Early Allocation should be included in any Working Group Adoption call. Prior to Working Group Adoption, an internet draft author can use the experimental SID range (as per Section 7.4.2) for their SIDs allocations or other values that do not create ambiguity with other SID uses (for example they can use a range that comes from a non-IANA managed "YANG SID Mega-Range" registry).¶
After Working Group Adoption, any modification of a ".sid" file is expected to be discussed on the mailing list of the appropriate Working Groups. Specific attention should be paid to implementers' opinion after Working Group Last Call if a SID value is to change its meaning. In all cases, a ".sid" file and the SIDs associated with it are subject to change before the publication of an internet draft as an RFC.¶
During the early use of SIDs, many existing, previously published YANG modules will not have SID allocations. For an allocation to be useful the included YANG modules may also need to have SID allocations made.¶
The Expert Reviewer who performs the (Early) Allocation analysis will need to go through the list of included YANG modules and perform SID allocations for those modules as well.¶
At the end of the IETF process all the dependencies of a given module for which SIDs are assigned, should also have SIDs assigned. Those dependencies' assignments should be permanent (not Early Allocation).¶
A previously SID-allocated YANG module which changes its references to include a YANG module for which there is no SID allocation needs to repeat the Early Allocation process.¶
Early Allocations are made with a one-year period, after which they are expired. [BCP100] indicates that at most one renewal may be made. For the SID allocation a far more lenient stance is desired.¶
This is driven by the very generous size of the SID space and the often complex and deep dependencies of YANG modules. Often a core module with many dependencies will undergo extensive review, delaying the publication of other documents.¶
Note that if a document is submitted for review to the IESG and at the time of submission some early allocations are valid (not expired), these allocations should not be expired while the document is under IESG consideration or waiting in the RFC Editor's queue after approval by the IESG.¶
The following ".sid" file (ietf-system@2014-08-06.sid) has been generated using the following yang modules:¶
For purposes of exposition, line breaks have been introduced below in some JSON strings that represent overly long identifiers.¶
For reconstructing the actual JSON file from this figure, all line breaks that occur in what would be JSON strings need to be removed, including any following blank space (indentation) on the line after the line break; in each such case, a single identifier without any embedded blank space results. This removal can be accomplished with this simple Ruby script:¶
@u = %{[^"\n]*}; @q = @u + '"' puts ARGF.read.gsub(/^(#@q(#@q#@q)*#@u) *\n +(#@q)/, "\\1\\3")¶
Assignment of SIDs to YANG items SHOULD be automated. The recommended process to assign SIDs is as follows:¶
When updating a YANG module that is in active use, the existing SID assignments are maintained. (In contrast, when evolving an early draft that has not yet been adopted by a community of developers, SID assignments are often better done from scratch after a revision.) If the name of a schema node changes, but the data remain structurally and semantically similar to what was previously available under an old name, the SID that was used for the old name MAY continue to be used for the new name. If the meaning of an item changes, a new SID MAY be assigned to it; this is particularly useful to allow the new SID to identify the new structure or semantics of the item. If the YANG data type changes in a new revision of a published module, such that the resulting CBOR encoding is changed, then implementations will be aided significantly if a new SID is assigned. Note that these decisions are generally at the discretion of the YANG module author, who should decide if the benefits of a manual intervention are worth the deviation from automatic assignment.¶
In case of an update to an existing ".sid" file, an additional step is needed that increments the ".sid" file version number. If there was no version number in the previous version of the ".sid" file, 0 is assumed as the version number of the old version of the ".sid" file and the version number is 1 for the new ".sid" file. Apart from that, changes of ".sid" files can also be automated using the same method described above, only unassigned YANG items are processed at step #3. Already existing items in the ".sid" file should not be given new SIDs.¶
Note that ".sid" file versions are specific to a YANG module revision. For each new YANG module or each new revision of an existing YANG module, the version number of the initial ".sid" file should either be 0 or should not be present.¶
Note also that RPC or action "input" and "output" data nodes MUST always be assigned SID even if they don't contain data nodes. The reason for this requirement is that other modules can augment the given module and those SIDs might be necessary.¶
Before assigning SIDs to their YANG modules, YANG module authors must acquire a SID range from a "YANG SID Range Registry". If the YANG module is part of an IETF draft or RFC, the SID range need to be acquired from the "IETF YANG SID Range Registry" as defined in Section 7.4. For the other YANG modules, the authors can acquire a SID range from any "YANG SID Range Registry" of their choice.¶
Once the SID range is acquired, owners can use it to generate ".sid" file/s for their YANG module/s. It is recommended to leave some unallocated SIDs following the allocated range in each ".sid" file in order to allow better evolution of the YANG module in the future. Generation of ".sid" files should be performed using an automated tool. Note that ".sid" files can only be generated for YANG modules and not for submodules.¶
The following activity diagram summarizes the creation of a YANG module and its associated ".sid" file.¶
The following Activity diagram summarizes the update of a YANG module and its associated ".sid" file.¶
The authors would like to thank Andy Bierman, Michael Richardson, Abhinav Somaraju, Peter van der Stok, Laurent Toutain and Randy Turner for their help during the development of this document and their useful comments during the review process.¶