< draft-bormann-cbor-tags-oid-01.txt   draft-bormann-cbor-tags-oid-02.txt >
Network Working Group C. Bormann Network Working Group C. Bormann
Internet-Draft Universitaet Bremen TZI Internet-Draft Universitaet Bremen TZI
Intended status: Standards Track S. Leonard Intended status: Standards Track S. Leonard
Expires: January 7, 2016 Penango, Inc. Expires: July 9, 2016 Penango, Inc.
July 06, 2015 January 06, 2016
Concise Binary Object Representation (CBOR) Tags for Concise Binary Object Representation (CBOR) Tags for
ASN.1 Object Identifiers ASN.1 Object Identifiers
draft-bormann-cbor-tags-oid-01 draft-bormann-cbor-tags-oid-02
Abstract Abstract
The Concise Binary Object Representation (CBOR, RFC 7049) is a data The Concise Binary Object Representation (CBOR, RFC 7049) is a data
format whose design goals include the possibility of extremely small format whose design goals include the possibility of extremely small
code size, fairly small message size, and extensibility without the code size, fairly small message size, and extensibility without the
need for version negotiation. need for version negotiation.
The present document makes use of this extensibility to define CBOR The present document makes use of this extensibility to define CBOR
tags <<O>> and <<R>> [values TBD] for ASN.1 object identifiers. It tags <<O>> and <<R>> [values TBD] for ASN.1 object identifiers. It
skipping to change at page 1, line 40 skipping to change at page 1, line 40
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 7, 2016. This Internet-Draft will expire on July 9, 2016.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
skipping to change at page 2, line 21 skipping to change at page 2, line 21
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. ASN.1 Object Identifiers . . . . . . . . . . . . . . . . . . 3 2. ASN.1 Object Identifiers . . . . . . . . . . . . . . . . . . 3
3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 6 4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 6
5. Diagnostic Notation . . . . . . . . . . . . . . . . . . . . . 7 5. Diagnostic Notation . . . . . . . . . . . . . . . . . . . . . 7
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7
7. Security Considerations . . . . . . . . . . . . . . . . . . . 8 7. Security Considerations . . . . . . . . . . . . . . . . . . . 8
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 9
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11
1. Introduction 1. Introduction
The Concise Binary Object Representation (CBOR, [RFC7049]) provides The Concise Binary Object Representation (CBOR, [RFC7049]) provides
for the interchange of structured data without a requirement for a for the interchange of structured data without a requirement for a
pre-agreed schema. RFC 7049 defines a basic set of data types, as pre-agreed schema. RFC 7049 defines a basic set of data types, as
well as a tagging mechanism that enables extending the set of data well as a tagging mechanism that enables extending the set of data
types supported via an IANA registry. types supported via an IANA registry.
Many IETF protocols carry ASN.1 object identifiers, originally Many IETF protocols carry ASN.1 object identifiers, originally
defined in 1988 [CCITT.X208.1988] and most recently in 2008 [X.680]. defined in 1988 [CCITT.X208.1988] and most recently in 2008 [X.680].
The ASN.1 Basic Encoding Rules (BER, [X.690]) specifies the binary The ASN.1 Basic Encoding Rules (BER, [X.690]) specify the binary
encodings of both ASN.1 object identifiers and relative object encodings of both ASN.1 object identifiers and relative object
identifiers. The contents of these encodings can be carried in a identifiers. The contents of these encodings can be carried in a
CBOR byte string. CBOR byte string.
This document defines two CBOR tags that cover the two kinds of ASN.1 This document defines two CBOR tags that cover the two kinds of ASN.1
object identifiers encoded in this way. It is intended as the object identifiers encoded in this way. It is intended as the
reference document for the IANA registration of the tags so defined. reference document for the IANA registration of the tags so defined.
1.1. Terminology 1.1. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
document are to be interpreted as described in RFC 2119 [RFC2119]. "OPTIONAL" in this document are to be interpreted as described in RFC
2119 [RFC2119].
The terminology of RFC 7049 applies; in particular the term "byte" is The terminology of RFC 7049 applies; in particular the term "byte" is
used in its now customary sense as a synonym for "octet". used in its now customary sense as a synonym for "octet".
2. ASN.1 Object Identifiers 2. ASN.1 Object Identifiers
The International Object Identifier tree [X.660] is a hierarchically The International Object Identifier tree [X.660] is a hierarchically
managed space of identifiers, each of which is uniquely represented managed space of identifiers, each of which is uniquely represented
as a sequence of unsigned integers ("sub-identifiers") [X.680]. as a sequence of unsigned integers ("sub-identifiers") [X.680].
While these sequences can easily be represented in CBOR arrays of While these sequences can easily be represented in CBOR arrays of
unsigned integers, a more compact representation can often be unsigned integers, a more compact representation can often be
achieved by adopting the widely used representation of ASN.1 object achieved by adopting the widely used representation of ASN.1 object
identifiers defined in BER; this representation may also be more identifiers defined in BER; this representation may also be more
amenable to processing by other software making use of ASN.1 object amenable to processing by other software making use of ASN.1 object
identifiers. identifiers.
BER represents the sequence of unsigned integers by concatenating BER represents the sequence of unsigned integers by concatenating
self-delimiting [RFC6256] representations of each of the sub- self-delimiting [RFC6256] representations of each of the sub-
identifier in sequence. identifiers in sequence.
ASN.1 distinguishes absolute object identifiers (ASN.1 Type "OBJECT ASN.1 distinguishes absolute object identifiers (ASN.1 Type "OBJECT
IDENTIFIER"), which begin at a root arc ([X.660] Clause 3.5.21), from IDENTIFIER"), which begin at a root arc ([X.660] Clause 3.5.21), from
relative object identifiers (ASN.1 Type "RELATIVE-OID"), which begin relative object identifiers (ASN.1 Type "RELATIVE-OID"), which begin
relative to some object identifier known from context ([X.680] Clause relative to some object identifier known from context ([X.680] Clause
3.8.63). As a special optimization, BER combines the first two 3.8.63). As a special optimization, BER combines the first two
integers in an absolute object identifier into one numeric identifier integers in an absolute object identifier into one numeric identifier
by making use of the property of the hierarchy that the first arc has by making use of the property of the hierarchy that the first arc has
only three integer values (0, 1, and 2), and the second arcs under 0 only three integer values (0, 1, and 2), and the second arcs under 0
and 1 are limited to the integer values between 0 and 39. (The root and 1 are limited to the integer values between 0 and 39. (The root
skipping to change at page 4, line 48 skipping to change at page 4, line 48
also to be treated as indivisible units: They MUST be encoded in also to be treated as indivisible units: They MUST be encoded in
definite-length form; indefinite-length form is treated as an definite-length form; indefinite-length form is treated as an
encoding error (and the same considerations as above apply). (An encoding error (and the same considerations as above apply). (An
added convenience is that CBOR encodings can be searched through added convenience is that CBOR encodings can be searched through
efficiently for specific OIDs or relative OIDs, without initiating efficiently for specific OIDs or relative OIDs, without initiating
the decoding process.) the decoding process.)
3. Examples 3. Examples
In the following examples, we are using tag number 6 for <<O>> and In the following examples, we are using tag number 6 for <<O>> and
tag number 7 for <<O>>. See Section 6.1. tag number 7 for <<R>>. See Section 6.1.
3.1. Encoding of the SHA-256 OID 3.1. Encoding of the SHA-256 OID
ASN.1 Value Notation ASN.1 Value Notation
{ joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)
csor(3) nistalgorithm(4) hashalgs(2) sha256(1) } csor(3) nistalgorithm(4) hashalgs(2) sha256(1) }
Dotted Decimal Notation (also XML Value Notation) Dotted Decimal Notation (also XML Value Notation)
2.16.840.1.101.3.4.2.1 2.16.840.1.101.3.4.2.1
skipping to change at page 5, line 35 skipping to change at page 5, line 35
Figure 2: SHA-256 OID in CBOR Figure 2: SHA-256 OID in CBOR
3.2. Encoding of a UUID OID 3.2. Encoding of a UUID OID
UUID UUID
8b0d1a20-dcc5-11d9-bda9-0002a5d5c51b 8b0d1a20-dcc5-11d9-bda9-0002a5d5c51b
ASN.1 Value Notation ASN.1 Value Notation
{ joint-iso-itu-t(2) uuid(25) { joint-iso-itu-t(2) uuid(25)
geomicaGPAS(2957291539512641589387040445673640841648) } geomicaGPAS(184830721219540099336690027854602552603) }
Dotted Decimal Notation (also XML Value Notation) Dotted Decimal Notation (also XML Value Notation)
2.25.2957291539512641589387040445673640841648 2.25.184830721219540099336690027854602552603
06 # UNIVERSAL TAG 6 06 # UNIVERSAL TAG 6
14 # 20 bytes, primitive 14 # 20 bytes, primitive
69 A2 E1 D1 D1 83 B9 C5 88 F6 B7 DA C8 80 85 A5 EA F1 A3 30 69 82 96 8D 8D 88 9B CC A8 C7 B3 BD D4 C0 80 AA AE D7 8A 1B
# | 2957291539512641589387040445673640841648 # | 184830721219540099336690027854602552603
# 2.25 # 2.25
Figure 3: UUID in an object identifier, in BER Figure 3: UUID in an object identifier, in BER
C6 # 0b110_00110: mt 6, tag 6 C6 # 0b110_00110: mt 6, tag 6
54 # 0b010_10100: mt 2, 20 bytes 54 # 0b010_10100: mt 2, 20 bytes
69 A2 E1 D1 D1 83 B9 C5 88 F6 B7 DA C8 80 85 A5 EA F1 A3 30` 69 82 96 8D 8D 88 9B CC A8 C7 B3 BD D4 C0 80 AA AE D7 8A 1B
Figure 4: UUID in an object identifier, in CBOR Figure 4: UUID in an object identifier, in CBOR
3.3. Encoding of a MIB Relative OID 3.3. Encoding of a MIB Relative OID
Given some OID (e.g., "lowpanMib", assumed to be "1.3.6.1.2.1.226" Given some OID (e.g., "lowpanMib", assumed to be "1.3.6.1.2.1.226"
[RFC7388]), to which the following is added: [RFC7388]), to which the following is added:
ASN.1 Value Notation (not suitable for diagnostic notation) ASN.1 Value Notation (not suitable for diagnostic notation)
{ lowpanObjects(1) lowpanStats(1) lowpanOutTransmits(29) } { lowpanObjects(1) lowpanStats(1) lowpanOutTransmits(29) }
skipping to change at page 6, line 49 skipping to change at page 6, line 49
based on BER; using a different encoding might not be aligned with based on BER; using a different encoding might not be aligned with
these expectations. If additional information about an OID is these expectations. If additional information about an OID is
desired, lookup services such as the OID Resolution Service (ORS, desired, lookup services such as the OID Resolution Service (ORS,
[X.672]) and the OID Repository (oid-info.com, [OIDINFO]) are [X.672]) and the OID Repository (oid-info.com, [OIDINFO]) are
available. available.
This specification allocates two numbers out of the single-byte tag This specification allocates two numbers out of the single-byte tag
space. This use of code point space is justified by the wide use of space. This use of code point space is justified by the wide use of
object identifiers in data interchange. For most common OIDs in use object identifiers in data interchange. For most common OIDs in use
(namely those whose contents encode to less than 24 bytes), the CBOR (namely those whose contents encode to less than 24 bytes), the CBOR
encoding will match the efficiency of [X.690]. encoding will match the efficiency of [X.690]. (This preliminary
conclusion is likely to generate some discussion, see Section 6.1.)
5. Diagnostic Notation 5. Diagnostic Notation
Implementers will likely want to see OIDs and relative OIDs in their Implementers will likely want to see OIDs and relative OIDs in their
"natural forms" (as sequences of unsigned integers) for diagnostic "natural forms" (as sequences of decimal unsigned integers) for
purposes. Accordingly, this section defines additional syntactic diagnostic purposes. Accordingly, this section defines additional
elements that can be used in conjunction with the diagnostic notation syntactic elements that can be used in conjunction with the
described in Section 6 of [RFC7049]. diagnostic notation described in Section 6 of [RFC7049].
An object identifier may be written in ASN.1 value notation (with An object identifier may be written in ASN.1 value notation (with
enclosing braces and secondary identifiers), or in dotted decimal enclosing braces and secondary identifiers), or in dotted decimal
notation with at least three arcs. Both examples are shown in notation with at least three arcs. Both examples are shown in
Section 3. The surrounding tag notation is optional. The ASN.1 Section 3. The surrounding tag notation is optional. The ASN.1
value notation for OIDs does not overlap with JSON object notation value notation for OIDs does not overlap with JSON object notation
for CBOR maps, because at least two arcs are required for a valid for CBOR maps, because at least two arcs are required for a valid
OID. OID.
A relative object identifier may be written in dotted decimal A relative object identifier may be written in dotted decimal
notation only, prefixed with a dot as shown in Section 3.3. The notation only, prefixed with a dot as shown in Section 3.3. The
surrounding tag notation is optional. ASN.1 value notation is not surrounding tag notation is optional. ASN.1 value notation is not
suitable for the diagnostic notation of relative OIDs because suitable for the diagnostic notation of relative OIDs because
knowledge of the base OID cannot be determined from the encoding knowledge of the base OID cannot be determined from the encoding
alone; such knowledge requires a protocol on top of CBOR. alone; such knowledge requires a protocol on top of CBOR.
The notation in this section may be employed in addition to the basic The notation in this section may be employed in addition to the basic
notation, which would be a tagged binary string. notation, which would be a tagged binary string.
+------------------------------+----------------+------------+ +------------------------------+--------------+------------+
| RFC 7049 diagnostic notation | 6(h'2b030601') | 7(h'0601') | | RFC 7049 diagnostic notation | 6(h'2b0601') | 7(h'0601') |
+------------------------------+----------------+------------+ +------------------------------+--------------+------------+
| Dotted decimal notation | 1.3.6.1 | .6.1 | | Dotted decimal notation | 1.3.6.1 | .6.1 |
| ASN.1 value notation | {1 3 6 1} | -N/A- | | ASN.1 value notation | {1 3 6 1} | -N/A- |
+------------------------------+----------------+------------+ +------------------------------+--------------+------------+
Table 1: Examples for extended diagnostic notation Table 1: Examples for extended diagnostic notation
6. IANA Considerations 6. IANA Considerations
(This section to be edited by the RFC editor.) (This section to be edited by the RFC editor.)
IANA is requested to assign the CBOR tags in Table 2, with the IANA is requested to assign the CBOR tags in Table 2, with the
present document as the specification reference. present document as the specification reference.
skipping to change at page 9, line 30 skipping to change at page 9, line 30
certainly be able to cause the accumulator to overflow. Compact and certainly be able to cause the accumulator to overflow. Compact and
efficient techniques for such conversions, such as the double dabble efficient techniques for such conversions, such as the double dabble
algorithm [DOUBLEDABBLE] are well-known in the art; their application algorithm [DOUBLEDABBLE] are well-known in the art; their application
to this field is left as an exercise to the reader. to this field is left as an exercise to the reader.
8. References 8. References
8.1. Normative References 8.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/
RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, October 2013. Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <http://www.rfc-editor.org/info/rfc7049>.
[X.660] International Telecommunications Union, "Information [X.660] International Telecommunications Union, "Information
technology -- Procedures for the operation of object technology -- Procedures for the operation of object
identifier registration authorities: General procedures identifier registration authorities: General procedures
and top arcs of the international object identifier tree", and top arcs of the international object identifier tree",
ITU-T Recommendation X.660, July 2011. ITU-T Recommendation X.660, July 2011.
[X.680] International Telecommunications Union, "Information [X.680] International Telecommunications Union, "Information
technology -- Abstract Syntax Notation One (ASN.1): technology -- Abstract Syntax Notation One (ASN.1):
Specification of basic notation", ITU-T Recommendation Specification of basic notation", ITU-T Recommendation
skipping to change at page 10, line 29 skipping to change at page 10, line 35
<http://www.oid-info.com/>. <http://www.oid-info.com/>.
[PKILCAKE] [PKILCAKE]
Kaminsky, D., Patterson, M., and L. Sassaman, "PKI Layer Kaminsky, D., Patterson, M., and L. Sassaman, "PKI Layer
Cake: New Collision Attacks Against the Global X.509 Cake: New Collision Attacks Against the Global X.509
Infrastructure", FC 2010, Lecture Notes in Computer Infrastructure", FC 2010, Lecture Notes in Computer
Science 6052 289-303, DOI: 10.1007/978-3-642-14577-3_22, Science 6052 289-303, DOI: 10.1007/978-3-642-14577-3_22,
January 2010, <http://dl.acm.org/citation.cfm?id=2163593>. January 2010, <http://dl.acm.org/citation.cfm?id=2163593>.
[RFC6256] Eddy, W. and E. Davies, "Using Self-Delimiting Numeric [RFC6256] Eddy, W. and E. Davies, "Using Self-Delimiting Numeric
Values in Protocols", RFC 6256, May 2011. Values in Protocols", RFC 6256, DOI 10.17487/RFC6256, May
2011, <http://www.rfc-editor.org/info/rfc6256>.
[RFC7388] Schoenwaelder, J., Sehgal, A., Tsou, T., and C. Zhou, [RFC7388] Schoenwaelder, J., Sehgal, A., Tsou, T., and C. Zhou,
"Definition of Managed Objects for IPv6 over Low-Power "Definition of Managed Objects for IPv6 over Low-Power
Wireless Personal Area Networks (6LoWPANs)", RFC 7388, Wireless Personal Area Networks (6LoWPANs)", RFC 7388, DOI
October 2014. 10.17487/RFC7388, October 2014,
<http://www.rfc-editor.org/info/rfc7388>.
[X.672] International Telecommunications Union, "Information [X.672] International Telecommunications Union, "Information
technology -- Open systems interconnection -- Object technology -- Open systems interconnection -- Object
identifier resolution system", ITU-T Recommendation X.672, identifier resolution system", ITU-T Recommendation X.672,
August 2010. August 2010.
Authors' Addresses Authors' Addresses
Carsten Bormann Carsten Bormann
Universitaet Bremen TZI Universitaet Bremen TZI
 End of changes. 20 change blocks. 
32 lines changed or deleted 39 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/