| Internet-Draft | yang-normalization | October 2026 |
| Méndez & López | Expires 25 April 2027 | [Page] |
This document defines a normalization procedure for YANG-modeled information. The procedure enables different serialized representations conveying equivalent information to produce the same normalized representation independently of the input encoding and applicable representation conventions. The normalized representation is intended to support comparison, hashing, integrity verification, provenance, and other procedures that require consistent representation of equivalent YANG-modeled information.¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://ana-mp26.github.io/yang-state-normalization/draft-mendez-opsawg-yang-normalization.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-mendez-opsawg-yang-normalization/.¶
Discussion of this document takes place on the Operations and Management Area Working Group Working Group mailing list (mailto:opsawg@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/opsawg/. Subscribe at https://www.ietf.org/mailman/listinfo/opsawg/.¶
Source for this draft and an issue tracker can be found at https://github.com/ana-mp26/yang-state-normalization.¶
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 25 April 2027.¶
Copyright (c) 2026 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.¶
YANG is widely used to model configuration data, operational state, notifications, and other information exchanged between network management systems.¶
Data modeled using YANG can be represented through different encodings, including XML, JSON, and CBOR. Furthermore, equivalent YANG-modeled information may be serialized differently by distinct implementations due to representation-specific conventions, ordering choices, or encoding mechanisms.¶
These differences make it difficult to determine whether two representations convey the same information. As a result, operations such as datastore comparison, data deduplication, fingerprint generation, integrity verification, provenance processing, and message-broker compaction often depend on representation-specific artifacts rather than on the underlying information itself.¶
Existing canonicalization mechanisms operate at the encoding level. For example, XML, JSON, and CBOR provide independent procedures for producing deterministic encodings of individual documents. However, these mechanisms do not address the broader problem of obtaining a common representation across different encodings.¶
This document defines a normalization procedure for YANG-modeled information that produces a deterministic representation independent of the original encoding. The procedure enables equivalent YANG-modeled information to converge into the same normalized representation, providing a stable basis for comparison, fingerprint generation, integrity verification, and other operational uses.¶
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.¶
Representation: A concrete serialized einstance of YANG-modeled data. Examples include XML, JSON, and CBOR encodings conveying the same underlying information.¶
Normalized Representation: A deterministic representation generated by the normalization procedure defined in this document.¶
Representation Equivalence: Two representations are representation-equivalent when they produce identical normalized representations.¶
Fingerprint: A cryptographic digest calculated from a normalized representation.¶
Schema-Independent Normalization: A normalization procedure that does not require access to the corresponding YANG schema during processing.¶
Semantic Equivalence: The property whereby two representations correspond to the same YANG-modeled information after considering all schema-dependent semantics.¶
YANG-modeled data can be represented using different encodings, including XML [RFC7950], JSON [RFC7951], and CBOR [RFC9254].¶
Existing canonicalization mechanisms operate within a particular encoding and produce deterministic representations of individual documents. Examples include XML Canonicalization (XML-C14N), the JSON Canonicalization Scheme (JCS) [RFC8785], and the deterministic encoding rules defined for CBOR [RFC8949].¶
These mechanisms enable a representation expressed using a particular encoding to be transformed into a deterministic byte sequence. However, they do not provide a common representation across different encodings, nor do they necessarily address all representation variations that may arise from encoding rules or implementation choices.¶
Ordering is one possible source of such variation. These differences may arise from implementation choices, internal datastore representations, module augmentations, or serialization procedures.¶
For example, one implementation may produce:¶
<aaa> <bbb/> <ccc/> <ddd/> </aaa>¶
while another implementation may produce:¶
<aaa> <ddd/> <bbb/> <ccc/> </aaa>¶
If the order of these nodes is not semantically significant, both serialized representations convey equivalent information despite having different element ordering and byte sequences.¶
As a result, equivalent YANG-modeled information may produce different serialized representations and therefore different fingerprints, hashes, or signatures. Direct comparison of serialized representations cannot reliably determine whether two representations convey the same information.¶
A normalization procedure operating above the encoding-specific representation layer is therefore needed to enable representation-independent comparison of YANG-modeled data.¶
The absence of a representation-independent form of YANG-modeled data affects several operational scenarios, including:¶
Datastore State Comparison: Network management systems frequently compare datastore snapshots obtained from different devices, controllers, or processing stages. Equivalent YANG-modeled data represented through different encodings or ordering conventions may appear different when compared directly, despite conveying the same information.¶
Message Broker Applications: YANG-modeled information is increasingly exchanged through message broker infrastructures and data distribution systems. Consistent representation of equivalent information can support operations such as message deduplication, topic compaction, change detection, and content synchronization.¶
Data Synchronization and Replication: Operational environments frequently exchange YANG-modeled data between multiple systems. A deterministic normalized representation can simplify data comparison, synchronization procedures, and consistency verification across distributed environments.¶
Data Deduplication: Storage and processing systems may benefit from the ability to identify equivalent information independently of the original representation. A normalized representation provides a stable basis for content identification and deduplication.¶
Provenance and Integrity Verification: Where stable and deterministic representations are required to generate reproducible fingerprints, hashes, and signatures and provenance records.¶
The normalization procedure takes a serialized YANG data document as input and produces a deterministic normalized representation.¶
The procedure parses the input document according to its encoding and constructs an abstract syntax tree (AST) of the serialized data representation. Abstract syntax trees are described in Section 1.1 of [Harper2016].¶
For the purposes of this document, the AST does not represent every detail of the concrete input syntax. It preserves only the structural and content-related information required by the normalization procedure. This information consists of node identifiers, textual values, hierarchical relationships, and node multiplicity.¶
The AST provides a common, encoding-independent representation of serialized YANG-modeled data. It is constructed without consulting a YANG schema. Consequently, it represents the observable structure and textual values exposed by the serialized document but does not resolve schema-dependent YANG semantics.¶
The tree contains a synthetic document root. The synthetic root provides a common container for the top-level nodes of the serialized input document. It does not correspond to a YANG data node and uses an empty identifier reserved for this purpose.¶
Each node below the synthetic document root has a non-empty identifier and is one of the following:¶
a leaf node, which contains a textual value and has no child nodes;¶
an inner node, which contains zero or more child nodes and has no textual value.¶
A node cannot contain both a textual value and child nodes. The abstract syntax tree preserves node multiplicity. Multiple nodes may have the same identifier, and identical nodes are not implicitly removed.¶
The input document is first parsed according to the syntax and structure of the selected encoding. Malformed input or an unsupported document structure causes normalization to fail.¶
The procedure creates the synthetic document root and adds the top-level data nodes obtained from the serialized document as its children.¶
The following conceptual rules are then applied:¶
An XML element, JSON object member, or CBOR map entry that contains nested data is represented as an inner node.¶
An XML element, JSON object member, or CBOR map entry that contains a scalar value is represented as a leaf node.¶
The name exposed by the input encoding is used to derive the node identifier.¶
A sequence of data items is represented as sibling nodes having the identifier associated with the sequence. The sequence itself does not produce an additional node.¶
An empty sequence produces no nodes.¶
An empty structured value is represented as an inner node having no children.¶
The encoding-specific representation of the YANG empty type is represented as a leaf having an empty textual value.¶
Scalar values are converted to textual form.¶
The same construction rules are applied to every nested data item until the complete abstract data tree has been constructed.¶
These rules are recursive in definition. An implementation is not required to use recursion internally, provided that it produces the same abstract data tree.¶
XML attributes are not represented in the abstract data tree defined by this version, the treatment of attributes is TBD. XML elements and their textual content are processed as data-tree nodes and values, respectively.¶
TBD: Specify the treatment of YANG metadata annotations, namespace-qualified identifiers, namespace declarations, format-specific constructs, and malformed or unsupported input structures. This initial version focuses on the fundamental normalization procedure. The treatment of schema-specific semantics, including default values, identityref and leafref resolution, and ordered-by-user semantics, is TBD. Further versions of this document are expected to determine whether these aspects require specific normalization rules or are inherently addressed by the general normalization procedure. Where specific handling is required to preserve equivalence, the corresponding rules will be incorporated into the normalization procedure.¶
The same YANG-modeled information MUST produce the same normalized representation regardless of the original serialization format.¶
Serialized YANG Data Document
XML / JSON / CBOR
|
v
Encoding-Specific Parsing
|
v
Abstract Data Tree
|
v
Identifier and Value Processing
|
v
Deterministic Subtree Encoding
|
v
Child Node Sorting
|
v
Normalized Byte Representation
|
v
Comparison / Hashing / Signing /...
¶
This section illustrates how equivalent YANG-modeled data represented using different serialization formats and encodings can produce the same normalized representation. The following XML and JSON representations examples are based on the interface data model originally defined in [RFC7223] and convey equivalent information.¶
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces"
xmlns:iana-if-type="urn:ietf:params:xml:ns:yang:iana-if-type"
xmlns:vlan="http://example.com/vlan">
<interface>
<name>eth0</name>
<type>iana-if-type:ethernetCsmacd</type>
<enabled>false</enabled>
</interface>
<interface>
<name>eth1</name>
<type>iana-if-type:ethernetCsmacd</type>
<enabled>true</enabled>
<vlan:vlan-tagging>true</vlan:vlan-tagging>
</interface>
<interface>
<name>eth1.10</name>
<type>iana-if-type:l2vlan</type>
<enabled>true</enabled>
<vlan:base-interface>eth1</vlan:base-interface>
<vlan:vlan-id>10</vlan:vlan-id>
</interface>
<interface>
<name>lo1</name>
<type>iana-if-type:softwareLoopback</type>
<enabled>true</enabled>
</interface>
</interfaces>
¶
{
"ietf-interfaces:interfaces": {
"interface": [
{
"enabled": true,
"name": "lo1",
"type": "iana-if-type:softwareLoopback"
},
{
"vlan:vlan-id": 10,
"enabled": true,
"type": "iana-if-type:l2vlan",
"vlan:base-interface": "eth1",
"name": "eth1.10"
},
{
"enabled": false,
"type": "iana-if-type:ethernetCsmacd",
"name": "eth0"
},
{
"vlan:vlan-tagging": true,
"name": "eth1",
"enabled": true,
"type": "iana-if-type:ethernetCsmacd"
}
]
}
}
¶
The following non-normative textual tree illustrates the intended outcome: equivalent XML, JSON, and CBOR representations are expected to produce the same normalized representation.¶
interfaces ├─ interface │ ├─ enabled = true │ ├─ name = lo1 │ └─ type = iana-if-type:softwareLoopback ├─ interface │ ├─ enabled = false │ ├─ name = eth0 │ └─ type = iana-if-type:ethernetCsmacd ├─ interface │ ├─ enabled = true │ ├─ name = eth1 │ ├─ type = iana-if-type:ethernetCsmacd │ └─ vlan-tagging = true └─ interface ├─ base-interface = eth1 ├─ enabled = true ├─ name = eth1.10 ├─ type = iana-if-type:l2vlan └─ vlan-id = 10¶
The normalization procedure defined in this document is intended to complement existing efforts related to the processing, identification, and distribution of YANG-modeled information.¶
The YANG provenance mechanisms defined in [I-D.ietf-opsawg-yang-provenance] operate on serialized representations of YANG data and can benefit from a stable, representation-independent normalization procedure capable of producing equivalent representations across different serialization formats.¶
Similarly, work related to message broker identification and key generation for YANG-modeled information, such as [I-D.ietf-nmop-yang-message-broker-message-key], may benefit from a normalization procedure that produces stable representations for equivalent information independently of their original encoding.¶
This document does not modify or replace such mechanisms. Instead, it provides a potential foundation that can be used by higher-level procedures requiring consistent representation of equivalent YANG-modeled information.¶
The normalization procedure defined in this document is intended to provide a deterministic representation of YANG-modeled data. It does not, by itself, provide integrity, authenticity, confidentiality, or provenance guarantees.¶
Security properties may be obtained by applying appropriate mechanisms, such as cryptographic hash functions, digital signatures, or provenance procedures, to the resulting normalized representation. Implementations relying on the normalized representation for integrity verification or provenance applications MUST use cryptographically secure algorithms appropriate for the intended use case. Incorrect normalization procedures may result in different representations producing the same normalized output or in equivalent information producing different normalized representations. Such situations may negatively affect comparison, fingerprint generation, and verification procedures.¶
This document has no IANA actions.¶
An open-source reference implementation, written in Java, is available at https://github.com/tefiros/yang-data-normalization.¶
This document is based on work partially funded by the EU Horizon Europe projects CYBERNEMO (grant 101168182) and 3C4AI (grant 101298630).¶