idnits 2.17.1 draft-ietf-core-senml-14.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 4 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (April 2, 2018) is 2214 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'BIPM' -- Possible downref: Non-RFC (?) normative reference: ref. 'IEEE.754.1985' -- Possible downref: Non-RFC (?) normative reference: ref. 'NIST811' ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) -- Possible downref: Non-RFC (?) normative reference: ref. 'RNC' == Outdated reference: A later version (-08) exists of draft-ietf-cbor-cddl-02 == Outdated reference: A later version (-11) exists of draft-ietf-core-dev-urn-01 == Outdated reference: A later version (-14) exists of draft-ietf-core-interfaces-11 -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 5751 (Obsoleted by RFC 8551) -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group C. Jennings 3 Internet-Draft Cisco 4 Intended status: Standards Track Z. Shelby 5 Expires: October 4, 2018 ARM 6 J. Arkko 7 A. Keranen 8 Ericsson 9 C. Bormann 10 Universitaet Bremen TZI 11 April 2, 2018 13 Media Types for Sensor Measurement Lists (SenML) 14 draft-ietf-core-senml-14 16 Abstract 18 This specification defines media types for representing simple sensor 19 measurements and device parameters in the Sensor Measurement Lists 20 (SenML). Representations are defined in JavaScript Object Notation 21 (JSON), Concise Binary Object Representation (CBOR), Extensible 22 Markup Language (XML), and Efficient XML Interchange (EXI), which 23 share the common SenML data model. A simple sensor, such as a 24 temperature sensor, could use one of these media types in protocols 25 such as HTTP or CoAP to transport the measurements of the sensor or 26 to be configured. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at http://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on October 4, 2018. 45 Copyright Notice 47 Copyright (c) 2018 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (http://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 3 63 2. Requirements and Design Goals . . . . . . . . . . . . . . . . 4 64 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 4. SenML Structure and Semantics . . . . . . . . . . . . . . . . 6 66 4.1. Base Fields . . . . . . . . . . . . . . . . . . . . . . . 6 67 4.2. Regular Fields . . . . . . . . . . . . . . . . . . . . . 7 68 4.3. SenML Labels . . . . . . . . . . . . . . . . . . . . . . 7 69 4.4. Considerations . . . . . . . . . . . . . . . . . . . . . 8 70 4.5. Resolved Records . . . . . . . . . . . . . . . . . . . . 10 71 4.6. Associating Meta-data . . . . . . . . . . . . . . . . . . 10 72 4.7. Configuration and Actuation usage . . . . . . . . . . . . 11 73 5. JSON Representation (application/senml+json) . . . . . . . . 11 74 5.1. Examples . . . . . . . . . . . . . . . . . . . . . . . . 12 75 5.1.1. Single Datapoint . . . . . . . . . . . . . . . . . . 12 76 5.1.2. Multiple Datapoints . . . . . . . . . . . . . . . . . 12 77 5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 13 78 5.1.4. Resolved Data . . . . . . . . . . . . . . . . . . . . 14 79 5.1.5. Multiple Data Types . . . . . . . . . . . . . . . . . 15 80 5.1.6. Collection of Resources . . . . . . . . . . . . . . . 15 81 5.1.7. Setting an Actuator . . . . . . . . . . . . . . . . . 16 82 6. CBOR Representation (application/senml+cbor) . . . . . . . . 17 83 7. XML Representation (application/senml+xml) . . . . . . . . . 19 84 8. EXI Representation (application/senml-exi) . . . . . . . . . 21 85 9. Fragment Identification Methods . . . . . . . . . . . . . . . 24 86 9.1. Fragment Identification Examples . . . . . . . . . . . . 24 87 10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 25 88 11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 89 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 90 12.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 27 91 12.2. SenML Label Registry . . . . . . . . . . . . . . . . . . 31 92 12.3. Media Type Registrations . . . . . . . . . . . . . . . . 32 93 12.3.1. senml+json Media Type Registration . . . . . . . . . 33 94 12.3.2. sensml+json Media Type Registration . . . . . . . . 34 95 12.3.3. senml+cbor Media Type Registration . . . . . . . . . 35 96 12.3.4. sensml+cbor Media Type Registration . . . . . . . . 36 97 12.3.5. senml+xml Media Type Registration . . . . . . . . . 37 98 12.3.6. sensml+xml Media Type Registration . . . . . . . . . 39 99 12.3.7. senml-exi Media Type Registration . . . . . . . . . 40 100 12.3.8. sensml-exi Media Type Registration . . . . . . . . . 41 101 12.4. XML Namespace Registration . . . . . . . . . . . . . . . 42 102 12.5. CoAP Content-Format Registration . . . . . . . . . . . . 42 103 13. Security Considerations . . . . . . . . . . . . . . . . . . . 43 104 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 43 105 15. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 44 106 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 44 107 16.1. Normative References . . . . . . . . . . . . . . . . . . 44 108 16.2. Informative References . . . . . . . . . . . . . . . . . 46 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 48 111 1. Overview 113 Connecting sensors to the Internet is not new, and there have been 114 many protocols designed to facilitate it. This specification defines 115 new media types for carrying simple sensor information in a protocol 116 such as HTTP [RFC7230] or CoAP [RFC7252]. This format was designed 117 so that processors with very limited capabilities could easily encode 118 a sensor measurement into the media type, while at the same time a 119 server parsing the data could relatively efficiently collect a large 120 number of sensor measurements. SenML can be used for a variety of 121 data flow models, most notably data feeds pushed from a sensor to a 122 collector, and the web resource model where the sensor is requested 123 as a resource representation (e.g., "GET /sensor/temperature"). 125 There are many types of more complex measurements and measurements 126 that this media type would not be suitable for. SenML strikes a 127 balance between having some information about the sensor carried with 128 the sensor data so that the data is self describing but it also tries 129 to make that a fairly minimal set of auxiliary information for 130 efficiency reason. Other information about the sensor can be 131 discovered by other methods such as using the CoRE Link Format 132 [RFC6690]. 134 SenML is defined by a data model for measurements and simple meta- 135 data about measurements and devices. The data is structured as a 136 single array that contains a series of SenML Records which can each 137 contain fields such as an unique identifier for the sensor, the time 138 the measurement was made, the unit the measurement is in, and the 139 current value of the sensor. Serializations for this data model are 140 defined for JSON [RFC8259], CBOR [RFC7049], XML 142 [W3C.REC-xml-20081126], and Efficient XML Interchange (EXI) 143 [W3C.REC-exi-20140211]. 145 For example, the following shows a measurement from a temperature 146 gauge encoded in the JSON syntax. 148 [ 149 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} 150 ] 152 In the example above, the array has a single SenML Record with a 153 measurement for a sensor named "urn:dev:ow:10e2073a01080063" with a 154 current value of 23.1 degrees Celsius. 156 2. Requirements and Design Goals 158 The design goal is to be able to send simple sensor measurements in 159 small packets from large numbers of constrained devices. Keeping the 160 total size of payload small makes it easy to use SenML also in 161 constrained networks, e.g., in a 6LoWPAN [RFC4944]. It is always 162 difficult to define what small code is, but there is a desire to be 163 able to implement this in roughly 1 KB of flash on a 8 bit 164 microprocessor. Experience with power meters and other large scale 165 deployments has indicated that the solution needs to support allowing 166 multiple measurements to be batched into a single HTTP or CoAP 167 request. This "batch" upload capability allows the server side to 168 efficiently support a large number of devices. It also conveniently 169 supports batch transfers from proxies and storage devices, even in 170 situations where the sensor itself sends just a single data item at a 171 time. The multiple measurements could be from multiple related 172 sensors or from the same sensor but at different times. 174 The basic design is an array with a series of measurements. The 175 following example shows two measurements made at different times. 176 The value of a measurement is given by the "v" field, the time of a 177 measurement is in the "t" field, the "n" field has a unique sensor 178 name, and the unit of the measurement is carried in the "u" field. 180 [ 181 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, 182 "v":23.5}, 183 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020091e+09, 184 "v":23.6} 185 ] 187 To keep the messages small, it does not make sense to repeat the "n" 188 field in each SenML Record so there is a concept of a Base Name which 189 is simply a string that is prepended to the Name field of all 190 elements in that record and any records that follow it. So a more 191 compact form of the example above is the following. 193 [ 194 {"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, 195 "v":23.5}, 196 {"u":"Cel","t":1.276020091e+09, 197 "v":23.6} 198 ] 200 In the above example the Base Name is in the "bn" field and the "n" 201 fields in each Record are the empty string so they are omitted. 203 Some devices have accurate time while others do not so SenML supports 204 absolute and relative times. Time is represented in floating point 205 as seconds. Values greater than zero represent an absolute time 206 relative to the Unix epoch (1970-01-01T00:00Z in UTC time) and the 207 time is counted same way as the Portable Operating System Interface 208 (POSIX) "seconds since the epoch" [TIME_T]. Values of 0 or less 209 represent a relative time in the past from the current time. A 210 simple sensor with no absolute wall clock time might take a 211 measurement every second, batch up 60 of them, and then send the 212 batch to a server. It would include the relative time each 213 measurement was made compared to the time the batch was sent in each 214 SenML Record. The server might have accurate NTP time and use the 215 time it received the data, and the relative offset, to replace the 216 times in the SenML with absolute times before saving the SenML Pack 217 in a document database. 219 3. Terminology 221 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 222 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 223 "OPTIONAL" in this document are to be interpreted as described in BCP 224 14 [RFC2119] [RFC8174] when, and only when, they appear in all 225 capitals, as shown here. 227 This document also uses the following terms: 229 SenML Record: One measurement or configuration instance in time 230 presented using the SenML data model. 232 SenML Pack: One or more SenML Records in an array structure. 234 SenML Label: A short name used in SenML Records to denote different 235 SenML fields (e.g., "v" for "value"). 237 SenML Field: A component of a record that associates a value to a 238 SenML Label for this record. 240 This document uses the terms "attribute" and "tag" where they occur 241 with the underlying technologies (XML, CBOR [RFC7049], and Link 242 Format [RFC6690]), not for SenML concepts per se. Note that 243 "attribute" has been widely used previously as a synonym for SenML 244 "field", though. 246 4. SenML Structure and Semantics 248 Each SenML Pack carries a single array that represents a set of 249 measurements and/or parameters. This array contains a series of 250 SenML Records with several fields described below. There are two 251 kinds of fields: base and regular. The base fields can be included 252 in any SenML Record and they apply to the entries in the Record. 253 Each base field also applies to all Records after it up to, but not 254 including, the next Record that has that same base field. All base 255 fields are optional. Regular fields can be included in any SenML 256 Record and apply only to that Record. 258 4.1. Base Fields 260 Base Name: This is a string that is prepended to the names found in 261 the entries. 263 Base Time: A base time that is added to the time found in an entry. 265 Base Unit: A base unit that is assumed for all entries, unless 266 otherwise indicated. If a record does not contain a Unit value, 267 then the Base Unit is used. Otherwise the value found in the Unit 268 (if any) is used. 270 Base Value: A base value is added to the value found in an entry, 271 similar to Base Time. 273 Base Sum: A base sum is added to the sum found in an entry, similar 274 to Base Time. 276 Version: Version number of media type format. This field is an 277 optional positive integer and defaults to 5 if not present. [RFC 278 Editor: change the default value to 10 when this specification is 279 published as an RFC and remove this note] 281 4.2. Regular Fields 283 Name: Name of the sensor or parameter. When appended to the Base 284 Name field, this must result in a globally unique identifier for 285 the resource. The name is optional, if the Base Name is present. 286 If the name is missing, Base Name must uniquely identify the 287 resource. This can be used to represent a large array of 288 measurements from the same sensor without having to repeat its 289 identifier on every measurement. 291 Unit: Unit for a measurement value. Optional. 293 Value: Value of the entry. Optional if a Sum value is present, 294 otherwise required. Values are represented using basic data 295 types. This specification defines floating point numbers ("v" 296 field for "Value"), booleans ("vb" for "Boolean Value"), strings 297 ("vs" for "String Value") and binary data ("vd" for "Data Value"). 298 Exactly one value field MUST appear unless there is Sum field in 299 which case it is allowed to have no Value field. 301 Sum: Integrated sum of the values over time. Optional. This field 302 is in the unit specified in the Unit value multiplied by seconds. 304 Time: Time when value was recorded. Optional. 306 Update Time: Period of time in seconds that represents the maximum 307 time before this sensor will provide an updated reading for a 308 measurement. Optional. This can be used to detect the failure of 309 sensors or communications path from the sensor. 311 4.3. SenML Labels 313 Table 1 provides an overview of all SenML fields defined by this 314 document with their respective labels and data types. 316 +---------------+-------+------------+------------+------------+ 317 | Name | Label | CBOR Label | JSON Type | XML Type | 318 +---------------+-------+------------+------------+------------+ 319 | Base Name | bn | -2 | String | string | 320 | Base Time | bt | -3 | Number | double | 321 | Base Unit | bu | -4 | String | string | 322 | Base Value | bv | -5 | Number | double | 323 | Base Sum | bs | -6 | Number | double | 324 | Version | bver | -1 | Number | int | 325 | Name | n | 0 | String | string | 326 | Unit | u | 1 | String | string | 327 | Value | v | 2 | Number | double | 328 | String Value | vs | 3 | String | string | 329 | Boolean Value | vb | 4 | Boolean | boolean | 330 | Data Value | vd | 8 | String (*) | string (*) | 331 | Value Sum | s | 5 | Number | double | 332 | Time | t | 6 | Number | double | 333 | Update Time | ut | 7 | Number | double | 334 +---------------+-------+------------+------------+------------+ 336 Table 1: SenML Labels 338 Data Value is base64 encoded string with URL safe alphabet as defined 339 in Section 5 of [RFC4648], with padding omitted. 341 For details of the JSON representation see Section 5, for the CBOR 342 Section 6, and for the XML Section 7. 344 4.4. Considerations 346 The SenML format can be extended with further custom fields. Both 347 new base and regular fields are allowed. See Section 12.2 for 348 details. Implementations MUST ignore fields they don't recognize 349 unless that field has a label name that ends with the '_' character 350 in which case an error MUST be generated. 352 All SenML Records in a Pack MUST have the same version number. This 353 is typically done by adding a Base Version field to only the first 354 Record in the Pack. 356 Systems reading one of the objects MUST check for the Version field. 357 If this value is a version number larger than the version which the 358 system understands, the system SHOULD NOT use this object. This 359 allows the version number to indicate that the object contains 360 structure or semantics that is different from what is defined in the 361 present document beyond just making use of the extension points 362 provided here. New version numbers can only be defined in an RFC 363 that updates this specification or it successors. 365 The Name value is concatenated to the Base Name value to yield the 366 name of the sensor. The resulting concatenated name needs to 367 uniquely identify and differentiate the sensor from all others. The 368 concatenated name MUST consist only of characters out of the set "A" 369 to "Z", "a" to "z", "0" to "9", "-", ":", ".", "/", and "_"; 370 furthermore, it MUST start with a character out of the set "A" to 371 "Z", "a" to "z", or "0" to "9". This restricted character set was 372 chosen so that concatenated names can be used directly within various 373 URI schemes (including segments of an HTTP path with no special 374 encoding) and can be used directly in many databases and analytic 375 systems. [RFC5952] contains advice on encoding an IPv6 address in a 376 name. See Section 14 for privacy considerations that apply to the 377 use of long-term stable unique identifiers. 379 Although it is RECOMMENDED that concatenated names are represented as 380 URIs [RFC3986] or URNs [RFC8141], the restricted character set 381 specified above puts strict limits on the URI schemes and URN 382 namespaces that can be used. As a result, implementers need to take 383 care in choosing the naming scheme for concatenated names, because 384 such names both need to be unique and need to conform to the 385 restricted character set. One approach is to include a bit string 386 that has guaranteed uniqueness (such as a 1-wire address). Some of 387 the examples within this document use the device URN namespace as 388 specified in [I-D.ietf-core-dev-urn]. UUIDs [RFC4122] are another 389 way to generate a unique name. However, the restricted character set 390 does not allow the use of many URI schemes, such as the 'tag' scheme 391 [RFC4151] and the 'ni' scheme [RFC6920], in names as such. The use 392 of URIs with characters incompatible with this set, and possible 393 mapping rules between the two, are outside of the scope of the 394 present document. 396 If the Record has no Unit, the Base Unit is used as the Unit. Having 397 no Unit and no Base Unit is allowed. 399 If either the Base Time or Time value is missing, the missing field 400 is considered to have a value of zero. The Base Time and Time values 401 are added together to get the time of measurement. A time of zero 402 indicates that the sensor does not know the absolute time and the 403 measurement was made roughly "now". A negative value is used to 404 indicate seconds in the past from roughly "now". A positive value is 405 used to indicate the number of seconds, excluding leap seconds, since 406 the start of the year 1970 in UTC. 408 If only one of the Base Sum or Sum value is present, the missing 409 field is considered to have a value of zero. The Base Sum and Sum 410 values are added together to get the sum of measurement. If neither 411 the Base Sum or Sum are present, then the measurement does not have a 412 sum value. 414 If the Base Value or Value is not present, the missing field(s) are 415 considered to have a value of zero. The Base Value and Value are 416 added together to get the value of the measurement. 418 Representing the statistical characteristics of measurements, such as 419 accuracy, can be very complex. Future specification may add new 420 fields to provide better information about the statistical properties 421 of the measurement. 423 In summary, the structure of a SenML record is laid out to support a 424 single measurement per record. If multiple data values are measured 425 at the same time (e.g., air pressure and altitude), they are best 426 kept as separate records linked through their Time value; this is 427 even true where one of the data values is more "meta" than others 428 (e.g., describes a condition that influences other measurements at 429 the same time). 431 4.5. Resolved Records 433 Sometimes it is useful to be able to refer to a defined normalized 434 format for SenML records. This normalized format tends to get used 435 for big data applications and intermediate forms when converting to 436 other formats. 438 A SenML Record is referred to as "resolved" if it does not contain 439 any base values, i.e., labels starting with the character 'b', except 440 for Version fields (see below), and has no relative times. To 441 resolve the records, the base values of the SenML Pack (if any) are 442 applied to the Record. That is, name and base name are concatenated, 443 base time is added to the time of the Record, if the Record did not 444 contain Unit the Base Unit is applied to the record, etc. In 445 addition the records need to be in chronological order. An example 446 of this is show in Section 5.1.4. 448 The Version field MUST NOT be present in resolved records if the 449 SenML version defined in this document is used and MUST be present 450 otherwise in all the resolved SenML Records. 452 Future specification that defines new base fields need to specify how 453 the field is resolved. 455 4.6. Associating Meta-data 457 SenML is designed to carry the minimum dynamic information about 458 measurements, and for efficiency reasons does not carry significant 459 static meta-data about the device, object or sensors. Instead, it is 460 assumed that this meta-data is carried out of band. For web 461 resources using SenML Packs, this meta-data can be made available 462 using the CoRE Link Format [RFC6690]. The most obvious use of this 463 link format is to describe that a resource is available in a SenML 464 format in the first place. The relevant media type indicator is 465 included in the Content-Type (ct=) link attribute (which is defined 466 for the Link Format in Section 7.2.1 of [RFC7252]). 468 4.7. Configuration and Actuation usage 470 SenML can also be used for configuring parameters and controlling 471 actuators. When a SenML Pack is sent (e.g., using a HTTP/CoAP POST 472 or PUT method) and the semantics of the target are such that SenML is 473 interpreted as configuration/actuation, SenML Records are interpreted 474 as a request to change the values of given (sub)resources (given as 475 names) to given values at the given time(s). The semantics of the 476 target resource supporting this usage can be described, e.g., using 477 [I-D.ietf-core-interfaces]. Examples of actuation usage are shown in 478 Section 5.1.7. 480 5. JSON Representation (application/senml+json) 482 For the SenML fields shown in Table 2, the SenML labels are used as 483 the JSON object member names within JSON objects representing the 484 JSON SenML Records. 486 +---------------+-------+---------+ 487 | Name | label | Type | 488 +---------------+-------+---------+ 489 | Base Name | bn | String | 490 | Base Time | bt | Number | 491 | Base Unit | bu | String | 492 | Base Value | bv | Number | 493 | Base Sum | bs | Number | 494 | Version | bver | Number | 495 | Name | n | String | 496 | Unit | u | String | 497 | Value | v | Number | 498 | String Value | vs | String | 499 | Boolean Value | vb | Boolean | 500 | Data Value | vd | String | 501 | Value Sum | s | Number | 502 | Time | t | Number | 503 | Update Time | ut | Number | 504 +---------------+-------+---------+ 506 Table 2: JSON SenML Labels 508 The root JSON value consists of an array with one JSON object for 509 each SenML Record. All the fields in the above table MAY occur in 510 the records with member values of the type specified in the table. 512 Only the UTF-8 [RFC3629] form of JSON is allowed. Characters in the 513 String Value are encoded using the escape sequences defined in 514 [RFC8259]. Octets in the Data Value are base64 encoded with URL safe 515 alphabet as defined in Section 5 of [RFC4648], with padding omitted. 517 Systems receiving measurements MUST be able to process the range of 518 floating point numbers that are representable as an IEEE double 519 precision floating point numbers [IEEE.754.1985]. This allows time 520 values to have better than microsecond precision over the next 100 521 years. The number of significant digits in any measurement is not 522 relevant, so a reading of 1.1 has exactly the same semantic meaning 523 as 1.10. If the value has an exponent, the "e" MUST be in lower 524 case. In the interest of avoiding unnecessary verbosity and speeding 525 up processing, the mantissa SHOULD be less than 19 characters long 526 and the exponent SHOULD be less than 5 characters long. 528 5.1. Examples 530 5.1.1. Single Datapoint 532 The following shows a temperature reading taken approximately "now" 533 by a 1-wire sensor device that was assigned the unique 1-wire address 534 of 10e2073a01080063: 536 [ 537 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} 538 ] 540 5.1.2. Multiple Datapoints 542 The following example shows voltage and current now, i.e., at an 543 unspecified time. 545 [ 546 {"bn":"urn:dev:ow:10e2073a01080063:","n":"voltage","u":"V","v":120.1}, 547 {"n":"current","u":"A","v":1.2} 548 ] 550 The next example is similar to the above one, but shows current at 551 Tue Jun 8 18:01:16.001 UTC 2010 and at each second for the previous 5 552 seconds. 554 [ 555 {"bn":"urn:dev:ow:10e2073a0108006:","bt":1.276020076001e+09, 556 "bu":"A","bver":5, 557 "n":"voltage","u":"V","v":120.1}, 558 {"n":"current","t":-5,"v":1.2}, 559 {"n":"current","t":-4,"v":1.3}, 560 {"n":"current","t":-3,"v":1.4}, 561 {"n":"current","t":-2,"v":1.5}, 562 {"n":"current","t":-1,"v":1.6}, 563 {"n":"current","v":1.7} 564 ] 566 Note that in some usage scenarios of SenML the implementations MAY 567 store or transmit SenML in a stream-like fashion, where data is 568 collected over time and continuously added to the object. This mode 569 of operation is optional, but systems or protocols using SenML in 570 this fashion MUST specify that they are doing this. SenML defines 571 separate media types to indicate Sensor Streaming Measurement Lists 572 (SensML) for this usage (see Section 12.3.2). In this situation the 573 SensML stream can be sent and received in a partial fashion, i.e., a 574 measurement entry can be read as soon as the SenML Record is received 575 and not have to wait for the full SensML Stream to be complete. 577 For instance, the following stream of measurements may be sent via a 578 long lived HTTP POST from the producer of a SensML to the consumer of 579 that, and each measurement object may be reported at the time it was 580 measured: 582 [ 583 {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, 584 "bu":"%RH","v":21.2}, 585 {"t":10,"v":21.3}, 586 {"t":20,"v":21.4}, 587 {"t":30,"v":21.4}, 588 {"t":40,"v":21.5}, 589 {"t":50,"v":21.5}, 590 {"t":60,"v":21.5}, 591 {"t":70,"v":21.6}, 592 {"t":80,"v":21.7}, 593 ... 595 5.1.3. Multiple Measurements 597 The following example shows humidity measurements from a mobile 598 device with a 1-wire address 10e2073a01080063, starting at Mon Oct 31 599 13:24:24 UTC 2011. The device also provides position data, which is 600 provided in the same measurement or parameter array as separate 601 entries. Note time is used to for correlating data that belongs 602 together, e.g., a measurement and a parameter associated with it. 603 Finally, the device also reports extra data about its battery status 604 at a separate time. 606 [ 607 {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, 608 "bu":"%RH","v":20}, 609 {"u":"lon","v":24.30621}, 610 {"u":"lat","v":60.07965}, 611 {"t":60,"v":20.3}, 612 {"u":"lon","t":60,"v":24.30622}, 613 {"u":"lat","t":60,"v":60.07965}, 614 {"t":120,"v":20.7}, 615 {"u":"lon","t":120,"v":24.30623}, 616 {"u":"lat","t":120,"v":60.07966}, 617 {"u":"%EL","t":150,"v":98}, 618 {"t":180,"v":21.2}, 619 {"u":"lon","t":180,"v":24.30628}, 620 {"u":"lat","t":180,"v":60.07967} 621 ] 623 The size of this example represented in various forms, as well as 624 that form compressed with gzip is given in the following table. 626 +----------+------+-----------------+ 627 | Encoding | Size | Compressed Size | 628 +----------+------+-----------------+ 629 | JSON | 573 | 206 | 630 | XML | 649 | 235 | 631 | CBOR | 254 | 196 | 632 | EXI | 161 | 184 | 633 +----------+------+-----------------+ 635 Table 3: Size Comparisons 637 5.1.4. Resolved Data 639 The following shows the example from the previous section show in 640 resolved format. 642 [ 643 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067464e+09, 644 "v":20}, 645 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067464e+09, 646 "v":24.30621}, 647 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067464e+09, 648 "v":60.07965}, 649 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067524e+09, 650 "v":20.3}, 651 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067524e+09, 652 "v":24.30622}, 653 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067524e+09, 654 "v":60.07965}, 655 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067584e+09, 656 "v":20.7}, 657 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067584e+09, 658 "v":24.30623}, 659 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067584e+09, 660 "v":60.07966}, 661 {"n":"urn:dev:ow:10e2073a01080063","u":"%EL","t":1.320067614e+09, 662 "v":98}, 663 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067644e+09, 664 "v":21.2}, 665 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067644e+09, 666 "v":24.30628}, 667 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067644e+09, 668 "v":60.07967} 669 ] 671 5.1.5. Multiple Data Types 673 The following example shows a sensor that returns different data 674 types. 676 [ 677 {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, 678 {"n":"label","vs":"Machine Room"}, 679 {"n":"open","vb":false}, 680 {"n":"nfv-reader","vd":"aGkgCg"} 681 ] 683 5.1.6. Collection of Resources 685 The following example shows the results from a query to one device 686 that aggregates multiple measurements from other devices. The 687 example assumes that a client has fetched information from a device 688 at 2001:db8::2 by performing a GET operation on http://[2001:db8::2] 689 at Mon Oct 31 16:27:09 UTC 2011, and has gotten two separate values 690 as a result, a temperature and humidity measurement as well as the 691 results from another device at http://[2001:db8::1] that also had a 692 temperature and humidity. Note that the last record would use the 693 Base Name from the 3rd record but the Base Time from the first 694 record. 696 [ 697 {"bn":"2001:db8::2/","bt":1.320078429e+09, 698 "n":"temperature","u":"Cel","v":25.2}, 699 {"n":"humidity","u":"%RH","v":30}, 700 {"bn":"2001:db8::1/","n":"temperature","u":"Cel","v":12.3}, 701 {"n":"humidity","u":"%RH","v":67} 702 ] 704 5.1.7. Setting an Actuator 706 The following example show the SenML that could be used to set the 707 current set point of a typical residential thermostat which has a 708 temperature set point, a switch to turn on and off the heat, and a 709 switch to turn on the fan override. 711 [ 712 {"bn":"urn:dev:ow:10e2073a01080063:"}, 713 {"n":"temp","u":"Cel","v":23.1}, 714 {"n":"heat","u":"/","v":1}, 715 {"n":"fan","u":"/","v":0} 716 ] 718 In the following example two different lights are turned on. It is 719 assumed that the lights are on a network that can guarantee delivery 720 of the messages to the two lights within 15 ms (e.g. a network using 721 802.1BA [IEEE802.1ba-2011] and 802.1AS [IEEE802.1as-2011] for time 722 synchronization). The controller has set the time of the lights 723 coming on to 20 ms in the future from the current time. This allows 724 both lights to receive the message, wait till that time, then apply 725 the switch command so that both lights come on at the same time. 727 [ 728 {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":1}, 729 {"n":"2001:db8::4","v":1} 730 ] 732 The following shows two lights being turned off using a non 733 deterministic network that has a high odds of delivering a message in 734 less than 100 ms and uses NTP for time synchronization. The current 735 time is 1320078429. The user has just turned off a light switch 736 which is turning off two lights. Both lights are dimmed to 50% 737 brightness immediately to give the user instant feedback that 738 something is changing. However given the network, the lights will 739 probably dim at somewhat different times. Then 100 ms in the future, 740 both lights will go off at the same time. The instant but not 741 synchronized dimming gives the user the sensation of quick responses 742 and the timed off 100 ms in the future gives the perception of both 743 lights going off at the same time. 745 [ 746 {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":0.5}, 747 {"n":"2001:db8::4","v":0.5}, 748 {"n":"2001:db8::3","t":0.1,"v":0}, 749 {"n":"2001:db8::4","t":0.1,"v":0} 750 ] 752 6. CBOR Representation (application/senml+cbor) 754 The CBOR [RFC7049] representation is equivalent to the JSON 755 representation, with the following changes: 757 o For JSON Numbers, the CBOR representation can use integers, 758 floating point numbers, or decimal fractions (CBOR Tag 4); however 759 a representation SHOULD be chosen such that when the CBOR value is 760 converted back to an IEEE double precision floating point value, 761 it has exactly the same value as the original Number. For the 762 version number, only an unsigned integer is allowed. 764 o Characters in the String Value are encoded using a definite length 765 text string (type 3). Octets in the Data Value are encoded using 766 a definite length byte string (type 2). 768 o For compactness, the CBOR representation uses integers for the 769 labels, as defined in Table 4. This table is conclusive, i.e., 770 there is no intention to define any additional integer map keys; 771 any extensions will use string map keys. This allows translators 772 converting between CBOR and JSON representations to convert also 773 all future labels without needing to update implementations. 775 +---------------+-------+------------+ 776 | Name | Label | CBOR Label | 777 +---------------+-------+------------+ 778 | Version | bver | -1 | 779 | Base Name | bn | -2 | 780 | Base Time | bt | -3 | 781 | Base Unit | bu | -4 | 782 | Base Value | bv | -5 | 783 | Base Sum | bs | -6 | 784 | Name | n | 0 | 785 | Unit | u | 1 | 786 | Value | v | 2 | 787 | String Value | vs | 3 | 788 | Boolean Value | vb | 4 | 789 | Value Sum | s | 5 | 790 | Time | t | 6 | 791 | Update Time | ut | 7 | 792 | Data Value | vd | 8 | 793 +---------------+-------+------------+ 795 Table 4: CBOR representation: integers for map keys 797 o For streaming SensML in CBOR representation, the array containing 798 the records SHOULD be a CBOR indefinite length array while for 799 non-streaming SenML, a definite length array MUST be used. 801 The following example shows a dump of the CBOR example for the same 802 sensor measurement as in Section 5.1.2. 804 0000 87 a7 21 78 1b 75 72 6e 3a 64 65 76 3a 6f 77 3a |..!x.urn:dev:ow:| 805 0010 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 3a |10e2073a0108006:| 806 0020 22 fb 41 d3 03 a1 5b 00 10 62 23 61 41 20 05 00 |".A...[..b#aA ..| 807 0030 67 76 6f 6c 74 61 67 65 01 61 56 02 fb 40 5e 06 |gvoltage.aV..@^.| 808 0040 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e 74 06 |fffff..gcurrent.| 809 0050 24 02 fb 3f f3 33 33 33 33 33 33 a3 00 67 63 75 |$..?.333333..gcu| 810 0060 72 72 65 6e 74 06 23 02 fb 3f f4 cc cc cc cc cc |rrent.#..?......| 811 0070 cd a3 00 67 63 75 72 72 65 6e 74 06 22 02 fb 3f |...gcurrent."..?| 812 0080 f6 66 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e |.ffffff..gcurren| 813 0090 74 06 21 02 f9 3e 00 a3 00 67 63 75 72 72 65 6e |t.!..>...gcurren| 814 00a0 74 06 20 02 fb 3f f9 99 99 99 99 99 9a a3 00 67 |t. ..?.........g| 815 00b0 63 75 72 72 65 6e 74 06 00 02 fb 3f fb 33 33 33 |current....?.333| 816 00c0 33 33 33 |333| 817 00c3 818 In CBOR diagnostic notation (Section 6 of [RFC7049]), this is: 820 [{-2: "urn:dev:ow:10e2073a0108006:", 821 -3: 1276020076.001, -4: "A", -1: 5, 0: "voltage", 1: "V", 2: 120.1}, 822 {0: "current", 6: -5, 2: 1.2}, {0: "current", 6: -4, 2: 1.3}, 823 {0: "current", 6: -3, 2: 1.4}, {0: "current", 6: -2, 2: 1.5}, 824 {0: "current", 6: -1, 2: 1.6}, {0: "current", 6: 0, 2: 1.7}] 826 7. XML Representation (application/senml+xml) 828 A SenML Pack or Stream can also be represented in XML format as 829 defined in this section. 831 Only the UTF-8 form of XML is allowed. Characters in the String 832 Value are encoded using the escape sequences defined in [RFC8259]. 833 Octets in the Data Value are base64 encoded with URL safe alphabet as 834 defined in Section 5 of [RFC4648]. 836 The following example shows an XML example for the same sensor 837 measurement as in Section 5.1.2. 839 840 842 843 844 845 846 847 848 850 The SenML Stream is represented as a sensml element that contains a 851 series of senml elements for each SenML Record. The SenML fields are 852 represented as XML attributes. For each field defined in this 853 document, the following table shows the SenML labels, which are used 854 for the XML attribute name, as well as the according restrictions on 855 the XML attribute values ("type") as used in the XML senml elements. 857 +---------------+-------+---------+ 858 | Name | Label | Type | 859 +---------------+-------+---------+ 860 | Base Name | bn | string | 861 | Base Time | bt | double | 862 | Base Unit | bu | string | 863 | Base Value | bv | double | 864 | Base Sum | bs | double | 865 | Base Version | bver | int | 866 | Name | n | string | 867 | Unit | u | string | 868 | Value | v | double | 869 | String Value | vs | string | 870 | Data Value | vd | string | 871 | Boolean Value | vb | boolean | 872 | Value Sum | s | double | 873 | Time | t | double | 874 | Update Time | ut | double | 875 +---------------+-------+---------+ 877 Table 5: XML SenML Labels 879 The RelaxNG [RNC] schema for the XML is: 881 default namespace = "urn:ietf:params:xml:ns:senml" 882 namespace rng = "http://relaxng.org/ns/structure/1.0" 884 senml = element senml { 885 attribute bn { xsd:string }?, 886 attribute bt { xsd:double }?, 887 attribute bv { xsd:double }?, 888 attribute bs { xsd:double }?, 889 attribute bu { xsd:string }?, 890 attribute bver { xsd:int }?, 892 attribute n { xsd:string }?, 893 attribute s { xsd:double }?, 894 attribute t { xsd:double }?, 895 attribute u { xsd:string }?, 896 attribute ut { xsd:double }?, 898 attribute v { xsd:double }?, 899 attribute vb { xsd:boolean }?, 900 attribute vs { xsd:string }?, 901 attribute vd { xsd:string }? 902 } 904 sensml = 905 element sensml { 906 senml+ 907 } 909 start = sensml 911 8. EXI Representation (application/senml-exi) 913 For efficient transmission of SenML over e.g. a constrained network, 914 Efficient XML Interchange (EXI) can be used. This encodes the XML 915 Schema [W3C.REC-xmlschema-1-20041028] structure of SenML into binary 916 tags and values rather than ASCII text. An EXI representation of 917 SenML SHOULD be made using the strict schema-mode of EXI. This mode 918 however does not allow tag extensions to the schema, and therefore 919 any extensions will be lost in the encoding. For uses where 920 extensions need to be preserved in EXI, the non-strict schema mode of 921 EXI MAY be used. 923 The EXI header MUST include an "EXI Options", as defined in 924 [W3C.REC-exi-20140211], with an schemaId set to the value of "a" 925 indicating the schema provided in this specification. Future 926 revisions to the schema can change the value of the schemaId to allow 927 for backwards compatibility. When the data will be transported over 928 CoAP or HTTP, an EXI Cookie SHOULD NOT be used as it simply makes 929 things larger and is redundant to information provided in the 930 Content-Type header. 932 The following is the XSD Schema to be used for strict schema guided 933 EXI processing. It is generated from the RelaxNG. 935 936 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 968 The following shows a hexdump of the EXI produced from encoding the 969 following XML example. Note this example is the same information as 970 the first example in Section 5.1.2 in JSON format. 972 973 975 976 977 Which compresses with EXI to the following displayed in hexdump: 979 0000 a0 30 0d 84 80 f3 ab 93 71 d3 23 2b b1 d3 7b b9 |.0......q.#+..{.| 980 0010 d1 89 83 29 91 81 b9 9b 09 81 89 81 c1 81 81 b1 |...)............| 981 0020 99 d2 84 bb 37 b6 3a 30 b3 b2 90 1a b1 58 84 c0 |....7.:0.....X..| 982 0030 33 04 b1 ba b9 39 32 b7 3a 10 1a 09 06 40 38 |3....92.:....@8| 983 003f 985 The above example used the bit packed form of EXI but it is also 986 possible to use a byte packed form of EXI which can makes it easier 987 for a simple sensor to produce valid EXI without really implementing 988 EXI. Consider the example of a temperature sensor that produces a 989 value in tenths of degrees Celsius over a range of 0.0 to 55.0. It 990 would produce an XML SenML file such as: 992 993 994 996 The compressed form, using the byte alignment option of EXI, for the 997 above XML is the following: 999 0000 a0 00 48 80 6c 20 01 06 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| 1000 0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| 1001 0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| 1002 0030 01 |.| 1003 0031 1005 A small temperature sensor device that only generates this one EXI 1006 file does not really need a full EXI implementation. It can simply 1007 hard code the output replacing the 1-wire device ID starting at byte 1008 0x14 and going to byte 0x23 with its device ID, and replacing the 1009 value "0xe7 0x01" at location 0x31 and 0x32 with the current 1010 temperature. The EXI Specification [W3C.REC-exi-20140211] contains 1011 the full information on how floating point numbers are represented, 1012 but for the purpose of this sensor, the temperature can be converted 1013 to an integer in tenths of degrees (231 in this example). EXI stores 1014 7 bits of the integer in each byte with the top bit set to one if 1015 there are further bytes. So the first bytes at is set to low 7 bits 1016 of the integer temperature in tenths of degrees plus 0x80. In this 1017 example 231 & 0x7F + 0x80 = 0xE7. The second byte is set to the 1018 integer temperature in tenths of degrees right shifted 7 bits. In 1019 this example 231 >> 7 = 0x01. 1021 9. Fragment Identification Methods 1023 A SenML Pack typically consists of multiple SenML Records and for 1024 some applications it may be useful to be able to refer with a 1025 Fragment Identifier to a single record, or a set of records, in a 1026 Pack. The fragment identifier is only interpreted by a client and 1027 does not impact retrieval of a representation. The SenML Fragment 1028 Identification is modeled after CSV Fragment Identifiers [RFC7111]. 1030 To select a single SenML Record, the "rec" scheme followed by a 1031 single number is used. For the purpose of numbering records, the 1032 first record is at position 1. A range of records can be selected by 1033 giving the first and the last record number separated by a '-' 1034 character. Instead of the second number, the '*' character can be 1035 used to indicate the last SenML Record in the Pack. A set of records 1036 can also be selected using a comma separated list of record positions 1037 or ranges. 1039 (We use the term "selecting a record" for identifying it as part of 1040 the fragment, not in the sense of isolating it from the Pack -- the 1041 record still needs to be interpreted as part of the Pack, e.g., using 1042 the base values defined in earlier records) 1044 9.1. Fragment Identification Examples 1046 The 3rd SenML Record from "coap://example.com/temp" resource can be 1047 selected with: 1049 coap://example.com/temp#rec=3 1051 Records from 3rd to 6th can be selected with: 1053 coap://example.com/temp#rec=3-6 1055 Records from 19th to the last can be selected with: 1057 coap://example.com/temp#rec=19-* 1059 The 3rd and 5th record can be selected with: 1061 coap://example.com/temp#rec=3,5 1063 To select the Records from third to fifth, the 10th record, and all 1064 from 19th to the last: 1066 coap://example.com/temp#rec=3-5,10,19-* 1068 10. Usage Considerations 1070 The measurements support sending both the current value of a sensor 1071 as well as the an integrated sum. For many types of measurements, 1072 the sum is more useful than the current value. For example, an 1073 electrical meter that measures the energy a given computer uses will 1074 typically want to measure the cumulative amount of energy used. This 1075 is less prone to error than reporting the power each second and 1076 trying to have something on the server side sum together all the 1077 power measurements. If the network between the sensor and the meter 1078 goes down over some period of time, when it comes back up, the 1079 cumulative sum helps reflect what happened while the network was 1080 down. A meter like this would typically report a measurement with 1081 the unit set to watts, but it would put the sum of energy used in the 1082 "s" field of the measurement. It might optionally include the 1083 current power in the "v" field. 1085 While the benefit of using the integrated sum is fairly clear for 1086 measurements like power and energy, it is less obvious for something 1087 like temperature. Reporting the sum of the temperature makes it easy 1088 to compute averages even when the individual temperature values are 1089 not reported frequently enough to compute accurate averages. 1090 Implementers are encouraged to report the cumulative sum as well as 1091 the raw value of a given sensor. 1093 Applications that use the cumulative sum values need to understand 1094 they are very loosely defined by this specification, and depending on 1095 the particular sensor implementation may behave in unexpected ways. 1096 Applications should be able to deal with the following issues: 1098 1. Many sensors will allow the cumulative sums to "wrap" back to 1099 zero after the value gets sufficiently large. 1101 2. Some sensors will reset the cumulative sum back to zero when the 1102 device is reset, loses power, or is replaced with a different 1103 sensor. 1105 3. Applications cannot make assumptions about when the device 1106 started accumulating values into the sum. 1108 Typically applications can make some assumptions about specific 1109 sensors that will allow them to deal with these problems. A common 1110 assumption is that for sensors whose measurement values are always 1111 positive, the sum should never get smaller; so if the sum does get 1112 smaller, the application will know that one of the situations listed 1113 above has happened. 1115 11. CDDL 1117 As a convenient reference, the JSON and CBOR representations can be 1118 described with the common CDDL [I-D.ietf-cbor-cddl] specification in 1119 Figure 1 (informative). 1121 SenML-Pack = [1* record] 1123 record = { 1124 ? bn => tstr, ; Base Name 1125 ? bt => numeric, ; Base Time 1126 ? bu => tstr, ; Base Units 1127 ? bv => numeric, ; Base Value 1128 ? bs => numeric, ; Base Sum 1129 ? bver => uint, ; Base Version 1130 ? n => tstr, ; Name 1131 ? u => tstr, ; Units 1132 ? s => numeric, ; Value Sum 1133 ? t => numeric, ; Time 1134 ? ut => numeric, ; Update Time 1135 ? ( v => numeric // ; Numeric Value 1136 vs => tstr // ; String Value 1137 vb => bool // ; Boolean Value 1138 vd => binary-value ) ; Data Value 1139 * key-value-pair 1140 } 1142 ; now define the generic versions 1143 key-value-pair = ( label => value ) 1145 label = non-b-label / b-label 1146 non-b-label = tstr .regexp "[A-Zac-z0-9][-_:.A-Za-z0-9]*" / uint 1147 b-label = tstr .regexp "b[-_:.A-Za-z0-9]+" / nint 1149 value = tstr / binary-value / numeric / bool 1150 numeric = number / decfrac 1152 Figure 1: Common CDDL specification for CBOR and JSON SenML 1154 For JSON, we use text labels and base64url-encoded binary data 1155 (Figure 2). 1157 bver = "bver" n = "n" s = "s" 1158 bn = "bn" u = "u" t = "t" 1159 bt = "bt" v = "v" ut = "ut" 1160 bu = "bu" vs = "vs" vd = "vd" 1161 bv = "bv" vb = "vb" 1162 bs = "bs" 1164 binary-value = tstr ; base64url encoded 1166 Figure 2: JSON-specific CDDL specification for SenML 1168 For CBOR, we use integer labels and native binary data (Figure 3). 1170 bver = -1 n = 0 s = 5 1171 bn = -2 u = 1 t = 6 1172 bt = -3 v = 2 ut = 7 1173 bu = -4 vs = 3 vd = 8 1174 bv = -5 vb = 4 1175 bs = -6 1177 binary-value = bstr 1179 Figure 3: CBOR-specific CDDL specification for SenML 1181 12. IANA Considerations 1183 Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with 1184 the RFC number of this specification. 1186 IANA will create a new registry for "Sensor Measurement Lists (SenML) 1187 Parameters". The sub-registries defined in Section 12.1 and 1188 Section 12.2 will be created inside this registry. 1190 12.1. Units Registry 1192 IANA will create a registry of SenML unit symbols. The primary 1193 purpose of this registry is to make sure that symbols uniquely map to 1194 give type of measurement. Definitions for many of these units can be 1195 found in location such as [NIST811] and [BIPM]. Units marked with an 1196 asterisk are NOT RECOMMENDED to be produced by new implementations, 1197 but are in active use and SHOULD be implemented by consumers that can 1198 use the related base units. 1200 +----------+------------------------------------+-------+-----------+ 1201 | Symbol | Description | Type | Reference | 1202 +----------+------------------------------------+-------+-----------+ 1203 | m | meter | float | RFC-AAAA | 1204 | kg | kilogram | float | RFC-AAAA | 1205 | g | gram* | float | RFC-AAAA | 1206 | s | second | float | RFC-AAAA | 1207 | A | ampere | float | RFC-AAAA | 1208 | K | kelvin | float | RFC-AAAA | 1209 | cd | candela | float | RFC-AAAA | 1210 | mol | mole | float | RFC-AAAA | 1211 | Hz | hertz | float | RFC-AAAA | 1212 | rad | radian | float | RFC-AAAA | 1213 | sr | steradian | float | RFC-AAAA | 1214 | N | newton | float | RFC-AAAA | 1215 | Pa | pascal | float | RFC-AAAA | 1216 | J | joule | float | RFC-AAAA | 1217 | W | watt | float | RFC-AAAA | 1218 | C | coulomb | float | RFC-AAAA | 1219 | V | volt | float | RFC-AAAA | 1220 | F | farad | float | RFC-AAAA | 1221 | Ohm | ohm | float | RFC-AAAA | 1222 | S | siemens | float | RFC-AAAA | 1223 | Wb | weber | float | RFC-AAAA | 1224 | T | tesla | float | RFC-AAAA | 1225 | H | henry | float | RFC-AAAA | 1226 | Cel | degrees Celsius | float | RFC-AAAA | 1227 | lm | lumen | float | RFC-AAAA | 1228 | lx | lux | float | RFC-AAAA | 1229 | Bq | becquerel | float | RFC-AAAA | 1230 | Gy | gray | float | RFC-AAAA | 1231 | Sv | sievert | float | RFC-AAAA | 1232 | kat | katal | float | RFC-AAAA | 1233 | m2 | square meter (area) | float | RFC-AAAA | 1234 | m3 | cubic meter (volume) | float | RFC-AAAA | 1235 | l | liter (volume)* | float | RFC-AAAA | 1236 | m/s | meter per second (velocity) | float | RFC-AAAA | 1237 | m/s2 | meter per square second | float | RFC-AAAA | 1238 | | (acceleration) | | | 1239 | m3/s | cubic meter per second (flow rate) | float | RFC-AAAA | 1240 | l/s | liter per second (flow rate)* | float | RFC-AAAA | 1241 | W/m2 | watt per square meter (irradiance) | float | RFC-AAAA | 1242 | cd/m2 | candela per square meter | float | RFC-AAAA | 1243 | | (luminance) | | | 1244 | bit | bit (information content) | float | RFC-AAAA | 1245 | bit/s | bit per second (data rate) | float | RFC-AAAA | 1246 | lat | degrees latitude (note 1) | float | RFC-AAAA | 1247 | lon | degrees longitude (note 1) | float | RFC-AAAA | 1248 | pH | pH value (acidity; logarithmic | float | RFC-AAAA | 1249 | | quantity) | | | 1250 | dB | decibel (logarithmic quantity) | float | RFC-AAAA | 1251 | dBW | decibel relative to 1 W (power | float | RFC-AAAA | 1252 | | level) | | | 1253 | Bspl | bel (sound pressure level; | float | RFC-AAAA | 1254 | | logarithmic quantity)* | | | 1255 | count | 1 (counter value) | float | RFC-AAAA | 1256 | / | 1 (Ratio e.g., value of a switch, | float | RFC-AAAA | 1257 | | note 2) | | | 1258 | % | 1 (Ratio e.g., value of a switch, | float | RFC-AAAA | 1259 | | note 2)* | | | 1260 | %RH | Percentage (Relative Humidity) | float | RFC-AAAA | 1261 | %EL | Percentage (remaining battery | float | RFC-AAAA | 1262 | | energy level) | | | 1263 | EL | seconds (remaining battery energy | float | RFC-AAAA | 1264 | | level) | | | 1265 | 1/s | 1 per second (event rate) | float | RFC-AAAA | 1266 | 1/min | 1 per minute (event rate, "rpm")* | float | RFC-AAAA | 1267 | beat/min | 1 per minute (Heart rate in beats | float | RFC-AAAA | 1268 | | per minute)* | | | 1269 | beats | 1 (Cumulative number of heart | float | RFC-AAAA | 1270 | | beats)* | | | 1271 | S/m | Siemens per meter (conductivity) | float | RFC-AAAA | 1272 +----------+------------------------------------+-------+-----------+ 1274 Table 6 1276 o Note 1: Assumed to be in WGS84 unless another reference frame is 1277 known for the sensor. 1279 o Note 2: A value of 0.0 indicates the switch is off while 1.0 1280 indicates on and 0.5 would be half on. The preferred name of this 1281 unit is "/". For historical reasons, the name "%" is also 1282 provided for the same unit - but note that while that name 1283 strongly suggests a percentage (0..100) -- it is however NOT a 1284 percentage, but the absolute ratio! 1286 New entries can be added to the registration by Expert Review as 1287 defined in [RFC8126]. Experts should exercise their own good 1288 judgment but need to consider the following guidelines: 1290 1. There needs to be a real and compelling use for any new unit to 1291 be added. 1293 2. Each unit should define the semantic information and be chosen 1294 carefully. Implementers need to remember that the same word may 1295 be used in different real-life contexts. For example, degrees 1296 when measuring latitude have no semantic relation to degrees 1297 when measuring temperature; thus two different units are needed. 1299 3. These measurements are produced by computers for consumption by 1300 computers. The principle is that conversion has to be easily be 1301 done when both reading and writing the media type. The value of 1302 a single canonical representation outweighs the convenience of 1303 easy human representations or loss of precision in a conversion. 1305 4. Use of SI prefixes such as "k" before the unit is not 1306 recommended. Instead one can represent the value using 1307 scientific notation such a 1.2e3. The "kg" unit is exception to 1308 this rule since it is an SI base unit; the "g" unit is provided 1309 for legacy compatibility. 1311 5. For a given type of measurement, there will only be one unit 1312 type defined. So for length, meters are defined and other 1313 lengths such as mile, foot, light year are not allowed. For 1314 most cases, the SI unit is preferred. 1316 (Note that some amount of judgment will be required here, as 1317 even SI itself is not entirely consistent in this respect. For 1318 instance, for temperature [ISO-80000-5] defines a quantity, item 1319 5-1 (thermodynamic temperature), and a corresponding unit 5-1.a 1320 (Kelvin), and then goes ahead to define another quantity right 1321 besides that, item 5-2 ("Celsius temperature"), and the 1322 corresponding unit 5-2.a (degree Celsius). The latter quantity 1323 is defined such that it gives the thermodynamic temperature as a 1324 delta from T0 = 275.15 K. ISO 80000-5 is defining both units 1325 side by side, and not really expressing a preference. This 1326 level of recognition of the alternative unit degree Celsius is 1327 the reason why Celsius temperatures exceptionally seem 1328 acceptable in the SenML units list alongside Kelvin.) 1330 6. Symbol names that could be easily confused with existing common 1331 units or units combined with prefixes should be avoided. For 1332 example, selecting a unit name of "mph" to indicate something 1333 that had nothing to do with velocity would be a bad choice, as 1334 "mph" is commonly used to mean miles per hour. 1336 7. The following should not be used because the are common SI 1337 prefixes: Y, Z, E, P, T, G, M, k, h, da, d, c, n, u, p, f, a, z, 1338 y, Ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi. 1340 8. The following units should not be used as they are commonly used 1341 to represent other measurements Ky, Gal, dyn, etg, P, St, Mx, G, 1342 Oe, Gb, sb, Lmb, mph, Ci, R, RAD, REM, gal, bbl, qt, degF, Cal, 1343 BTU, HP, pH, B/s, psi, Torr, atm, at, bar, kWh. 1345 9. The unit names are case sensitive and the correct case needs to 1346 be used, but symbols that differ only in case should not be 1347 allocated. 1349 10. A number after a unit typically indicates the previous unit 1350 raised to that power, and the / indicates that the units that 1351 follow are the reciprocal. A unit should have only one / in the 1352 name. 1354 11. A good list of common units can be found in the Unified Code for 1355 Units of Measure [UCUM]. 1357 12.2. SenML Label Registry 1359 IANA will create a new registry for SenML labels. The initial 1360 content of the registry is: 1362 +--------------+-------+----+-----------+----------+----+-----------+ 1363 | Name | Label | CL | JSON Type | XML Type | EI | Reference | 1364 +--------------+-------+----+-----------+----------+----+-----------+ 1365 | Base Name | bn | -2 | String | string | a | RFCXXXX | 1366 | Base Time | bt | -3 | Number | double | a | RFCXXXX | 1367 | Base Unit | bu | -4 | String | string | a | RFCXXXX | 1368 | Base Value | bv | -5 | Number | double | a | RFCXXXX | 1369 | Base Sum | bs | -6 | Number | double | a | RFCXXXX | 1370 | Base Version | bver | -1 | Number | int | a | RFCXXXX | 1371 | Name | n | 0 | String | string | a | RFCXXXX | 1372 | Unit | u | 1 | String | string | a | RFCXXXX | 1373 | Value | v | 2 | Number | double | a | RFCXXXX | 1374 | String Value | vs | 3 | String | string | a | RFCXXXX | 1375 | Boolean | vb | 4 | Boolean | boolean | a | RFCXXXX | 1376 | Value | | | | | | | 1377 | Data Value | vd | 8 | String | string | a | RFCXXXX | 1378 | Value Sum | s | 5 | Number | double | a | RFCXXXX | 1379 | Time | t | 6 | Number | double | a | RFCXXXX | 1380 | Update Time | ut | 7 | Number | double | a | RFCXXXX | 1381 +--------------+-------+----+-----------+----------+----+-----------+ 1383 Table 7: IANA Registry for SenML Labels, CL = CBOR Label, EI = EXI ID 1385 This is the same table as Table 1, with notes removed, and with 1386 columns added for the information that is all the same for this 1387 initial set of registrations, but will need to be supplied with a 1388 different value for new registrations. 1390 Note to RFC Editor. Please replace RFCXXXX with the number for this 1391 RFC. 1393 All new entries must define the Label Name, Label, and XML Type but 1394 the CBOR labels SHOULD be left empty as CBOR will use the string 1395 encoding for any new labels. The EI column contains the EXI schemaId 1396 value of the first Schema which includes this label or is empty if 1397 this label was not intended for use with EXI. The Note field SHOULD 1398 contain information about where to find out more information about 1399 this label. 1401 The JSON, CBOR, and EXI types are derived from the XML type. All XML 1402 numeric types such as double, float, integer and int become a JSON 1403 Number. XML boolean and string become a JSON Boolean and String 1404 respectively. CBOR represents numeric values with a CBOR type that 1405 does not lose any information from the JSON value. EXI uses the XML 1406 types. 1408 New entries can be added to the registration by Expert Review as 1409 defined in [RFC8126]. Experts should exercise their own good 1410 judgment but need to consider that shorter labels should have more 1411 strict review. New entries should not be made that counteract the 1412 advice at the end of Section 4.4. 1414 All new SenML labels that have "base" semantics (see Section 4.1) 1415 MUST start with the character 'b'. Regular labels MUST NOT start 1416 with that character. All new SenML labels with Value semantics (see 1417 Section 4.2) MUST have "Value" in their (long form) name. 1419 Extensions that add a label that is intended for use with XML need to 1420 create a new RelaxNG scheme that includes all the labels in the IANA 1421 registry. 1423 Extensions that add a label that is intended for use with EXI need to 1424 create a new XSD Schema that includes all the labels in the IANA 1425 registry and then allocate a new EXI schemaId value. Moving to the 1426 next letter in the alphabet is the suggested way to create the new 1427 value for the EXI schemaId. Any labels with previously blank ID 1428 values SHOULD be updated in the IANA table to have their ID set to 1429 this new schemaId value. 1431 Extensions that are mandatory to understand to correctly process the 1432 Pack MUST have a label name that ends with the '_' character. 1434 12.3. Media Type Registrations 1436 The following registrations are done following the procedure 1437 specified in [RFC6838] and [RFC7303]. This document registers media 1438 types for each serialization format of SenML (JSON, CBOR, and EXI) 1439 and also media types for the same formats of the streaming use 1440 (SensML). Clipboard formats are defined for the JSON and XML form of 1441 lists but do not make sense for streams or other formats. 1443 Note to RFC Editor - please remove this paragraph. Note that a 1444 request for media type review for senml+json was sent to the media- 1445 types@iana.org on Sept 21, 2010. A second request for all the types 1446 was sent on October 31, 2016. Please change all instances of RFC- 1447 AAAA with the RFC number of this document. 1449 12.3.1. senml+json Media Type Registration 1451 Type name: application 1453 Subtype name: senml+json 1455 Required parameters: none 1457 Optional parameters: none 1459 Encoding considerations: Must be encoded as using a subset of the 1460 encoding allowed in [RFC8259]. See RFC-AAAA for details. This 1461 simplifies implementation of very simple system and does not impose 1462 any significant limitations as all this data is meant for machine to 1463 machine communications and is not meant to be human readable. 1465 Security considerations: See Section 13 of RFC-AAAA. 1467 Interoperability considerations: Applications MUST ignore any JSON 1468 key value pairs that they do not understand unless the key ends with 1469 the '_' character in which case an error MUST be generated. This 1470 allows backwards compatible extensions to this specification. The 1471 "bver" field can be used to ensure the receiver supports a minimal 1472 level of functionality needed by the creator of the JSON object. 1474 Published specification: RFC-AAAA 1476 Applications that use this media type: The type is used by systems 1477 that report e.g., electrical power usage and environmental 1478 information such as temperature and humidity. It can be used for a 1479 wide range of sensor reporting systems. 1481 Fragment identifier considerations: Fragment identification for 1482 application/senml+json is supported by using fragment identifiers as 1483 specified by RFC-AAAA. 1485 Additional information: 1487 Magic number(s): none 1489 File extension(s): senml 1491 Windows Clipboard Name: "JSON Sensor Measurement List" 1492 Macintosh file type code(s): none 1494 Macintosh Universal Type Identifier code: org.ietf.senml-json 1495 conforms to public.text 1497 Person & email address to contact for further information: Cullen 1498 Jennings 1500 Intended usage: COMMON 1502 Restrictions on usage: None 1504 Author: Cullen Jennings 1506 Change controller: IESG 1508 12.3.2. sensml+json Media Type Registration 1510 Type name: application 1512 Subtype name: sensml+json 1514 Required parameters: none 1516 Optional parameters: none 1518 Encoding considerations: Must be encoded as using a subset of the 1519 encoding allowed in [RFC8259]. See RFC-AAAA for details. This 1520 simplifies implementation of very simple system and does not impose 1521 any significant limitations as all this data is meant for machine to 1522 machine communications and is not meant to be human readable. 1524 Security considerations: See Section 13 of RFC-AAAA. 1526 Interoperability considerations: Applications MUST ignore any JSON 1527 key value pairs that they do not understand unless the key ends with 1528 the '_' character in which case an error MUST be generated. This 1529 allows backwards compatible extensions to this specification. The 1530 "bver" field can be used to ensure the receiver supports a minimal 1531 level of functionality needed by the creator of the JSON object. 1533 Published specification: RFC-AAAA 1535 Applications that use this media type: The type is used by systems 1536 that report e.g., electrical power usage and environmental 1537 information such as temperature and humidity. It can be used for a 1538 wide range of sensor reporting systems. 1540 Fragment identifier considerations: Fragment identification for 1541 application/sensml+json is supported by using fragment identifiers as 1542 specified by RFC-AAAA. 1544 Additional information: 1546 Magic number(s): none 1548 File extension(s): sensml 1550 Macintosh file type code(s): none 1552 Person & email address to contact for further information: Cullen 1553 Jennings 1555 Intended usage: COMMON 1557 Restrictions on usage: None 1559 Author: Cullen Jennings 1561 Change controller: IESG 1563 12.3.3. senml+cbor Media Type Registration 1565 Type name: application 1567 Subtype name: senml+cbor 1569 Required parameters: none 1571 Optional parameters: none 1573 Encoding considerations: Must be encoded as using [RFC7049]. See 1574 RFC-AAAA for details. 1576 Security considerations: See Section 13 of RFC-AAAA. 1578 Interoperability considerations: Applications MUST ignore any key 1579 value pairs that they do not understand unless the key ends with the 1580 '_' character in which case an error MUST be generated. This allows 1581 backwards compatible extensions to this specification. The "bver" 1582 field can be used to ensure the receiver supports a minimal level of 1583 functionality needed by the creator of the CBOR object. 1585 Published specification: RFC-AAAA 1586 Applications that use this media type: The type is used by systems 1587 that report e.g., electrical power usage and environmental 1588 information such as temperature and humidity. It can be used for a 1589 wide range of sensor reporting systems. 1591 Fragment identifier considerations: Fragment identification for 1592 application/senml+cbor is supported by using fragment identifiers as 1593 specified by RFC-AAAA. 1595 Additional information: 1597 Magic number(s): none 1599 File extension(s): senmlc 1601 Macintosh file type code(s): none 1603 Macintosh Universal Type Identifier code: org.ietf.senml-cbor 1604 conforms to public.data 1606 Person & email address to contact for further information: Cullen 1607 Jennings 1609 Intended usage: COMMON 1611 Restrictions on usage: None 1613 Author: Cullen Jennings 1615 Change controller: IESG 1617 12.3.4. sensml+cbor Media Type Registration 1619 Type name: application 1621 Subtype name: sensml+cbor 1623 Required parameters: none 1625 Optional parameters: none 1627 Encoding considerations: Must be encoded as using [RFC7049]. See 1628 RFC-AAAA for details. 1630 Security considerations: See Section 13 of RFC-AAAA. 1632 Interoperability considerations: Applications MUST ignore any key 1633 value pairs that they do not understand unless the key ends with the 1634 '_' character in which case an error MUST be generated. This allows 1635 backwards compatible extensions to this specification. The "bver" 1636 field can be used to ensure the receiver supports a minimal level of 1637 functionality needed by the creator of the CBOR object. 1639 Published specification: RFC-AAAA 1641 Applications that use this media type: The type is used by systems 1642 that report e.g., electrical power usage and environmental 1643 information such as temperature and humidity. It can be used for a 1644 wide range of sensor reporting systems. 1646 Fragment identifier considerations: Fragment identification for 1647 application/sensml+cbor is supported by using fragment identifiers as 1648 specified by RFC-AAAA. 1650 Additional information: 1652 Magic number(s): none 1654 File extension(s): sensmlc 1656 Macintosh file type code(s): none 1658 Person & email address to contact for further information: Cullen 1659 Jennings 1661 Intended usage: COMMON 1663 Restrictions on usage: None 1665 Author: Cullen Jennings 1667 Change controller: IESG 1669 12.3.5. senml+xml Media Type Registration 1671 Type name: application 1673 Subtype name: senml+xml 1675 Required parameters: none 1677 Optional parameters: none 1679 Encoding considerations: Must be encoded as using 1680 [W3C.REC-xml-20081126]. See RFC-AAAA for details. 1682 Security considerations: See Section 13 of RFC-AAAA. 1684 Interoperability considerations: Applications MUST ignore any XML 1685 tags or attributes that they do not understand unless the attribute 1686 name ends with the '_' character in which case an error MUST be 1687 generated. This allows backwards compatible extensions to this 1688 specification. The "bver" attribute in the senml XML tag can be used 1689 to ensure the receiver supports a minimal level of functionality 1690 needed by the creator of the XML SenML Pack. 1692 Published specification: RFC-AAAA 1694 Applications that use this media type: The type is used by systems 1695 that report e.g., electrical power usage and environmental 1696 information such as temperature and humidity. It can be used for a 1697 wide range of sensor reporting systems. 1699 Fragment identifier considerations: Fragment identification for 1700 application/senml+xml is supported by using fragment identifiers as 1701 specified by RFC-AAAA. 1703 Additional information: 1705 Magic number(s): none 1707 File extension(s): senmlx 1709 Windows Clipboard Name: "XML Sensor Measurement List" 1711 Macintosh file type code(s): none 1713 Macintosh Universal Type Identifier code: org.ietf.senml-xml conforms 1714 to public.xml 1716 Person & email address to contact for further information: Cullen 1717 Jennings 1719 Intended usage: COMMON 1721 Restrictions on usage: None 1723 Author: Cullen Jennings 1725 Change controller: IESG 1727 12.3.6. sensml+xml Media Type Registration 1729 Type name: application 1731 Subtype name: sensml+xml 1733 Required parameters: none 1735 Optional parameters: none 1737 Encoding considerations: Must be encoded as using 1738 [W3C.REC-xml-20081126]. See RFC-AAAA for details. 1740 Security considerations: See Section 13 of RFC-AAAA. 1742 Interoperability considerations: Applications MUST ignore any XML 1743 tags or attributes that they do not understand unless the attribute 1744 name ends with the '_' character in which case an error MUST be 1745 generated. This allows backwards compatible extensions to this 1746 specification. The "bver" attribute in the senml XML tag can be used 1747 to ensure the receiver supports a minimal level of functionality 1748 needed by the creator of the XML SenML Pack. 1750 Published specification: RFC-AAAA 1752 Applications that use this media type: The type is used by systems 1753 that report e.g., electrical power usage and environmental 1754 information such as temperature and humidity. It can be used for a 1755 wide range of sensor reporting systems. 1757 Fragment identifier considerations: Fragment identification for 1758 application/sensml+xml is supported by using fragment identifiers as 1759 specified by RFC-AAAA. 1761 Additional information: 1763 Magic number(s): none 1765 File extension(s): sensmlx 1767 Macintosh file type code(s): none 1769 Person & email address to contact for further information: Cullen 1770 Jennings 1772 Intended usage: COMMON 1774 Restrictions on usage: None 1775 Author: Cullen Jennings 1777 Change controller: IESG 1779 12.3.7. senml-exi Media Type Registration 1781 Type name: application 1783 Subtype name: senml-exi 1785 Required parameters: none 1787 Optional parameters: none 1789 Encoding considerations: Must be encoded as using 1790 [W3C.REC-exi-20140211]. See RFC-AAAA for details. 1792 Security considerations: See Section 13 of RFC-AAAA. 1794 Interoperability considerations: Applications MUST ignore any XML 1795 tags or attributes that they do not understand unless the attribute 1796 name ends with the '_' character in which case an error MUST be 1797 generated. This allows backwards compatible extensions to this 1798 specification. The "bver" attribute in the senml XML tag can be used 1799 to ensure the receiver supports a minimal level of functionality 1800 needed by the creator of the XML SenML Pack. Further information on 1801 using schemas to guide the EXI can be found in RFC-AAAA. 1803 Published specification: RFC-AAAA 1805 Applications that use this media type: The type is used by systems 1806 that report e.g., electrical power usage and environmental 1807 information such as temperature and humidity. It can be used for a 1808 wide range of sensor reporting systems. 1810 Fragment identifier considerations: Fragment identification for 1811 application/senml-exi is supported by using fragment identifiers as 1812 specified by RFC-AAAA. 1814 Additional information: 1816 Magic number(s): none 1818 File extension(s): senmle 1820 Macintosh file type code(s): none 1821 Macintosh Universal Type Identifier code: org.ietf.senml-exi conforms 1822 to public.data 1824 Person & email address to contact for further information: Cullen 1825 Jennings 1827 Intended usage: COMMON 1829 Restrictions on usage: None 1831 Author: Cullen Jennings 1833 Change controller: IESG 1835 12.3.8. sensml-exi Media Type Registration 1837 Type name: application 1839 Subtype name: sensml-exi 1841 Required parameters: none 1843 Optional parameters: none 1845 Encoding considerations: Must be encoded as using 1846 [W3C.REC-exi-20140211]. See RFC-AAAA for details. 1848 Security considerations: See Section 13 of RFC-AAAA. 1850 Interoperability considerations: Applications MUST ignore any XML 1851 tags or attributes that they do not understand unless the attribute 1852 name ends with the '_' character in which case an error MUST be 1853 generated. This allows backwards compatible extensions to this 1854 specification. The "bver" attribute in the senml XML tag can be used 1855 to ensure the receiver supports a minimal level of functionality 1856 needed by the creator of the XML SenML Pack. Further information on 1857 using schemas to guide the EXI can be found in RFC-AAAA. 1859 Published specification: RFC-AAAA 1861 Applications that use this media type: The type is used by systems 1862 that report e.g., electrical power usage and environmental 1863 information such as temperature and humidity. It can be used for a 1864 wide range of sensor reporting systems. 1866 Fragment identifier considerations: Fragment identification for 1867 application/sensml-exi is supported by using fragment identifiers as 1868 specified by RFC-AAAA. 1870 Additional information: 1872 Magic number(s): none 1874 File extension(s): sensmle 1876 Macintosh file type code(s): none 1878 Person & email address to contact for further information: Cullen 1879 Jennings 1881 Intended usage: COMMON 1883 Restrictions on usage: None 1885 Author: Cullen Jennings 1887 Change controller: IESG 1889 12.4. XML Namespace Registration 1891 This document registers the following XML namespaces in the IETF XML 1892 registry defined in [RFC3688]. 1894 URI: urn:ietf:params:xml:ns:senml 1896 Registrant Contact: The IESG. 1898 XML: N/A, the requested URIs are XML namespaces 1900 12.5. CoAP Content-Format Registration 1902 IANA is requested to assign CoAP Content-Format IDs for the SenML 1903 media types in the "CoAP Content-Formats" sub-registry, within the 1904 "CoRE Parameters" registry [RFC7252]. IDs for the JSON, CBOR, and 1905 EXI Content-Formats are assigned from the "Expert Review" (0-255) 1906 range and for the XML Content-Format from the "IETF Review or IESG 1907 Approval" range. The assigned IDs are shown in Table 8. 1909 +-------------------------+-----+ 1910 | Media type | ID | 1911 +-------------------------+-----+ 1912 | application/senml+json | TBD | 1913 | application/sensml+json | TBD | 1914 | application/senml+cbor | TBD | 1915 | application/sensml+cbor | TBD | 1916 | application/senml-exi | TBD | 1917 | application/sensml-exi | TBD | 1918 | application/senml+xml | TBD | 1919 | application/sensml+xml | TBD | 1920 +-------------------------+-----+ 1922 Table 8: CoAP Content-Format IDs 1924 13. Security Considerations 1926 Sensor data can contain a wide range of information ranging from 1927 information that is very public, such as the outside temperature in a 1928 given city, to very private information that requires integrity and 1929 confidentiality protection, such as patient health information. The 1930 SenML formats do not provide any security and instead rely on the 1931 protocol that carries them to provide security. Applications using 1932 SenML need to look at the overall context of how these media types 1933 will be used to decide if the security is adequate. The SenML 1934 formats defined by this specification do not contain any executable 1935 content. However, future extensions could potentially embed 1936 application specific executable content in the data. 1938 See also Section 14. 1940 14. Privacy Considerations 1942 Sensor data can range from information with almost no security 1943 considerations, such as the current temperature in a given city, to 1944 highly sensitive medical or location data. This specification 1945 provides no security protection for the data but is meant to be used 1946 inside another container or transport protocol such as S/MIME 1947 [RFC5751] or HTTP with TLS [RFC5246] that can provide integrity, 1948 confidentiality, and authentication information about the source of 1949 the data. 1951 The name fields need to uniquely identify the sources or destinations 1952 of the values in a SenML Pack. However, the use of long-term stable 1953 unique identifiers can be problematic for privacy reasons [RFC6973], 1954 depending on the application and the potential of these identifiers 1955 to be used in correlation with other information. They should be 1956 used with care or avoided as for example described for IPv6 addresses 1957 in [RFC7721]. 1959 15. Acknowledgement 1961 We would like to thank Alexander Pelov, Alexey Melnikov, Andrew 1962 McClure, Andrew McGregor, Bjoern Hoehrmann, Christian Amsuess, 1963 Christian Groves, Daniel Peintner, Jan-Piet Mens, Jim Schaad, Joe 1964 Hildebrand, John Klensin, Karl Palsson, Lennart Duhrsen, Lisa 1965 Dusseault, Lyndsay Campbell, Martin Thomson, Michael Koster, Peter 1966 Saint-Andre, Roni Even, and Stephen Farrell, for their review 1967 comments. 1969 16. References 1971 16.1. Normative References 1973 [BIPM] Bureau International des Poids et Mesures, "The 1974 International System of Units (SI)", 8th edition, 2006. 1976 [IEEE.754.1985] 1977 Institute of Electrical and Electronics Engineers, 1978 "Standard for Binary Floating-Point Arithmetic", IEEE 1979 Standard 754, August 1985. 1981 [NIST811] Thompson, A. and B. Taylor, "Guide for the Use of the 1982 International System of Units (SI)", NIST Special 1983 Publication 811, 2008. 1985 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1986 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 1987 RFC2119, March 1997, . 1990 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 1991 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 1992 2003, . 1994 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1995 DOI 10.17487/RFC3688, January 2004, . 1998 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1999 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 2000 . 2002 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 2003 Specifications and Registration Procedures", BCP 13, RFC 2004 6838, DOI 10.17487/RFC6838, January 2013, 2005 . 2007 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 2008 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 2009 October 2013, . 2011 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 2012 Application Protocol (CoAP)", RFC 7252, DOI 10.17487/ 2013 RFC7252, June 2014, . 2016 [RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, 2017 DOI 10.17487/RFC7303, July 2014, . 2020 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 2021 Writing an IANA Considerations Section in RFCs", BCP 26, 2022 RFC 8126, DOI 10.17487/RFC8126, June 2017, 2023 . 2025 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2026 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2027 May 2017, . 2029 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 2030 Interchange Format", STD 90, RFC 8259, DOI 10.17487/ 2031 RFC8259, December 2017, . 2034 [RNC] ISO/IEC, "Information technology -- Document Schema 2035 Definition Language (DSDL) -- Part 2: Regular-grammar- 2036 based validation -- RELAX NG", ISO/IEC 19757-2, Annex C: 2037 RELAX NG Compact syntax, December 2008. 2039 [TIME_T] The Open Group Base Specifications, "Vol. 1: Base 2040 Definitions, Issue 7", Section 4.15 'Seconds Since the 2041 Epoch', IEEE Std 1003.1, 2013 Edition, 2013, 2042 . 2045 [W3C.REC-exi-20140211] 2046 Schneider, J., Kamiya, T., Peintner, D., and R. Kyusakov, 2047 "Efficient XML Interchange (EXI) Format 1.0 (Second 2048 Edition)", World Wide Web Consortium Recommendation REC- 2049 exi-20140211, February 2014, 2050 . 2052 [W3C.REC-xml-20081126] 2053 Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and 2054 F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth 2055 Edition)", World Wide Web Consortium Recommendation REC- 2056 xml-20081126, November 2008, 2057 . 2059 [W3C.REC-xmlschema-1-20041028] 2060 Thompson, H., Beech, D., Maloney, M., and N. Mendelsohn, 2061 "XML Schema Part 1: Structures Second Edition", World Wide 2062 Web Consortium Recommendation REC-xmlschema-1-20041028, 2063 October 2004, 2064 . 2066 16.2. Informative References 2068 [I-D.ietf-cbor-cddl] 2069 Birkholz, H., Vigano, C., and C. Bormann, "Concise data 2070 definition language (CDDL): a notational convention to 2071 express CBOR data structures", draft-ietf-cbor-cddl-02 2072 (work in progress), February 2018. 2074 [I-D.ietf-core-dev-urn] 2075 Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource 2076 Names for Device Identifiers", draft-ietf-core-dev-urn-01 2077 (work in progress), March 2018. 2079 [I-D.ietf-core-interfaces] 2080 Shelby, Z., Vial, M., Koster, M., Groves, C., Zhu, J., and 2081 B. Silverajan, "Reusable Interface Definitions for 2082 Constrained RESTful Environments", draft-ietf-core- 2083 interfaces-11 (work in progress), March 2018. 2085 [IEEE802.1as-2011] 2086 IEEE, "IEEE Standard for Local and Metropolitan Area 2087 Networks - Timing and Synchronization for Time-Sensitive 2088 Applications in Bridged Local Area Networks", 2011. 2090 [IEEE802.1ba-2011] 2091 IEEE, "IEEE Standard for Local and metropolitan area 2092 networks--Audio Video Bridging (AVB) Systems", 2011. 2094 [ISO-80000-5] 2095 "Quantities and units - Part 5: Thermodynamics", ISO 2096 80000-5, Edition 1.0, May 2007. 2098 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2099 Resource Identifier (URI): Generic Syntax", STD 66, RFC 2100 3986, DOI 10.17487/RFC3986, January 2005, 2101 . 2103 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 2104 Unique IDentifier (UUID) URN Namespace", RFC 4122, DOI 2105 10.17487/RFC4122, July 2005, . 2108 [RFC4151] Kindberg, T. and S. Hawke, "The 'tag' URI Scheme", RFC 2109 4151, DOI 10.17487/RFC4151, October 2005, 2110 . 2112 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 2113 "Transmission of IPv6 Packets over IEEE 802.15.4 2114 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 2115 . 2117 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 2118 (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/ 2119 RFC5246, August 2008, . 2122 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2123 Mail Extensions (S/MIME) Version 3.2 Message 2124 Specification", RFC 5751, DOI 10.17487/RFC5751, January 2125 2010, . 2127 [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 2128 Address Text Representation", RFC 5952, DOI 10.17487/ 2129 RFC5952, August 2010, . 2132 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 2133 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 2134 . 2136 [RFC6920] Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B., 2137 Keranen, A., and P. Hallam-Baker, "Naming Things with 2138 Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013, 2139 . 2141 [RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., 2142 Morris, J., Hansen, M., and R. Smith, "Privacy 2143 Considerations for Internet Protocols", RFC 6973, DOI 2144 10.17487/RFC6973, July 2013, . 2147 [RFC7111] Hausenblas, M., Wilde, E., and J. Tennison, "URI Fragment 2148 Identifiers for the text/csv Media Type", RFC 7111, DOI 2149 10.17487/RFC7111, January 2014, . 2152 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 2153 Protocol (HTTP/1.1): Message Syntax and Routing", RFC 2154 7230, DOI 10.17487/RFC7230, June 2014, . 2157 [RFC7721] Cooper, A., Gont, F., and D. Thaler, "Security and Privacy 2158 Considerations for IPv6 Address Generation Mechanisms", 2159 RFC 7721, DOI 10.17487/RFC7721, March 2016, 2160 . 2162 [RFC8141] Saint-Andre, P. and J. Klensin, "Uniform Resource Names 2163 (URNs)", RFC 8141, DOI 10.17487/RFC8141, April 2017, 2164 . 2166 [UCUM] Schadow, G. and C. McDonald, "The Unified Code for Units 2167 of Measure (UCUM)", Regenstrief Institute and Indiana 2168 University School of Informatics, 2013, 2169 . 2171 Authors' Addresses 2173 Cullen Jennings 2174 Cisco 2175 400 3rd Avenue SW 2176 Calgary, AB T2P 4H2 2177 Canada 2179 Email: fluffy@iii.ca 2180 Zach Shelby 2181 ARM 2182 150 Rose Orchard 2183 San Jose 95134 2184 USA 2186 Phone: +1-408-203-9434 2187 Email: zach.shelby@arm.com 2189 Jari Arkko 2190 Ericsson 2191 Jorvas 02420 2192 Finland 2194 Email: jari.arkko@piuha.net 2196 Ari Keranen 2197 Ericsson 2198 Jorvas 02420 2199 Finland 2201 Email: ari.keranen@ericsson.com 2203 Carsten Bormann 2204 Universitaet Bremen TZI 2205 Postfach 330440 2206 Bremen D-28359 2207 Germany 2209 Phone: +49-421-218-63921 2210 Email: cabo@tzi.org