draft-ietf-core-senml-09.txt | draft-ietf-core-senml-10.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: December 31, 2017 ARM | Expires: January 4, 2018 ARM | |||
J. Arkko | J. Arkko | |||
A. Keranen | A. Keranen | |||
Ericsson | Ericsson | |||
C. Bormann | C. Bormann | |||
Universitaet Bremen TZI | Universitaet Bremen TZI | |||
June 29, 2017 | July 3, 2017 | |||
Media Types for Sensor Measurement Lists (SenML) | Media Types for Sensor Measurement Lists (SenML) | |||
draft-ietf-core-senml-09 | draft-ietf-core-senml-10 | |||
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 Measurement Lists | measurements and device parameters in the Sensor Measurement Lists | |||
(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 44 ¶ | 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 December 31, 2017. | This Internet-Draft will expire on January 4, 2018. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2017 IETF Trust and the persons identified as the | Copyright (c) 2017 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 | |||
skipping to change at page 2, line 25 ¶ | skipping to change at page 2, line 25 ¶ | |||
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 . . . . . . . . . . . . . . . . 4 | 2. Requirements and Design Goals . . . . . . . . . . . . . . . . 4 | |||
3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 | 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
4. SenML Structure and Semantics . . . . . . . . . . . . . . . . 5 | 4. SenML Structure and Semantics . . . . . . . . . . . . . . . . 6 | |||
4.1. Base attributes . . . . . . . . . . . . . . . . . . . . . 6 | 4.1. Base Fields . . . . . . . . . . . . . . . . . . . . . . . 6 | |||
4.2. Regular attributes . . . . . . . . . . . . . . . . . . . 6 | 4.2. Regular Fields . . . . . . . . . . . . . . . . . . . . . 6 | |||
4.3. Considerations . . . . . . . . . . . . . . . . . . . . . 7 | 4.3. Considerations . . . . . . . . . . . . . . . . . . . . . 7 | |||
4.4. Resolved Records . . . . . . . . . . . . . . . . . . . . 8 | 4.4. Resolved Records . . . . . . . . . . . . . . . . . . . . 8 | |||
4.5. Associating Meta-data . . . . . . . . . . . . . . . . . . 8 | 4.5. Associating Meta-data . . . . . . . . . . . . . . . . . . 9 | |||
4.6. Configuration and Actuation usage . . . . . . . . . . . . 9 | ||||
5. JSON Representation (application/senml+json) . . . . . . . . 9 | 5. JSON Representation (application/senml+json) . . . . . . . . 9 | |||
5.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 10 | 5.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 10 | |||
5.1.1. Single Datapoint . . . . . . . . . . . . . . . . . . 10 | 5.1.1. Single Datapoint . . . . . . . . . . . . . . . . . . 11 | |||
5.1.2. Multiple Datapoints . . . . . . . . . . . . . . . . . 10 | 5.1.2. Multiple Datapoints . . . . . . . . . . . . . . . . . 11 | |||
5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 11 | 5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 12 | |||
5.1.4. Resolved Data . . . . . . . . . . . . . . . . . . . . 12 | 5.1.4. Resolved Data . . . . . . . . . . . . . . . . . . . . 13 | |||
5.1.5. Multiple Data Types . . . . . . . . . . . . . . . . . 13 | 5.1.5. Multiple Data Types . . . . . . . . . . . . . . . . . 14 | |||
5.1.6. Collection of Resources . . . . . . . . . . . . . . . 13 | 5.1.6. Collection of Resources . . . . . . . . . . . . . . . 14 | |||
5.1.7. Setting an Actuator . . . . . . . . . . . . . . . . . 14 | 5.1.7. Setting an Actuator . . . . . . . . . . . . . . . . . 14 | |||
6. CBOR Representation (application/senml+cbor) . . . . . . . . 15 | 6. CBOR Representation (application/senml+cbor) . . . . . . . . 15 | |||
7. XML Representation (application/senml+xml) . . . . . . . . . 17 | 7. XML Representation (application/senml+xml) . . . . . . . . . 17 | |||
8. EXI Representation (application/senml+exi) . . . . . . . . . 19 | 8. EXI Representation (application/senml+exi) . . . . . . . . . 19 | |||
9. Fragment Identification Methods . . . . . . . . . . . . . . . 22 | 9. Fragment Identification Methods . . . . . . . . . . . . . . . 22 | |||
9.1. Fragment Identification Examples . . . . . . . . . . . . 22 | 9.1. Fragment Identification Examples . . . . . . . . . . . . 22 | |||
10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 23 | 10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 23 | |||
11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 | 11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 | |||
12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 | 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 | |||
12.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 25 | 12.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 25 | |||
skipping to change at page 3, line 18 ¶ | skipping to change at page 3, line 19 ¶ | |||
12.3.7. senml+exi Media Type Registration . . . . . . . . . 38 | 12.3.7. senml+exi Media Type Registration . . . . . . . . . 38 | |||
12.3.8. sensml+exi Media Type Registration . . . . . . . . . 39 | 12.3.8. sensml+exi Media Type Registration . . . . . . . . . 39 | |||
12.4. XML Namespace Registration . . . . . . . . . . . . . . . 41 | 12.4. XML Namespace Registration . . . . . . . . . . . . . . . 41 | |||
12.5. CoAP Content-Format Registration . . . . . . . . . . . . 41 | 12.5. CoAP Content-Format Registration . . . . . . . . . . . . 41 | |||
13. Security Considerations . . . . . . . . . . . . . . . . . . . 41 | 13. Security Considerations . . . . . . . . . . . . . . . . . . . 41 | |||
14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 41 | 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 41 | |||
15. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 42 | 15. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 42 | |||
16. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 | 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 | |||
16.1. Normative References . . . . . . . . . . . . . . . . . . 42 | 16.1. Normative References . . . . . . . . . . . . . . . . . . 42 | |||
16.2. Informative References . . . . . . . . . . . . . . . . . 43 | 16.2. Informative References . . . . . . . . . . . . . . . . . 43 | |||
Appendix A. Links Extension . . . . . . . . . . . . . . . . . . 44 | Appendix A. Links Extension . . . . . . . . . . . . . . . . . . 45 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 | |||
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. This format was designed so that processors | such as HTTP or CoAP. This format was designed so that processors | |||
with very limited capabilities could easily encode a sensor | with very limited capabilities could easily encode a sensor | |||
measurement into the media type, while at the same time a server | measurement into the media type, while at the same time a server | |||
skipping to change at page 3, line 47 ¶ | skipping to change at page 3, line 48 ¶ | |||
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]. | |||
SenML is defined by a data model for measurements and simple meta- | SenML is defined by a data model for measurements and simple meta- | |||
data about measurements and devices. The data is structured as a | data about measurements and devices. The data is structured as a | |||
single array that contains a series of SenML Records which can each | single array that contains a series of SenML Records which can each | |||
contain attributes such as an unique identifier for the sensor, the | contain fields such as an unique identifier for the sensor, the time | |||
time the measurement was made, the unit the measurement is in, and | the measurement was made, the unit the measurement is in, and the | |||
the current value of the sensor. Serializations for this data model | current value of the sensor. Serializations for this data model are | |||
are defined for JSON [RFC7159], CBOR [RFC7049], XML, and Efficient | defined for JSON [RFC7159], CBOR [RFC7049], XML, and Efficient XML | |||
XML Interchange (EXI) [W3C.REC-exi-20140211]. | Interchange (EXI) [W3C.REC-exi-20140211]. | |||
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","u":"Cel","v":23.1} | {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} | |||
] | ] | |||
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 | |||
skipping to change at page 4, line 36 ¶ | skipping to change at page 4, line 38 ¶ | |||
measurements to be batched into a single HTTP or CoAP request. This | measurements to be batched into a single HTTP or CoAP request. This | |||
"batch" upload capability allows the server side to efficiently | "batch" upload capability allows the server side to efficiently | |||
support a large number of devices. It also conveniently supports | support a large number of devices. It also conveniently supports | |||
batch transfers from proxies and storage devices, even in situations | batch transfers from proxies and storage devices, even in situations | |||
where the sensor itself sends just a single data item at a time. The | where the sensor itself sends just a single data item at a time. The | |||
multiple measurements could be from multiple related sensors or from | multiple measurements could be from multiple related sensors or from | |||
the same sensor but at different times. | the same sensor but at different times. | |||
The basic design is an array with a series of measurements. The | The basic design is an array with a series of measurements. The | |||
following example shows two measurements made at different times. | following example shows two measurements made at different times. | |||
The value of a measurement is in the "v" tag, the time of a | The value of a measurement is given by the "v" field, the time of a | |||
measurement is in the "t" tag, the "n" tag has a unique sensor name, | measurement is in the "t" field, the "n" field has a unique sensor | |||
and the unit of the measurement is carried in the "u" tag. | name, and the unit of the measurement is carried in the "u" field. | |||
[ | [ | |||
{"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, | {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, | |||
"v":23.5}, | "v":23.5}, | |||
{"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020091e+09, | {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020091e+09, | |||
"v":23.6} | "v":23.6} | |||
] | ] | |||
To keep the messages small, it does not make sense to repeat the "n" | To keep the messages small, it does not make sense to repeat the "n" | |||
tag in each SenML Record so there is a concept of a Base Name which | field in each SenML Record so there is a concept of a Base Name which | |||
is simply a string that is prepended to the Name field of all | is simply a string that is prepended to the Name field of all | |||
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","u":"Cel","t":1.276020076e+09, | {"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, | |||
"v":23.5}, | "v":23.5}, | |||
{"u":"Cel","t":1.276020091e+09, | {"u":"Cel","t":1.276020091e+09, | |||
"v":23.6} | "v":23.6} | |||
] | ] | |||
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" field and the "n" | |||
tags in each Record are the empty string so they are omitted. | fields in each Record are the empty string so they are omitted. | |||
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, batch up 60 of them, and then send the batch to a server. It | second, batch up 60 of them, and then send the batch to a server. It | |||
would include the relative time each measurement was made compared to | would include the relative time each measurement was made compared to | |||
the time the batch was sent in each SenML Record. The server might | the time the batch was sent in each SenML Record. The server might | |||
skipping to change at page 5, line 42 ¶ | skipping to change at page 5, line 44 ¶ | |||
"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. | |||
SenML Label: A short name used in SenML Records to denote different | ||||
SenML fields (e.g., "v" for "value"). | ||||
SenML Field: A component of a record that associates a value to a | ||||
SenML Label for this record. | ||||
This document uses the terms "attribute" and "tag" where they occur | ||||
with the underlying technologies (XML, CBOR [RFC7049], and Link | ||||
Format [RFC6690]), not for SenML concepts per se. Note that | ||||
"attribute" has been widely used previously as a synonym for SenML | ||||
"field", though. | ||||
4. SenML Structure and 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 | |||
SenML Records with several attributes described below. There are two | SenML Records with several fields described below. There are two | |||
kind of attributes: base and regular. The base attributes can be | kinds of fields: base and regular. The base fields can be included | |||
included in any SenML Record and they apply to the entries in the | in any SenML Record and they apply to the entries in the Record. | |||
Record. Each base attribute also applies to all Records after it up | Each base field also applies to all Records after it up to, but not | |||
to, but not including, the next Record that has that same base | including, the next Record that has that same base field. All base | |||
attribute. All base attributes are optional. Regular attributes can | fields are optional. Regular fields can be included in any SenML | |||
be included in any SenML Record and apply only to that Record. | Record and apply only to that Record. | |||
4.1. Base attributes | 4.1. Base Fields | |||
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. | the entries. | |||
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. | |||
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. If a record does not contain a Unit value, | otherwise indicated. If a record does not contain a Unit value, | |||
then the Base Unit is used. Otherwise the value found in the Unit | then the Base Unit is used. Otherwise the value found in the Unit | |||
(if any) is used. | (if any) is used. | |||
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. | similar to Base Time. | |||
Base Sum: A base sum is added to the sum found in an entry, similar | Base Sum: A base sum is added to the sum found in an entry, similar | |||
to Base Time. | to Base Time. | |||
Version: Version number of media type format. This attribute is an | Version: Version number of media type format. This field is an | |||
optional positive integer and defaults to 5 if not present. [RFC | optional positive integer and defaults to 5 if not present. [RFC | |||
Editor: change the default value to 10 when this specification is | Editor: change the default value to 10 when this specification is | |||
published as an RFC and remove this note] | published as an RFC and remove this note] | |||
4.2. Regular attributes | 4.2. Regular Fields | |||
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 field, this must result in a globally unique identifier for | |||
for the resource. The name is optional, if the Base Name is | the resource. The name is optional, if the Base Name is present. | |||
present. If the name is missing, Base Name must uniquely identify | If the name is missing, Base Name must uniquely identify the | |||
the resource. This can be used to represent a large array of | 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. | Unit: Units for a measurement value. Optional. | |||
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 basic data | otherwise required. Values are represented using basic data | |||
types. This specification defines floating point numbers ("v" | types. This specification defines floating point numbers ("v" | |||
field for "Value"), booleans ("vb" for "Boolean Value"), strings | field for "Value"), booleans ("vb" for "Boolean Value"), strings | |||
("vs" for "String Value") and binary data ("vd" for "Data Value"). | ("vs" for "String Value") and binary data ("vd" for "Data Value"). | |||
Exactly one value field MUST appear unless there is Sum field in | Exactly one value field MUST appear unless there is Sum field in | |||
which case it is allowed to have no Value field. | which case it is allowed to have no Value field. | |||
Sum: Integrated sum of the values over time. Optional. This | Sum: Integrated sum of the values over time. Optional. This field | |||
attribute is in the units specified in the Unit value multiplied | 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 | 4.3. Considerations | |||
The SenML format can be extended with further custom attributes. | The SenML format can be extended with further custom fields. Both | |||
Both new base and regular attributes are allowed. See Section 12.2 | new base and regular fields are allowed. See Section 12.2 for | |||
for details. Implementations MUST ignore attributes they don't | details. Implementations MUST ignore fields they don't recognize | |||
recognize unless that attribute has a label name that ends with the | unless that field has a label name that ends with the '_' character | |||
'_' character in which case an error MUST be generated. | in which case an error MUST be generated. | |||
Systems reading one of the objects MUST check for the Version | All SenML Records in a Pack MUST have the same version number. This | |||
attribute. If this value is a version number larger than the version | is typically done by adding a Base Version field to only the first | |||
which the system understands, the system SHOULD NOT use this object. | Record in the Pack. | |||
This allows the version number to indicate that the object contains | ||||
mandatory to understand attributes. New version numbers can only be | Systems reading one of the objects MUST check for the Version field. | |||
If this value is a version number larger than the version which the | ||||
system understands, the system SHOULD NOT use this object. This | ||||
allows the version number to indicate that the object contains | ||||
mandatory to understand fields. 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 | |||
differentiate the sensor from all others. It is RECOMMENDED that the | differentiate the sensor from all others. It is RECOMMENDED that the | |||
full names are represented as URIs [RFC3986] or URNs [RFC2141]. One | full names are represented as URIs [RFC3986] or URNs [RFC2141]. One | |||
way to create a unique name is to include some bit string that has | way to create a unique name is to include some bit string that has | |||
guaranteed uniqueness (such as a 1-wire address) that is assigned to | guaranteed uniqueness (such as a 1-wire address) that is assigned to | |||
the device. Some of the examples in this draft use the device URN | the device. Some of the examples in this draft use the device URN | |||
type as specified in [I-D.arkko-core-dev-urn]. UUIDs [RFC4122] are | type as specified in [I-D.arkko-core-dev-urn]. UUIDs [RFC4122] are | |||
another way to generate a unique name. Note that long-term stable | another way to generate a unique name. Note that long-term stable | |||
unique identifiers are problematic for privacy reasons and should be | unique identifiers are problematic for privacy reasons and should be | |||
used with care or avoided as described in [RFC7721]. | used with care or avoided as described in [RFC7721]. | |||
The resulting concatenated name MUST consist only of characters out | The resulting concatenated name MUST consist only of characters out | |||
of the set "A" to "Z", "a" to "z", "0" to "9", "-", ":", ".", or "_" | of the set "A" to "Z", "a" to "z", "0" to "9", "-", ":", ".", "/", or | |||
and it MUST start with a character out of the set "A" to "Z", "a" to | "_" and it MUST start with a character out of the set "A" to "Z", "a" | |||
"z", or "0" to "9". This restricted character set was chosen so that | to "z", or "0" to "9". This restricted character set was chosen so | |||
these names can be directly used as in other types of URI including | that these names can be directly used as in other types of URI | |||
segments of an HTTP path with no special encoding and can be directly | including segments of an HTTP path with no special encoding and can | |||
used in many databases and analytic systems. [RFC5952] contains | be directly used in many databases and analytic systems. [RFC5952] | |||
advice on encoding an IPv6 address in a name. | contains advice on encoding an IPv6 address in a name. | |||
If the Record has no Unit, the Base Unit is used as the Unit. Having | If the Record has no Unit, the Base Unit is used as the Unit. Having | |||
no Unit and no Base Unit is allowed. | no Unit and no Base Unit is allowed. | |||
If either the Base Time or Time value is missing, the missing | If either the Base Time or Time value is missing, the missing field | |||
attribute is considered to have a value of zero. The Base Time and | is considered to have a value of zero. The Base Time and Time values | |||
Time values are added together to get the time of measurement. A | are added together to get the time of measurement. A time of zero | |||
time of zero indicates that the sensor does not know the absolute | indicates that the sensor does not know the absolute time and the | |||
time and the measurement was made roughly "now". A negative value is | measurement was made roughly "now". A negative value is used to | |||
used to indicate seconds in the past from roughly "now". A positive | indicate seconds in the past from roughly "now". A positive value is | |||
value is used to indicate the number of seconds, excluding leap | used to indicate the number of seconds, excluding leap seconds, since | |||
seconds, since the start of the year 1970 in UTC. | the start of the year 1970 in UTC. | |||
If only one of the Base Sum or Sum value is present, the missing | If only one of the Base Sum or Sum value is present, the missing | |||
attribute is considered to have a value of zero. The Base Sum and | field is considered to have a value of zero. The Base Sum and Sum | |||
Sum values are added together to get the sum of measurement. If | values are added together to get the sum of measurement. If neither | |||
neither the Base Sum or Sum are present, then the measurement does | the Base Sum or Sum are present, then the measurement does not have a | |||
not have a sum value. | sum value. | |||
If the Base Value or Value is not present, the missing attribute(s) | If the Base Value or Value is not present, the missing field(s) are | |||
are considered to have a value of zero. The Base Value and Value are | considered to have a value of zero. The Base Value and Value are | |||
added together to get the value of the measurement. | added together to get the value of the measurement. | |||
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 | fields to provide better information about the statistical properties | |||
properties of the measurement. | of the measurement. | |||
4.4. Resolved Records | 4.4. Resolved Records | |||
Sometimes it is useful to be able to refer to a defined normalized | Sometimes it is useful to be able to refer to a defined normalized | |||
format for SenML records. This normalized format tends to get used | format for SenML records. This normalized format tends to get used | |||
for big data applications and intermediate forms when converting to | for big data applications and intermediate forms when converting to | |||
other formats. | other formats. | |||
A SenML Record is referred to as "resolved" if it does not contain | A SenML Record is referred to as "resolved" if it does not contain | |||
any base values and has no relative times, but the base values of the | any base values and has no relative times, but the base values of the | |||
SenML Pack (if any) are applied to the Record. That is, name and | SenML Pack (if any) are applied to the Record. That is, name and | |||
base name are concatenated, base time is added to the time of the | base name are concatenated, base time is added to the time of the | |||
Record, if the Record did not contain Unit the Base Unit is applied | Record, if the Record did not contain Unit the Base Unit is applied | |||
to the record, etc. In addition the records need to be in | to the record, etc. In addition the records need to be in | |||
chronological order. An example of this is show in Section 5.1.4. | chronological order. An example of this is show in Section 5.1.4. | |||
Future specification that defines new base attributes need to specify | Future specification that defines new base fields need to specify how | |||
how the attribute is resolved. | the field is resolved. | |||
4.5. Associating Meta-data | 4.5. 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=) link attribute (which is defined | |||
for the Link Format in Section 7.2.1 of [RFC7252]). | ||||
4.6. Configuration and Actuation usage | ||||
SenML can also be used for configuring parameters and controlling | ||||
actuators. When a SenML Pack is sent (e.g., using a HTTP/CoAP POST | ||||
or PUT method) and the semantics of the target are such that SenML is | ||||
interpreted as configuration/actuation, SenML Records are interpreted | ||||
as a request to change the values of given (sub)resources (given as | ||||
names) to given values at the given time(s). | ||||
5. JSON Representation (application/senml+json) | 5. JSON Representation (application/senml+json) | |||
The SenML labels (JSON object member names) shown in Table 1 are used | For the SenML fields shown in Table 1, the SenML labels are used as | |||
in JSON SenML Record attributes. | the JSON object member names within JSON objects representing the | |||
JSON SenML Records. | ||||
+---------------+-------+---------+ | +---------------+-------+---------+ | |||
| Name | label | 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 | | |||
| Base Sum | bs | Number | | | Base Sum | bs | Number | | |||
| Version | bver | Number | | | Version | bver | Number | | |||
skipping to change at page 9, line 35 ¶ | skipping to change at page 10, line 28 ¶ | |||
| 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 | | |||
| Link | l | String | | | Link | l | String | | |||
+---------------+-------+---------+ | +---------------+-------+---------+ | |||
Table 1: JSON SenML Labels | Table 1: JSON SenML Labels | |||
The root content consists of an array with one JSON object for each | The root JSON value consists of an array with one JSON object for | |||
SenML Record. All the fields in the above table MAY occur in the | each SenML Record. All the fields in the above table MAY occur in | |||
records with the type specified in the table. | the records with member values of 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 [RFC7159]. | Value are encoded using the escape sequences defined in [RFC7159]. | |||
Octets in the Data Value are base64 encoded with URL safe alphabet as | Octets in the Data Value are base64 encoded with URL safe alphabet as | |||
defined in Section 5 of [RFC4648]. | defined in Section 5 of [RFC4648], with padding omitted. | |||
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. | |||
skipping to change at page 13, line 43 ¶ | skipping to change at page 14, line 14 ¶ | |||
5.1.5. Multiple Data Types | 5.1.5. Multiple Data Types | |||
The following example shows a sensor that returns different data | The following example shows a sensor that returns different data | |||
types. | types. | |||
[ | [ | |||
{"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, | {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, | |||
{"n":"label","vs":"Machine Room"}, | {"n":"label","vs":"Machine Room"}, | |||
{"n":"open","vb":false}, | {"n":"open","vb":false}, | |||
{"n":"nfv-reader","vd":"aGkgCg=="} | {"n":"nfv-reader","vd":"aGkgCg"} | |||
] | ] | |||
5.1.6. Collection of Resources | 5.1.6. Collection of Resources | |||
The following example shows the results from a query to one device | The following example shows the results from a query to one device | |||
that aggregates multiple measurements from another devices. The | that aggregates multiple measurements from another devices. The | |||
example assumes that a client has fetched information from a device | example assumes that a client has fetched information from a device | |||
at 2001:db8::2 by performing a GET operation on http://[2001:db8::2] | at 2001:db8::2 by performing a GET operation on http://[2001:db8::2] | |||
at Mon Oct 31 16:27:09 UTC 2011, and has gotten two separate values | at Mon Oct 31 16:27:09 UTC 2011, and has gotten two separate values | |||
as a result, a temperature and humidity measurement as well as the | as a result, a temperature and humidity measurement as well as the | |||
results from another device at http://[2001:db8::1] that also had a | results from another device at http://[2001:db8::1] that also had a | |||
temperature and humidity. Note that the last record would use the | temperature and humidity. Note that the last record would use the | |||
Base Name from the 3rd record but the Base Time from the first | Base Name from the 3rd record but the Base Time from the first | |||
record. | record. | |||
[ | [ | |||
{"bn":"2001:db8::2","bt":1.320078429e+09, | {"bn":"2001:db8::2/","bt":1.320078429e+09, | |||
"n":"temperature","u":"Cel","v":25.2}, | "n":"temperature","u":"Cel","v":25.2}, | |||
{"n":"humidity","u":"%RH","v":30}, | {"n":"humidity","u":"%RH","v":30}, | |||
{"bn":"2001:db8::1", | {"bn":"2001:db8::1/","n":"temperature","u":"Cel","v":12.3}, | |||
"n":"temperature","u":"Cel","v":12.3}, | ||||
{"n":"humidity","u":"%RH","v":67} | {"n":"humidity","u":"%RH","v":67} | |||
] | ] | |||
5.1.7. Setting an Actuator | 5.1.7. Setting an Actuator | |||
The following example show the SenML that could be used to set the | The following example show the SenML that could be used to set the | |||
current set point of a typical residential thermostat which has a | current set point of a typical residential thermostat which has a | |||
temperature set point, a switch to turn on and off the heat, and a | temperature set point, a switch to turn on and off the heat, and a | |||
switch to turn on the fan override. | switch to turn on the fan override. | |||
skipping to change at page 14, line 32 ¶ | skipping to change at page 15, line 4 ¶ | |||
current set point of a typical residential thermostat which has a | current set point of a typical residential thermostat which has a | |||
temperature set point, a switch to turn on and off the heat, and a | temperature set point, a switch to turn on and off the heat, and a | |||
switch to turn on the fan override. | switch to turn on the fan override. | |||
[ | [ | |||
{"bn":"urn:dev:ow:10e2073a01080063:"}, | {"bn":"urn:dev:ow:10e2073a01080063:"}, | |||
{"n":"temp","u":"Cel","v":23.1}, | {"n":"temp","u":"Cel","v":23.1}, | |||
{"n":"heat","u":"/","v":1}, | {"n":"heat","u":"/","v":1}, | |||
{"n":"fan","u":"/","v":0} | {"n":"fan","u":"/","v":0} | |||
] | ] | |||
In the following example two different lights are turned on. It is | In the following example two different lights are turned on. It is | |||
assumed that the lights are on a 802.1BA network that can guarantee | assumed that the lights are on a network that can guarantee delivery | |||
delivery of the messages to the two lights within 15 ms and uses | of the messages to the two lights within 15 ms (e.g. a network using | |||
802.1AS for time synchronization. The controller has set the time of | 802.1BA [IEEE802.1ba-2011] and 802.1AS [IEEE802.1as-2011] for time | |||
the lights coming on to 20 ms in the future from the current time. | synchronization). The controller has set the time of the lights | |||
This allows both lights to receive the message, wait till that time, | coming on to 20 ms in the future from the current time. This allows | |||
then apply the switch command so that both lights come on at the same | both lights to receive the message, wait till that time, then apply | |||
time. | the switch command so that both lights come on at the same time. | |||
[ | [ | |||
{"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":1}, | {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":1}, | |||
{"n":"2001:db8::4","v":1} | {"n":"2001:db8::4","v":1} | |||
] | ] | |||
The following shows two lights being turned off using a non | The following shows two lights being turned off using a non | |||
deterministic network that has a high odds of delivering a message in | deterministic network that has a high odds of delivering a message in | |||
less than 100 ms and uses NTP for time synchronization. The current | less than 100 ms and uses NTP for time synchronization. The current | |||
time is 1320078429. The user has just turned off a light switch | time is 1320078429. The user has just turned off a light switch | |||
skipping to change at page 15, line 33 ¶ | skipping to change at page 16, line 7 ¶ | |||
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); however | floating point numbers, or decimal fractions (CBOR Tag 4); however | |||
a representation SHOULD be chosen such that when the CBOR value is | a representation SHOULD be chosen such that when the CBOR value is | |||
converted back to an IEEE double precision floating point value, | converted back to an IEEE double precision floating point value, | |||
it has exactly the same value as the original Number. For the | it has exactly the same value as the original Number. For the | |||
version number, only an unsigned integer is allowed. | version number, only an unsigned integer is allowed. | |||
o Characters in the String Value are encoded using a definite length | o Characters in the String Value are encoded using a definite length | |||
text string (type 3). Octets in the Data Value are encoded using | text string (type 3). Octets in the Data Value are encoded using | |||
a definite length byte string (type 2) . | a definite length byte string (type 2). | |||
o For compactness, the CBOR representation uses integers for the map | o For compactness, the CBOR representation uses integers for the | |||
keys defined in Table 3. This table is conclusive, i.e., there is | labels, as defined in Table 3. This table is conclusive, i.e., | |||
no intention to define any additional integer map keys; any | there is no intention to define any additional integer map keys; | |||
extensions will use string map keys. This allows translators | any extensions will use string map keys. This allows translators | |||
converting between CBOR and JSON representations to convert also | converting between CBOR and JSON representations to convert also | |||
all future labels without needing to update implementations. | all future labels without needing to update implementations. | |||
+---------------+-------+------------+ | +---------------+-------+------------+ | |||
| Name | Label | CBOR Label | | | Name | Label | CBOR Label | | |||
+---------------+-------+------------+ | +---------------+-------+------------+ | |||
| Version | bver | -1 | | | Version | bver | -1 | | |||
| Base Name | bn | -2 | | | Base Name | bn | -2 | | |||
| Base Time | bt | -3 | | | Base Time | bt | -3 | | |||
| Base Units | bu | -4 | | | Base Units | bu | -4 | | |||
skipping to change at page 16, line 29 ¶ | skipping to change at page 16, line 40 ¶ | |||
| 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 | | |||
| Link | l | 9 | | | Link | l | 9 | | |||
+---------------+-------+------------+ | +---------------+-------+------------+ | |||
Table 3: CBOR representation: integers for map keys | Table 3: CBOR representation: integers for map keys | |||
o For streaming SensML in CBOR representation, the array containing | o For streaming SensML in CBOR representation, the array containing | |||
the records SHOULD be an CBOR indefinite length array while for | the records SHOULD be a CBOR indefinite length array while for | |||
non streaming SenML, a definite length array MUST be used. | non-streaming SenML, a definite length array MUST be used. | |||
The following example shows a dump of the CBOR example for the same | The following example shows a dump of the CBOR example for the same | |||
sensor measurement as in Section 5.1.2. | sensor measurement as in Section 5.1.2. | |||
0000 87 a7 21 78 1b 75 72 6e 3a 64 65 76 3a 6f 77 3a |..!x.urn:dev:ow:| | 0000 87 a7 21 78 1b 75 72 6e 3a 64 65 76 3a 6f 77 3a |..!x.urn:dev:ow:| | |||
0010 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 3a |10e2073a0108006:| | 0010 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 3a |10e2073a0108006:| | |||
0020 22 fb 41 d3 03 a1 5b 00 10 62 23 61 41 20 05 00 |".A...[..b#aA ..| | 0020 22 fb 41 d3 03 a1 5b 00 10 62 23 61 41 20 05 00 |".A...[..b#aA ..| | |||
0030 67 76 6f 6c 74 61 67 65 01 61 56 02 fb 40 5e 06 |gvoltage.aV..@^.| | 0030 67 76 6f 6c 74 61 67 65 01 61 56 02 fb 40 5e 06 |gvoltage.aV..@^.| | |||
0040 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e 74 06 |fffff..gcurrent.| | 0040 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e 74 06 |fffff..gcurrent.| | |||
0050 24 02 fb 3f f3 33 33 33 33 33 33 a3 00 67 63 75 |$..?.333333..gcu| | 0050 24 02 fb 3f f3 33 33 33 33 33 33 a3 00 67 63 75 |$..?.333333..gcu| | |||
skipping to change at page 17, line 29 ¶ | skipping to change at page 17, line 44 ¶ | |||
<senml bn="urn:dev:ow:10e2073a0108006:" bt="1.276020076001e+09" | <senml bn="urn:dev:ow:10e2073a0108006:" bt="1.276020076001e+09" | |||
bu="A" bver="5" n="voltage" u="V" v="120.1"></senml> | bu="A" bver="5" n="voltage" u="V" v="120.1"></senml> | |||
<senml n="current" t="-5" v="1.2"></senml> | <senml n="current" t="-5" v="1.2"></senml> | |||
<senml n="current" t="-4" v="1.3"></senml> | <senml n="current" t="-4" v="1.3"></senml> | |||
<senml n="current" t="-3" v="1.4"></senml> | <senml n="current" t="-3" v="1.4"></senml> | |||
<senml n="current" t="-2" v="1.5"></senml> | <senml n="current" t="-2" v="1.5"></senml> | |||
<senml n="current" t="-1" v="1.6"></senml> | <senml n="current" t="-1" v="1.6"></senml> | |||
<senml n="current" v="1.7"></senml> | <senml n="current" v="1.7"></senml> | |||
</sensml> | </sensml> | |||
The SenML Stream is represented as a sensml tag that contains a | The SenML Stream is represented as a sensml element that contains a | |||
series of senml tags for each SenML Record. The SenML Fields are | series of senml elements for each SenML Record. The SenML fields are | |||
represents as XML attributes. The following table shows the mapping | represented as XML attributes. For each field defined in this | |||
of the SenML labels, which are used for the attribute name, to the | document, the following table shows the SenML labels, which are used | |||
attribute types used in the XML senml tags. | for the XML attribute name, as well as the according restrictions on | |||
the XML attribute values ("type") as used in the XML senml elements. | ||||
+---------------+-------+---------+ | +---------------+-------+---------+ | |||
| Name | Label | Type | | | Name | Label | 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 Sum | bs | double | | | Base Sum | bs | double | | |||
| Base Version | bver | int | | | Base Version | bver | int | | |||
skipping to change at page 21, line 39 ¶ | skipping to change at page 21, line 39 ¶ | |||
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 80 6c 20 01 07 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| | 0000 a0 00 48 80 6c 20 01 07 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| | |||
0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| | 0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| | |||
0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| | 0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| | |||
0030 01 |.| | 0030 01 |.| | |||
0031 | 0031 | |||
A small temperature sensor devices that only generates this one EXI | A small temperature sensor device that only generates this one EXI | |||
file does not really need an full EXI implementation. It can simply | file does not really need an full EXI implementation. It can simply | |||
hard code the output replacing the 1-wire device ID starting at byte | hard code the output replacing the 1-wire device ID starting at byte | |||
0x20 and going to byte 0x2F with it's device ID, and replacing the | 0x20 and going to byte 0x2F with it's device ID, and replacing the | |||
value "0xe7 0x01" at location 0x37 and 0x38 with the current | value "0xe7 0x01" at location 0x37 and 0x38 with the current | |||
temperature. The EXI Specification [W3C.REC-exi-20140211] contains | temperature. The EXI Specification [W3C.REC-exi-20140211] 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 | |||
skipping to change at page 22, line 21 ¶ | skipping to change at page 22, line 21 ¶ | |||
Fragment Identifier to a single record, or a set of records, in a | Fragment Identifier to a single record, or a set of records, in a | |||
Pack. The fragment identifier is only interpreted by a client and | Pack. The fragment identifier is only interpreted by a client and | |||
does not impact retrieval of a representation. The SenML Fragment | does not impact retrieval of a representation. The SenML Fragment | |||
Identification is modeled after CSV Fragment Identifiers [RFC7111]. | Identification is modeled after CSV Fragment Identifiers [RFC7111]. | |||
To select a single SenML Record, the "rec" scheme followed by a | To select a single SenML Record, the "rec" scheme followed by a | |||
single number is used. For the purpose of numbering records, the | single number is used. For the purpose of numbering records, the | |||
first record is at position 1. A range of records can be selected by | first record is at position 1. A range of records can be selected by | |||
giving the first and the last record number separated by a '-' | giving the first and the last record number separated by a '-' | |||
character. Instead of the second number, the '*' character can be | character. Instead of the second number, the '*' character can be | |||
used to indicate the last Senml Record in the Pack. A set of records | used to indicate the last SenML Record in the Pack. A set of records | |||
can also be selected using a comma separated list of record positions | can also be selected using a comma separated list of record positions | |||
or ranges. | or ranges. | |||
(We use the term "selecting a record" for identifying it as part of | (We use the term "selecting a record" for identifying it as part of | |||
the fragment, not in the sense of isolating it from the Pack -- the | the fragment, not in the sense of isolating it from the Pack -- the | |||
record still needs to be interpreted as part of the Pack, e.g., using | record still needs to be interpreted as part of the Pack, e.g., using | |||
the base values defined in record 1.) | the base values defined in earlier records) | |||
9.1. Fragment Identification Examples | 9.1. Fragment Identification Examples | |||
The 3rd SenML Record from "coap://example.com/temp" resource can be | The 3rd SenML Record from "coap://example.com/temp" resource can be | |||
selected with: | selected with: | |||
coap://example.com/temp#rec=3 | coap://example.com/temp#rec=3 | |||
Records from 3rd to 6th can be selected with: | Records from 3rd to 6th can be selected with: | |||
skipping to change at page 23, line 21 ¶ | skipping to change at page 23, line 21 ¶ | |||
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 | |||
cumulative sum helps reflect what happened while the network was | cumulative sum helps reflect what happened while the network was | |||
down. A meter like this would typically report a measurement with | down. A meter like this would typically report a measurement with | |||
the units set to watts, but it would put the sum of energy used in | the units set to watts, but it would put the sum of energy used in | |||
the "s" attribute of the measurement. It might optionally include | the "s" field of the measurement. It might optionally include the | |||
the current power in the "v" attribute. | current power in the "v" field. | |||
While the benefit of using the integrated sum is fairly clear for | While the benefit of using the integrated sum is fairly clear for | |||
measurements like power and energy, it is less obvious for something | measurements like power and energy, it is less obvious for something | |||
like temperature. Reporting the sum of the temperature makes it easy | like temperature. Reporting the sum of the temperature makes it easy | |||
to compute averages even when the individual temperature values are | to compute averages even when the individual temperature values are | |||
not reported frequently enough to compute accurate averages. | not reported frequently enough to compute accurate averages. | |||
Implementors are encouraged to report the cumulative sum as well as | Implementors are encouraged to report the cumulative sum as well as | |||
the raw value of a given sensor. | the raw value of a given sensor. | |||
Applications that use the cumulative sum values need to understand | Applications that use the cumulative sum values need to understand | |||
skipping to change at page 24, line 17 ¶ | skipping to change at page 24, line 17 ¶ | |||
For reference, the JSON and CBOR representations can be described | For reference, the JSON and CBOR representations can be described | |||
with the common CDDL [I-D.greevenbosch-appsawg-cbor-cddl] | with the common CDDL [I-D.greevenbosch-appsawg-cbor-cddl] | |||
specification in Figure 1. | specification in Figure 1. | |||
SenML-Pack = [1* record] | SenML-Pack = [1* record] | |||
record = { | record = { | |||
? bn => tstr, ; Base Name | ? bn => tstr, ; Base Name | |||
? bt => numeric, ; Base Time | ? bt => numeric, ; Base Time | |||
? bu => tstr, ; Base Units | ? bu => tstr, ; Base Units | |||
? bv => numeric, ; Base value | ? bv => numeric, ; Base Value | |||
? bs => numeric, ; Base sum | ? bs => numeric, ; Base Sum | |||
? bver => uint, ; Base Version | ? bver => uint, ; Base Version | |||
? n => tstr, ; Name | ? n => tstr, ; Name | |||
? u => tstr, ; Units | ? u => tstr, ; Units | |||
? s => numeric, ; Value Sum | ? s => numeric, ; Value Sum | |||
? t => numeric, ; Time | ? t => numeric, ; Time | |||
? ut => numeric, ; Update Time | ? ut => numeric, ; Update Time | |||
? l => tstr, ; Link | ? l => tstr, ; Link | |||
? ( v => numeric // ; Numeric Value | ? ( v => numeric // ; Numeric Value | |||
vs => tstr // ; String Value | vs => tstr // ; String Value | |||
vb => bool // ; Boolean Value | vb => bool // ; Boolean Value | |||
skipping to change at page 30, line 15 ¶ | skipping to change at page 30, line 15 ¶ | |||
All new SenML labels that have "base" semantics (see Section 4.1) | All new SenML labels that have "base" semantics (see Section 4.1) | |||
MUST start with character 'b'. Regular labels MUST NOT start with | MUST start with character 'b'. Regular labels MUST NOT start with | |||
that character. | that character. | |||
Extensions that add a label that is intended for use with XML need to | Extensions that add a label that is intended for use with XML need to | |||
create a new RelaxNG scheme that includes all the labels in the IANA | create a new RelaxNG scheme that includes all the labels in the IANA | |||
registry. | registry. | |||
Extensions that add a label that is intended for use with EXI need to | Extensions that add a label that is intended for use with EXI need to | |||
create a new XSD Schema that includes all the labels in the IANA | create a new XSD Schema that includes all the labels in the IANA | |||
registry then allocate a new EXI schemaId value. Moving to the next | registry and then allocate a new EXI schemaId value. Moving to the | |||
letter in the alphabet is the suggested way to create the new value | next letter in the alphabet is the suggested way to create the new | |||
for the EXI schemaId. Any labels with previously blank ID values | value for the EXI schemaId. Any labels with previously blank ID | |||
SHOULD be updated in the IANA table to have their ID set to this new | values SHOULD be updated in the IANA table to have their ID set to | |||
schemaId value. | this new schemaId value. | |||
Extensions that are mandatory to understand to correctly process the | Extensions that are mandatory to understand to correctly process the | |||
Pack MUST have a label name that ends with the '_' character. | Pack MUST have a label name that ends with the '_' character. | |||
12.3. Media Type Registration | 12.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]. Clipboard formats are defined | specified in [RFC6838] and [RFC7303]. Clipboard formats are defined | |||
for the JSON and XML form of lists but do not make sense for streams | for the JSON and XML form of lists but do not make sense for streams | |||
or other formats. | or other formats. | |||
skipping to change at page 36, line 19 ¶ | skipping to change at page 36, line 19 ¶ | |||
Security considerations: Sensor data can contain a wide range of | Security considerations: Sensor data can contain a wide range of | |||
information ranging from information that is very public, such the | information ranging from information that is very public, such the | |||
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 tags | Interoperability considerations: Applications should ignore any XML | |||
or attributes that they do not understand. This allows backwards | tags or attributes that they do not understand. This allows | |||
compatibility extensions to this specification. The "bver" attribute | backwards compatibility extensions to this specification. The "bver" | |||
in the senml tag can be used to ensure the receiver supports a | attribute in the senml XML tag can be used to ensure the receiver | |||
minimal level of functionality needed by the creator of the XML. | supports a minimal level of functionality needed by the creator of | |||
the XML. | ||||
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 e.g., electrical power usage and environmental | that report e.g., electrical power usage and environmental | |||
information such as temperature and humidity. It can be used for a | information such as temperature and humidity. It can be used for a | |||
wide range of sensor reporting systems. | wide range of sensor reporting systems. | |||
Fragment identifier considerations: Fragment identification for | Fragment identifier considerations: Fragment identification for | |||
application/senml+xml is supported by using fragment identifiers as | application/senml+xml is supported by using fragment identifiers as | |||
skipping to change at page 37, line 35 ¶ | skipping to change at page 37, line 35 ¶ | |||
Security considerations: Sensor data can contain a wide range of | Security considerations: Sensor data can contain a wide range of | |||
information ranging from information that is very public, such the | information ranging from information that is very public, such the | |||
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 tags | Interoperability considerations: Applications should ignore any XML | |||
or attributes that they do not understand. This allows backwards | tags or attributes that they do not understand. This allows | |||
compatibility extensions to this specification. The "bver" attribute | backwards compatibility extensions to this specification. The "bver" | |||
in the senml tag can be used to ensure the receiver supports a | attribute in the senml XML tag can be used to ensure the receiver | |||
minimal level of functionality needed by the creator of the XML. | supports a minimal level of functionality needed by the creator of | |||
the XML. | ||||
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 e.g., electrical power usage and environmental | that report e.g., electrical power usage and environmental | |||
information such as temperature and humidity. It can be used for a | information such as temperature and humidity. It can be used for a | |||
wide range of sensor reporting systems. | wide range of sensor reporting systems. | |||
Fragment identifier considerations: Fragment identification for | Fragment identifier considerations: Fragment identification for | |||
application/senml+xml is supported by using fragment identifiers as | application/senml+xml is supported by using fragment identifiers as | |||
skipping to change at page 38, line 47 ¶ | skipping to change at page 38, line 47 ¶ | |||
Security considerations: Sensor data can contain a wide range of | Security considerations: Sensor data can contain a wide range of | |||
information ranging from information that is very public, such the | information ranging from information that is very public, such the | |||
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 tags | Interoperability considerations: Applications should ignore any XML | |||
or attributes that they do not understand. This allows backwards | tags or attributes that they do not understand. This allows | |||
compatibility extensions to this specification. The "bver" attribute | backwards compatibility extensions to this specification. The "bver" | |||
in the senml tag can be used to ensure the receiver supports a | attribute in the senml XML tag can be used to ensure the receiver | |||
minimal level of functionality needed by the creator of the XML. | supports a minimal level of functionality needed by the creator of | |||
the XML. Further information on using schemas to guide the EXI can | ||||
Further information on using schemas to guide the EXI can be found in | be found in RFC-AAAA. | |||
RFC-AAAA. | ||||
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 e.g., electrical power usage and environmental | that report e.g., electrical power usage and environmental | |||
information such as temperature and humidity. It can be used for a | information such as temperature and humidity. It can be used for a | |||
wide range of sensor reporting systems. | wide range of sensor reporting systems. | |||
Fragment identifier considerations: Fragment identification for | Fragment identifier considerations: Fragment identification for | |||
application/senml+exi is supported by using fragment identifiers as | application/senml+exi is supported by using fragment identifiers as | |||
skipping to change at page 40, line 15 ¶ | skipping to change at page 40, line 15 ¶ | |||
Security considerations: Sensor data can contain a wide range of | Security considerations: Sensor data can contain a wide range of | |||
information ranging from information that is very public, such the | information ranging from information that is very public, such the | |||
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 tags | Interoperability considerations: Applications should ignore any XML | |||
or attributes that they do not understand. This allows backwards | tags or attributes that they do not understand. This allows | |||
compatibility extensions to this specification. The "bver" attribute | backwards compatibility extensions to this specification. The "bver" | |||
in the senml tag can be used to ensure the receiver supports a | attribute in the senml XML tag can be used to ensure the receiver | |||
minimal level of functionality needed by the creator of the XML. | supports a minimal level of functionality needed by the creator of | |||
Further information on using schemas to guide the EXI can be found in | the XML. Further information on using schemas to guide the EXI can | |||
RFC-AAAA. | be found in RFC-AAAA. | |||
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 e.g., electrical power usage and environmental | that report e.g., electrical power usage and environmental | |||
information such as temperature and humidity. It can be used for a | information such as temperature and humidity. It can be used for a | |||
wide range of sensor reporting systems. | wide range of sensor reporting systems. | |||
Fragment identifier considerations: Fragment identification for | Fragment identifier considerations: Fragment identification for | |||
application/senml+exi is supported by using fragment identifiers as | application/senml+exi is supported by using fragment identifiers as | |||
skipping to change at page 44, line 11 ¶ | skipping to change at page 44, line 11 ¶ | |||
definition language (CDDL): a notational convention to | definition language (CDDL): a notational convention to | |||
express CBOR data structures", draft-greevenbosch-appsawg- | express CBOR data structures", draft-greevenbosch-appsawg- | |||
cbor-cddl-10 (work in progress), March 2017. | cbor-cddl-10 (work in progress), March 2017. | |||
[I-D.ietf-core-links-json] | [I-D.ietf-core-links-json] | |||
Li, K., Rahman, A., and C. Bormann, "Representing | Li, K., Rahman, A., and C. Bormann, "Representing | |||
Constrained RESTful Environments (CoRE) Link Format in | Constrained RESTful Environments (CoRE) Link Format in | |||
JSON and CBOR", draft-ietf-core-links-json-08 (work in | JSON and CBOR", draft-ietf-core-links-json-08 (work in | |||
progress), April 2017. | progress), April 2017. | |||
[IEEE802.1as-2011] | ||||
IEEE, "IEEE Standard for Local and Metropolitan Area | ||||
Networks - Timing and Synchronization for Time-Sensitive | ||||
Applications in Bridged Local Area Networks", 2011. | ||||
[IEEE802.1ba-2011] | ||||
IEEE, "IEEE Standard for Local and metropolitan area | ||||
networks--Audio Video Bridging (AVB) Systems", 2011. | ||||
[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, | Resource Identifier (URI): Generic Syntax", STD 66, | |||
RFC 3986, DOI 10.17487/RFC3986, January 2005, | RFC 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 | |||
Unique IDentifier (UUID) URN Namespace", RFC 4122, | Unique IDentifier (UUID) URN Namespace", RFC 4122, | |||
skipping to change at page 44, line 50 ¶ | skipping to change at page 45, line 12 ¶ | |||
RFC 7721, DOI 10.17487/RFC7721, March 2016, | RFC 7721, DOI 10.17487/RFC7721, March 2016, | |||
<http://www.rfc-editor.org/info/rfc7721>. | <http://www.rfc-editor.org/info/rfc7721>. | |||
[UCUM] Schadow, G. and C. McDonald, "The Unified Code for Units | [UCUM] Schadow, G. and C. McDonald, "The Unified Code for Units | |||
of Measure (UCUM)", Regenstrief Institute and Indiana | of Measure (UCUM)", Regenstrief Institute and Indiana | |||
University School of Informatics, 2013, | University School of Informatics, 2013, | |||
<http://unitsofmeasure.org/ucum.html>. | <http://unitsofmeasure.org/ucum.html>. | |||
Appendix A. Links Extension | Appendix A. Links Extension | |||
An attribute to support a link extension for SenML is defined as a | A field to support a link extension for SenML is defined as a string | |||
string attribute by this specification. The link extension can be | field by this specification. The link extension can be used for | |||
used for additional information about a SenML Record. The definition | additional information about a SenML Record. The definition and | |||
and usage of the contents of this value are specified in | usage of the contents of this value are specified in | |||
[I-D.ietf-core-links-json]. | [I-D.ietf-core-links-json]. | |||
For JSON and XML the attribute has a label of "l" and a value that is | For JSON and XML the field has a label of "l" and a value that is a | |||
a string. | string. | |||
The following shows an example of the links extension. | The following shows an example of the links extension. | |||
[ | [ | |||
{"bn":"urn:dev:ow:10e2073a01080063:","bt":1.320078429e+09, | {"bn":"urn:dev:ow:10e2073a01080063:","bt":1.320078429e+09, | |||
"l":"[{\"href\":\"humidity\",\"foo\":\"bar\"}]", | "l":"[{\"href\":\"humidity\",\"foo\":\"bar\"}]", | |||
"n":"temperature","u":"Cel","v":27.2}, | "n":"temperature","u":"Cel","v":27.2}, | |||
{"n":"humidity","u":"%RH","v":80} | {"n":"humidity","u":"%RH","v":80} | |||
] | ] | |||
End of changes. 53 change blocks. | ||||
152 lines changed or deleted | 188 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/ |