SenML Features and Versions
draft-ietf-core-senml-versions-02

Document Type Active Internet-Draft (core WG)
Author Carsten Bormann 
Last updated 2021-04-19 (latest revision 2021-02-21)
Replaces draft-bormann-core-senml-versions
Stream Internet Engineering Task Force (IETF)
Intended RFC status Proposed Standard
Formats plain text html xml pdf htmlized (tools) htmlized bibtex
Additional Resources
- Working Group Repo
- Mailing list discussion
Stream WG state Submitted to IESG for Publication
Document shepherd Jaime Jimenez
Shepherd write-up Show (last changed 2021-04-05)
IESG IESG state In Last Call (ends 2021-05-03)
Action Holders
Consensus Boilerplate Yes
Telechat date
Responsible AD Francesca Palombini
Send notices to jaime@iki.fi
IANA IANA review state IANA - Review Needed
CoRE                                                          C. Bormann
Internet-Draft                                   Universitaet Bremen TZI
Updates: 8428 (if approved)                             21 February 2021
Intended status: Standards Track                                        
Expires: 25 August 2021

                      SenML Features and Versions
                   draft-ietf-core-senml-versions-02

Abstract

   This short document updates RFC 8428, Sensor Measurement Lists
   (SenML), by specifying the use of independently selectable "SenML
   Features" and mapping them to SenML version numbers.

Discussion Venues

   This note is to be removed before publishing as an RFC.

   Discussion of this document takes place on the CORE Working Group
   mailing list (core@ietf.org), which is archived at
   https://mailarchive.ietf.org/arch/browse/core/
   (https://mailarchive.ietf.org/arch/browse/core/).

   Source for this draft and an issue tracker can be found at
   https://github.com/core-wg/senml-versions (https://github.com/core-
   wg/senml-versions).

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 25 August 2021.

Bormann                  Expires 25 August 2021                 [Page 1]
Internet-Draft         SenML Features and Versions         February 2021

Copyright Notice

   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 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  . . . . . . . . . . . . . . . . . . . . . . . .   2
     1.1.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Feature Codes and the Version number  . . . . . . . . . . . .   3
     2.1.  Discussion  . . . . . . . . . . . . . . . . . . . . . . .   3
   3.  Features: Reserved0, Reserved1, Reserved2, Reserved3  . . . .   4
   4.  Feature: Secondary Units  . . . . . . . . . . . . . . . . . .   4
   5.  Security Considerations . . . . . . . . . . . . . . . . . . .   4
   6.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   4
   7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .   5
     7.1.  Normative References  . . . . . . . . . . . . . . . . . .   5
     7.2.  Informative References  . . . . . . . . . . . . . . . . .   6
   Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6

1.  Introduction

   The Sensor Measurement Lists (SenML) specification [RFC8428] provides
   a version number that is initially set to 10, without further
   specification on the way to make use of different version numbers.

   The traditional idea of using a version number for evolving an
   interchange format presupposes a linear progression of that format.
   A more likely form of evolution of SenML is the addition of
   independently selectable _features_ that can be added to the base
   version (version 10) in a fashion that these are mostly independent
   of each other.  A recipient of a SenML pack can check the features it
   implements against those required by the pack, processing the pack
   only if all required features are provided in the implementation.

   This short document specifies the use of SenML Features and maps them
   to SenML version number space, updating [RFC8428].

Bormann                  Expires 25 August 2021                 [Page 2]
Internet-Draft         SenML Features and Versions         February 2021

1.1.  Terminology

   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.

   Where bit arithmetic is explained, this document uses the notation
   familiar from the programming language C [C], including the "0b"
   prefix for binary numbers defined in Section 5.13.2 of the C++
   language standard [Cplusplus], except that superscript notation
   (example for two to the power of 64: 2^(64)) denotes exponentiation;
   in the plain text version of this draft, superscript notation is
   rendered by C-incompatible surrogate notation as seen in this
   example.

2.  Feature Codes and the Version number

   The present specification defines "SenML Features", each identified
   by a "feature name" (a text string) and a "feature code", an unsigned
   integer less than 53.

   The specific version of a SenML pack is composed of a set of
   features.  The SenML version number ("bver" field) is then a bitmap
   of these features, specifically the sum of, for each feature present,
   two taken to the power of the feature code of that feature.

                __ 52                      fc
   version  =  \          present(fc) ⋅ 2
               /__ fc = 0

   where present(fc) is 1 if the feature with the feature code "fc" is
   present, 0 otherwise.

2.1.  Discussion

   Representing features as a bitmap within a number is quite efficient
   as long as feature codes are sparingly allocated (see also
   Section 6).

   Compatibility with the existing SenML version number, 10 decimal
   (0b1010), requires reserving four of the lower-most bit positions
   Section 3.  There is an upper limit to the range of the integer
   numbers that can be represented in all SenML representations:
   practical JSON limits this to 2^(53)-1 [RFC7493].  This means the
   feature codes 4 to 52 are available, one of which is taken by
   Section 4, leaving 48 for allocation.  (The current version 10 (with

Bormann                  Expires 25 August 2021                 [Page 3]
Internet-Draft         SenML Features and Versions         February 2021

   all other feature codes unset) can be visualized as
   "0b00000000000000000000000000000000000000000000000001010".)  For a
   lifetime of this scheme of several decades, approximately two feature
   codes per year or less should be allocated.  (More boutique features
   can always be communicated by must-understand fields, see Section 4.4
   of [RFC8428].)

   Most representations visible to engineers working with SenML will use
   decimal numbers, e.g. 26 (0b11010, 0x1a) for a version that adds the
   "Secondary Units" feature (Section 4).  This is sightly unwieldy, but
   will be quickly memorized in practice.

3.  Features: Reserved0, Reserved1, Reserved2, Reserved3

   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
   present and the features Reserved0 (0) and Reserved2 (2) are always
   absent, yielding a version number of 10 if no other feature is in
   use.  These four reserved feature codes are not to be used with any
   more specific semantics except in a specification that updates the
   present specification.

4.  Feature: Secondary Units

   The feature "Secondary Units" (code number 4) indicates that
   secondary unit names [RFC8798] MAY be be used in the "u" field of
   SenML Records, in addition to the primary unit names already allowed
   by [RFC8428].

   Note that the most basic use of this feature simply sets the SenML
   version number to 26 (10 + 2^(4)).

5.  Security Considerations

   The security considerations of [RFC8428] apply.  This specification
   provides structure to the interpretation of the SenML version number,
   which poses no additional security considerations except for some
   potential for surprise that version numbers do not simply increase
   linearly.

6.  IANA Considerations

   IANA is requested to create a new subregistry "SenML features" within
   the SenML registry [IANA.senml], with the registration policy
   "specification required" [RFC8126] and the columns:

   *  Feature code (an unsigned integer less than 53)

Bormann                  Expires 25 August 2021                 [Page 4]
Internet-Draft         SenML Features and Versions         February 2021

   *  Feature name (text)

   *  Specification

   The initial content of this registry is as follows:

            +==============+=================+===============+
            | Feature code | Feature name    | Specification |
            +==============+=================+===============+
            | 0            | Reserved0       | RFCthis       |
            +--------------+-----------------+---------------+
            | 1            | Reserved1       | RFCthis       |
            +--------------+-----------------+---------------+
            | 2            | Reserved2       | RFCthis       |
            +--------------+-----------------+---------------+
            | 3            | Reserved3       | RFCthis       |
            +--------------+-----------------+---------------+
            | 4            | Secondary Units | RFCthis       |
            +--------------+-----------------+---------------+

                Table 1: Features defined for SenML at the
                             time of writing

   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
   specifically instructed to maintain a frugal regime of code point
   allocation, keeping code points available for SenML Features that are
   likely to be useful for non-trivial subsets of the SenML ecosystem.
   Quantitatively, the expert could for instance steer the allocation to
   not allocate more than 10 % of the remaining set per year.

7.  References

7.1.  Normative References

   [C]        International Organization for Standardization,
              "Information technology — Programming languages — C", ISO/
              IEC 9899:2018, Fourth Edition, June 2018,
              <https://www.iso.org/standard/74528.html>.

   [Cplusplus]
              International Organization for Standardization,
              "Programming languages — C++", ISO/IEC 14882:2020, Sixth
              Edition, December 2020,
              <https://www.iso.org/standard/79358.html>.

Bormann                  Expires 25 August 2021                 [Page 5]
Internet-Draft         SenML Features and Versions         February 2021

   [IANA.senml]
              IANA, "Sensor Measurement Lists (SenML)",
              <http://www.iana.org/assignments/senml>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC8126]  Cotton, M., Leiba, B., and T. Narten, "Guidelines for
              Writing an IANA Considerations Section in RFCs", BCP 26,
              RFC 8126, DOI 10.17487/RFC8126, June 2017,
              <https://www.rfc-editor.org/info/rfc8126>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8428]  Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C.
              Bormann, "Sensor Measurement Lists (SenML)", RFC 8428,
              DOI 10.17487/RFC8428, August 2018,
              <https://www.rfc-editor.org/info/rfc8428>.

   [RFC8798]  Bormann, C., "Additional Units for Sensor Measurement
              Lists (SenML)", RFC 8798, DOI 10.17487/RFC8798, June 2020,
              <https://www.rfc-editor.org/info/rfc8798>.

7.2.  Informative References

   [RFC7493]  Bray, T., Ed., "The I-JSON Message Format", RFC 7493,
              DOI 10.17487/RFC7493, March 2015,
              <https://www.rfc-editor.org/info/rfc7493>.

Acknowledgements

   Ari Keränen proposed to use the version number as a bitmap and
   provided further input on this specification.  Jaime Jiménez help
   clarify the document by providing a review.

Author's Address

   Carsten Bormann
   Universitaet Bremen TZI
   Postfach 330440
   D-28359 Bremen
   Germany

   Phone: +49-421-218-63921

Bormann                  Expires 25 August 2021                 [Page 6]
Internet-Draft         SenML Features and Versions         February 2021

   Email: cabo@tzi.org

Bormann                  Expires 25 August 2021                 [Page 7]