CBOR Encoding of Data Modeled with YANG
draft-ietf-core-yang-cbor-15
Internet Engineering Task Force M. Veillette, Ed.
Internet-Draft Trilliant Networks Inc.
Intended status: Standards Track I. Petrov, Ed.
Expires: 28 July 2021 Google Switzerland GmbH
A. Pelov
Acklio
24 January 2021
CBOR Encoding of Data Modeled with YANG
draft-ietf-core-yang-cbor-15
Abstract
This document defines encoding rules for serializing configuration
data, state data, RPC input and RPC output, action input, action
output, notifications and yang-data extension defined within YANG
modules using the Concise Binary Object Representation (CBOR, RFC
8949).
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 28 July 2021.
Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved.
Veillette, et al. Expires 28 July 2021 [Page 1]
Internet-Draft CBOR Encoding of Data Modeled with YANG January 2021
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 Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology and Notation . . . . . . . . . . . . . . . . . . 3
3. Properties of the CBOR Encoding . . . . . . . . . . . . . . . 5
3.1. CBOR diagnostic notation . . . . . . . . . . . . . . . . 6
3.2. YANG Schema Item iDentifier . . . . . . . . . . . . . . . 8
3.3. Name . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4. Encoding of YANG Schema Node Instances . . . . . . . . . . . 10
4.1. The 'leaf' . . . . . . . . . . . . . . . . . . . . . . . 10
4.1.1. Using SIDs in keys . . . . . . . . . . . . . . . . . 10
4.1.2. Using names in keys . . . . . . . . . . . . . . . . . 11
4.2. The 'container' and other nodes from the data tree . . . 11
4.2.1. Using SIDs in keys . . . . . . . . . . . . . . . . . 12
4.2.2. Using names in keys . . . . . . . . . . . . . . . . . 13
4.3. The 'leaf-list' . . . . . . . . . . . . . . . . . . . . . 15
4.3.1. Using SIDs in keys . . . . . . . . . . . . . . . . . 15
4.3.2. Using names in keys . . . . . . . . . . . . . . . . . 15
4.4. The 'list' and 'list' instance(s) . . . . . . . . . . . . 16
4.4.1. Using SIDs in keys . . . . . . . . . . . . . . . . . 17
4.4.2. Using names in keys . . . . . . . . . . . . . . . . . 19
4.5. The 'anydata' . . . . . . . . . . . . . . . . . . . . . . 21
4.5.1. Using SIDs in keys . . . . . . . . . . . . . . . . . 22
4.5.2. Using names in keys . . . . . . . . . . . . . . . . . 23
4.6. The 'anyxml' . . . . . . . . . . . . . . . . . . . . . . 24
4.6.1. Using SIDs in keys . . . . . . . . . . . . . . . . . 24
4.6.2. Using names in keys . . . . . . . . . . . . . . . . . 25
5. Encoding of 'yang-data' extension . . . . . . . . . . . . . . 25
5.1. Using SIDs in keys . . . . . . . . . . . . . . . . . . . 26
5.2. Using names in keys . . . . . . . . . . . . . . . . . . . 27
6. Representing YANG Data Types in CBOR . . . . . . . . . . . . 28
6.1. The unsigned integer Types . . . . . . . . . . . . . . . 28
6.2. The integer Types . . . . . . . . . . . . . . . . . . . . 29
6.3. The 'decimal64' Type . . . . . . . . . . . . . . . . . . 29
6.4. The 'string' Type . . . . . . . . . . . . . . . . . . . . 30
6.5. The 'boolean' Type . . . . . . . . . . . . . . . . . . . 30
6.6. The 'enumeration' Type . . . . . . . . . . . . . . . . . 31
Show full document text