draft-ietf-core-senml-00.txt   draft-ietf-core-senml-01.txt 
Network Working Group C. Jennings Network Working Group C. Jennings
Internet-Draft Cisco Internet-Draft Cisco
Intended status: Standards Track Z. Shelby Intended status: Standards Track Z. Shelby
Expires: October 21, 2016 ARM Expires: January 9, 2017 ARM
J. Arkko J. Arkko
A. Keranen A. Keranen
Ericsson Ericsson
April 19, 2016 C. Bormann
Universitaet Bremen TZI
July 8, 2016
Media Types for Sensor Markup Language (SenML) Media Types for Sensor Markup Language (SenML)
draft-ietf-core-senml-00 draft-ietf-core-senml-01
Abstract Abstract
This specification defines media types for representing simple sensor This specification defines media types for representing simple sensor
measurements and device parameters in the Sensor Markup Language measurements and device parameters in the Sensor Markup Language
(SenML). Representations are defined in JavaScript Object Notation (SenML). Representations are defined in JavaScript Object Notation
(JSON), Concise Binary Object Representation (CBOR), eXtensible (JSON), Concise Binary Object Representation (CBOR), eXtensible
Markup Language (XML), and Efficient XML Interchange (EXI), which Markup Language (XML), and Efficient XML Interchange (EXI), which
share the common SenML data model. A simple sensor, such as a share the common SenML data model. A simple sensor, such as a
temperature sensor, could use this media type in protocols such as temperature sensor, could use this media type in protocols such as
skipping to change at page 1, line 42 skipping to change at page 1, line 44
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 October 21, 2016. This Internet-Draft will expire on January 9, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 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
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Requirements and Design Goals . . . . . . . . . . . . . . . . 3 2. Requirements and Design Goals . . . . . . . . . . . . . . . . 4
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5
4. Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . 5 4. SenML Structure and Semantics . . . . . . . . . . . . . . . . 5
5. Associating Meta-data . . . . . . . . . . . . . . . . . . . . 8 4.1. Base attributes . . . . . . . . . . . . . . . . . . . . . 5
6. JSON Representation (application/senml+json) . . . . . . . . 8 4.2. Regular attributes . . . . . . . . . . . . . . . . . . . 6
6.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 9 4.3. Considerations . . . . . . . . . . . . . . . . . . . . . 6
6.1.1. Single Datapoint . . . . . . . . . . . . . . . . . . 9 4.4. Associating Meta-data . . . . . . . . . . . . . . . . . . 8
6.1.2. Multiple Datapoints . . . . . . . . . . . . . . . . . 9 5. JSON Representation (application/senml+json) . . . . . . . . 8
6.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 10 5.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 9
6.1.4. Collection of Resources . . . . . . . . . . . . . . . 11 5.1.1. Single Datapoint . . . . . . . . . . . . . . . . . . 9
7. CBOR Representation (application/senml+cbor) . . . . . . . . 12 5.1.2. Multiple Datapoints . . . . . . . . . . . . . . . . . 9
8. XML Representation (application/senml+xml) . . . . . . . . . 13 5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 11
9. EXI Representation (application/senml-exi) . . . . . . . . . 15 5.1.4. Collection of Resources . . . . . . . . . . . . . . . 12
10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 19 6. CBOR Representation (application/senml+cbor) . . . . . . . . 12
11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 7. XML Representation (application/senml+xml) . . . . . . . . . 13
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 8. EXI Representation (application/senml-exi) . . . . . . . . . 15
12.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 21 9. Usage Considerations . . . . . . . . . . . . . . . . . . . . 17
12.2. SenML label registry . . . . . . . . . . . . . . . . . . 24 10. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
12.3. Media Type Registration . . . . . . . . . . . . . . . . 24 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20
12.3.1. senml+json Media Type Registration . . . . . . . . . 24 11.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 20
12.3.2. senml+cbor Media Type Registration . . . . . . . . . 25 11.2. SenML label registry . . . . . . . . . . . . . . . . . . 23
12.3.3. senml+xml Media Type Registration . . . . . . . . . 26 11.3. Media Type Registration . . . . . . . . . . . . . . . . 24
12.3.4. senml-exi Media Type Registration . . . . . . . . . 27 11.3.1. senml+json Media Type Registration . . . . . . . . . 24
12.4. XML Namespace Registration . . . . . . . . . . . . . . . 28 11.3.2. senml+cbor Media Type Registration . . . . . . . . . 25
12.5. CoAP Content-Format Registration . . . . . . . . . . . . 28 11.3.3. senml+xml Media Type Registration . . . . . . . . . 26
13. Security Considerations . . . . . . . . . . . . . . . . . . . 28 11.3.4. senml-exi Media Type Registration . . . . . . . . . 27
14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 29 11.4. XML Namespace Registration . . . . . . . . . . . . . . . 28
15. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 29 11.5. CoAP Content-Format Registration . . . . . . . . . . . . 28
16. References . . . . . . . . . . . . . . . . . . . . . . . . . 29 12. Security Considerations . . . . . . . . . . . . . . . . . . . 28
16.1. Normative References . . . . . . . . . . . . . . . . . . 29 13. Privacy Considerations . . . . . . . . . . . . . . . . . . . 28
16.2. Informative References . . . . . . . . . . . . . . . . . 30 14. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 29
15. References . . . . . . . . . . . . . . . . . . . . . . . . . 29
15.1. Normative References . . . . . . . . . . . . . . . . . . 29
15.2. Informative References . . . . . . . . . . . . . . . . . 30
Appendix A. Links extension . . . . . . . . . . . . . . . . . . 31 Appendix A. Links extension . . . . . . . . . . . . . . . . . . 31
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31
1. Overview 1. Overview
Connecting sensors to the internet is not new, and there have been Connecting sensors to the Internet is not new, and there have been
many protocols designed to facilitate it. This specification defines many protocols designed to facilitate it. This specification defines
new media types for carrying simple sensor information in a protocol new media types for carrying simple sensor information in a protocol
such as HTTP or CoAP called the Sensor Markup Language (SenML). This such as HTTP or CoAP. This format was designed so that processors
format was designed so that processors with very limited capabilities with very limited capabilities could easily encode a sensor
could easily encode a sensor measurement into the media type, while measurement into the media type, while at the same time a server
at the same time a server parsing the data could relatively parsing the data could relatively efficiently collect a large number
efficiently collect a large number of sensor measurements. The of sensor measurements. The markup language can be used for a
markup language can be used for a variety of data flow models, most variety of data flow models, most notably data feeds pushed from a
notably data feeds pushed from a sensor to a collector, and the web sensor to a collector, and the web resource model where the sensor is
resource model where the sensor is requested as a resource requested as a resource representation (e.g., "GET /sensor/
representation (e.g., "GET /sensor/temperature"). temperature").
There are many types of more complex measurements and measurements There are many types of more complex measurements and measurements
that this media type would not be suitable for. SenML strikes a that this media type would not be suitable for. SenML strikes a
balance between having some information about the sensor carried with balance between having some information about the sensor carried with
the sensor data so that the data is self describing but it also tries the sensor data so that the data is self describing but it also tries
to make that a fairly minimal set of auxiliary information for to make that a fairly minimal set of auxiliary information for
efficiency reason. Other information about the sensor can be efficiency reason. Other information about the sensor can be
discovered by other methods such as using the CoRE Link Format discovered by other methods such as using the CoRE Link Format
[RFC6690]. [RFC6690].
skipping to change at page 3, line 45 skipping to change at page 3, line 51
are defined for JSON [RFC7159], CBOR [RFC7049], XML, and Efficient are defined for JSON [RFC7159], CBOR [RFC7049], XML, and Efficient
XML Interchange (EXI) [W3C.REC-exi-20110310]. XML Interchange (EXI) [W3C.REC-exi-20110310].
For example, the following shows a measurement from a temperature For example, the following shows a measurement from a temperature
gauge encoded in the JSON syntax. gauge encoded in the JSON syntax.
[{ "n": "urn:dev:ow:10e2073a01080063", "v":23.1, "u":"Cel" }] [{ "n": "urn:dev:ow:10e2073a01080063", "v":23.1, "u":"Cel" }]
In the example above, the array has a single SenML Record with a In the example above, the array has a single SenML Record with a
measurement for a sensor named "urn:dev:ow:10e2073a01080063" with a measurement for a sensor named "urn:dev:ow:10e2073a01080063" with a
current value of 23.5 degrees Celsius. current value of 23.1 degrees Celsius.
2. Requirements and Design Goals 2. Requirements and Design Goals
The design goal is to be able to send simple sensor measurements in The design goal is to be able to send simple sensor measurements in
small packets on mesh networks from large numbers of constrained small packets on mesh networks from large numbers of constrained
devices. Keeping the total size of payload under 80 bytes makes this devices. Keeping the total size of payload under 80 bytes makes this
easy to use on a wireless mesh network. It is always difficult to easy to use on a wireless mesh network. It is always difficult to
define what small code is, but there is a desire to be able to define what small code is, but there is a desire to be able to
implement this in roughly 1 KB of flash on a 8 bit microprocessor. implement this in roughly 1 KB of flash on a 8 bit microprocessor.
Experience with Google power meter and large scale deployments has Experience with Google power meter and large scale deployments has
skipping to change at page 4, line 42 skipping to change at page 4, line 49
elements in that record and any records that follow it. So a more elements in that record and any records that follow it. So a more
compact form of the example above is the following. compact form of the example above is the following.
[ [
{ "bn": "urn:dev:ow:10e2073a01080063", { "bn": "urn:dev:ow:10e2073a01080063",
"t": 1276020076, "v":23.5, "u":"Cel" }, "t": 1276020076, "v":23.5, "u":"Cel" },
{ "t": 1276020091, "v":23.6, "u":"Cel" } { "t": 1276020091, "v":23.6, "u":"Cel" }
] ]
In the above example the Base Name is in the "bn" tag and the "n" In the above example the Base Name is in the "bn" tag and the "n"
tags in each Record are the empty string so they are omitted. The tags in each Record are the empty string so they are omitted.
Base Name also could be put in a separate Record such as in the
following example.
[
{ "bn": "urn:dev:ow:10e2073a01080063" },
{ "t": 1276020076, "v":23.5, "u":"Cel" },
{ "t": 1276020091, "v":23.6, "u":"Cel" }
]
Some devices have accurate time while others do not so SenML supports Some devices have accurate time while others do not so SenML supports
absolute and relative times. Time is represented in floating point absolute and relative times. Time is represented in floating point
as seconds and values greater than zero represent an absolute time as seconds and values greater than zero represent an absolute time
relative to the unix epoch while values of 0 or less represent a relative to the Unix epoch while values of 0 or less represent a
relative time in the past from the current time. A simple sensor relative time in the past from the current time. A simple sensor
with no absolute wall clock time might take a measurement every with no absolute wall clock time might take a measurement every
second and batch up 60 of them then send it to a server. It would second and batch up 60 of them then send it to a server. It would
include the relative time the measurement was made to the time the include the relative time the measurement was made to the time the
batch was send in the SenML Pack. The server might have accurate NTP batch was send in the SenML Pack. The server might have accurate NTP
time and use the time it received the data, and the relative offset, time and use the time it received the data, and the relative offset,
to replace the times in the SenML with absolute times before saving to replace the times in the SenML with absolute times before saving
the SenML Pack in a document database. the SenML Pack in a document database.
3. Terminology 3. Terminology
skipping to change at page 5, line 31 skipping to change at page 5, line 29
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. [RFC2119].
This document also uses the following terms: This document also uses the following terms:
SenML Record: One measurement or configuration instance in time SenML Record: One measurement or configuration instance in time
presented using the SenML data model. presented using the SenML data model.
SenML Pack: One or more SenML Records in an array structure. SenML Pack: One or more SenML Records in an array structure.
4. Semantics 4. SenML Structure and Semantics
Each SenML Pack carries a single array that represents a set of Each SenML Pack carries a single array that represents a set of
measurements and/or parameters. This array contains a series of measurements and/or parameters. This array contains a series of
objects with several optional attributes described below: SenML Records with several attributes described below. There are two
kind of attributes: base and regular. The base attributes can only
be included in the first SenML Record and they apply to the entries
in all Records. All base attributes are optional. Regular
attributes can be included in any SenML Record and apply only to that
Record.
4.1. Base attributes
Base Name: This is a string that is prepended to the names found in Base Name: This is a string that is prepended to the names found in
the entries. This attribute is optional. This applies to the the entries.
entries in all Records. A Base Name can only be included in the
first Record of the array.
Base Time: A base time that is added to the time found in an entry. Base Time: A base time that is added to the time found in an entry.
This attribute is optional. This applies to the entries in all
Records. A Base Time can only be included in the first Record of
the array.
Base Unit: A base unit that is assumed for all entries, unless Base Unit: A base unit that is assumed for all entries, unless
otherwise indicated. This attribute is optional. If a record otherwise indicated. If a record does not contain a unit value,
does not contain a unit value, then the base unit is used then the base unit is used. Otherwise the value of found in the
otherwise the value of found in the Unit is used. This applies to Unit is used.
the entries in all Records. A Base Unit can only be included in
the first object of the array.
Base Value: A base value is added to the value found in an entry, Base Value: A base value is added to the value found in an entry,
similar to Base Time. This attribute is optional. This applies similar to Base Time.
to the entries in all Records. A Base Value can only be included
in the first Record of the array.
Version: Version number of media type format. This attribute is Version: Version number of media type format. This attribute is an
optional positive integer and defaults to 5 if not present. A optional positive integer and defaults to 5 if not present. [RFC
Version can only be included in the first object of the array. Editor: change the default value to 10 when this specification is
published as an RFC and remove this note]
4.2. Regular attributes
Name: Name of the sensor or parameter. When appended to the Base Name: Name of the sensor or parameter. When appended to the Base
Name attribute, this must result in a globally unique identifier Name attribute, this must result in a globally unique identifier
for the resource. The name is optional, if the Base Name is for the resource. The name is optional, if the Base Name is
present. If the name is missing, Base Name must uniquely identify present. If the name is missing, Base Name must uniquely identify
the resource. This can be used to represent a large array of the resource. This can be used to represent a large array of
measurements from the same sensor without having to repeat its measurements from the same sensor without having to repeat its
identifier on every measurement. identifier on every measurement.
Unit: Units for a measurement value. Optional. If the Record has Unit: Units for a measurement value. Optional. If the Record has
not Unit, the Base Unit is used as the Unit. Having no Unit and no Unit, the Base Unit is used as the Unit. Having no Unit and no
no Base Unit is allowed. Base Unit is allowed.
Value Value of the entry. Optional if a Sum value is present, Value Value of the entry. Optional if a Sum value is present,
otherwise required. Values are represented using three basic data otherwise required. Values are represented using three basic data
types, Floating point numbers ("v" field for "Value"), Booleans types, Floating point numbers ("v" field for "Value"), Booleans
("vb" for "Boolean Value"), Strings ("vs" for "String Value") and ("vb" for "Boolean Value"), Strings ("vs" for "String Value") and
Data ("vd" for "Binary Data Value") . Exactly one of these three Binary Data ("vd" for "Data Value") . Exactly one of these four
fields MUST appear unless there is Sum field in which case it is fields MUST appear unless there is Sum field in which case it is
allowed to have no Value field or to have "v" field. allowed to have no Value field or to have "v" field.
Sum: Integrated sum of the values over time. Optional. This Sum: Integrated sum of the values over time. Optional. This
attribute is in the units specified in the Unit value multiplied attribute is in the units specified in the Unit value multiplied
by seconds. by seconds.
Time: Time when value was recorded. Optional. Time: Time when value was recorded. Optional.
Update Time: An optional time in seconds that represents the maximum Update Time: An optional time in seconds that represents the maximum
time before this sensor will provide an updated reading for a time before this sensor will provide an updated reading for a
measurement. This can be used to detect the failure of sensors or measurement. This can be used to detect the failure of sensors or
communications path from the sensor. communications path from the sensor.
4.3. Considerations
The SenML format can be extended with further custom attributes. The SenML format can be extended with further custom attributes.
TODO - describe what extensions are possible and how to do them. Both new base and regular attributes are allowed. See Section 11.2
for details. Implementations MUST ignore attributes they don't
recognize.
Systems reading one of the objects MUST check for the Version Systems reading one of the objects MUST check for the Version
attribute. If this value is a version number larger than the version attribute. If this value is a version number larger than the version
which the system understands, the system SHOULD NOT use this object. which the system understands, the system SHOULD NOT use this object.
This allows the version number to indicate that the object contains This allows the version number to indicate that the object contains
mandatory to understand attributes. New version numbers can only be mandatory to understand attributes. New version numbers can only be
defined in an RFC that updates this specification or it successors. defined in an RFC that updates this specification or it successors.
The Name value is concatenated to the Base Name value to get the name The Name value is concatenated to the Base Name value to get the name
of the sensor. The resulting name needs to uniquely identify and of the sensor. The resulting name needs to uniquely identify and
skipping to change at page 8, line 5 skipping to change at page 8, line 7
time and the measurement was made roughly "now". A negative value is time and the measurement was made roughly "now". A negative value is
used to indicate seconds in the past from roughly "now". A positive used to indicate seconds in the past from roughly "now". A positive
value is used to indicate the number of seconds, excluding leap value is used to indicate the number of seconds, excluding leap
seconds, since the start of the year 1970 in UTC. seconds, since the start of the year 1970 in UTC.
Representing the statistical characteristics of measurements, such as Representing the statistical characteristics of measurements, such as
accuracy, can be very complex. Future specification may add new accuracy, can be very complex. Future specification may add new
attributes to provide better information about the statistical attributes to provide better information about the statistical
properties of the measurement. properties of the measurement.
5. Associating Meta-data A SenML object is referred to as "expanded" if it does not contain
any base values and has no relative times.
4.4. Associating Meta-data
SenML is designed to carry the minimum dynamic information about SenML is designed to carry the minimum dynamic information about
measurements, and for efficiency reasons does not carry significant measurements, and for efficiency reasons does not carry significant
static meta-data about the device, object or sensors. Instead, it is static meta-data about the device, object or sensors. Instead, it is
assumed that this meta-data is carried out of band. For web assumed that this meta-data is carried out of band. For web
resources using SenML Packs, this meta-data can be made available resources using SenML Packs, this meta-data can be made available
using the CoRE Link Format [RFC6690]. The most obvious use of this using the CoRE Link Format [RFC6690]. The most obvious use of this
link format is to describe that a resource is available in a SenML link format is to describe that a resource is available in a SenML
format in the first place. The relevant media type indicator is format in the first place. The relevant media type indicator is
included in the Content-Type (ct=) attribute. included in the Content-Type (ct=) attribute.
6. JSON Representation (application/senml+json) 5. JSON Representation (application/senml+json)
Record atributes: The SenML labels (JSON object member names) shown in Table 1 are used
in JSON SenML Record attributes.
+---------------+------+---------+ +---------------+-------+---------+
| SenML | JSON | Type | | Name | label | Type |
+---------------+------+---------+ +---------------+-------+---------+
| Base Name | bn | String | | Base Name | bn | String |
| Base Time | bt | Number | | Base Time | bt | Number |
| Base Unit | bu | String | | Base Unit | bu | String |
| Base Value | bv | Number | | Base Value | bv | Number |
| Version | bver | Number | | Version | bver | Number |
| Name | n | String | | Name | n | String |
| Unit | u | String | | Unit | u | String |
| Value | v | Number | | Value | v | Number |
| String Value | vs | String | | String Value | vs | String |
| Boolean Value | vb | Boolean | | Boolean Value | vb | Boolean |
| Data Value | vd | String | | Data Value | vd | String |
| Value Sum | s | Number | | Value Sum | s | Number |
| Time | t | Number | | Time | t | Number |
| Update Time | ut | Number | | Update Time | ut | Number |
+---------------+------+---------+ +---------------+-------+---------+
The root content consists of an array with JSON objects for each Table 1: JSON SenML Labels
The root content consists of an array with one JSON object for each
SenML Record. All the fields in the above table MAY occur in the SenML Record. All the fields in the above table MAY occur in the
records with the type specified in the table. records with the type specified in the table.
Only the UTF-8 form of JSON is allowed. Characters in the String Only the UTF-8 form of JSON is allowed. Characters in the String
Value are encoded using the escape sequences defined in [RFC4627]. Value are encoded using the escape sequences defined in [RFC7159].
Characters in the Data Value are base64 encoded with URL safe Characters in the Data Value are base64 encoded with URL safe
alphabet as defined in Section 5 of [RFC4648]. alphabet as defined in Section 5 of [RFC4648].
Systems receiving measurements MUST be able to process the range of Systems receiving measurements MUST be able to process the range of
floating point numbers that are representable as an IEEE double- floating point numbers that are representable as an IEEE double-
precision floating-point numbers [IEEE.754.1985]. The number of precision floating-point numbers [IEEE.754.1985]. The number of
significant digits in any measurement is not relevant, so a reading significant digits in any measurement is not relevant, so a reading
of 1.1 has exactly the same semantic meaning as 1.10. If the value of 1.1 has exactly the same semantic meaning as 1.10. If the value
has an exponent, the "e" MUST be in lower case. The mantissa SHOULD has an exponent, the "e" MUST be in lower case. The mantissa SHOULD
be less than 19 characters long and the exponent SHOULD be less than be less than 19 characters long and the exponent SHOULD be less than
5 characters long. This allows time values to have better than micro 5 characters long. This allows time values to have better than micro
second precision over the next 100 years. second precision over the next 100 years.
6.1. Examples 5.1. Examples
TODO - Add example with string, data, boolean, and base value TODO - Add example with string, data, boolean, and base value
6.1.1. Single Datapoint 5.1.1. Single Datapoint
The following shows a temperature reading taken approximately "now" The following shows a temperature reading taken approximately "now"
by a 1-wire sensor device that was assigned the unique 1-wire address by a 1-wire sensor device that was assigned the unique 1-wire address
of 10e2073a01080063: of 10e2073a01080063:
[{ "n": "urn:dev:ow:10e2073a01080063", "v":23.1, "u":"Cel" }] [{ "n": "urn:dev:ow:10e2073a01080063", "v":23.1, "u":"Cel" }]
6.1.2. Multiple Datapoints 5.1.2. Multiple Datapoints
The following example shows voltage and current now, i.e., at an The following example shows voltage and current now, i.e., at an
unspecified time. unspecified time.
[{"bn": "urn:dev:ow:10e2073a01080063/"}, [ {"bn": "urn:dev:ow:10e2073a01080063",
{ "n": "voltage", "t": 0, "u": "V", "v": 120.1 }, "n": "voltage", "t": 0, "u": "V", "v": 120.1 },
{ "n": "current", "t": 0, "u": "A", "v": 1.2 } {"n": "current", "t": 0, "u": "A", "v": 1.2 }
] ]
The next example is similar to the above one, but shows current at The next example is similar to the above one, but shows current at
Tue Jun 8 18:01:16 UTC 2010 and at each second for the previous 5 Tue Jun 8 18:01:16.001 UTC 2010 and at each second for the previous 5
seconds. seconds.
[{"bn": "urn:dev:ow:10e2073a01080063/", [{"bn": "urn:dev:ow:10e2073a01080063/",
"bt": 1276020076.001, "bt": 1276020076.001,
"bu": "A", "bu": "A",
"bver": 5}, "bver": 5,
{ "n": "voltage", "u": "V", "v": 120.1 }, "n": "voltage", "u": "V", "v": 120.1 },
{ "n": "current", "t": -5, "v": 1.2 }, { "n": "current", "t": -5, "v": 1.2 },
{ "n": "current", "t": -4, "v": 1.30 }, { "n": "current", "t": -4, "v": 1.30 },
{ "n": "current", "t": -3, "v": 0.14e1 }, { "n": "current", "t": -3, "v": 0.14e1 },
{ "n": "current", "t": -2, "v": 1.5 }, { "n": "current", "t": -2, "v": 1.5 },
{ "n": "current", "t": -1, "v": 1.6 }, { "n": "current", "t": -1, "v": 1.6 },
{ "n": "current", "t": 0, "v": 1.7 } { "n": "current", "t": 0, "v": 1.7 }
] ]
Note that in some usage scenarios of SenML the implementations MAY Note that in some usage scenarios of SenML the implementations MAY
store or transmit SenML in a stream-like fashion, where data is store or transmit SenML in a stream-like fashion, where data is
collected over time and continuously added to the object. This mode collected over time and continuously added to the object. This mode
of operation is optional, but systems or protocols using SenML in of operation is optional, but systems or protocols using SenML in
this fashion MUST specify that they are doing this. SenML defines a this fashion MUST specify that they are doing this. SenML defines a
separate mime type (TODO) to indicate Sensor Streaming Markup separate media type to indicate Sensor Streaming Markup Language
Language (SensML) for this usage. In this situation the SensML (SensML) for this usage (see Section 11.3.1). In this situation the
stream can be sent and received in a partial fashion, i.e., a SensML stream can be sent and received in a partial fashion, i.e., a
measurement entry can be read as soon as the SenML Record is received measurement entry can be read as soon as the SenML Record is received
and not have to wait for the full SensML Stream to be complete. and not have to wait for the full SensML Stream to be complete.
For instance, the following stream of measurements may be sent via a For instance, the following stream of measurements may be sent via a
long lived HTTP POST from the producer of a SensML to the consumer of long lived HTTP POST from the producer of a SensML to the consumer of
that, and each measurement object may be reported at the time it that, and each measurement object may be reported at the time it was
measured: measured:
[ {"bn": "urn:dev:ow:10e2073a01080063", [ {"bn": "urn:dev:ow:10e2073a01080063",
"bt": 1320067464, "bt": 1320067464,
"bu": "%RH"}, "bu": "%RH",
{ "v": 21.2, "t": 0 }, "v": 21.2, "t": 0 },
{ "v": 21.3, "t": 10 }, { "v": 21.3, "t": 10 },
{ "v": 21.4, "t": 20 }, { "v": 21.4, "t": 20 },
{ "v": 21.4, "t": 30 }, { "v": 21.4, "t": 30 },
{ "v": 21.5, "t": 40 }, { "v": 21.5, "t": 40 },
{ "v": 21.5, "t": 50 }, { "v": 21.5, "t": 50 },
{ "v": 21.5, "t": 60 }, { "v": 21.5, "t": 60 },
{ "v": 21.6, "t": 70 }, { "v": 21.6, "t": 70 },
{ "v": 21.7, "t": 80 }, { "v": 21.7, "t": 80 },
{ "v": 21.5, "t": 90 }, { "v": 21.5, "t": 90 },
... ...
6.1.3. Multiple Measurements 5.1.3. Multiple Measurements
The following example shows humidity measurements from a mobile The following example shows humidity measurements from a mobile
device with an IPv6 address 2001:db8::1, starting at Mon Oct 31 device with a 1-wire address 10e2073a01080063, starting at Mon Oct 31
13:24:24 UTC 2011. The device also provides position data, which is 13:24:24 UTC 2011. The device also provides position data, which is
provided in the same measurement or parameter array as separate provided in the same measurement or parameter array as separate
entries. Note time is used to for correlating data that belongs entries. Note time is used to for correlating data that belongs
together, e.g., a measurement and a parameter associated with it. together, e.g., a measurement and a parameter associated with it.
Finally, the device also reports extra data about its battery status Finally, the device also reports extra data about its battery status
at a separate time. at a separate time.
[{"bn": "urn:dev:ow:10e2073a01080063", [{"bn": "urn:dev:ow:10e2073a01080063",
"bt": 1320067464, "bt": 1320067464,
"bu": "%RH"}, "bu": "%RH",
{ "v": 20.0, "t": 0 }, "v": 20.0, "t": 0 },
{ "v": 24.30621, "u": "lon", "t": 0 }, { "v": 24.30621, "u": "lon", "t": 0 },
{ "v": 60.07965, "u": "lat", "t": 0 }, { "v": 60.07965, "u": "lat", "t": 0 },
{ "v": 20.3, "t": 60 }, { "v": 20.3, "t": 60 },
{ "v": 24.30622, "u": "lon", "t": 60 }, { "v": 24.30622, "u": "lon", "t": 60 },
{ "v": 60.07965, "u": "lat", "t": 60 }, { "v": 60.07965, "u": "lat", "t": 60 },
{ "v": 20.7, "t": 120 }, { "v": 20.7, "t": 120 },
{ "v": 24.30623, "u": "lon", "t": 120 }, { "v": 24.30623, "u": "lon", "t": 120 },
{ "v": 60.07966, "u": "lat", "t": 120 }, { "v": 60.07966, "u": "lat", "t": 120 },
{ "v": 98.0, "u": "%EL", "t": 150 }, { "v": 98.0, "u": "%EL", "t": 150 },
{ "v": 21.2, "t": 180 }, { "v": 21.2, "t": 180 },
{ "v": 24.30628, "u": "lon", "t": 180 }, { "v": 24.30628, "u": "lon", "t": 180 },
{ "v": 60.07967, "u": "lat", "t": 180 } { "v": 60.07967, "u": "lat", "t": 180 }
] ]
The size of this example represented in various forms, as well as The size of this example represented in various forms, as well as
that form compressed with gzip is given in the following table. that form compressed with gzip is given in the following table.
+----------+------+-----------------+ +----------+------+-----------------+
| Encoding | Size | Compressed Size | | Encoding | Size | Compressed Size |
+----------+------+-----------------+ +----------+------+-----------------+
| JSON | 567 | 200 | | JSON | 573 | 206 |
| XML | 656 | 232 | | XML | 649 | 235 |
| CBOR | 292 | 192 | | CBOR | 254 | 196 |
| EXI | 160 | 183 | | EXI | 173 | 196 |
+----------+------+-----------------+ +----------+------+-----------------+
Table 1: Size Comparisons Table 2: Size Comparisons
Note the CBOR and EXI sizes are not using the schema guidance so the Note the EXI sizes are not using the schema guidance so the EXI
could be a bit smaller. representation could be a bit smaller.
6.1.4. Collection of Resources 5.1.4. Collection of Resources
The following example shows how to query one device that can provide The following example shows how to query one device that can provide
multiple measurements. The example assumes that a client has fetched multiple measurements. The example assumes that a client has fetched
information from a device at 2001:db8::2 by performing a GET information from a device at 2001:db8::2 by performing a GET
operation on http://[2001:db8::2] at Mon Oct 31 16:27:09 UTC 2011, operation on http://[2001:db8::2] at Mon Oct 31 16:27:09 UTC 2011,
and has gotten two separate values as a result, a temperature and and has gotten two separate values as a result, a temperature and
humidity measurement. humidity measurement.
[{"bn": "urn:dev:ow:10e2073a01080063/", [{"bn": "http://[2001:db8::2]/",
"bt": 1320078429, "bt": 1320078429,
"bver": 5 "bver": 5,
}, "n": "temperature", "v": 27.2, "u": "Cel" },
{ "n": "temperature", "v": 27.2, "u": "Cel" },
{ "n": "humidity", "v": 80, "u": "%RH" } { "n": "humidity", "v": 80, "u": "%RH" }
] ]
7. CBOR Representation (application/senml+cbor) 6. CBOR Representation (application/senml+cbor)
The CBOR [RFC7049] representation is equivalent to the JSON The CBOR [RFC7049] representation is equivalent to the JSON
representation, with the following changes: representation, with the following changes:
o For compactness, the CBOR representation uses integers for the map o For compactness, the CBOR representation uses integers for the map
keys defined in Table 2. This table is conclusive, i.e., there is keys defined in Table 3. This table is conclusive, i.e., there is
no intention to define any additional integer map keys; any no intention to define any additional integer map keys; any
extensions will use string map keys. extensions will use string map keys.
o For JSON Numbers, the CBOR representation can use integers, o For JSON Numbers, the CBOR representation can use integers,
floating point numbers, or decimal fractions (CBOR Tag 4); the floating point numbers, or decimal fractions (CBOR Tag 4); the
common limitations of JSON implementations are not relevant for common limitations of JSON implementations are not relevant for
these. For the version number, however, only an unsigned integer these. For the version number, however, only an unsigned integer
is allowed. is allowed.
+---------------+------------+------------+ +---------------+------------+------------+
skipping to change at page 12, line 48 skipping to change at page 13, line 24
| Units | u | 1 | | Units | u | 1 |
| Value | v | 2 | | Value | v | 2 |
| String Value | vs | 3 | | String Value | vs | 3 |
| Boolean Value | vb | 4 | | Boolean Value | vb | 4 |
| Value Sum | s | 5 | | Value Sum | s | 5 |
| Time | t | 6 | | Time | t | 6 |
| Update Time | ut | 7 | | Update Time | ut | 7 |
| Data Value | vd | 8 | | Data Value | vd | 8 |
+---------------+------------+------------+ +---------------+------------+------------+
Table 2: CBOR representation: integers for map keys Table 3: CBOR representation: integers for map keys
The following example shows an hexdump of the CBOR example for the
same sensor measurement as in Section 6.1.2.
0000 88 a4 62 62 6e 78 1c 75 72 6e 3a 64 65 76 3a 6f |..bbnx.urn:dev:o|
0010 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 30 30 |w:10e2073a010800|
0020 36 33 2f 62 62 74 fb 41 d3 03 a1 5b 00 10 62 62 |63/bbt.A...[..bb|
0030 62 75 61 41 64 62 76 65 72 05 a3 61 6e 67 76 6f |buaAdbver..angvo|
0040 6c 74 61 67 65 61 75 61 56 61 76 fb 40 5e 06 66 |ltageauaVav.@^.f|
0050 66 66 66 66 a3 61 6e 67 63 75 72 72 65 6e 74 61 |ffff.angcurrenta|
0060 74 fb c0 14 00 00 00 00 00 00 61 76 fb 3f f3 33 |t.........av.?.3|
0070 33 33 33 33 33 a3 61 6e 67 63 75 72 72 65 6e 74 |33333.angcurrent|
0080 61 74 fb c0 10 00 00 00 00 00 00 61 76 fb 3f f4 |at.........av.?.|
0090 cc cc cc cc cc cd a3 61 6e 67 63 75 72 72 65 6e |.......angcurren|
00a0 74 61 74 fb c0 08 00 00 00 00 00 00 61 76 fb 3f |tat.........av.?|
00b0 f6 66 66 66 66 66 66 a3 61 6e 67 63 75 72 72 65 |.ffffff.angcurre|
00c0 6e 74 61 74 fb c0 00 00 00 00 00 00 00 61 76 fb |ntat.........av.|
00d0 3f f8 00 00 00 00 00 00 a3 61 6e 67 63 75 72 72 |?........angcurr|
00e0 65 6e 74 61 74 fb bf f0 00 00 00 00 00 00 61 76 |entat.........av|
00f0 fb 3f f9 99 99 99 99 99 9a a2 61 6e 67 63 75 72 |.?........angcur|
0100 72 65 6e 74 61 76 fb 3f fb 33 33 33 33 33 33 |rentav.?.333333|
010f
8. XML Representation (application/senml+xml) The following example shows a dump of the CBOR example for the same
sensor measurement as in Section 5.1.2.
A SenML Stream can also be represented in XML format as defined in 7. XML Representation (application/senml+xml)
this section. The following example shows an XML example for the
same sensor measurement as in Section 6.1.2.
<sensml xmlns="urn:ietf:params:xml:ns:senml"> A SenML Pack or Stream can also be represented in XML format as
<senml bn="urn:dev:ow:10e2073a01080063/" bt="1.276020076001e+09" defined in this section. The following example shows an XML example
bu="A" bver="5"></senml> for the same sensor measurement as in Section 5.1.2.
<senml n="voltage" u="V" v="120.1"></senml>
<senml n="current" t="-5" v="1.2"></senml>
<senml n="current" t="-4" v="1.3"></senml>
<senml n="current" t="-3" v="1.4"></senml>
<senml n="current" t="-2" v="1.5"></senml>
<senml n="current" t="-1" v="1.6"></senml>
<senml n="current" v="1.7"></senml>
</sensml>
The SenML Stream is represented as a sensml tag that contains a The SenML Stream is represented as a sensml tag that contains a
series of senml tags for each SenML Record. The SenML Fields are series of senml tags for each SenML Record. The SenML Fields are
represents as XML attributes. The following table shows the mapping represents as XML attributes. The following table shows the mapping
the SenML Field names to the attribute used in the XML senml tag. of the SenML labels to the attribute names and types used in the XML
senml tags.
+---------------+------+---------+ +---------------+------+---------+
| SenML Field | XML | Type | | Name | XML | Type |
+---------------+------+---------+ +---------------+------+---------+
| Base Name | bn | string | | Base Name | bn | string |
| Base Time | bt | double | | Base Time | bt | double |
| Base Unit | bu | string | | Base Unit | bu | string |
| Base Value | bv | double | | Base Value | bv | double |
| Base Version | bver | int | | Base Version | bver | int |
| Name | n | string | | Name | n | string |
| Unit | u | string | | Unit | u | string |
| Value | v | double | | Value | v | double |
| String Value | vs | string | | String Value | vs | string |
| Data Value | vd | string | | Data Value | vd | string |
| Boolean Value | vb | boolean | | Boolean Value | vb | boolean |
| Value Sum | s | double | | Value Sum | s | double |
| Time | t | double | | Time | t | double |
| Update Time | ut | double | | Update Time | ut | double |
+---------------+------+---------+ +---------------+------+---------+
Table 4: XML SenML Labels
The RelaxNG schema for the XML is: The RelaxNG schema for the XML is:
default namespace = "urn:ietf:params:xml:ns:senml" default namespace = "urn:ietf:params:xml:ns:senml"
namespace rng = "http://relaxng.org/ns/structure/1.0" namespace rng = "http://relaxng.org/ns/structure/1.0"
link = element l {
attribute * { xsd:string }*
}
senml = element senml { senml = element senml {
attribute bn { xsd:string }?, attribute bn { xsd:string }?,
attribute bt { xsd:double }?, attribute bt { xsd:double }?,
attribute bv { xsd:double }?, attribute bv { xsd:double }?,
attribute bu { xsd:string }?, attribute bu { xsd:string }?,
attribute bver { xsd:int }?, attribute bver { xsd:int }?,
attribute n { xsd:string }?, attribute n { xsd:string }?,
attribute s { xsd:double }?, attribute s { xsd:double }?,
attribute t { xsd:double }?, attribute t { xsd:double }?,
attribute u { xsd:string }?, attribute u { xsd:string }?,
attribute ut { xsd:double }?, attribute ut { xsd:double }?,
attribute v { xsd:double }?, attribute v { xsd:double }?,
attribute vb { xsd:boolean }?, attribute vb { xsd:boolean }?,
attribute vs { xsd:string }?, attribute vs { xsd:string }?,
attribute vd { xsd:string }?, attribute vd { xsd:string }?,
link* attribute l { xsd:string }?
} }
sensml = sensml =
element sensml { element sensml {
senml+ senml+
} }
start = sensml start = sensml
9. EXI Representation (application/senml-exi) 8. EXI Representation (application/senml-exi)
For efficient transmission of SenML over e.g. a constrained network, For efficient transmission of SenML over e.g. a constrained network,
Efficient XML Interchange (EXI) can be used. This encodes the XML Efficient XML Interchange (EXI) can be used. This encodes the XML
Schema structure of SenML into binary tags and values rather than Schema structure of SenML into binary tags and values rather than
ASCII text. An EXI representation of SenML SHOULD be made using the ASCII text. An EXI representation of SenML SHOULD be made using the
strict schema-mode of EXI. This mode however does not allow tag strict schema-mode of EXI. This mode however does not allow tag
extensions to the schema, and therefore any extensions will be lost extensions to the schema, and therefore any extensions will be lost
in the encoding. For uses where extensions need to be preserved in in the encoding. For uses where extensions need to be preserved in
EXI, the non-strict schema mode of EXI MAY be used. EXI, the non-strict schema mode of EXI MAY be used.
skipping to change at page 17, line 10 skipping to change at page 16, line 17
TODO - examples probably have the wrong setting the schemaID TODO - examples probably have the wrong setting the schemaID
The following is the XSD Schema to be used for strict schema guided The following is the XSD Schema to be used for strict schema guided
EXI processing. It is generated from the RelaxNG. EXI processing. It is generated from the RelaxNG.
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="urn:ietf:params:xml:ns:senml" targetNamespace="urn:ietf:params:xml:ns:senml"
xmlns:ns1="urn:ietf:params:xml:ns:senml"> xmlns:ns1="urn:ietf:params:xml:ns:senml">
<xs:element name="l">
<xs:complexType>
<xs:anyAttribute processContents="skip" />
</xs:complexType>
</xs:element>
<xs:element name="senml"> <xs:element name="senml">
<xs:complexType> <xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded"
ref="ns1:l" />
</xs:sequence>
<xs:attribute name="bn" type="xs:string" /> <xs:attribute name="bn" type="xs:string" />
<xs:attribute name="bt" type="xs:double" /> <xs:attribute name="bt" type="xs:double" />
<xs:attribute name="bv" type="xs:double" /> <xs:attribute name="bv" type="xs:double" />
<xs:attribute name="bu" type="xs:string" /> <xs:attribute name="bu" type="xs:string" />
<xs:attribute name="bver" type="xs:int" /> <xs:attribute name="bver" type="xs:int" />
<xs:attribute name="n" type="xs:string" /> <xs:attribute name="n" type="xs:string" />
<xs:attribute name="s" type="xs:double" /> <xs:attribute name="s" type="xs:double" />
<xs:attribute name="t" type="xs:double" /> <xs:attribute name="t" type="xs:double" />
<xs:attribute name="u" type="xs:string" /> <xs:attribute name="u" type="xs:string" />
<xs:attribute name="ut" type="xs:double" /> <xs:attribute name="ut" type="xs:double" />
<xs:attribute name="v" type="xs:double" /> <xs:attribute name="v" type="xs:double" />
<xs:attribute name="vb" type="xs:boolean" /> <xs:attribute name="vb" type="xs:boolean" />
<xs:attribute name="vs" type="xs:string" /> <xs:attribute name="vs" type="xs:string" />
<xs:attribute name="vd" type="xs:string" /> <xs:attribute name="vd" type="xs:string" />
<xs:attribute name="l" type="xs:string" />
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="sensml"> <xs:element name="sensml">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element maxOccurs="unbounded" ref="ns1:senml" /> <xs:element maxOccurs="unbounded" ref="ns1:senml" />
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:schema> </xs:schema>
The following shows a hexdump of the EXI produced from encoding the The following shows a hexdump of the EXI produced from encoding the
following XML example. Note this example is the same information as following XML example. Note this example is the same information as
the first example in Section 6.1.2 in JSON format. the first example in Section 5.1.2 in JSON format.
<sensml xmlns="urn:ietf:params:xml:ns:senml">
<senml bn="urn:dev:ow:10e2073a01080063/"></senml>
<senml n="voltage" u="V" v="120.1"></senml>
<senml n="current" u="A" v="1.2"></senml>
</sensml>
Which compresses with EXI to the following displayed in hexdump: Which compresses with EXI to the following displayed in hexdump:
0000 a0 30 3d cd 95 b9 b5 b0 b9 9d 95 b8 b9 e1 cd 91 |.0=.............| 0000 a0 30 3d cd 95 b9 b5 b0 b9 9d 95 b8 b9 e1 cd 90 |.0=.............|
0010 00 f3 ab 93 71 d3 23 2b b1 d3 7b b9 d1 89 83 29 |....q.#+..{....)| 0010 80 eb ab 93 71 d3 23 2b b1 d3 7b b9 d1 89 83 29 |....q.#+..{....)|
0020 91 81 b9 9b 09 81 89 81 c1 81 81 b1 99 7f 14 25 |...............%| 0020 91 81 b9 9b 09 81 89 81 c1 81 81 b1 9a 84 bb 37 |...............7|
0030 d9 bd b1 d1 85 9d 94 80 d5 8a c4 26 01 0a 12 c6 |...........&....| 0030 b6 3a 30 b3 b2 90 1a b1 58 84 c0 33 04 b1 ba b9 |.:0.....X..3....|
0040 ea e4 e4 ca dc e8 40 68 24 19 00 90 |......@h$...| 0040 39 32 b7 3a 10 1a 09 06 40 38 |92.:....@8|
004c 004a
The above example used the bit packed form of EXI but it is also The above example used the bit packed form of EXI but it is also
possible to use a byte packed form of EXI which can makes it easier possible to use a byte packed form of EXI which can makes it easier
for a simple sensor to produce valid EXI without really implementing for a simple sensor to produce valid EXI without really implementing
EXI. Consider the example of a temperature sensor that produces a EXI. Consider the example of a temperature sensor that produces a
value in tenths of degrees Celsius over a range of 0.0 to 55.0. It value in tenths of degrees Celsius over a range of 0.0 to 55.0. It
would produce an XML SenML file such as: would produce an XML SenML file such as:
<sensml xmlns="urn:ietf:params:xml:ns:senml">
<senml n="urn:dev:ow:10e2073a01080063" u="Cel" v="23.1"></senml>
</sensml>
The compressed form, using the byte alignment option of EXI, for the The compressed form, using the byte alignment option of EXI, for the
above XML is the following: above XML is the following:
0000 a0 00 48 81 ee 6c ad cd ad 85 cc ec ad c5 cf 0e |..H..l..........| 0000 a0 00 48 81 ee 6c ad cd ad 85 cc ec ad c5 cf 0e |..H..l..........|
0010 6c 80 02 05 1d 75 72 6e 3a 64 65 76 3a 6f 77 3a |l....urn:dev:ow:| 0010 6c 80 01 06 1d 75 72 6e 3a 64 65 76 3a 6f 77 3a |l....urn:dev:ow:|
0020 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 33 |10e2073a01080063| 0020 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 33 |10e2073a01080063|
0030 02 05 43 65 6c 01 00 e7 01 01 00 04 01 |..Cel........| 0030 02 05 43 65 6c 01 00 e7 01 01 00 03 01 |..Cel........|
003d 003d
A small temperature sensor devices that only generates this one EXI A small temperature sensor devices that only generates this one EXI
file does not really need an full EXI implementation. It can simple file does not really need an full EXI implementation. It can simply
hard code the output replacing the one wire device ID starting at hard code the output replacing the 1-wire device ID starting at byte
byte 0x16 and going to byte 0x31 with it's device ID, and replacing 0x20 and going to byte 0x2F with it's device ID, and replacing the
the value "0xe7 0x01" at location 0x38 to 0x39 with the current value "0xe7 0x01" at location 0x37 and 0x38 with the current
temperature. The EXI Specification [W3C.REC-exi-20110310] contains temperature. The EXI Specification [W3C.REC-exi-20110310] contains
the full information 'on how floating point numbers are represented, the full information 'on how floating point numbers are represented,
but for the purpose of this sensor, the temperature can be converted but for the purpose of this sensor, the temperature can be converted
to an integer in tenths of degrees (231 in this example). EXI stores to an integer in tenths of degrees (231 in this example). EXI stores
7 bits of the integer in each byte with the top bit set to one if 7 bits of the integer in each byte with the top bit set to one if
there are further bytes. So the first bytes at is set to low 7 bits there are further bytes. So the first bytes at is set to low 7 bits
of the integer temperature in tenths of degrees plus 0x80. In this of the integer temperature in tenths of degrees plus 0x80. In this
example 231 & 0x7F + 0x80 = 0xE7. The second byte is set to the example 231 & 0x7F + 0x80 = 0xE7. The second byte is set to the
integer temperature in tenths of degrees right shifted 7 bits. In integer temperature in tenths of degrees right shifted 7 bits. In
this example 231 >> 7 = 0x01. this example 231 >> 7 = 0x01.
10. Usage Considerations 9. Usage Considerations
The measurements support sending both the current value of a sensor The measurements support sending both the current value of a sensor
as well as the an integrated sum. For many types of measurements, as well as the an integrated sum. For many types of measurements,
the sum is more useful than the current value. For example, an the sum is more useful than the current value. For example, an
electrical meter that measures the energy a given computer uses will electrical meter that measures the energy a given computer uses will
typically want to measure the cumulative amount of energy used. This typically want to measure the cumulative amount of energy used. This
is less prone to error than reporting the power each second and is less prone to error than reporting the power each second and
trying to have something on the server side sum together all the trying to have something on the server side sum together all the
power measurements. If the network between the sensor and the meter power measurements. If the network between the sensor and the meter
goes down over some period of time, when it comes back up, the goes down over some period of time, when it comes back up, the
skipping to change at page 20, line 7 skipping to change at page 18, line 43
3. Applications cannot make assumptions about when the device 3. Applications cannot make assumptions about when the device
started accumulating values into the sum. started accumulating values into the sum.
Typically applications can make some assumptions about specific Typically applications can make some assumptions about specific
sensors that will allow them to deal with these problems. A common sensors that will allow them to deal with these problems. A common
assumption is that for sensors whose measurement values are always assumption is that for sensors whose measurement values are always
positive, the sum should never get smaller; so if the sum does get positive, the sum should never get smaller; so if the sum does get
smaller, the application will know that one of the situations listed smaller, the application will know that one of the situations listed
above has happened. above has happened.
11. CDDL 10. CDDL
For reference, the CBOR representation can be described with the CDDL For reference, the JSON and CBOR representations can be described
[I-D.greevenbosch-appsawg-cbor-cddl] specification in Figure 1. with the common CDDL [I-D.greevenbosch-appsawg-cbor-cddl]
specification in Figure 1.
SenML-Pack = [initial-record, * follow-on-record] SenML-Pack = [initial-record, * follow-on-record]
initial-record = initial-defined .and initial-generic initial-record = initial-defined .and initial-generic
follow-on-record = follow-on-defined .and follow-on-generic follow-on-record = follow-on-defined .and follow-on-generic
; first do a specification of the labels as defined: ; first do a specification of the labels as defined:
initial-defined = { initial-defined = {
? bn => tstr, ; Base Name ? bn => tstr, ; Base Name
skipping to change at page 20, line 32 skipping to change at page 19, line 21
? bu => tstr, ; Base Units ? bu => tstr, ; Base Units
? bv => numeric, ; Base value ? bv => numeric, ; Base value
? bver => uint, ; Base Version ? bver => uint, ; Base Version
follow-on-defined-group, follow-on-defined-group,
+ base-key-value-pair + base-key-value-pair
} }
follow-on-defined-group = ( follow-on-defined-group = (
? n => tstr, ; Name ? n => tstr, ; Name
? u => tstr, ; Units ? u => tstr, ; Units
? ( v => numeric // ; Numeric Value
vs => tstr // ; String Value
vb => bool // ; Boolean Value
vd => bstr ) ; Data Value
? s => numeric, ; Value Sum ? s => numeric, ; Value Sum
? t => numeric, ; Time ? t => numeric, ; Time
? ut => numeric, ; Update Time ? ut => numeric, ; Update Time
* key-value-pair * key-value-pair,
? ( v => numeric // ; Numeric Value
vs => tstr // ; String Value
vb => bool // ; Boolean Value
vd => binary-value ) ; Data Value
) )
follow-on-defined = { follow-on-defined-group } follow-on-defined = { follow-on-defined-group }
; CBOR version (use the labels)
bver = -1 n = 0 s = 5
bn = -2 u = 1 t = 6
bt = -3 v = 2 ut = 7
bu = -4 vs = 3 vd = 8
bv = -5 vb = 4
; use the label *names* for JSON
; now define the generic versions ; now define the generic versions
initial-generic = { initial-generic = {
follow-on-generic-group, follow-on-generic-group,
* base-key-value-pair, * base-key-value-pair,
} }
follow-on-generic-group = ( follow-on-generic-group = (
+ key-value-pair, + key-value-pair,
) )
follow-on-generic = { follow-on-generic-group } follow-on-generic = { follow-on-generic-group }
skipping to change at page 21, line 21 skipping to change at page 19, line 51
) )
follow-on-generic = { follow-on-generic-group } follow-on-generic = { follow-on-generic-group }
key-value-pair = ( non-b-label => value ) key-value-pair = ( non-b-label => value )
base-key-value-pair = ( b-label => value ) base-key-value-pair = ( b-label => value )
non-b-label = tstr .regexp "[A-Zac-z0-9][-_:.A-Za-z0-9]*" / uint non-b-label = tstr .regexp "[A-Zac-z0-9][-_:.A-Za-z0-9]*" / uint
b-label = tstr .regexp "b[-_:.A-Za-z0-9]+" / nint b-label = tstr .regexp "b[-_:.A-Za-z0-9]+" / nint
value = tstr / bstr / numeric / bool value = tstr / binary-value / numeric / bool
numeric = number / decfrac numeric = number / decfrac
Figure 1: CDDL specification for CBOR SenML Figure 1: Common CDDL specification for CBOR and JSON SenML
TODO - seems to be a problem with CDDL not validating examples For JSON, we use text labels and base64url-encoded binary data
(Figure 2).
12. IANA Considerations bver = "bver" n = "n" s = "s"
bn = "bn" u = "u" t = "t"
bt = "bt" v = "v" ut = "ut"
bu = "bu" vs = "vs" vd = "vd"
bv = "bv" vb = "vb"
binary-value = tstr ; base64url encoded
Figure 2: JSON-specific CDDL specification for SenML
For CBOR, we use integer labels and native binary data (Figure 3).
bver = -1 n = 0 s = 5
bn = -2 u = 1 t = 6
bt = -3 v = 2 ut = 7
bu = -4 vs = 3 vd = 8
bv = -5 vb = 4
binary-value = bstr
Figure 3: CBOR-specific CDDL specification for SenML
11. IANA Considerations
Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with
the RFC number of this specification. the RFC number of this specification.
12.1. Units Registry 11.1. Units Registry
IANA will create a registry of SenML unit symbols. The primary IANA will create a registry of SenML unit symbols. The primary
purpose of this registry is to make sure that symbols uniquely map to purpose of this registry is to make sure that symbols uniquely map to
give type of measurement. Definitions for many of these units can be give type of measurement. Definitions for many of these units can be
found in location such as [NIST811] and [BIPM]. found in location such as [NIST811] and [BIPM]. Units marked with an
asterisk are NOT RECOMMENDED to be produced by new implementations,
but are in active use and SHOULD be implemented by consumers that can
use the related base units.
+--------+--------------------------------------+-------+-----------+ +----------+------------------------------------+-------+-----------+
| Symbol | Description | Type | Reference | | Symbol | Description | Type | Reference |
+--------+--------------------------------------+-------+-----------+ +----------+------------------------------------+-------+-----------+
| m | meter | float | RFC-AAAA | | m | meter | float | RFC-AAAA |
| g | gram | float | RFC-AAAA | | kg | kilogram | float | RFC-AAAA |
| s | second | float | RFC-AAAA | | g | gram* | float | RFC-AAAA |
| A | ampere | float | RFC-AAAA | | s | second | float | RFC-AAAA |
| K | kelvin | float | RFC-AAAA | | A | ampere | float | RFC-AAAA |
| cd | candela | float | RFC-AAAA | | K | kelvin | float | RFC-AAAA |
| mol | mole | float | RFC-AAAA | | cd | candela | float | RFC-AAAA |
| Hz | hertz | float | RFC-AAAA | | mol | mole | float | RFC-AAAA |
| rad | radian | float | RFC-AAAA | | Hz | hertz | float | RFC-AAAA |
| sr | steradian | float | RFC-AAAA | | rad | radian | float | RFC-AAAA |
| N | newton | float | RFC-AAAA | | sr | steradian | float | RFC-AAAA |
| Pa | pascal | float | RFC-AAAA | | N | newton | float | RFC-AAAA |
| J | joule | float | RFC-AAAA | | Pa | pascal | float | RFC-AAAA |
| W | watt | float | RFC-AAAA | | J | joule | float | RFC-AAAA |
| C | coulomb | float | RFC-AAAA | | W | watt | float | RFC-AAAA |
| V | volt | float | RFC-AAAA | | C | coulomb | float | RFC-AAAA |
| F | farad | float | RFC-AAAA | | V | volt | float | RFC-AAAA |
| Ohm | ohm | float | RFC-AAAA | | F | farad | float | RFC-AAAA |
| S | siemens | float | RFC-AAAA | | Ohm | ohm | float | RFC-AAAA |
| Wb | weber | float | RFC-AAAA | | S | siemens | float | RFC-AAAA |
| T | tesla | float | RFC-AAAA | | Wb | weber | float | RFC-AAAA |
| H | henry | float | RFC-AAAA | | T | tesla | float | RFC-AAAA |
| Cel | degrees Celsius | float | RFC-AAAA | | H | henry | float | RFC-AAAA |
| lm | lumen | float | RFC-AAAA | | Cel | degrees Celsius | float | RFC-AAAA |
| lx | lux | float | RFC-AAAA | | lm | lumen | float | RFC-AAAA |
| Bq | becquerel | float | RFC-AAAA | | lx | lux | float | RFC-AAAA |
| Gy | gray | float | RFC-AAAA | | Bq | becquerel | float | RFC-AAAA |
| Sv | sievert | float | RFC-AAAA | | Gy | gray | float | RFC-AAAA |
| kat | katal | float | RFC-AAAA | | Sv | sievert | float | RFC-AAAA |
| pH | pH acidity | float | RFC-AAAA | | kat | katal | float | RFC-AAAA |
| % | Value of a switch (note 1) | float | RFC-AAAA | | m2 | square meter (area) | float | RFC-AAAA |
| count | counter value | float | RFC-AAAA | | m3 | cubic meter (volume) | float | RFC-AAAA |
| %RH | Relative Humidity | float | RFC-AAAA | | l | liter (volume)* | float | RFC-AAAA |
| m2 | area | float | RFC-AAAA | | m/s | meter per second (velocity) | float | RFC-AAAA |
| l | volume in liters | float | RFC-AAAA | | m/s2 | meter per square second | float | RFC-AAAA |
| m/s | velocity | float | RFC-AAAA | | | (acceleration) | | |
| m/s2 | acceleration | float | RFC-AAAA | | m3/s | cubic meter per second (flow rate) | float | RFC-AAAA |
| l/s | flow rate in liters per second | float | RFC-AAAA | | l/s | liter per second (flow rate)* | float | RFC-AAAA |
| W/m2 | irradiance | float | RFC-AAAA | | W/m2 | watt per square meter (irradiance) | float | RFC-AAAA |
| cd/m2 | luminance | float | RFC-AAAA | | cd/m2 | candela per square meter | float | RFC-AAAA |
| Bspl | bel sound pressure level | float | RFC-AAAA | | | (luminance) | | |
| bit/s | bits per second | float | RFC-AAAA | | bit | bit (information content) | float | RFC-AAAA |
| lat | degrees latitude (note 2) | float | RFC-AAAA | | bit/s | bit per second (data rate) | float | RFC-AAAA |
| lon | degrees longitude (note 2) | float | RFC-AAAA | | lat | degrees latitude (note 2) | float | RFC-AAAA |
| %EL | remaining battery energy level in | float | RFC-AAAA | | lon | degrees longitude (note 2) | float | RFC-AAAA |
| | percents | | | | pH | pH value (acidity; logarithmic | float | RFC-AAAA |
| EL | remaining battery energy level in | float | RFC-AAAA | | | quantity) | | |
| | seconds | | | | dB | decibel (logarithmic quantity) | float | RFC-AAAA |
| beat/m | Heart rate in beats per minute | float | RFC-AAAA | | Bspl | bel (sound pressure level; | float | RFC-AAAA |
| beats | Cumulative number of heart beats | float | RFC-AAAA | | | logarithmic quantity)* | | |
+--------+--------------------------------------+-------+-----------+ | count | 1 (counter value) | float | RFC-AAAA |
| / | 1 (Ratio e.g., value of a switch, | float | RFC-AAAA |
| | note 1) | | |
| % | 1 (Ratio e.g., value of a switch, | float | RFC-AAAA |
| | note 1)* | | |
| %RH | Percentage (Relative Humidity) | float | RFC-AAAA |
| %EL | Percentage (remaining battery | float | RFC-AAAA |
| | energy level) | | |
| EL | seconds (remaining battery energy | float | RFC-AAAA |
| | level) | | |
| 1/s | 1 per second (event rate) | float | RFC-AAAA |
| 1/min | 1 per minute (event rate, "rpm")* | float | RFC-AAAA |
| beat/min | 1 per minute (Heart rate in beats | float | RFC-AAAA |
| | per minute)* | | |
| beats | 1 (Cumulative number of heart | float | RFC-AAAA |
| | beats)* | | |
+----------+------------------------------------+-------+-----------+
Table 3 Table 5
o Note 1: A value of 0.0 indicates the switch is off while 1.0 o Note 1: A value of 0.0 indicates the switch is off while 1.0
indicates on and 0.5 would be half on. indicates on and 0.5 would be half on. The preferred name of this
unit is "/". For historical reasons, the name "%" is also
provided for the same unit - but note that while that name
strongly suggests a percentage (0..100) -- it is however NOT a
percentage, but the absolute ratio!
o Note 2: Assumed to be in WGS84 unless another reference frame is o Note 2: Assumed to be in WGS84 unless another reference frame is
known for the sensor. known for the sensor.
New entries can be added to the registration by either Expert Review New entries can be added to the registration by either Expert Review
or IESG Approval as defined in [RFC5226]. Experts should exercise or IESG Approval as defined in [RFC5226]. Experts should exercise
their own good judgment but need to consider the following their own good judgment but need to consider the following
guidelines: guidelines:
1. There needs to be a real and compelling use for any new unit to 1. There needs to be a real and compelling use for any new unit to
skipping to change at page 23, line 28 skipping to change at page 23, line 7
be used in different real-life contexts. For example, degrees be used in different real-life contexts. For example, degrees
when measuring latitude have no semantic relation to degrees when measuring latitude have no semantic relation to degrees
when measuring temperature; thus two different units are needed. when measuring temperature; thus two different units are needed.
3. These measurements are produced by computers for consumption by 3. These measurements are produced by computers for consumption by
computers. The principle is that conversion has to be easily be computers. The principle is that conversion has to be easily be
done when both reading and writing the media type. The value of done when both reading and writing the media type. The value of
a single canonical representation outweighs the convenience of a single canonical representation outweighs the convenience of
easy human representations or loss of precision in a conversion. easy human representations or loss of precision in a conversion.
4. Use of SI prefixes such as "k" before the unit is not allowed. 4. Use of SI prefixes such as "k" before the unit is not
Instead one can represent the value using scientific notation recommended. Instead one can represent the value using
such a 1.2e3. TODO - Open Issue. Some people would like to scientific notation such a 1.2e3. The "kg" unit is exception to
have SI prefixes to improve human readability. this rule since it is an SI base unit; the "g" unit is provided
for legacy compatibility.
5. For a given type of measurement, there will only be one unit 5. For a given type of measurement, there will only be one unit
type defined. So for length, meters are defined and other type defined. So for length, meters are defined and other
lengths such as mile, foot, light year are not allowed. For lengths such as mile, foot, light year are not allowed. For
most cases, the SI unit is preferred. most cases, the SI unit is preferred.
6. Symbol names that could be easily confused with existing common 6. Symbol names that could be easily confused with existing common
units or units combined with prefixes should be avoided. For units or units combined with prefixes should be avoided. For
example, selecting a unit name of "mph" to indicate something example, selecting a unit name of "mph" to indicate something
that had nothing to do with velocity would be a bad choice, as that had nothing to do with velocity would be a bad choice, as
skipping to change at page 24, line 17 skipping to change at page 23, line 45
allocated. allocated.
10. A number after a unit typically indicates the previous unit 10. A number after a unit typically indicates the previous unit
raised to that power, and the / indicates that the units that raised to that power, and the / indicates that the units that
follow are the reciprocal. A unit should have only one / in the follow are the reciprocal. A unit should have only one / in the
name. name.
11. A good list of common units can be found in the Unified Code for 11. A good list of common units can be found in the Unified Code for
Units of Measure [UCUM]. Units of Measure [UCUM].
12.2. SenML label registry 11.2. SenML label registry
IANA will create a registry for SenML labels. The initial content of IANA will create a new registry for SenML labels. The initial
the registry are shown in TODO. content of the registry are shown in Table 1 and Table 4.
New entries can be added to the registration by either Expert Review New entries can be added to the registration by either Expert Review
or IESG Approval as defined in [RFC5226]. Experts should exercise or IESG Approval as defined in [RFC5226]. Experts should exercise
their own good judgment but need to consider that shorter labels their own good judgment but need to consider that shorter labels
should have more strict review. should have more strict review.
12.3. Media Type Registration All new SenML labels that have "base" semantics (see Section 4.1)
must start with character 'b'. Regular labels must not start with
that character.
All new entries must define the Label Name, Label, JSON Type, and XML
Type.
11.3. Media Type Registration
The following registrations are done following the procedure The following registrations are done following the procedure
specified in [RFC6838] and [RFC7303]. specified in [RFC6838] and [RFC7303].
12.3.1. senml+json Media Type Registration 11.3.1. senml+json Media Type Registration
Type name: application Type name: application
Subtype name: senml+json and sensml+json Subtype name: senml+json and sensml+json
Required parameters: none Required parameters: none
Optional parameters: none Optional parameters: none
Encoding considerations: Must be encoded as using a subset of the Encoding considerations: Must be encoded as using a subset of the
skipping to change at page 25, line 11 skipping to change at page 24, line 47
outside temperature in a given city, to very private information that outside temperature in a given city, to very private information that
requires integrity and confidentiality protection, such as patient requires integrity and confidentiality protection, such as patient
health information. This format does not provide any security and health information. This format does not provide any security and
instead relies on the transport protocol that carries it to provide instead relies on the transport protocol that carries it to provide
security. Given applications need to look at the overall context of security. Given applications need to look at the overall context of
how this media type will be used to decide if the security is how this media type will be used to decide if the security is
adequate. adequate.
Interoperability considerations: Applications should ignore any JSON Interoperability considerations: Applications should ignore any JSON
key value pairs that they do not understand. This allows backwards key value pairs that they do not understand. This allows backwards
compatibility extensions to this specification. The "ver" field can compatibility extensions to this specification. The "bver" field can
be used to ensure the receiver supports a minimal level of be used to ensure the receiver supports a minimal level of
functionality needed by the creator of the JSON object. functionality needed by the creator of the JSON object.
Published specification: RFC-AAAA Published specification: RFC-AAAA
Applications that use this media type: The type is used by systems Applications that use this media type: The type is used by systems
that report electrical power usage and environmental information such that report e.g., electrical power usage and environmental
as temperature and humidity. It can be used for a wide range of information such as temperature and humidity. It can be used for a
sensor reporting systems. wide range of sensor reporting systems.
Additional information: Additional information:
Magic number(s): none Magic number(s): none
File extension(s): senml File extension(s): senml and sensml
Macintosh file type code(s): none Macintosh file type code(s): none
Person & email address to contact for further information: Cullen Person & email address to contact for further information: Cullen
Jennings <fluffy@iii.ca> Jennings <fluffy@iii.ca>
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: None Restrictions on usage: None
Author: Cullen Jennings <fluffy@iii.ca> Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG Change controller: IESG
12.3.2. senml+cbor Media Type Registration 11.3.2. senml+cbor Media Type Registration
Type name: application Type name: application
Subtype name: senml+cbor Subtype name: senml+cbor and sensml+cbor
Required parameters: none Required parameters: none
Optional parameters: none Optional parameters: none
Encoding considerations: TBD Encoding considerations: TBD
Security considerations: TBD
Security considerations: See Section 11.3.1
Interoperability considerations: TBD Interoperability considerations: TBD
Published specification: RFC-AAAA Published specification: RFC-AAAA
Applications that use this media type: The type is used by systems Applications that use this media type: See Section 11.3.1
that report electrical power usage and environmental information such
as temperature and humidity. It can be used for a wide range of
sensor reporting systems.
Additional information: Additional information:
Magic number(s): none Magic number(s): none
File extension(s): senmlc and sensmlc
File extension(s): senml
Macintosh file type code(s): none Macintosh file type code(s): none
Person & email address to contact for further information: Cullen Person & email address to contact for further information: Cullen
Jennings <fluffy@iii.ca> Jennings <fluffy@iii.ca>
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: None Restrictions on usage: None
Author: Cullen Jennings <fluffy@iii.ca> Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG Change controller: IESG
12.3.3. senml+xml Media Type Registration 11.3.3. senml+xml Media Type Registration
Type name: application Type name: application
Subtype name: senml+xml and sensml+xml Subtype name: senml+xml and sensml+xml
Required parameters: none Required parameters: none
Optional parameters: none Optional parameters: none
Encoding considerations: TBD Encoding considerations: TBD
Security considerations: TBD Security considerations: See Section 11.3.1
Interoperability considerations: TBD Interoperability considerations: TBD
Published specification: RFC-AAAA Published specification: RFC-AAAA
Applications that use this media type: TBD
Applications that use this media type: See Section 11.3.1
Additional information: Additional information:
Magic number(s): none Magic number(s): none
File extension(s): senml File extension(s): senmlx and sensmlx
Macintosh file type code(s): none Macintosh file type code(s): none
Person & email address to contact for further information: Cullen Person & email address to contact for further information: Cullen
Jennings <fluffy@iii.ca> Jennings <fluffy@iii.ca>
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: None Restrictions on usage: None
Author: Cullen Jennings <fluffy@iii.ca> Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG Change controller: IESG
12.3.4. senml-exi Media Type Registration 11.3.4. senml-exi Media Type Registration
Type name: application Type name: application
Subtype name: senml-exi Subtype name: senml-exi and sensml-exi
Required parameters: none Required parameters: none
Optional parameters: none Optional parameters: none
Encoding considerations: TBD Encoding considerations: TBD
Security considerations: TBD Security considerations: TBD
Interoperability considerations: TBD Interoperability considerations: TBD
Published specification: RFC-AAAA Published specification: RFC-AAAA
Applications that use this media type: TBD Applications that use this media type: See Section 11.3.1
Additional information: Additional information:
Magic number(s): none Magic number(s): none
File extension(s): senml File extension(s): senmle and sensmle
Macintosh file type code(s): none Macintosh file type code(s): none
Person & email address to contact for further information: Cullen Person & email address to contact for further information: Cullen
Jennings <fluffy@iii.ca> Jennings <fluffy@iii.ca>
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: None Restrictions on usage: None
Author: Cullen Jennings <fluffy@iii.ca> Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG Change controller: IESG
skipping to change at page 28, line 15 skipping to change at page 28, line 5
Jennings <fluffy@iii.ca> Jennings <fluffy@iii.ca>
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: None Restrictions on usage: None
Author: Cullen Jennings <fluffy@iii.ca> Author: Cullen Jennings <fluffy@iii.ca>
Change controller: IESG Change controller: IESG
12.4. XML Namespace Registration 11.4. XML Namespace Registration
This document registers the following XML namespaces in the IETF XML This document registers the following XML namespaces in the IETF XML
registry defined in [RFC3688]. registry defined in [RFC3688].
URI: urn:ietf:params:xml:ns:senml URI: urn:ietf:params:xml:ns:senml
Registrant Contact: The IESG. Registrant Contact: The IESG.
XML: N/A, the requested URIs are XML namespaces XML: N/A, the requested URIs are XML namespaces
12.5. CoAP Content-Format Registration 11.5. CoAP Content-Format Registration
IANA is requested to assign CoAP Content-Format IDs for the SenML IANA is requested to assign CoAP Content-Format IDs for the SenML
media types in the "CoAP Content-Formats" sub-registry, within the media types in the "CoAP Content-Formats" sub-registry, within the
"CoRE Parameters" registry [RFC7252]. All IDs are assigned from the "CoRE Parameters" registry [RFC7252]. All IDs are assigned from the
"Expert Review" (0-255) range. The assigned IDs are show in Table 4. "Expert Review" (0-255) range. The assigned IDs are show in Table 6.
+-------------------------+-----+ +-------------------------+-----+
| Media type | ID | | Media type | ID |
+-------------------------+-----+ +-------------------------+-----+
| application/senml+json | TBD | | application/senml+json | TBD |
| application/sensml+json | TBD | | application/sensml+json | TBD |
| application/senml+cbor | TBD | | application/senml+cbor | TBD |
| application/senml+xml | TBD | | application/senml+xml | TBD |
| application/sensml+xml | TBD | | application/sensml+xml | TBD |
| application/senml-exi | TBD | | application/senml-exi | TBD |
+-------------------------+-----+ +-------------------------+-----+
Table 4: CoAP Content-Format IDs Table 6: CoAP Content-Format IDs
13. Security Considerations 12. Security Considerations
See Section 14. Further discussion of security properties can be See Section 13. Further discussion of security properties can be
found in Section 12.3. found in Section 11.3.
14. Privacy Considerations 13. Privacy Considerations
Sensor data can range from information with almost no security Sensor data can range from information with almost no security
considerations, such as the current temperature in a given city, to considerations, such as the current temperature in a given city, to
highly sensitive medical or location data. This specification highly sensitive medical or location data. This specification
provides no security protection for the data but is meant to be used provides no security protection for the data but is meant to be used
inside another container or transport protocol such as S/MIME or HTTP inside another container or transport protocol such as S/MIME or HTTP
with TLS that can provide integrity, confidentiality, and with TLS that can provide integrity, confidentiality, and
authentication information about the source of the data. authentication information about the source of the data.
15. Acknowledgement 14. Acknowledgement
We would like to thank Lisa Dusseault, Joe Hildebrand, Lyndsay We would like to thank Lisa Dusseault, Joe Hildebrand, Lyndsay
Campbell, Martin Thomson, John Klensin, Bjoern Hoehrmann, Carsten Campbell, Martin Thomson, John Klensin, Bjoern Hoehrmann, Carsten
Bormann, and Christian Amsuess for their review comments. Bormann, and Christian Amsuess for their review comments.
The CBOR Representation text and CDDL was contributed by Carsten 15. References
Bormann.
16. References
16.1. Normative References 15.1. Normative References
[BIPM] Bureau International des Poids et Mesures, "The [BIPM] Bureau International des Poids et Mesures, "The
International System of Units (SI)", 8th edition, 2006. International System of Units (SI)", 8th edition, 2006.
[IEEE.754.1985] [IEEE.754.1985]
Institute of Electrical and Electronics Engineers, Institute of Electrical and Electronics Engineers,
"Standard for Binary Floating-Point Arithmetic", IEEE "Standard for Binary Floating-Point Arithmetic", IEEE
Standard 754, August 1985. Standard 754, August 1985.
[NIST811] Thompson, A. and B. Taylor, "Guide for the Use of the [NIST811] Thompson, A. and B. Taylor, "Guide for the Use of the
skipping to change at page 29, line 49 skipping to change at page 29, line 36
[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, DOI 10.17487/ Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/
RFC2119, March 1997, RFC2119, March 1997,
<http://www.rfc-editor.org/info/rfc2119>. <http://www.rfc-editor.org/info/rfc2119>.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
DOI 10.17487/RFC3688, January 2004, DOI 10.17487/RFC3688, January 2004,
<http://www.rfc-editor.org/info/rfc3688>. <http://www.rfc-editor.org/info/rfc3688>.
[RFC4627] Crockford, D., "The application/json Media Type for
JavaScript Object Notation (JSON)", RFC 4627, DOI
10.17487/RFC4627, July 2006,
<http://www.rfc-editor.org/info/rfc4627>.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006,
<http://www.rfc-editor.org/info/rfc4648>. <http://www.rfc-editor.org/info/rfc4648>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226, IANA Considerations Section in RFCs", BCP 26, RFC 5226,
DOI 10.17487/RFC5226, May 2008, DOI 10.17487/RFC5226, May 2008,
<http://www.rfc-editor.org/info/rfc5226>. <http://www.rfc-editor.org/info/rfc5226>.
[RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type
skipping to change at page 30, line 42 skipping to change at page 30, line 24
[RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, [RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303,
DOI 10.17487/RFC7303, July 2014, DOI 10.17487/RFC7303, July 2014,
<http://www.rfc-editor.org/info/rfc7303>. <http://www.rfc-editor.org/info/rfc7303>.
[W3C.REC-exi-20110310] [W3C.REC-exi-20110310]
Schneider, J. and T. Kamiya, "Efficient XML Interchange Schneider, J. and T. Kamiya, "Efficient XML Interchange
(EXI) Format 1.0", World Wide Web Consortium (EXI) Format 1.0", World Wide Web Consortium
Recommendation REC-exi-20110310, March 2011, Recommendation REC-exi-20110310, March 2011,
<http://www.w3.org/TR/2011/REC-exi-20110310>. <http://www.w3.org/TR/2011/REC-exi-20110310>.
16.2. Informative References 15.2. Informative References
[I-D.arkko-core-dev-urn] [I-D.arkko-core-dev-urn]
Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource
Names for Device Identifiers", draft-arkko-core-dev-urn-03 Names for Device Identifiers", draft-arkko-core-dev-urn-03
(work in progress), July 2012. (work in progress), July 2012.
[I-D.greevenbosch-appsawg-cbor-cddl] [I-D.greevenbosch-appsawg-cbor-cddl]
Vigano, C. and H. Birkholz, "CBOR data definition language Vigano, C. and H. Birkholz, "CBOR data definition language
(CDDL): a notational convention to express CBOR data (CDDL): a notational convention to express CBOR data
structures", draft-greevenbosch-appsawg-cbor-cddl-08 (work structures", draft-greevenbosch-appsawg-cbor-cddl-08 (work
in progress), March 2016. in progress), March 2016.
[I-D.ietf-core-links-json] [I-D.ietf-core-links-json]
Li, K., Rahman, A., and C. Bormann, "Representing CoRE Li, K., Rahman, A., and D. Bormann, "Representing CoRE
Formats in JSON and CBOR", draft-ietf-core-links-json-04 Formats in JSON and CBOR", draft-ietf-core-links-json-05
(work in progress), November 2015. (work in progress), April 2016.
[RFC2141] Moats, R., "URN Syntax", RFC 2141, DOI 10.17487/RFC2141, [RFC2141] Moats, R., "URN Syntax", RFC 2141, DOI 10.17487/RFC2141,
May 1997, <http://www.rfc-editor.org/info/rfc2141>. May 1997, <http://www.rfc-editor.org/info/rfc2141>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, RFC Resource Identifier (URI): Generic Syntax", STD 66, RFC
3986, DOI 10.17487/RFC3986, January 2005, 3986, DOI 10.17487/RFC3986, January 2005,
<http://www.rfc-editor.org/info/rfc3986>. <http://www.rfc-editor.org/info/rfc3986>.
[RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally
skipping to change at page 32, line 13 skipping to change at page 31, line 42
and defined by [I-D.ietf-core-links-json]. and defined by [I-D.ietf-core-links-json].
The link extension can be an array of objects that can be used for The link extension can be an array of objects that can be used for
additional information. Each object in the Link array is constrained additional information. Each object in the Link array is constrained
to being a map of strings to strings with unique keys. to being a map of strings to strings with unique keys.
The following shows an example of the links extension. The following shows an example of the links extension.
[{"bn": "urn:dev:ow:10e2073a01080063/", [{"bn": "urn:dev:ow:10e2073a01080063/",
"bt": 1320078429, "bt": 1320078429,
"l": "[{\"href\":\"humidity\",\"foo\":\"bar1\"}\" "l": "[{\"href\":\"humidity\",\"foo\":\"bar1\"}",
}, "n": "temperature", "v": 27.2, "u": "Cel" },
{ "n": "temperature", "v": 27.2, "u": "Cel" },
{ "n": "humidity", "v": 80, "u": "%RH" } { "n": "humidity", "v": 80, "u": "%RH" }
] ]
Authors' Addresses Authors' Addresses
Cullen Jennings Cullen Jennings
Cisco Cisco
400 3rd Avenue SW 400 3rd Avenue SW
Calgary, AB T2P 4H2 Calgary, AB T2P 4H2
Canada Canada
Phone: +1 408 421-9990 Phone: +1 408 421-9990
Email: fluffy@cisco.com Email: fluffy@iii.ca
Zach Shelby Zach Shelby
ARM ARM
150 Rose Orchard 150 Rose Orchard
San Jose 95134 San Jose 95134
USA USA
Phone: +1-408-203-9434 Phone: +1-408-203-9434
Email: zach.shelby@arm.com Email: zach.shelby@arm.com
skipping to change at page 33, line 4 skipping to change at page 32, line 28
Phone: +1-408-203-9434 Phone: +1-408-203-9434
Email: zach.shelby@arm.com Email: zach.shelby@arm.com
Jari Arkko Jari Arkko
Ericsson Ericsson
Jorvas 02420 Jorvas 02420
Finland Finland
Email: jari.arkko@piuha.net Email: jari.arkko@piuha.net
Ari Keranen Ari Keranen
Ericsson Ericsson
Jorvas 02420 Jorvas 02420
Finland Finland
Email: ari.keranen@ericsson.com Email: ari.keranen@ericsson.com
Carsten Bormann
Universitaet Bremen TZI
Postfach 330440
Bremen D-28359
Germany
Phone: +49-421-218-63921
Email: cabo@tzi.org
 End of changes. 127 change blocks. 
353 lines changed or deleted 347 lines changed or added

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