draft-ietf-core-senml-versions-03.txt   draft-ietf-core-senml-versions-04.txt 
CoRE C. Bormann CoRE C. Bormann
Internet-Draft Universitaet Bremen TZI Internet-Draft Universitaet Bremen TZI
Updates: 8428 (if approved) 9 May 2021 Updates: 8428 (if approved) 4 June 2021
Intended status: Standards Track Intended status: Standards Track
Expires: 10 November 2021 Expires: 6 December 2021
SenML Features and Versions SenML Features and Versions
draft-ietf-core-senml-versions-03 draft-ietf-core-senml-versions-04
Abstract Abstract
This short document updates RFC 8428, Sensor Measurement Lists This short document updates RFC 8428, Sensor Measurement Lists
(SenML), by specifying the use of independently selectable "SenML (SenML), by specifying the use of independently selectable "SenML
Features" and mapping them to SenML version numbers. Features" and mapping them to SenML version numbers.
Discussion Venues Discussion Venues
This note is to be removed before publishing as an RFC. This note is to be removed before publishing as an RFC.
skipping to change at page 1, line 46 skipping to change at page 1, line 46
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 https://datatracker.ietf.org/drafts/current/. Drafts is at https://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 10 November 2021. This Internet-Draft will expire on 6 December 2021.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 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 (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
2. Feature Codes and the Version number . . . . . . . . . . . . 3 2. Feature Codes and the Version number . . . . . . . . . . . . 3
2.1. Discussion . . . . . . . . . . . . . . . . . . . . . . . 3 2.1. Discussion . . . . . . . . . . . . . . . . . . . . . . . 4
2.2. Updating RFC8428 . . . . . . . . . . . . . . . . . . . . 4 2.2. Updating RFC8428 . . . . . . . . . . . . . . . . . . . . 4
3. Features: Reserved0, Reserved1, Reserved2, Reserved3 . . . . 5 3. Features: Reserved0, Reserved1, Reserved2, Reserved3 . . . . 5
4. Feature: Secondary Units . . . . . . . . . . . . . . . . . . 5 4. Feature: Secondary Units . . . . . . . . . . . . . . . . . . 5
5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 7
7.1. Normative References . . . . . . . . . . . . . . . . . . 6 7.1. Normative References . . . . . . . . . . . . . . . . . . 7
7.2. Informative References . . . . . . . . . . . . . . . . . 7 7.2. Informative References . . . . . . . . . . . . . . . . . 7
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction 1. Introduction
The Sensor Measurement Lists (SenML) specification [RFC8428] provides The Sensor Measurement Lists (SenML) specification [RFC8428] provides
a version number that is initially set to 10, without further a version number that is initially set to 10, without further
specification on the way to make use of different version numbers. specification on the way to make use of different version numbers.
The traditional idea of using a version number to indicate the The traditional idea of using a version number to indicate the
evolution of an interchange format generally assumes an incremental evolution of an interchange format generally assumes an incremental
progression of the version number as the format accretes additional progression of the version number as the format accretes additional
features over time. However in the case of SenML it is expected that features over time. However, in the case of SenML, it is expected
the likely evolution will be for independently selectable capability that the likely evolution will be for independently selectable
_features_ to be added to the basic specification that is indicated capability _features_ to be added to the basic specification that is
by version number 10. To support this model, this document indicated by version number 10. To support this model, this document
repurposes the single version number accompanying a pack of SenML repurposes the single version number accompanying a pack of SenML
records so that it is interpreted as a bitmap that indicates the set records so that it is interpreted as a bitmap that indicates the set
of features a recipient would need to have implemented to be able to of features a recipient would need to have implemented to be able to
process the pack. process the pack.
This short document specifies the use of SenML Features and maps them This short document specifies the use of SenML Features and maps them
to SenML version number space, updating [RFC8428]. to SenML version number space, updating [RFC8428].
1.1. Terminology 1.1. Terminology
skipping to change at page 3, line 29 skipping to change at page 3, line 29
language standard [Cplusplus], except that superscript notation language standard [Cplusplus], except that superscript notation
(example for two to the power of 64: 2^64) denotes exponentiation; in (example for two to the power of 64: 2^64) denotes exponentiation; in
the plain text version of this draft, superscript notation is the plain text version of this draft, superscript notation is
rendered in paragraph text by C-incompatible surrogate notation as rendered in paragraph text by C-incompatible surrogate notation as
seen in this example, and in display math by a crude plaintext seen in this example, and in display math by a crude plaintext
representation, as is the sum (Sigma) sign. representation, as is the sum (Sigma) sign.
2. Feature Codes and the Version number 2. Feature Codes and the Version number
The present specification defines "SenML Features", each identified The present specification defines "SenML Features", each identified
by a "feature name" (a text string) and a "feature code", an unsigned by a "feature name" (a text string) and a "feature code" (an unsigned
integer less than 53. integer less than 53).
The specific version of a SenML pack is composed of a set of The specific version of a SenML pack is composed of a set of
features. The SenML version number ("bver" field) is then a bitmap features. The SenML version number ("bver" field) is then a bitmap
of these features, specifically the sum of, for each feature present, of these features represented as an unsigned integer, specifically
two taken to the power of the feature code of that feature. the sum of, for each feature present, two taken to the power of the
feature code of that feature (Figure 1).
__ 52 fc __ 52 fc
version = \ present(fc) ⋅ 2 version = \ present(fc)2
/__ fc = 0 /__ fc = 0
Figure 1: Feature bitmap as a sum of feature bits
where present(fc) is 1 if the feature with the feature code "fc" is where present(fc) is 1 if the feature with the feature code "fc" is
present, 0 otherwise. (The expression 2^fc can be implemented as "1 present, 0 otherwise. (The expression 2^fc can be implemented as "1
<< fc" in C and related languages.) << fc" in C and related languages.)
RFC editor: Please check that, in the TXT version, no "&nbsp;" crept
into the above due to xml2rfc bug 641, and remove this paragraph. If
possible with today's RFCXML, add the Sigma character as a
parenthesis after "sum" in the caption.
2.1. Discussion 2.1. Discussion
Representing features as a bitmap within a number is quite efficient Representing features as a bitmap within a number is quite efficient
as long as feature codes are sparingly allocated (see also as long as feature codes are sparingly allocated (see also
Section 6). Section 6).
Compatibility with the existing SenML version number, 10 decimal Compatibility with the existing SenML version number, 10 decimal
(0b1010), requires reserving four of the least significant bit (0b1010), requires reserving four of the least significant bit
positions for the base version as described in Section 3. There is positions for the base version as described in Section 3. There is
an upper limit to the range of the integer numbers that can be an upper limit to the range of the integer numbers that can be
represented in all SenML representations: practical JSON limits this represented in all SenML representations: practical JSON limits this
to 2^53-1 [RFC7493]. This means the feature codes 4 to 52 are to 2^53-1 [RFC7493]. This means the feature codes 4 to 52 are
available, one of which is taken by the feature defined in Section 4, available, one of which is taken by the feature defined in Section 4,
leaving 48 for allocation. (The current version 10 (with all other leaving 48 for allocation. (The current version 10 (with all other
feature codes unset) can be visualized as feature codes unset) can be visualized as
"0b00000000000000000000000000000000000000000000000001010".) For a "0b00000000000000000000000000000000000000000000000001010".) For a
lifetime of this scheme of several decades, approximately two feature lifetime of this scheme of several decades, approximately two feature
codes per year or less should be allocated. Note that less generally codes per year or fewer should be allocated. Note that less
applicable features can always be communicated via fields labeled generally applicable features can always be communicated via fields
with names that end with the "_" character ("must-understand labeled with names that end with the "_" character ("must-understand
fields"), see Section 4.4 of [RFC8428].) fields"), see Section 4.4 of [RFC8428].)
Most representations visible to engineers working with SenML will use Most representations visible to engineers working with SenML will use
decimal numbers, e.g. 26 (0b11010, 0x1a) for a version that adds the decimal numbers, e.g., 26 (0b11010, 0x1a) for a version that adds the
"Secondary Units" feature (Section 4). This is sightly unwieldy, but "Secondary Units" feature (Section 4). This is slightly unwieldy,
will be quickly memorized in practice. but will be quickly memorized in practice.
As a general observation, ending up over time with dozens of
individually selectable optional extensions may lead to too many
variants of what is supported by different implementations, reducing
interoperability. So, in practice, it is still desirable to batch up
extensions that are expected to be supported together into a single
feature bit, leading to a sort of hybrid between completely
independent extensions and a linear version scheme. This is also
another reason why a space of 48 remaining feature codes should
suffice for a while.
2.2. Updating Section 4.4 of [RFC8428] 2.2. Updating Section 4.4 of [RFC8428]
The last paragraph of Section 4.4 of [RFC8428] may be read to give The last paragraph of Section 4.4 of [RFC8428] may be read to give
the impression that SenML version numbers are totally ordered, i.e., the impression that SenML version numbers are totally ordered, i.e.,
that an implementation that understands version n also always that an implementation that understands version n also always
understands all versions k < n. If this ever was true for SenML understands all versions k < n. If this ever was true for SenML
versions before 10, it certainly is no longer true with this versions before 10, it certainly is no longer true with this
specification. specification.
skipping to change at page 5, line 10 skipping to change at page 5, line 26
accept version number 42, but would not be able to work with a pack accept version number 42, but would not be able to work with a pack
indicating version number 26 (base specification plus feature code indicating version number 26 (base specification plus feature code
4). (If the implementation _requires_ feature code 5 without being 4). (If the implementation _requires_ feature code 5 without being
backwards compatible, it will accept 42, but not 10.) backwards compatible, it will accept 42, but not 10.)
3. Features: Reserved0, Reserved1, Reserved2, Reserved3 3. Features: Reserved0, Reserved1, Reserved2, Reserved3
For SenML Version 10 as described in [RFC8428], the feature codes 0 For SenML Version 10 as described in [RFC8428], the feature codes 0
to 3 are already in use. Reserved1 (1) and Reserved3 (3) are always to 3 are already in use. Reserved1 (1) and Reserved3 (3) are always
present and the features Reserved0 (0) and Reserved2 (2) are always present and the features Reserved0 (0) and Reserved2 (2) are always
absent, yielding a version number of 10 if no other feature is in absent, i.e., the four least significant bits set to 0b1010 indicate
use. These four reserved feature codes are not to be used with any a version number of 10 if no other feature is in use. These four
more specific semantics except in a specification that updates the reserved feature codes are not to be used with any more specific
present specification. semantics except in a specification that updates the present
specification. (Note that Reserved0 and Reserved2 could be used in
such a specification in a similar way to the way the feature codes 4
to 52 are in the present specification.)
4. Feature: Secondary Units 4. Feature: Secondary Units
The feature "Secondary Units" (code number 4) indicates that The feature "Secondary Units" (code number 4) indicates that
secondary unit names [RFC8798] MAY be be used in the "u" field of secondary unit names [RFC8798] MAY be used in the "u" field of SenML
SenML Records, in addition to the primary unit names already allowed Records, in addition to the primary unit names already allowed by
by [RFC8428]. [RFC8428].
Note that the most basic use of this feature simply sets the SenML Note that the most basic use of this feature simply sets the SenML
version number to 26 (10 + 2^4). version number to 26 (10 + 2^4).
5. Security Considerations 5. Security Considerations
The security considerations of [RFC8428] apply. This specification The security considerations of [RFC8428] apply. This specification
provides structure to the interpretation of the SenML version number, provides structure to the interpretation of the SenML version number,
which poses no additional security considerations except for some which poses no additional security considerations except for some
potential for surprise that version numbers do not simply increase potential for surprise that version numbers do not simply increase
skipping to change at page 6, line 28 skipping to change at page 6, line 48
Table 1: Features defined for SenML at the time of Table 1: Features defined for SenML at the time of
writing writing
As the number of features that can be registered has a hard limit (48 As the number of features that can be registered has a hard limit (48
codes left at the time of writing), the designated expert is codes left at the time of writing), the designated expert is
specifically instructed to maintain a frugal regime of code point specifically instructed to maintain a frugal regime of code point
allocation, keeping code points available for SenML Features that are allocation, keeping code points available for SenML Features that are
likely to be useful for non-trivial subsets of the SenML ecosystem. likely to be useful for non-trivial subsets of the SenML ecosystem.
Quantitatively, the expert could for instance steer the allocation to Quantitatively, the expert could for instance steer the allocation to
not allocate more than 10 % of the remaining set per year. a target of not allocating more than 10 % of the remaining set per
year.
Where the specification of the feature code is provided in a document Where the specification of the feature code is provided in a document
that is separate from the specification of the feature itself (as that is separate from the specification of the feature itself (as
with feature code 4 above), both specifications should be listed. with feature code 4 above), both specifications should be listed.
7. References 7. References
7.1. Normative References 7.1. Normative References
[C] International Organization for Standardization, [C] International Organization for Standardization,
skipping to change at page 7, line 40 skipping to change at page 8, line 15
[RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493,
DOI 10.17487/RFC7493, March 2015, DOI 10.17487/RFC7493, March 2015,
<https://www.rfc-editor.org/info/rfc7493>. <https://www.rfc-editor.org/info/rfc7493>.
Acknowledgements Acknowledgements
Ari Keränen proposed to use the version number as a bitmap and Ari Keränen proposed to use the version number as a bitmap and
provided further input on this specification. Jaime Jiménez helped provided further input on this specification. Jaime Jiménez helped
clarify the document by providing a review. Elwyn Davies provided a clarify the document by providing a review. Elwyn Davies provided a
detailed GENART review, with directly implementable text suggestions detailed GENART review, with directly implementable text suggestions
that now form part of this specification. that now form part of this specification. Rob Wilton supplied
comments one of which became the last paragraph of Section 2.1; Éric
Vyncke helped with Section 2. Additional thanks go to the other IESG
reviewers.
Author's Address Author's Address
Carsten Bormann Carsten Bormann
Universitaet Bremen TZI Universitaet Bremen TZI
Postfach 330440 Postfach 330440
D-28359 Bremen D-28359 Bremen
Germany Germany
Phone: +49-421-218-63921 Phone: +49-421-218-63921
 End of changes. 19 change blocks. 
34 lines changed or deleted 59 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/