idnits 2.17.1 draft-ietf-core-senml-12.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 (December 14, 2017) is 2325 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) ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) == Outdated reference: A later version (-08) exists of draft-ietf-cbor-cddl-00 == Outdated reference: A later version (-14) exists of draft-ietf-core-interfaces-10 Summary: 2 errors (**), 0 flaws (~~), 4 warnings (==), 4 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: June 17, 2018 ARM 6 J. Arkko 7 A. Keranen 8 Ericsson 9 C. Bormann 10 Universitaet Bremen TZI 11 December 14, 2017 13 Media Types for Sensor Measurement Lists (SenML) 14 draft-ietf-core-senml-12 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 this media type in protocols such as 25 HTTP or CoAP to transport the measurements of the sensor or to be 26 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 June 17, 2018. 45 Copyright Notice 47 Copyright (c) 2017 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 . . . . . . . . . . . . . . . . . . . . . 6 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 . . . . . . . . . . . . 10 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 . . . . . . . . . . . . . . . . . 15 82 6. CBOR Representation (application/senml+cbor) . . . . . . . . 16 83 7. XML Representation (application/senml+xml) . . . . . . . . . 18 84 8. EXI Representation (application/senml+exi) . . . . . . . . . 20 85 9. Fragment Identification Methods . . . . . . . . . . . . . . . 23 86 9.1. Fragment Identification Examples . . . . . . . . . . . . 23 87 10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 24 88 11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 89 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 90 12.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 26 91 12.2. SenML Label Registry . . . . . . . . . . . . . . . . . . 30 92 12.3. Media Type Registration . . . . . . . . . . . . . . . . 31 93 12.3.1. senml+json Media Type Registration . . . . . . . . . 32 94 12.3.2. sensml+json Media Type Registration . . . . . . . . 33 95 12.3.3. senml+cbor Media Type Registration . . . . . . . . . 34 96 12.3.4. sensml+cbor Media Type Registration . . . . . . . . 35 97 12.3.5. senml+xml Media Type Registration . . . . . . . . . 36 98 12.3.6. sensml+xml Media Type Registration . . . . . . . . . 37 99 12.3.7. senml+exi Media Type Registration . . . . . . . . . 38 100 12.3.8. sensml+exi Media Type Registration . . . . . . . . . 40 101 12.4. XML Namespace Registration . . . . . . . . . . . . . . . 41 102 12.5. CoAP Content-Format Registration . . . . . . . . . . . . 41 103 13. Security Considerations . . . . . . . . . . . . . . . . . . . 41 104 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 42 105 15. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 42 106 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 107 16.1. Normative References . . . . . . . . . . . . . . . . . . 42 108 16.2. Informative References . . . . . . . . . . . . . . . . . 44 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 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 or CoAP. This format was designed so that processors 117 with very limited capabilities could easily encode a sensor 118 measurement into the media type, while at the same time a server 119 parsing the data could relatively efficiently collect a large number 120 of sensor measurements. SenML can be used for a variety of data flow 121 models, most notably data feeds pushed from a sensor to a collector, 122 and the web resource model where the sensor is requested as a 123 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 [RFC7159], CBOR [RFC7049], XML, and Efficient XML 141 Interchange (EXI) [W3C.REC-exi-20140211]. 143 For example, the following shows a measurement from a temperature 144 gauge encoded in the JSON syntax. 146 [ 147 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} 148 ] 150 In the example above, the array has a single SenML Record with a 151 measurement for a sensor named "urn:dev:ow:10e2073a01080063" with a 152 current value of 23.1 degrees Celsius. 154 2. Requirements and Design Goals 156 The design goal is to be able to send simple sensor measurements in 157 small packets from large numbers of constrained devices. Keeping the 158 total size of payload small makes it easy to use SenML also in 159 constrained networks, e.g., in a 6LoWPAN [RFC4944]. It is always 160 difficult to define what small code is, but there is a desire to be 161 able to implement this in roughly 1 KB of flash on a 8 bit 162 microprocessor. Experience with power meters and other large scale 163 deployments has indicated that the solution needs to support allowing 164 multiple measurements to be batched into a single HTTP or CoAP 165 request. This "batch" upload capability allows the server side to 166 efficiently support a large number of devices. It also conveniently 167 supports batch transfers from proxies and storage devices, even in 168 situations where the sensor itself sends just a single data item at a 169 time. The multiple measurements could be from multiple related 170 sensors or from the same sensor but at different times. 172 The basic design is an array with a series of measurements. The 173 following example shows two measurements made at different times. 174 The value of a measurement is given by the "v" field, the time of a 175 measurement is in the "t" field, the "n" field has a unique sensor 176 name, and the unit of the measurement is carried in the "u" field. 178 [ 179 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, 180 "v":23.5}, 181 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020091e+09, 182 "v":23.6} 183 ] 185 To keep the messages small, it does not make sense to repeat the "n" 186 field in each SenML Record so there is a concept of a Base Name which 187 is simply a string that is prepended to the Name field of all 188 elements in that record and any records that follow it. So a more 189 compact form of the example above is the following. 191 [ 192 {"bn":"urn:dev:ow:10e2073a01080063","u":"Cel","t":1.276020076e+09, 193 "v":23.5}, 194 {"u":"Cel","t":1.276020091e+09, 195 "v":23.6} 196 ] 198 In the above example the Base Name is in the "bn" field and the "n" 199 fields in each Record are the empty string so they are omitted. 201 Some devices have accurate time while others do not so SenML supports 202 absolute and relative times. Time is represented in floating point 203 as seconds and values greater than zero represent an absolute time 204 relative to the Unix epoch while values of 0 or less represent a 205 relative time in the past from the current time. A simple sensor 206 with no absolute wall clock time might take a measurement every 207 second, batch up 60 of them, and then send the batch to a server. It 208 would include the relative time each measurement was made compared to 209 the time the batch was sent in each SenML Record. The server might 210 have accurate NTP time and use the time it received the data, and the 211 relative offset, to replace the times in the SenML with absolute 212 times before saving the SenML Pack in a document database. 214 3. Terminology 216 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 217 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 218 "OPTIONAL" in this document are to be interpreted as described in 219 [RFC2119]. 221 This document also uses the following terms: 223 SenML Record: One measurement or configuration instance in time 224 presented using the SenML data model. 226 SenML Pack: One or more SenML Records in an array structure. 228 SenML Label: A short name used in SenML Records to denote different 229 SenML fields (e.g., "v" for "value"). 231 SenML Field: A component of a record that associates a value to a 232 SenML Label for this record. 234 This document uses the terms "attribute" and "tag" where they occur 235 with the underlying technologies (XML, CBOR [RFC7049], and Link 236 Format [RFC6690]), not for SenML concepts per se. Note that 237 "attribute" has been widely used previously as a synonym for SenML 238 "field", though. 240 4. SenML Structure and Semantics 242 Each SenML Pack carries a single array that represents a set of 243 measurements and/or parameters. This array contains a series of 244 SenML Records with several fields described below. There are two 245 kinds of fields: base and regular. The base fields can be included 246 in any SenML Record and they apply to the entries in the Record. 247 Each base field also applies to all Records after it up to, but not 248 including, the next Record that has that same base field. All base 249 fields are optional. Regular fields can be included in any SenML 250 Record and apply only to that Record. 252 4.1. Base Fields 254 Base Name: This is a string that is prepended to the names found in 255 the entries. 257 Base Time: A base time that is added to the time found in an entry. 259 Base Unit: A base unit that is assumed for all entries, unless 260 otherwise indicated. If a record does not contain a Unit value, 261 then the Base Unit is used. Otherwise the value found in the Unit 262 (if any) is used. 264 Base Value: A base value is added to the value found in an entry, 265 similar to Base Time. 267 Base Sum: A base sum is added to the sum found in an entry, similar 268 to Base Time. 270 Version: Version number of media type format. This field is an 271 optional positive integer and defaults to 5 if not present. [RFC 272 Editor: change the default value to 10 when this specification is 273 published as an RFC and remove this note] 275 4.2. Regular Fields 277 Name: Name of the sensor or parameter. When appended to the Base 278 Name field, this must result in a globally unique identifier for 279 the resource. The name is optional, if the Base Name is present. 280 If the name is missing, Base Name must uniquely identify the 281 resource. This can be used to represent a large array of 282 measurements from the same sensor without having to repeat its 283 identifier on every measurement. 285 Unit: Unit for a measurement value. Optional. 287 Value: Value of the entry. Optional if a Sum value is present, 288 otherwise required. Values are represented using basic data 289 types. This specification defines floating point numbers ("v" 290 field for "Value"), booleans ("vb" for "Boolean Value"), strings 291 ("vs" for "String Value") and binary data ("vd" for "Data Value"). 292 Exactly one value field MUST appear unless there is Sum field in 293 which case it is allowed to have no Value field. 295 Sum: Integrated sum of the values over time. Optional. This field 296 is in the unit specified in the Unit value multiplied by seconds. 298 Time: Time when value was recorded. Optional. 300 Update Time: Period of time in seconds that represents the maximum 301 time before this sensor will provide an updated reading for a 302 measurement. Optional. This can be used to detect the failure of 303 sensors or communications path from the sensor. 305 4.3. SenML Labels 307 Table 1 provides an overview of all SenML fields defined by this 308 document with their respective labels and data types. 310 +---------------+-------+------------+------------+------------+ 311 | Name | Label | CBOR Label | JSON Type | XML Type | 312 +---------------+-------+------------+------------+------------+ 313 | Base Name | bn | -2 | String | string | 314 | Base Time | bt | -3 | Number | double | 315 | Base Unit | bu | -4 | String | string | 316 | Base Value | bv | -5 | Number | double | 317 | Base Sum | bs | -6 | Number | double | 318 | Version | bver | -1 | Number | int | 319 | Name | n | 0 | String | string | 320 | Unit | u | 1 | String | string | 321 | Value | v | 2 | Number | double | 322 | String Value | vs | 3 | String | string | 323 | Boolean Value | vb | 4 | Boolean | boolean | 324 | Data Value | vd | 8 | String (*) | string (*) | 325 | Value Sum | s | 5 | Number | double | 326 | Time | t | 6 | Number | double | 327 | Update Time | ut | 7 | Number | double | 328 +---------------+-------+------------+------------+------------+ 330 Table 1: SenML Labels 332 Data Value is base64 encoded string with URL safe alphabet as defined 333 in Section 5 of [RFC4648], with padding omitted. 335 For details of the JSON representation see Section 5, for the CBOR 336 Section 6, and for the XML Section 7. 338 4.4. Considerations 340 The SenML format can be extended with further custom fields. Both 341 new base and regular fields are allowed. See Section 12.2 for 342 details. Implementations MUST ignore fields they don't recognize 343 unless that field has a label name that ends with the '_' character 344 in which case an error MUST be generated. 346 All SenML Records in a Pack MUST have the same version number. This 347 is typically done by adding a Base Version field to only the first 348 Record in the Pack. 350 Systems reading one of the objects MUST check for the Version field. 351 If this value is a version number larger than the version which the 352 system understands, the system SHOULD NOT use this object. This 353 allows the version number to indicate that the object contains 354 structure or semantics that is different from what is defined in the 355 present document beyond just making use of the extension points 356 provided here. New version numbers can only be defined in an RFC 357 that updates this specification or it successors. 359 The Name value is concatenated to the Base Name value to yield the 360 name of the sensor. The resulting concatenated name needs to 361 uniquely identify and differentiate the sensor from all others. The 362 concatenated name MUST consist only of characters out of the set "A" 363 to "Z", "a" to "z", "0" to "9", "-", ":", ".", "/", and "_"; 364 furthermore, it MUST start with a character out of the set "A" to 365 "Z", "a" to "z", or "0" to "9". This restricted character set was 366 chosen so that concatenated names can be used directly within various 367 URI schemes (including segments of an HTTP path with no special 368 encoding) and can be used directly in many databases and analytic 369 systems. [RFC5952] contains advice on encoding an IPv6 address in a 370 name. See Section 14 for privacy considerations that apply to the 371 use of long-term stable unique identifiers. 373 Although it is RECOMMENDED that concatenated names are represented as 374 URIs [RFC3986] or URNs [RFC8141], the restricted character set 375 specified above puts strict limits on the URI schemes and URN 376 namespaces that can be used. As a result, implementers need to take 377 care in choosing the naming scheme for concatenated names, because 378 such names both need to be unique and need to conform to the 379 restricted character set. One approach is to include a bit string 380 that has guaranteed uniqueness (such as a 1-wire address). Some of 381 the examples within this document use the device URN namespace as 382 specified in [I-D.arkko-core-dev-urn]. UUIDs [RFC4122] are another 383 way to generate a unique name. However, the restricted character set 384 does not allow the use of many URI schemes in names as such. The use 385 of URIs with characters incompatible with this set, and possible 386 mapping rules between the two, are outside of the scope of the 387 present document. 389 If the Record has no Unit, the Base Unit is used as the Unit. Having 390 no Unit and no Base Unit is allowed. 392 If either the Base Time or Time value is missing, the missing field 393 is considered to have a value of zero. The Base Time and Time values 394 are added together to get the time of measurement. A time of zero 395 indicates that the sensor does not know the absolute time and the 396 measurement was made roughly "now". A negative value is used to 397 indicate seconds in the past from roughly "now". A positive value is 398 used to indicate the number of seconds, excluding leap seconds, since 399 the start of the year 1970 in UTC. 401 If only one of the Base Sum or Sum value is present, the missing 402 field is considered to have a value of zero. The Base Sum and Sum 403 values are added together to get the sum of measurement. If neither 404 the Base Sum or Sum are present, then the measurement does not have a 405 sum value. 407 If the Base Value or Value is not present, the missing field(s) are 408 considered to have a value of zero. The Base Value and Value are 409 added together to get the value of the measurement. 411 Representing the statistical characteristics of measurements, such as 412 accuracy, can be very complex. Future specification may add new 413 fields to provide better information about the statistical properties 414 of the measurement. 416 In summary, the structure of a SenML record is laid out to support a 417 single measurement per record. If multiple data values are measured 418 at the same time (e.g., air pressure and altitude), they are best 419 kept as separate records linked through their Time value; this is 420 even true where one of the data values is more "meta" than others 421 (e.g., describes a condition that influences other measurements at 422 the same time). 424 4.5. Resolved Records 426 Sometimes it is useful to be able to refer to a defined normalized 427 format for SenML records. This normalized format tends to get used 428 for big data applications and intermediate forms when converting to 429 other formats. 431 A SenML Record is referred to as "resolved" if it does not contain 432 any base values, i.e., labels starting with the character 'b', except 433 for Version fields (see below), and has no relative times. To 434 resolve the records, the base values of the SenML Pack (if any) are 435 applied to the Record. That is, name and base name are concatenated, 436 base time is added to the time of the Record, if the Record did not 437 contain Unit the Base Unit is applied to the record, etc. In 438 addition the records need to be in chronological order. An example 439 of this is show in Section 5.1.4. 441 The Version field MUST NOT be present in resolved records if the 442 SenML version defined in this document is used and MUST be present 443 otherwise in all the resolved SenML Records. 445 Future specification that defines new base fields need to specify how 446 the field is resolved. 448 4.6. Associating Meta-data 450 SenML is designed to carry the minimum dynamic information about 451 measurements, and for efficiency reasons does not carry significant 452 static meta-data about the device, object or sensors. Instead, it is 453 assumed that this meta-data is carried out of band. For web 454 resources using SenML Packs, this meta-data can be made available 455 using the CoRE Link Format [RFC6690]. The most obvious use of this 456 link format is to describe that a resource is available in a SenML 457 format in the first place. The relevant media type indicator is 458 included in the Content-Type (ct=) link attribute (which is defined 459 for the Link Format in Section 7.2.1 of [RFC7252]). 461 4.7. Configuration and Actuation usage 463 SenML can also be used for configuring parameters and controlling 464 actuators. When a SenML Pack is sent (e.g., using a HTTP/CoAP POST 465 or PUT method) and the semantics of the target are such that SenML is 466 interpreted as configuration/actuation, SenML Records are interpreted 467 as a request to change the values of given (sub)resources (given as 468 names) to given values at the given time(s). The semantics of the 469 target resource supporting this usage can be described, e.g., using 470 [I-D.ietf-core-interfaces]. Examples of actuation usage are shown in 471 Section 5.1.7. 473 5. JSON Representation (application/senml+json) 475 For the SenML fields shown in Table 2, the SenML labels are used as 476 the JSON object member names within JSON objects representing the 477 JSON SenML Records. 479 +---------------+-------+---------+ 480 | Name | label | Type | 481 +---------------+-------+---------+ 482 | Base Name | bn | String | 483 | Base Time | bt | Number | 484 | Base Unit | bu | String | 485 | Base Value | bv | Number | 486 | Base Sum | bs | Number | 487 | Version | bver | Number | 488 | Name | n | String | 489 | Unit | u | String | 490 | Value | v | Number | 491 | String Value | vs | String | 492 | Boolean Value | vb | Boolean | 493 | Data Value | vd | String | 494 | Value Sum | s | Number | 495 | Time | t | Number | 496 | Update Time | ut | Number | 497 +---------------+-------+---------+ 499 Table 2: JSON SenML Labels 501 The root JSON value consists of an array with one JSON object for 502 each SenML Record. All the fields in the above table MAY occur in 503 the records with member values of the type specified in the table. 505 Only the UTF-8 form of JSON is allowed. Characters in the String 506 Value are encoded using the escape sequences defined in [RFC7159]. 507 Octets in the Data Value are base64 encoded with URL safe alphabet as 508 defined in Section 5 of [RFC4648], with padding omitted. 510 Systems receiving measurements MUST be able to process the range of 511 floating point numbers that are representable as an IEEE double 512 precision floating point numbers [IEEE.754.1985]. The number of 513 significant digits in any measurement is not relevant, so a reading 514 of 1.1 has exactly the same semantic meaning as 1.10. If the value 515 has an exponent, the "e" MUST be in lower case. The mantissa SHOULD 516 be less than 19 characters long and the exponent SHOULD be less than 517 5 characters long. This allows time values to have better than micro 518 second precision over the next 100 years. 520 5.1. Examples 522 5.1.1. Single Datapoint 524 The following shows a temperature reading taken approximately "now" 525 by a 1-wire sensor device that was assigned the unique 1-wire address 526 of 10e2073a01080063: 528 [ 529 {"n":"urn:dev:ow:10e2073a01080063","u":"Cel","v":23.1} 530 ] 532 5.1.2. Multiple Datapoints 534 The following example shows voltage and current now, i.e., at an 535 unspecified time. 537 [ 538 {"bn":"urn:dev:ow:10e2073a01080063:","n":"voltage","u":"V","v":120.1}, 539 {"n":"current","u":"A","v":1.2} 540 ] 542 The next example is similar to the above one, but shows current at 543 Tue Jun 8 18:01:16.001 UTC 2010 and at each second for the previous 5 544 seconds. 546 [ 547 {"bn":"urn:dev:ow:10e2073a0108006:","bt":1.276020076001e+09, 548 "bu":"A","bver":5, 549 "n":"voltage","u":"V","v":120.1}, 550 {"n":"current","t":-5,"v":1.2}, 551 {"n":"current","t":-4,"v":1.3}, 552 {"n":"current","t":-3,"v":1.4}, 553 {"n":"current","t":-2,"v":1.5}, 554 {"n":"current","t":-1,"v":1.6}, 555 {"n":"current","v":1.7} 556 ] 558 Note that in some usage scenarios of SenML the implementations MAY 559 store or transmit SenML in a stream-like fashion, where data is 560 collected over time and continuously added to the object. This mode 561 of operation is optional, but systems or protocols using SenML in 562 this fashion MUST specify that they are doing this. SenML defines a 563 separate media type to indicate Sensor Streaming Measurement Lists 564 (SensML) for this usage (see Section 12.3.2). In this situation the 565 SensML stream can be sent and received in a partial fashion, i.e., a 566 measurement entry can be read as soon as the SenML Record is received 567 and not have to wait for the full SensML Stream to be complete. 569 For instance, the following stream of measurements may be sent via a 570 long lived HTTP POST from the producer of a SensML to the consumer of 571 that, and each measurement object may be reported at the time it was 572 measured: 574 [ 575 {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, 576 "bu":"%RH","v":21.2}, 577 {"t":10,"v":21.3}, 578 {"t":20,"v":21.4}, 579 {"t":30,"v":21.4}, 580 {"t":40,"v":21.5}, 581 {"t":50,"v":21.5}, 582 {"t":60,"v":21.5}, 583 {"t":70,"v":21.6}, 584 {"t":80,"v":21.7}, 585 ... 587 5.1.3. Multiple Measurements 589 The following example shows humidity measurements from a mobile 590 device with a 1-wire address 10e2073a01080063, starting at Mon Oct 31 591 13:24:24 UTC 2011. The device also provides position data, which is 592 provided in the same measurement or parameter array as separate 593 entries. Note time is used to for correlating data that belongs 594 together, e.g., a measurement and a parameter associated with it. 595 Finally, the device also reports extra data about its battery status 596 at a separate time. 598 [ 599 {"bn":"urn:dev:ow:10e2073a01080063","bt":1.320067464e+09, 600 "bu":"%RH","v":20}, 601 {"u":"lon","v":24.30621}, 602 {"u":"lat","v":60.07965}, 603 {"t":60,"v":20.3}, 604 {"u":"lon","t":60,"v":24.30622}, 605 {"u":"lat","t":60,"v":60.07965}, 606 {"t":120,"v":20.7}, 607 {"u":"lon","t":120,"v":24.30623}, 608 {"u":"lat","t":120,"v":60.07966}, 609 {"u":"%EL","t":150,"v":98}, 610 {"t":180,"v":21.2}, 611 {"u":"lon","t":180,"v":24.30628}, 612 {"u":"lat","t":180,"v":60.07967} 613 ] 615 The size of this example represented in various forms, as well as 616 that form compressed with gzip is given in the following table. 618 +----------+------+-----------------+ 619 | Encoding | Size | Compressed Size | 620 +----------+------+-----------------+ 621 | JSON | 573 | 206 | 622 | XML | 649 | 235 | 623 | CBOR | 254 | 196 | 624 | EXI | 161 | 184 | 625 +----------+------+-----------------+ 627 Table 3: Size Comparisons 629 5.1.4. Resolved Data 631 The following shows the example from the previous section show in 632 resolved format. 634 [ 635 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067464e+09, 636 "v":20}, 637 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067464e+09, 638 "v":24.30621}, 639 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067464e+09, 640 "v":60.07965}, 641 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067524e+09, 642 "v":20.3}, 643 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067524e+09, 644 "v":24.30622}, 645 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067524e+09, 646 "v":60.07965}, 647 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067584e+09, 648 "v":20.7}, 649 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067584e+09, 650 "v":24.30623}, 651 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067584e+09, 652 "v":60.07966}, 653 {"n":"urn:dev:ow:10e2073a01080063","u":"%EL","t":1.320067614e+09, 654 "v":98}, 655 {"n":"urn:dev:ow:10e2073a01080063","u":"%RH","t":1.320067644e+09, 656 "v":21.2}, 657 {"n":"urn:dev:ow:10e2073a01080063","u":"lon","t":1.320067644e+09, 658 "v":24.30628}, 659 {"n":"urn:dev:ow:10e2073a01080063","u":"lat","t":1.320067644e+09, 660 "v":60.07967} 661 ] 663 5.1.5. Multiple Data Types 665 The following example shows a sensor that returns different data 666 types. 668 [ 669 {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, 670 {"n":"label","vs":"Machine Room"}, 671 {"n":"open","vb":false}, 672 {"n":"nfv-reader","vd":"aGkgCg"} 673 ] 675 5.1.6. Collection of Resources 677 The following example shows the results from a query to one device 678 that aggregates multiple measurements from another devices. The 679 example assumes that a client has fetched information from a device 680 at 2001:db8::2 by performing a GET operation on http://[2001:db8::2] 681 at Mon Oct 31 16:27:09 UTC 2011, and has gotten two separate values 682 as a result, a temperature and humidity measurement as well as the 683 results from another device at http://[2001:db8::1] that also had a 684 temperature and humidity. Note that the last record would use the 685 Base Name from the 3rd record but the Base Time from the first 686 record. 688 [ 689 {"bn":"2001:db8::2/","bt":1.320078429e+09, 690 "n":"temperature","u":"Cel","v":25.2}, 691 {"n":"humidity","u":"%RH","v":30}, 692 {"bn":"2001:db8::1/","n":"temperature","u":"Cel","v":12.3}, 693 {"n":"humidity","u":"%RH","v":67} 694 ] 696 5.1.7. Setting an Actuator 698 The following example show the SenML that could be used to set the 699 current set point of a typical residential thermostat which has a 700 temperature set point, a switch to turn on and off the heat, and a 701 switch to turn on the fan override. 703 [ 704 {"bn":"urn:dev:ow:10e2073a01080063:"}, 705 {"n":"temp","u":"Cel","v":23.1}, 706 {"n":"heat","u":"/","v":1}, 707 {"n":"fan","u":"/","v":0} 708 ] 709 In the following example two different lights are turned on. It is 710 assumed that the lights are on a network that can guarantee delivery 711 of the messages to the two lights within 15 ms (e.g. a network using 712 802.1BA [IEEE802.1ba-2011] and 802.1AS [IEEE802.1as-2011] for time 713 synchronization). The controller has set the time of the lights 714 coming on to 20 ms in the future from the current time. This allows 715 both lights to receive the message, wait till that time, then apply 716 the switch command so that both lights come on at the same time. 718 [ 719 {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":1}, 720 {"n":"2001:db8::4","v":1} 721 ] 723 The following shows two lights being turned off using a non 724 deterministic network that has a high odds of delivering a message in 725 less than 100 ms and uses NTP for time synchronization. The current 726 time is 1320078429. The user has just turned off a light switch 727 which is turning off two lights. Both lights are dimmed to 50% 728 brightness immediately to give the user instant feedback that 729 something is changing. However given the network, the lights will 730 probably dim at somewhat different times. Then 100 ms in the future, 731 both lights will go off at the same time. The instant but not 732 synchronized dimming gives the user the sensation of quick responses 733 and the timed off 100 ms in the future gives the perception of both 734 lights going off at the same time. 736 [ 737 {"bt":1.320078429e+09,"bu":"/","n":"2001:db8::3","v":0.5}, 738 {"n":"2001:db8::4","v":0.5}, 739 {"n":"2001:db8::3","t":0.1,"v":0}, 740 {"n":"2001:db8::4","t":0.1,"v":0} 741 ] 743 6. CBOR Representation (application/senml+cbor) 745 The CBOR [RFC7049] representation is equivalent to the JSON 746 representation, with the following changes: 748 o For JSON Numbers, the CBOR representation can use integers, 749 floating point numbers, or decimal fractions (CBOR Tag 4); however 750 a representation SHOULD be chosen such that when the CBOR value is 751 converted back to an IEEE double precision floating point value, 752 it has exactly the same value as the original Number. For the 753 version number, only an unsigned integer is allowed. 755 o Characters in the String Value are encoded using a definite length 756 text string (type 3). Octets in the Data Value are encoded using 757 a definite length byte string (type 2). 759 o For compactness, the CBOR representation uses integers for the 760 labels, as defined in Table 4. This table is conclusive, i.e., 761 there is no intention to define any additional integer map keys; 762 any extensions will use string map keys. This allows translators 763 converting between CBOR and JSON representations to convert also 764 all future labels without needing to update implementations. 766 +---------------+-------+------------+ 767 | Name | Label | CBOR Label | 768 +---------------+-------+------------+ 769 | Version | bver | -1 | 770 | Base Name | bn | -2 | 771 | Base Time | bt | -3 | 772 | Base Unit | bu | -4 | 773 | Base Value | bv | -5 | 774 | Base Sum | bs | -6 | 775 | Name | n | 0 | 776 | Unit | u | 1 | 777 | Value | v | 2 | 778 | String Value | vs | 3 | 779 | Boolean Value | vb | 4 | 780 | Value Sum | s | 5 | 781 | Time | t | 6 | 782 | Update Time | ut | 7 | 783 | Data Value | vd | 8 | 784 +---------------+-------+------------+ 786 Table 4: CBOR representation: integers for map keys 788 o For streaming SensML in CBOR representation, the array containing 789 the records SHOULD be a CBOR indefinite length array while for 790 non-streaming SenML, a definite length array MUST be used. 792 The following example shows a dump of the CBOR example for the same 793 sensor measurement as in Section 5.1.2. 795 0000 87 a7 21 78 1b 75 72 6e 3a 64 65 76 3a 6f 77 3a |..!x.urn:dev:ow:| 796 0010 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 3a |10e2073a0108006:| 797 0020 22 fb 41 d3 03 a1 5b 00 10 62 23 61 41 20 05 00 |".A...[..b#aA ..| 798 0030 67 76 6f 6c 74 61 67 65 01 61 56 02 fb 40 5e 06 |gvoltage.aV..@^.| 799 0040 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e 74 06 |fffff..gcurrent.| 800 0050 24 02 fb 3f f3 33 33 33 33 33 33 a3 00 67 63 75 |$..?.333333..gcu| 801 0060 72 72 65 6e 74 06 23 02 fb 3f f4 cc cc cc cc cc |rrent.#..?......| 802 0070 cd a3 00 67 63 75 72 72 65 6e 74 06 22 02 fb 3f |...gcurrent."..?| 803 0080 f6 66 66 66 66 66 66 a3 00 67 63 75 72 72 65 6e |.ffffff..gcurren| 804 0090 74 06 21 02 f9 3e 00 a3 00 67 63 75 72 72 65 6e |t.!..>...gcurren| 805 00a0 74 06 20 02 fb 3f f9 99 99 99 99 99 9a a3 00 67 |t. ..?.........g| 806 00b0 63 75 72 72 65 6e 74 06 00 02 fb 3f fb 33 33 33 |current....?.333| 807 00c0 33 33 33 |333| 808 00c3 810 In CBOR diagnostic notation (Section 6 of [RFC7049]), this is: 812 [{-2: "urn:dev:ow:10e2073a0108006:", 813 -3: 1276020076.001, -4: "A", -1: 5, 0: "voltage", 1: "V", 2: 120.1}, 814 {0: "current", 6: -5, 2: 1.2}, {0: "current", 6: -4, 2: 1.3}, 815 {0: "current", 6: -3, 2: 1.4}, {0: "current", 6: -2, 2: 1.5}, 816 {0: "current", 6: -1, 2: 1.6}, {0: "current", 6: 0, 2: 1.7}] 818 7. XML Representation (application/senml+xml) 820 A SenML Pack or Stream can also be represented in XML format as 821 defined in this section. 823 Only the UTF-8 form of XML is allowed. Characters in the String 824 Value are encoded using the escape sequences defined in [RFC7159]. 825 Octets in the Data Value are base64 encoded with URL safe alphabet as 826 defined in Section 5 of [RFC4648]. 828 The following example shows an XML example for the same sensor 829 measurement as in Section 5.1.2. 831 832 834 835 836 837 838 839 840 841 The SenML Stream is represented as a sensml element that contains a 842 series of senml elements for each SenML Record. The SenML fields are 843 represented as XML attributes. For each field defined in this 844 document, the following table shows the SenML labels, which are used 845 for the XML attribute name, as well as the according restrictions on 846 the XML attribute values ("type") as used in the XML senml elements. 848 +---------------+-------+---------+ 849 | Name | Label | Type | 850 +---------------+-------+---------+ 851 | Base Name | bn | string | 852 | Base Time | bt | double | 853 | Base Unit | bu | string | 854 | Base Value | bv | double | 855 | Base Sum | bs | double | 856 | Base Version | bver | int | 857 | Name | n | string | 858 | Unit | u | string | 859 | Value | v | double | 860 | String Value | vs | string | 861 | Data Value | vd | string | 862 | Boolean Value | vb | boolean | 863 | Value Sum | s | double | 864 | Time | t | double | 865 | Update Time | ut | double | 866 +---------------+-------+---------+ 868 Table 5: XML SenML Labels 870 The RelaxNG schema for the XML is: 872 default namespace = "urn:ietf:params:xml:ns:senml" 873 namespace rng = "http://relaxng.org/ns/structure/1.0" 875 senml = element senml { 876 attribute bn { xsd:string }?, 877 attribute bt { xsd:double }?, 878 attribute bv { xsd:double }?, 879 attribute bs { xsd:double }?, 880 attribute bu { xsd:string }?, 881 attribute bver { xsd:int }?, 883 attribute n { xsd:string }?, 884 attribute s { xsd:double }?, 885 attribute t { xsd:double }?, 886 attribute u { xsd:string }?, 887 attribute ut { xsd:double }?, 889 attribute v { xsd:double }?, 890 attribute vb { xsd:boolean }?, 891 attribute vs { xsd:string }?, 892 attribute vd { xsd:string }? 893 } 895 sensml = 896 element sensml { 897 senml+ 898 } 900 start = sensml 902 8. EXI Representation (application/senml+exi) 904 For efficient transmission of SenML over e.g. a constrained network, 905 Efficient XML Interchange (EXI) can be used. This encodes the XML 906 Schema structure of SenML into binary tags and values rather than 907 ASCII text. An EXI representation of SenML SHOULD be made using the 908 strict schema-mode of EXI. This mode however does not allow tag 909 extensions to the schema, and therefore any extensions will be lost 910 in the encoding. For uses where extensions need to be preserved in 911 EXI, the non-strict schema mode of EXI MAY be used. 913 The EXI header MUST include an "EXI Options", as defined in 914 [W3C.REC-exi-20140211], with an schemaId set to the value of "a" 915 indicating the schema provided in this specification. Future 916 revisions to the schema can change the value of the schemaId to allow 917 for backwards compatibility. When the data will be transported over 918 CoAP or HTTP, an EXI Cookie SHOULD NOT be used as it simply makes 919 things larger and is redundant to information provided in the 920 Content-Type header. 922 The following is the XSD Schema to be used for strict schema guided 923 EXI processing. It is generated from the RelaxNG. 925 926 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 958 The following shows a hexdump of the EXI produced from encoding the 959 following XML example. Note this example is the same information as 960 the first example in Section 5.1.2 in JSON format. 962 963 965 966 967 Which compresses with EXI to the following displayed in hexdump: 969 0000 a0 30 0d 84 80 f3 ab 93 71 d3 23 2b b1 d3 7b b9 |.0......q.#+..{.| 970 0010 d1 89 83 29 91 81 b9 9b 09 81 89 81 c1 81 81 b1 |...)............| 971 0020 99 d2 84 bb 37 b6 3a 30 b3 b2 90 1a b1 58 84 c0 |....7.:0.....X..| 972 0030 33 04 b1 ba b9 39 32 b7 3a 10 1a 09 06 40 38 |3....92.:....@8| 973 003f 975 The above example used the bit packed form of EXI but it is also 976 possible to use a byte packed form of EXI which can makes it easier 977 for a simple sensor to produce valid EXI without really implementing 978 EXI. Consider the example of a temperature sensor that produces a 979 value in tenths of degrees Celsius over a range of 0.0 to 55.0. It 980 would produce an XML SenML file such as: 982 983 984 986 The compressed form, using the byte alignment option of EXI, for the 987 above XML is the following: 989 0000 a0 00 48 80 6c 20 01 06 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| 990 0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| 991 0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| 992 0030 01 |.| 993 0031 995 A small temperature sensor device that only generates this one EXI 996 file does not really need an full EXI implementation. It can simply 997 hard code the output replacing the 1-wire device ID starting at byte 998 0x20 and going to byte 0x2F with it's device ID, and replacing the 999 value "0xe7 0x01" at location 0x37 and 0x38 with the current 1000 temperature. The EXI Specification [W3C.REC-exi-20140211] contains 1001 the full information on how floating point numbers are represented, 1002 but for the purpose of this sensor, the temperature can be converted 1003 to an integer in tenths of degrees (231 in this example). EXI stores 1004 7 bits of the integer in each byte with the top bit set to one if 1005 there are further bytes. So the first bytes at is set to low 7 bits 1006 of the integer temperature in tenths of degrees plus 0x80. In this 1007 example 231 & 0x7F + 0x80 = 0xE7. The second byte is set to the 1008 integer temperature in tenths of degrees right shifted 7 bits. In 1009 this example 231 >> 7 = 0x01. 1011 9. Fragment Identification Methods 1013 A SenML Pack typically consists of multiple SenML Records and for 1014 some applications it may be useful to be able to refer with a 1015 Fragment Identifier to a single record, or a set of records, in a 1016 Pack. The fragment identifier is only interpreted by a client and 1017 does not impact retrieval of a representation. The SenML Fragment 1018 Identification is modeled after CSV Fragment Identifiers [RFC7111]. 1020 To select a single SenML Record, the "rec" scheme followed by a 1021 single number is used. For the purpose of numbering records, the 1022 first record is at position 1. A range of records can be selected by 1023 giving the first and the last record number separated by a '-' 1024 character. Instead of the second number, the '*' character can be 1025 used to indicate the last SenML Record in the Pack. A set of records 1026 can also be selected using a comma separated list of record positions 1027 or ranges. 1029 (We use the term "selecting a record" for identifying it as part of 1030 the fragment, not in the sense of isolating it from the Pack -- the 1031 record still needs to be interpreted as part of the Pack, e.g., using 1032 the base values defined in earlier records) 1034 9.1. Fragment Identification Examples 1036 The 3rd SenML Record from "coap://example.com/temp" resource can be 1037 selected with: 1039 coap://example.com/temp#rec=3 1041 Records from 3rd to 6th can be selected with: 1043 coap://example.com/temp#rec=3-6 1045 Records from 19th to the last can be selected with: 1047 coap://example.com/temp#rec=19-* 1049 The 3rd and 5th record can be selected with: 1051 coap://example.com/temp#rec=3,5 1053 To select the Records from third to fifth, the 10th record, and all 1054 from 19th to the last: 1056 coap://example.com/temp#rec=3-5,10,19-* 1058 10. Usage Considerations 1060 The measurements support sending both the current value of a sensor 1061 as well as the an integrated sum. For many types of measurements, 1062 the sum is more useful than the current value. For example, an 1063 electrical meter that measures the energy a given computer uses will 1064 typically want to measure the cumulative amount of energy used. This 1065 is less prone to error than reporting the power each second and 1066 trying to have something on the server side sum together all the 1067 power measurements. If the network between the sensor and the meter 1068 goes down over some period of time, when it comes back up, the 1069 cumulative sum helps reflect what happened while the network was 1070 down. A meter like this would typically report a measurement with 1071 the unit set to watts, but it would put the sum of energy used in the 1072 "s" field of the measurement. It might optionally include the 1073 current power in the "v" field. 1075 While the benefit of using the integrated sum is fairly clear for 1076 measurements like power and energy, it is less obvious for something 1077 like temperature. Reporting the sum of the temperature makes it easy 1078 to compute averages even when the individual temperature values are 1079 not reported frequently enough to compute accurate averages. 1080 Implementers are encouraged to report the cumulative sum as well as 1081 the raw value of a given sensor. 1083 Applications that use the cumulative sum values need to understand 1084 they are very loosely defined by this specification, and depending on 1085 the particular sensor implementation may behave in unexpected ways. 1086 Applications should be able to deal with the following issues: 1088 1. Many sensors will allow the cumulative sums to "wrap" back to 1089 zero after the value gets sufficiently large. 1091 2. Some sensors will reset the cumulative sum back to zero when the 1092 device is reset, loses power, or is replaced with a different 1093 sensor. 1095 3. Applications cannot make assumptions about when the device 1096 started accumulating values into the sum. 1098 Typically applications can make some assumptions about specific 1099 sensors that will allow them to deal with these problems. A common 1100 assumption is that for sensors whose measurement values are always 1101 positive, the sum should never get smaller; so if the sum does get 1102 smaller, the application will know that one of the situations listed 1103 above has happened. 1105 11. CDDL 1107 For reference, the JSON and CBOR representations can be described 1108 with the common CDDL [I-D.ietf-cbor-cddl] specification in Figure 1. 1110 SenML-Pack = [1* record] 1112 record = { 1113 ? bn => tstr, ; Base Name 1114 ? bt => numeric, ; Base Time 1115 ? bu => tstr, ; Base Units 1116 ? bv => numeric, ; Base Value 1117 ? bs => numeric, ; Base Sum 1118 ? bver => uint, ; Base Version 1119 ? n => tstr, ; Name 1120 ? u => tstr, ; Units 1121 ? s => numeric, ; Value Sum 1122 ? t => numeric, ; Time 1123 ? ut => numeric, ; Update Time 1124 ? ( v => numeric // ; Numeric Value 1125 vs => tstr // ; String Value 1126 vb => bool // ; Boolean Value 1127 vd => binary-value ) ; Data Value 1128 * key-value-pair 1129 } 1131 ; now define the generic versions 1132 key-value-pair = ( label => value ) 1134 label = non-b-label / b-label 1135 non-b-label = tstr .regexp "[A-Zac-z0-9][-_:.A-Za-z0-9]*" / uint 1136 b-label = tstr .regexp "b[-_:.A-Za-z0-9]+" / nint 1138 value = tstr / binary-value / numeric / bool 1139 numeric = number / decfrac 1141 Figure 1: Common CDDL specification for CBOR and JSON SenML 1143 For JSON, we use text labels and base64url-encoded binary data 1144 (Figure 2). 1146 bver = "bver" n = "n" s = "s" 1147 bn = "bn" u = "u" t = "t" 1148 bt = "bt" v = "v" ut = "ut" 1149 bu = "bu" vs = "vs" vd = "vd" 1150 bv = "bv" vb = "vb" 1151 bs = "bs" 1153 binary-value = tstr ; base64url encoded 1155 Figure 2: JSON-specific CDDL specification for SenML 1157 For CBOR, we use integer labels and native binary data (Figure 3). 1159 bver = -1 n = 0 s = 5 1160 bn = -2 u = 1 t = 6 1161 bt = -3 v = 2 ut = 7 1162 bu = -4 vs = 3 vd = 8 1163 bv = -5 vb = 4 1164 bs = -6 1166 binary-value = bstr 1168 Figure 3: CBOR-specific CDDL specification for SenML 1170 12. IANA Considerations 1172 Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with 1173 the RFC number of this specification. 1175 12.1. Units Registry 1177 IANA will create a registry of SenML unit symbols. The primary 1178 purpose of this registry is to make sure that symbols uniquely map to 1179 give type of measurement. Definitions for many of these units can be 1180 found in location such as [NIST811] and [BIPM]. Units marked with an 1181 asterisk are NOT RECOMMENDED to be produced by new implementations, 1182 but are in active use and SHOULD be implemented by consumers that can 1183 use the related base units. 1185 +----------+------------------------------------+-------+-----------+ 1186 | Symbol | Description | Type | Reference | 1187 +----------+------------------------------------+-------+-----------+ 1188 | m | meter | float | RFC-AAAA | 1189 | kg | kilogram | float | RFC-AAAA | 1190 | g | gram* | float | RFC-AAAA | 1191 | s | second | float | RFC-AAAA | 1192 | A | ampere | float | RFC-AAAA | 1193 | K | kelvin | float | RFC-AAAA | 1194 | cd | candela | float | RFC-AAAA | 1195 | mol | mole | float | RFC-AAAA | 1196 | Hz | hertz | float | RFC-AAAA | 1197 | rad | radian | float | RFC-AAAA | 1198 | sr | steradian | float | RFC-AAAA | 1199 | N | newton | float | RFC-AAAA | 1200 | Pa | pascal | float | RFC-AAAA | 1201 | J | joule | float | RFC-AAAA | 1202 | W | watt | float | RFC-AAAA | 1203 | C | coulomb | float | RFC-AAAA | 1204 | V | volt | float | RFC-AAAA | 1205 | F | farad | float | RFC-AAAA | 1206 | Ohm | ohm | float | RFC-AAAA | 1207 | S | siemens | float | RFC-AAAA | 1208 | Wb | weber | float | RFC-AAAA | 1209 | T | tesla | float | RFC-AAAA | 1210 | H | henry | float | RFC-AAAA | 1211 | Cel | degrees Celsius | float | RFC-AAAA | 1212 | lm | lumen | float | RFC-AAAA | 1213 | lx | lux | float | RFC-AAAA | 1214 | Bq | becquerel | float | RFC-AAAA | 1215 | Gy | gray | float | RFC-AAAA | 1216 | Sv | sievert | float | RFC-AAAA | 1217 | kat | katal | float | RFC-AAAA | 1218 | m2 | square meter (area) | float | RFC-AAAA | 1219 | m3 | cubic meter (volume) | float | RFC-AAAA | 1220 | l | liter (volume)* | float | RFC-AAAA | 1221 | m/s | meter per second (velocity) | float | RFC-AAAA | 1222 | m/s2 | meter per square second | float | RFC-AAAA | 1223 | | (acceleration) | | | 1224 | m3/s | cubic meter per second (flow rate) | float | RFC-AAAA | 1225 | l/s | liter per second (flow rate)* | float | RFC-AAAA | 1226 | W/m2 | watt per square meter (irradiance) | float | RFC-AAAA | 1227 | cd/m2 | candela per square meter | float | RFC-AAAA | 1228 | | (luminance) | | | 1229 | bit | bit (information content) | float | RFC-AAAA | 1230 | bit/s | bit per second (data rate) | float | RFC-AAAA | 1231 | lat | degrees latitude (note 1) | float | RFC-AAAA | 1232 | lon | degrees longitude (note 1) | float | RFC-AAAA | 1233 | pH | pH value (acidity; logarithmic | float | RFC-AAAA | 1234 | | quantity) | | | 1235 | dB | decibel (logarithmic quantity) | float | RFC-AAAA | 1236 | dBW | decibel relative to 1 W (power | float | RFC-AAAA | 1237 | | level) | | | 1238 | Bspl | bel (sound pressure level; | float | RFC-AAAA | 1239 | | logarithmic quantity)* | | | 1240 | count | 1 (counter value) | float | RFC-AAAA | 1241 | / | 1 (Ratio e.g., value of a switch, | float | RFC-AAAA | 1242 | | note 2) | | | 1243 | % | 1 (Ratio e.g., value of a switch, | float | RFC-AAAA | 1244 | | note 2)* | | | 1245 | %RH | Percentage (Relative Humidity) | float | RFC-AAAA | 1246 | %EL | Percentage (remaining battery | float | RFC-AAAA | 1247 | | energy level) | | | 1248 | EL | seconds (remaining battery energy | float | RFC-AAAA | 1249 | | level) | | | 1250 | 1/s | 1 per second (event rate) | float | RFC-AAAA | 1251 | 1/min | 1 per minute (event rate, "rpm")* | float | RFC-AAAA | 1252 | beat/min | 1 per minute (Heart rate in beats | float | RFC-AAAA | 1253 | | per minute)* | | | 1254 | beats | 1 (Cumulative number of heart | float | RFC-AAAA | 1255 | | beats)* | | | 1256 | S/m | Siemens per meter (conductivity) | float | RFC-AAAA | 1257 +----------+------------------------------------+-------+-----------+ 1259 Table 6 1261 o Note 1: Assumed to be in WGS84 unless another reference frame is 1262 known for the sensor. 1264 o Note 2: A value of 0.0 indicates the switch is off while 1.0 1265 indicates on and 0.5 would be half on. The preferred name of this 1266 unit is "/". For historical reasons, the name "%" is also 1267 provided for the same unit - but note that while that name 1268 strongly suggests a percentage (0..100) -- it is however NOT a 1269 percentage, but the absolute ratio! 1271 New entries can be added to the registration by Expert Review as 1272 defined in [RFC8126]. Experts should exercise their own good 1273 judgment but need to consider the following guidelines: 1275 1. There needs to be a real and compelling use for any new unit to 1276 be added. 1278 2. Each unit should define the semantic information and be chosen 1279 carefully. Implementers need to remember that the same word may 1280 be used in different real-life contexts. For example, degrees 1281 when measuring latitude have no semantic relation to degrees 1282 when measuring temperature; thus two different units are needed. 1284 3. These measurements are produced by computers for consumption by 1285 computers. The principle is that conversion has to be easily be 1286 done when both reading and writing the media type. The value of 1287 a single canonical representation outweighs the convenience of 1288 easy human representations or loss of precision in a conversion. 1290 4. Use of SI prefixes such as "k" before the unit is not 1291 recommended. Instead one can represent the value using 1292 scientific notation such a 1.2e3. The "kg" unit is exception to 1293 this rule since it is an SI base unit; the "g" unit is provided 1294 for legacy compatibility. 1296 5. For a given type of measurement, there will only be one unit 1297 type defined. So for length, meters are defined and other 1298 lengths such as mile, foot, light year are not allowed. For 1299 most cases, the SI unit is preferred. 1301 (Note that some amount of judgment will be required here, as 1302 even SI itself is not entirely consistent in this respect. For 1303 instance, for temperature [ISO-80000-5] defines a quantity, item 1304 5-1 (thermodynamic temperature), and a corresponding unit 5-1.a 1305 (Kelvin), and then goes ahead to define another quantity right 1306 besides that, item 5-2 ("Celsius temperature"), and the 1307 corresponding unit 5-2.a (degree Celsius). The latter quantity 1308 is defined such that it gives the thermodynamic temperature as a 1309 delta from T0 = 275.15 K. ISO 80000-5 is defining both units 1310 side by side, and not really expressing a preference. This 1311 level of recognition of the alternative unit degree Celsius is 1312 the reason why Celsius temperatures exceptionally seem 1313 acceptable in the SenML units list alongside Kelvin.) 1315 6. Symbol names that could be easily confused with existing common 1316 units or units combined with prefixes should be avoided. For 1317 example, selecting a unit name of "mph" to indicate something 1318 that had nothing to do with velocity would be a bad choice, as 1319 "mph" is commonly used to mean miles per hour. 1321 7. The following should not be used because the are common SI 1322 prefixes: Y, Z, E, P, T, G, M, k, h, da, d, c, n, u, p, f, a, z, 1323 y, Ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi. 1325 8. The following units should not be used as they are commonly used 1326 to represent other measurements Ky, Gal, dyn, etg, P, St, Mx, G, 1327 Oe, Gb, sb, Lmb, mph, Ci, R, RAD, REM, gal, bbl, qt, degF, Cal, 1328 BTU, HP, pH, B/s, psi, Torr, atm, at, bar, kWh. 1330 9. The unit names are case sensitive and the correct case needs to 1331 be used, but symbols that differ only in case should not be 1332 allocated. 1334 10. A number after a unit typically indicates the previous unit 1335 raised to that power, and the / indicates that the units that 1336 follow are the reciprocal. A unit should have only one / in the 1337 name. 1339 11. A good list of common units can be found in the Unified Code for 1340 Units of Measure [UCUM]. 1342 12.2. SenML Label Registry 1344 IANA will create a new registry for SenML labels. The initial 1345 content of the registry is: 1347 +--------------+-------+----+-----------+----------+----+-----------+ 1348 | Name | Label | CL | JSON Type | XML Type | EI | Reference | 1349 +--------------+-------+----+-----------+----------+----+-----------+ 1350 | Base Name | bn | -2 | String | string | a | RFCXXXX | 1351 | Base Time | bt | -3 | Number | double | a | RFCXXXX | 1352 | Base Unit | bu | -4 | String | string | a | RFCXXXX | 1353 | Base Value | bv | -5 | Number | double | a | RFCXXXX | 1354 | Base Sum | bs | -6 | Number | double | a | RFCXXXX | 1355 | Base Version | bver | -1 | Number | int | a | RFCXXXX | 1356 | Name | n | 0 | String | string | a | RFCXXXX | 1357 | Unit | u | 1 | String | string | a | RFCXXXX | 1358 | Value | v | 2 | Number | double | a | RFCXXXX | 1359 | String Value | vs | 3 | String | string | a | RFCXXXX | 1360 | Boolean | vb | 4 | Boolean | boolean | a | RFCXXXX | 1361 | Value | | | | | | | 1362 | Data Value | vd | 8 | String | string | a | RFCXXXX | 1363 | Value Sum | s | 5 | Number | double | a | RFCXXXX | 1364 | Time | t | 6 | Number | double | a | RFCXXXX | 1365 | Update Time | ut | 7 | Number | double | a | RFCXXXX | 1366 +--------------+-------+----+-----------+----------+----+-----------+ 1368 Table 7: IANA Registry for SenML Labels, CL = CBOR Label, EI = EXI ID 1370 This is the same table as Table 1, with notes removed, and with 1371 columns added for the information that is all the same for this 1372 initial set of registrations, but will need to be supplied with a 1373 different value for new registrations. 1375 Note to RFC Editor. Please replace RFCXXXX with the number for this 1376 RFC. 1378 All new entries must define the Label Name, Label, and XML Type but 1379 the CBOR labels SHOULD be left empty as CBOR will use the string 1380 encoding for any new labels. The EI column contains the EXI schemaId 1381 value of the first Schema which includes this label or is empty if 1382 this label was not intended for use with EXI. The Note field SHOULD 1383 contain information about where to find out more information about 1384 this label. 1386 The JSON, CBOR, and EXI types are derived from the XML type. All XML 1387 numeric types such as double, float, integer and int become a JSON 1388 Number. XML boolean and string become a JSON Boolean and String 1389 respectively. CBOR represents numeric values with a CBOR type that 1390 does not lose any information from the JSON value. EXI uses the XML 1391 types. 1393 New entries can be added to the registration by Expert Review as 1394 defined in [RFC8126]. Experts should exercise their own good 1395 judgment but need to consider that shorter labels should have more 1396 strict review. New entries should not be made that counteract the 1397 advice at the end of Section 4.4. 1399 All new SenML labels that have "base" semantics (see Section 4.1) 1400 MUST start with the character 'b'. Regular labels MUST NOT start 1401 with that character. 1403 Extensions that add a label that is intended for use with XML need to 1404 create a new RelaxNG scheme that includes all the labels in the IANA 1405 registry. 1407 Extensions that add a label that is intended for use with EXI need to 1408 create a new XSD Schema that includes all the labels in the IANA 1409 registry and then allocate a new EXI schemaId value. Moving to the 1410 next letter in the alphabet is the suggested way to create the new 1411 value for the EXI schemaId. Any labels with previously blank ID 1412 values SHOULD be updated in the IANA table to have their ID set to 1413 this new schemaId value. 1415 Extensions that are mandatory to understand to correctly process the 1416 Pack MUST have a label name that ends with the '_' character. 1418 12.3. Media Type Registration 1420 The following registrations are done following the procedure 1421 specified in [RFC6838] and [RFC7303]. Clipboard formats are defined 1422 for the JSON and XML form of lists but do not make sense for streams 1423 or other formats. 1425 Note to RFC Editor - please remove this paragraph. Note that a 1426 request for media type review for senml+json was sent to the media- 1427 types@iana.org on Sept 21, 2010. A second request for all the types 1428 was sent on October 31, 2016. Please change all instances of RFC- 1429 AAAA with the RFC number of this document. 1431 12.3.1. senml+json Media Type Registration 1433 Type name: application 1435 Subtype name: senml+json 1437 Required parameters: none 1439 Optional parameters: none 1441 Encoding considerations: Must be encoded as using a subset of the 1442 encoding allowed in [RFC7159]. See RFC-AAAA for details. This 1443 simplifies implementation of very simple system and does not impose 1444 any significant limitations as all this data is meant for machine to 1445 machine communications and is not meant to be human readable. 1447 Security considerations: See Section 13 of RFC-AAAA. 1449 Interoperability considerations: Applications should ignore any JSON 1450 key value pairs that they do not understand. This allows backwards 1451 compatibility extensions to this specification. The "bver" field can 1452 be used to ensure the receiver supports a minimal level of 1453 functionality needed by the creator of the JSON object. 1455 Published specification: RFC-AAAA 1457 Applications that use this media type: The type is used by systems 1458 that report e.g., electrical power usage and environmental 1459 information such as temperature and humidity. It can be used for a 1460 wide range of sensor reporting systems. 1462 Fragment identifier considerations: Fragment identification for 1463 application/senml+json is supported by using fragment identifiers as 1464 specified by RFC-AAAA. 1466 Additional information: 1468 Magic number(s): none 1470 File extension(s): senml 1472 Windows Clipboard Name: "JSON Sensor Measurement List" 1474 Macintosh file type code(s): none 1476 Macintosh Universal Type Identifier code: org.ietf.senml-json 1477 conforms to public.text 1478 Person & email address to contact for further information: Cullen 1479 Jennings 1481 Intended usage: COMMON 1483 Restrictions on usage: None 1485 Author: Cullen Jennings 1487 Change controller: IESG 1489 12.3.2. sensml+json Media Type Registration 1491 Type name: application 1493 Subtype name: sensml+json 1495 Required parameters: none 1497 Optional parameters: none 1499 Encoding considerations: Must be encoded as using a subset of the 1500 encoding allowed in [RFC7159]. See RFC-AAAA for details. This 1501 simplifies implementation of very simple system and does not impose 1502 any significant limitations as all this data is meant for machine to 1503 machine communications and is not meant to be human readable. 1505 Security considerations: See Section 13 of RFC-AAAA. 1507 Interoperability considerations: Applications should ignore any JSON 1508 key value pairs that they do not understand. This allows backwards 1509 compatibility extensions to this specification. The "bver" field can 1510 be used to ensure the receiver supports a minimal level of 1511 functionality needed by the creator of the JSON object. 1513 Published specification: RFC-AAAA 1515 Applications that use this media type: The type is used by systems 1516 that report e.g., electrical power usage and environmental 1517 information such as temperature and humidity. It can be used for a 1518 wide range of sensor reporting systems. 1520 Fragment identifier considerations: Fragment identification for 1521 application/senml+json is supported by using fragment identifiers as 1522 specified by RFC-AAAA. 1524 Additional information: 1526 Magic number(s): none 1528 File extension(s): sensml 1530 Macintosh file type code(s): none 1532 Person & email address to contact for further information: Cullen 1533 Jennings 1535 Intended usage: COMMON 1537 Restrictions on usage: None 1539 Author: Cullen Jennings 1541 Change controller: IESG 1543 12.3.3. senml+cbor Media Type Registration 1545 Type name: application 1547 Subtype name: senml+cbor 1549 Required parameters: none 1551 Optional parameters: none 1553 Encoding considerations: Must be encoded as using [RFC7049]. See 1554 RFC-AAAA for details. 1556 Security considerations: See Section 13 of RFC-AAAA. 1558 Interoperability considerations: Applications should ignore any key 1559 value pairs that they do not understand. This allows backwards 1560 compatibility extensions to this specification. The "bver" field can 1561 be used to ensure the receiver supports a minimal level of 1562 functionality needed by the creator of the CBOR object. 1564 Published specification: RFC-AAAA 1566 Applications that use this media type: The type is used by systems 1567 that report e.g., electrical power usage and environmental 1568 information such as temperature and humidity. It can be used for a 1569 wide range of sensor reporting systems. 1571 Fragment identifier considerations: Fragment identification for 1572 application/senml+cbor is supported by using fragment identifiers as 1573 specified by RFC-AAAA. 1575 Additional information: 1577 Magic number(s): none 1579 File extension(s): senmlc 1581 Macintosh file type code(s): none 1583 Macintosh Universal Type Identifier code: org.ietf.senml-cbor 1584 conforms to public.data 1586 Person & email address to contact for further information: Cullen 1587 Jennings 1589 Intended usage: COMMON 1591 Restrictions on usage: None 1593 Author: Cullen Jennings 1595 Change controller: IESG 1597 12.3.4. sensml+cbor Media Type Registration 1599 Type name: application 1601 Subtype name: sensml+cbor 1603 Required parameters: none 1605 Optional parameters: none 1607 Encoding considerations: Must be encoded as using [RFC7049]. See 1608 RFC-AAAA for details. 1610 Security considerations: See Section 13 of RFC-AAAA. 1612 Interoperability considerations: Applications should ignore any key 1613 value pairs that they do not understand. This allows backwards 1614 compatibility extensions to this specification. The "bver" field can 1615 be used to ensure the receiver supports a minimal level of 1616 functionality needed by the creator of the CBOR object. 1618 Published specification: RFC-AAAA 1620 Applications that use this media type: The type is used by systems 1621 that report e.g., electrical power usage and environmental 1622 information such as temperature and humidity. It can be used for a 1623 wide range of sensor reporting systems. 1625 Fragment identifier considerations: Fragment identification for 1626 application/senml+cbor is supported by using fragment identifiers as 1627 specified by RFC-AAAA. 1629 Additional information: 1631 Magic number(s): none 1633 File extension(s): sensmlc 1635 Macintosh file type code(s): none 1637 Person & email address to contact for further information: Cullen 1638 Jennings 1640 Intended usage: COMMON 1642 Restrictions on usage: None 1644 Author: Cullen Jennings 1646 Change controller: IESG 1648 12.3.5. senml+xml Media Type Registration 1650 Type name: application 1652 Subtype name: senml+xml 1654 Required parameters: none 1656 Optional parameters: none 1658 Encoding considerations: Must be encoded as using 1659 [W3C.REC-xml-20081126]. See RFC-AAAA for details. 1661 Security considerations: See Section 13 of RFC-AAAA. 1663 Interoperability considerations: Applications should ignore any XML 1664 tags or attributes that they do not understand. This allows 1665 backwards compatibility extensions to this specification. The "bver" 1666 attribute in the senml XML tag can be used to ensure the receiver 1667 supports a minimal level of functionality needed by the creator of 1668 the XML. 1670 Published specification: RFC-AAAA 1672 Applications that use this media type: The type is used by systems 1673 that report e.g., electrical power usage and environmental 1674 information such as temperature and humidity. It can be used for a 1675 wide range of sensor reporting systems. 1677 Fragment identifier considerations: Fragment identification for 1678 application/senml+xml is supported by using fragment identifiers as 1679 specified by RFC-AAAA. 1681 Additional information: 1683 Magic number(s): none 1685 File extension(s): senmlx 1687 Windows Clipboard Name: "XML Sensor Measurement List" 1689 Macintosh file type code(s): none 1691 Macintosh Universal Type Identifier code: org.ietf.senml-xml conforms 1692 to public.xml 1694 Person & email address to contact for further information: Cullen 1695 Jennings 1697 Intended usage: COMMON 1699 Restrictions on usage: None 1701 Author: Cullen Jennings 1703 Change controller: IESG 1705 12.3.6. sensml+xml Media Type Registration 1707 Type name: application 1709 Subtype name: sensml+xml 1711 Required parameters: none 1713 Optional parameters: none 1715 Encoding considerations: Must be encoded as using 1716 [W3C.REC-xml-20081126]. See RFC-AAAA for details. 1718 Security considerations: See Section 13 of RFC-AAAA. 1720 Interoperability considerations: Applications should ignore any XML 1721 tags or attributes that they do not understand. This allows 1722 backwards compatibility extensions to this specification. The "bver" 1723 attribute in the senml XML tag can be used to ensure the receiver 1724 supports a minimal level of functionality needed by the creator of 1725 the XML. 1727 Published specification: RFC-AAAA 1729 Applications that use this media type: The type is used by systems 1730 that report e.g., electrical power usage and environmental 1731 information such as temperature and humidity. It can be used for a 1732 wide range of sensor reporting systems. 1734 Fragment identifier considerations: Fragment identification for 1735 application/senml+xml is supported by using fragment identifiers as 1736 specified by RFC-AAAA. 1738 Additional information: 1740 Magic number(s): none 1742 File extension(s): sensmlx 1744 Macintosh file type code(s): none 1746 Person & email address to contact for further information: Cullen 1747 Jennings 1749 Intended usage: COMMON 1751 Restrictions on usage: None 1753 Author: Cullen Jennings 1755 Change controller: IESG 1757 12.3.7. senml+exi Media Type Registration 1759 Type name: application 1761 Subtype name: senml+exi 1763 Required parameters: none 1765 Optional parameters: none 1766 Encoding considerations: Must be encoded as using 1767 [W3C.REC-exi-20140211]. See RFC-AAAA for details. 1769 Security considerations: See Section 13 of RFC-AAAA. 1771 Interoperability considerations: Applications should ignore any XML 1772 tags or attributes that they do not understand. This allows 1773 backwards compatibility extensions to this specification. The "bver" 1774 attribute in the senml XML tag can be used to ensure the receiver 1775 supports a minimal level of functionality needed by the creator of 1776 the XML. Further information on using schemas to guide the EXI can 1777 be found in RFC-AAAA. 1779 Published specification: RFC-AAAA 1781 Applications that use this media type: The type is used by systems 1782 that report e.g., electrical power usage and environmental 1783 information such as temperature and humidity. It can be used for a 1784 wide range of sensor reporting systems. 1786 Fragment identifier considerations: Fragment identification for 1787 application/senml+exi is supported by using fragment identifiers as 1788 specified by RFC-AAAA. 1790 Additional information: 1792 Magic number(s): none 1794 File extension(s): senmle 1796 Macintosh file type code(s): none 1798 Macintosh Universal Type Identifier code: org.ietf.senml-exi conforms 1799 to public.data 1801 Person & email address to contact for further information: Cullen 1802 Jennings 1804 Intended usage: COMMON 1806 Restrictions on usage: None 1808 Author: Cullen Jennings 1810 Change controller: IESG 1812 12.3.8. sensml+exi Media Type Registration 1814 Type name: application 1816 Subtype name: sensml+exi 1818 Required parameters: none 1820 Optional parameters: none 1822 Encoding considerations: Must be encoded as using 1823 [W3C.REC-exi-20140211]. See RFC-AAAA for details. 1825 Security considerations: See Section 13 of RFC-AAAA. 1827 Interoperability considerations: Applications should ignore any XML 1828 tags or attributes that they do not understand. This allows 1829 backwards compatibility extensions to this specification. The "bver" 1830 attribute in the senml XML tag can be used to ensure the receiver 1831 supports a minimal level of functionality needed by the creator of 1832 the XML. Further information on using schemas to guide the EXI can 1833 be found in RFC-AAAA. 1835 Published specification: RFC-AAAA 1837 Applications that use this media type: The type is used by systems 1838 that report e.g., electrical power usage and environmental 1839 information such as temperature and humidity. It can be used for a 1840 wide range of sensor reporting systems. 1842 Fragment identifier considerations: Fragment identification for 1843 application/senml+exi is supported by using fragment identifiers as 1844 specified by RFC-AAAA. 1846 Additional information: 1848 Magic number(s): none 1850 File extension(s): sensmle 1852 Macintosh file type code(s): none 1854 Person & email address to contact for further information: Cullen 1855 Jennings 1857 Intended usage: COMMON 1859 Restrictions on usage: None 1860 Author: Cullen Jennings 1862 Change controller: IESG 1864 12.4. XML Namespace Registration 1866 This document registers the following XML namespaces in the IETF XML 1867 registry defined in [RFC3688]. 1869 URI: urn:ietf:params:xml:ns:senml 1871 Registrant Contact: The IESG. 1873 XML: N/A, the requested URIs are XML namespaces 1875 12.5. CoAP Content-Format Registration 1877 IANA is requested to assign CoAP Content-Format IDs for the SenML 1878 media types in the "CoAP Content-Formats" sub-registry, within the 1879 "CoRE Parameters" registry [RFC7252]. All IDs are assigned from the 1880 "Expert Review" (0-255) range. The assigned IDs are show in Table 8. 1882 +-------------------------+-----+ 1883 | Media type | ID | 1884 +-------------------------+-----+ 1885 | application/senml+json | TBD | 1886 | application/sensml+json | TBD | 1887 | application/senml+cbor | TBD | 1888 | application/sensml+cbor | TBD | 1889 | application/senml+xml | TBD | 1890 | application/sensml+xml | TBD | 1891 | application/senml+exi | TBD | 1892 | application/sensml+exi | TBD | 1893 +-------------------------+-----+ 1895 Table 8: CoAP Content-Format IDs 1897 13. Security Considerations 1899 Sensor data can contain a wide range of information ranging from 1900 information that is very public, such as the outside temperature in a 1901 given city, to very private information that requires integrity and 1902 confidentiality protection, such as patient health information. The 1903 SenML format does not provide any security and instead relies on the 1904 protocol that carries it to provide security. Applications using 1905 SenML need to look at the overall context of how this media type will 1906 be used to decide if the security is adequate. 1908 See also Section 14. 1910 14. Privacy Considerations 1912 Sensor data can range from information with almost no security 1913 considerations, such as the current temperature in a given city, to 1914 highly sensitive medical or location data. This specification 1915 provides no security protection for the data but is meant to be used 1916 inside another container or transport protocol such as S/MIME or HTTP 1917 with TLS that can provide integrity, confidentiality, and 1918 authentication information about the source of the data. 1920 The name fields need to uniquely identify the sources or destinations 1921 of the values in a SenML Pack. However, the use of long-term stable 1922 unique identifiers can be problematic for privacy reasons [RFC6973], 1923 depending on the application and the potential of these identifiers 1924 to be used in correlation with other information. They should be 1925 used with care or avoided as for example described for IPv6 addresses 1926 in [RFC7721]. 1928 15. Acknowledgement 1930 We would like to thank Alexander Pelov, Andrew McClure, Andrew 1931 McGregor, Bjoern Hoehrmann, Christian Amsuess, Christian Groves, 1932 Daniel Peintner, Jan-Piet Mens, Jim Schaad, Joe Hildebrand, John 1933 Klensin, Karl Palsson, Lennart Duhrsen, Lisa Dusseault, Lyndsay 1934 Campbell, Martin Thomson, Michael Koster, Peter Saint-Andre, and 1935 Stephen Farrell, for their review comments. 1937 16. References 1939 16.1. Normative References 1941 [BIPM] Bureau International des Poids et Mesures, "The 1942 International System of Units (SI)", 8th edition, 2006. 1944 [IEEE.754.1985] 1945 Institute of Electrical and Electronics Engineers, 1946 "Standard for Binary Floating-Point Arithmetic", IEEE 1947 Standard 754, August 1985. 1949 [NIST811] Thompson, A. and B. Taylor, "Guide for the Use of the 1950 International System of Units (SI)", NIST Special 1951 Publication 811, 2008. 1953 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1954 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 1955 RFC2119, March 1997, . 1958 [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, 1959 DOI 10.17487/RFC3688, January 2004, . 1962 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1963 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 1964 . 1966 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1967 Specifications and Registration Procedures", BCP 13, RFC 1968 6838, DOI 10.17487/RFC6838, January 2013, 1969 . 1971 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 1972 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 1973 October 2013, . 1975 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 1976 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 1977 2014, . 1979 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1980 Application Protocol (CoAP)", RFC 7252, DOI 10.17487/ 1981 RFC7252, June 2014, . 1984 [RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, 1985 DOI 10.17487/RFC7303, July 2014, . 1988 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 1989 Writing an IANA Considerations Section in RFCs", BCP 26, 1990 RFC 8126, DOI 10.17487/RFC8126, June 2017, 1991 . 1993 [W3C.REC-exi-20140211] 1994 Schneider, J., Kamiya, T., Peintner, D., and R. Kyusakov, 1995 "Efficient XML Interchange (EXI) Format 1.0 (Second 1996 Edition)", World Wide Web Consortium Recommendation REC- 1997 exi-20140211, February 2014, 1998 . 2000 [W3C.REC-xml-20081126] 2001 Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and 2002 F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth 2003 Edition)", World Wide Web Consortium Recommendation REC- 2004 xml-20081126, November 2008, 2005 . 2007 16.2. Informative References 2009 [I-D.arkko-core-dev-urn] 2010 Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource 2011 Names for Device Identifiers", draft-arkko-core-dev-urn-05 2012 (work in progress), October 2017. 2014 [I-D.ietf-cbor-cddl] 2015 Birkholz, H., Vigano, C., and C. Bormann, "Concise data 2016 definition language (CDDL): a notational convention to 2017 express CBOR data structures", draft-ietf-cbor-cddl-00 2018 (work in progress), July 2017. 2020 [I-D.ietf-core-interfaces] 2021 Shelby, Z., Vial, M., Koster, M., Groves, C., Zhu, J., and 2022 B. Silverajan, "Reusable Interface Definitions for 2023 Constrained RESTful Environments", draft-ietf-core- 2024 interfaces-10 (work in progress), September 2017. 2026 [IEEE802.1as-2011] 2027 IEEE, "IEEE Standard for Local and Metropolitan Area 2028 Networks - Timing and Synchronization for Time-Sensitive 2029 Applications in Bridged Local Area Networks", 2011. 2031 [IEEE802.1ba-2011] 2032 IEEE, "IEEE Standard for Local and metropolitan area 2033 networks--Audio Video Bridging (AVB) Systems", 2011. 2035 [ISO-80000-5] 2036 "Quantities and units - Part 5: Thermodynamics", ISO 2037 80000-5, Edition 1.0, May 2007. 2039 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2040 Resource Identifier (URI): Generic Syntax", STD 66, RFC 2041 3986, DOI 10.17487/RFC3986, January 2005, 2042 . 2044 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 2045 Unique IDentifier (UUID) URN Namespace", RFC 4122, DOI 2046 10.17487/RFC4122, July 2005, . 2049 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 2050 "Transmission of IPv6 Packets over IEEE 802.15.4 2051 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 2052 . 2054 [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 2055 Address Text Representation", RFC 5952, DOI 10.17487/ 2056 RFC5952, August 2010, . 2059 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 2060 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 2061 . 2063 [RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., 2064 Morris, J., Hansen, M., and R. Smith, "Privacy 2065 Considerations for Internet Protocols", RFC 6973, DOI 2066 10.17487/RFC6973, July 2013, . 2069 [RFC7111] Hausenblas, M., Wilde, E., and J. Tennison, "URI Fragment 2070 Identifiers for the text/csv Media Type", RFC 7111, DOI 2071 10.17487/RFC7111, January 2014, . 2074 [RFC7721] Cooper, A., Gont, F., and D. Thaler, "Security and Privacy 2075 Considerations for IPv6 Address Generation Mechanisms", 2076 RFC 7721, DOI 10.17487/RFC7721, March 2016, 2077 . 2079 [RFC8141] Saint-Andre, P. and J. Klensin, "Uniform Resource Names 2080 (URNs)", RFC 8141, DOI 10.17487/RFC8141, April 2017, 2081 . 2083 [UCUM] Schadow, G. and C. McDonald, "The Unified Code for Units 2084 of Measure (UCUM)", Regenstrief Institute and Indiana 2085 University School of Informatics, 2013, 2086 . 2088 Authors' Addresses 2090 Cullen Jennings 2091 Cisco 2092 400 3rd Avenue SW 2093 Calgary, AB T2P 4H2 2094 Canada 2096 Email: fluffy@iii.ca 2097 Zach Shelby 2098 ARM 2099 150 Rose Orchard 2100 San Jose 95134 2101 USA 2103 Phone: +1-408-203-9434 2104 Email: zach.shelby@arm.com 2106 Jari Arkko 2107 Ericsson 2108 Jorvas 02420 2109 Finland 2111 Email: jari.arkko@piuha.net 2113 Ari Keranen 2114 Ericsson 2115 Jorvas 02420 2116 Finland 2118 Email: ari.keranen@ericsson.com 2120 Carsten Bormann 2121 Universitaet Bremen TZI 2122 Postfach 330440 2123 Bremen D-28359 2124 Germany 2126 Phone: +49-421-218-63921 2127 Email: cabo@tzi.org