--- 1/draft-ietf-core-senml-04.txt 2017-03-13 09:14:18.819380990 -0700 +++ 2/draft-ietf-core-senml-05.txt 2017-03-13 09:14:18.903382968 -0700 @@ -1,24 +1,24 @@ Network Working Group C. Jennings Internet-Draft Cisco Intended status: Standards Track Z. Shelby -Expires: May 4, 2017 ARM +Expires: September 14, 2017 ARM J. Arkko A. Keranen Ericsson C. Bormann Universitaet Bremen TZI - October 31, 2016 + March 13, 2017 Media Types for Sensor Measurement Lists (SenML) - draft-ietf-core-senml-04 + draft-ietf-core-senml-05 Abstract This specification defines media types for representing simple sensor measurements and device parameters in the Sensor Measurement Lists (SenML). Representations are defined in JavaScript Object Notation (JSON), Concise Binary Object Representation (CBOR), eXtensible Markup Language (XML), and Efficient XML Interchange (EXI), which share the common SenML data model. A simple sensor, such as a temperature sensor, could use this media type in protocols such as @@ -33,25 +33,25 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on May 4, 2017. + This Internet-Draft will expire on September 14, 2017. Copyright Notice - Copyright (c) 2016 IETF Trust and the persons identified as the + Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as @@ -73,56 +73,60 @@ 5.1.1. Single Datapoint . . . . . . . . . . . . . . . . . . 10 5.1.2. Multiple Datapoints . . . . . . . . . . . . . . . . . 10 5.1.3. Multiple Measurements . . . . . . . . . . . . . . . . 11 5.1.4. Resolved Data . . . . . . . . . . . . . . . . . . . . 12 5.1.5. Multiple Data Types . . . . . . . . . . . . . . . . . 13 5.1.6. Collection of Resources . . . . . . . . . . . . . . . 13 5.1.7. Setting an Actuator . . . . . . . . . . . . . . . . . 14 6. CBOR Representation (application/senml+cbor) . . . . . . . . 15 7. XML Representation (application/senml+xml) . . . . . . . . . 17 8. EXI Representation (application/senml+exi) . . . . . . . . . 19 - 9. Usage Considerations . . . . . . . . . . . . . . . . . . . . 22 - 10. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 - 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 - 11.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 25 - 11.2. SenML Label Registry . . . . . . . . . . . . . . . . . . 28 - 11.3. Media Type Registration . . . . . . . . . . . . . . . . 29 - 11.3.1. senml+json Media Type Registration . . . . . . . . . 29 - 11.3.2. senml+cbor Media Type Registration . . . . . . . . . 31 - 11.3.3. senml+xml Media Type Registration . . . . . . . . . 32 - 11.3.4. senml+exi Media Type Registration . . . . . . . . . 33 - - 11.4. XML Namespace Registration . . . . . . . . . . . . . . . 34 - 11.5. CoAP Content-Format Registration . . . . . . . . . . . . 34 - 12. Security Considerations . . . . . . . . . . . . . . . . . . . 35 - 13. Privacy Considerations . . . . . . . . . . . . . . . . . . . 35 - 14. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 35 - 15. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 - 15.1. Normative References . . . . . . . . . . . . . . . . . . 35 - 15.2. Informative References . . . . . . . . . . . . . . . . . 37 - Appendix A. Links Extension . . . . . . . . . . . . . . . . . . 38 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38 + 9. Fragment Identification Methods . . . . . . . . . . . . . . . 22 + 9.1. Fragment Identification Examples . . . . . . . . . . . . 22 + 10. Usage Considerations . . . . . . . . . . . . . . . . . . . . 23 + 11. CDDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 + 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 + 12.1. Units Registry . . . . . . . . . . . . . . . . . . . . . 26 + 12.2. SenML Label Registry . . . . . . . . . . . . . . . . . . 29 + 12.3. Media Type Registration . . . . . . . . . . . . . . . . 30 + 12.3.1. senml+json Media Type Registration . . . . . . . . . 30 + 12.3.2. sensml+json Media Type Registration . . . . . . . . 32 + 12.3.3. senml+cbor Media Type Registration . . . . . . . . . 33 + 12.3.4. sensml+cbor Media Type Registration . . . . . . . . 34 + 12.3.5. senml+xml Media Type Registration . . . . . . . . . 36 + 12.3.6. sensml+xml Media Type Registration . . . . . . . . . 37 + 12.3.7. senml+exi Media Type Registration . . . . . . . . . 38 + 12.3.8. sensml+exi Media Type Registration . . . . . . . . . 40 + 12.4. XML Namespace Registration . . . . . . . . . . . . . . . 41 + 12.5. CoAP Content-Format Registration . . . . . . . . . . . . 41 + 13. Security Considerations . . . . . . . . . . . . . . . . . . . 42 + 14. Privacy Considerations . . . . . . . . . . . . . . . . . . . 42 + 15. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 42 + 16. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 + 16.1. Normative References . . . . . . . . . . . . . . . . . . 42 + 16.2. Informative References . . . . . . . . . . . . . . . . . 44 + Appendix A. Links Extension . . . . . . . . . . . . . . . . . . 45 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 45 1. Overview Connecting sensors to the Internet is not new, and there have been many protocols designed to facilitate it. This specification defines new media types for carrying simple sensor information in a protocol such as HTTP or CoAP. This format was designed so that processors with very limited capabilities could easily encode a sensor measurement into the media type, while at the same time a server parsing the data could relatively efficiently collect a large number - of sensor measurements. The markup language can be used for a - variety of data flow models, most notably data feeds pushed from a - sensor to a collector, and the web resource model where the sensor is - requested as a resource representation (e.g., "GET /sensor/ - temperature"). + of sensor measurements. SenML can be used for a variety of data flow + models, most notably data feeds pushed from a sensor to a collector, + and the web resource model where the sensor is requested as a + resource representation (e.g., "GET /sensor/temperature"). There are many types of more complex measurements and measurements that this media type would not be suitable for. SenML strikes a balance between having some information about the sensor carried with the sensor data so that the data is self describing but it also tries to make that a fairly minimal set of auxiliary information for efficiency reason. Other information about the sensor can be discovered by other methods such as using the CoRE Link Format [RFC6690]. @@ -192,26 +196,26 @@ In the above example the Base Name is in the "bn" tag and the "n" tags in each Record are the empty string so they are omitted. Some devices have accurate time while others do not so SenML supports absolute and relative times. Time is represented in floating point as seconds and values greater than zero represent an absolute time relative to the Unix epoch while values of 0 or less represent a relative time in the past from the current time. A simple sensor with no absolute wall clock time might take a measurement every - second and batch up 60 of them then send it to a server. It would - include the relative time the measurement was made to the time the - batch was send in the SenML Pack. The server might have accurate NTP - time and use the time it received the data, and the relative offset, - to replace the times in the SenML with absolute times before saving - the SenML Pack in a document database. + second, batch up 60 of them, and then send the batch to a server. It + would include the relative time each measurement was made compared to + the time the batch was sent in each SenML Record. The server might + have accurate NTP time and use the time it received the data, and the + relative offset, to replace the times in the SenML with absolute + times before saving the SenML Pack in a document database. 3. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. This document also uses the following terms: @@ -283,21 +287,21 @@ Time: Time when value was recorded. Optional. Update Time: An optional time in seconds that represents the maximum time before this sensor will provide an updated reading for a measurement. This can be used to detect the failure of sensors or communications path from the sensor. 4.3. Considerations The SenML format can be extended with further custom attributes. - Both new base and regular attributes are allowed. See Section 11.2 + Both new base and regular attributes are allowed. See Section 12.2 for details. Implementations MUST ignore attributes they don't recognize. Systems reading one of the objects MUST check for the Version attribute. If this value is a version number larger than the version which the system understands, the system SHOULD NOT use this object. This allows the version number to indicate that the object contains mandatory to understand attributes. New version numbers can only be defined in an RFC that updates this specification or it successors. @@ -464,21 +468,21 @@ {"n":"current","t":-1,"v":1.6}, {"n":"current","v":1.7} ] Note that in some usage scenarios of SenML the implementations MAY store or transmit SenML in a stream-like fashion, where data is collected over time and continuously added to the object. This mode of operation is optional, but systems or protocols using SenML in this fashion MUST specify that they are doing this. SenML defines a separate media type to indicate Sensor Streaming Measurement Lists - (SensML) for this usage (see Section 11.3.1). In this situation the + (SensML) for this usage (see Section 12.3.1). In this situation the SensML stream can be sent and received in a partial fashion, i.e., a measurement entry can be read as soon as the SenML Record is received and not have to wait for the full SensML Stream to be complete. For instance, the following stream of measurements may be sent via a long lived HTTP POST from the producer of a SensML to the consumer of that, and each measurement object may be reported at the time it was measured: [ @@ -524,21 +528,21 @@ The size of this example represented in various forms, as well as that form compressed with gzip is given in the following table. +----------+------+-----------------+ | Encoding | Size | Compressed Size | +----------+------+-----------------+ | JSON | 573 | 206 | | XML | 649 | 235 | | CBOR | 254 | 196 | - | EXI | 174 | 197 | + | EXI | 162 | 185 | +----------+------+-----------------+ Table 2: Size Comparisons Note the EXI sizes are not using the schema guidance so the EXI representation could be a bit smaller. 5.1.4. Resolved Data The following shows the example from the previous section show in @@ -807,27 +811,28 @@ For efficient transmission of SenML over e.g. a constrained network, Efficient XML Interchange (EXI) can be used. This encodes the XML Schema structure of SenML into binary tags and values rather than ASCII text. An EXI representation of SenML SHOULD be made using the strict schema-mode of EXI. This mode however does not allow tag extensions to the schema, and therefore any extensions will be lost in the encoding. For uses where extensions need to be preserved in EXI, the non-strict schema mode of EXI MAY be used. - The EXI header option MUST be included. An EXI schemaID options MUST - be set to the value of "a" indicating the scheme provided in this - specification. Future revisions to the schema can change this - schemaID to allow for backwards compatibility. When the data will be - transported over CoAP or HTTP, an EXI Cookie SHOULD NOT be used as it - simply makes things larger and is redundant to information provided - in the Content-Type header. + The EXI header MUST include an "EXI Options", as defined in + [W3C.REC-exi-20140211], with an schemaId set to the value of "a" + indicating the schema provided in this specification. Future + revisions to the schema can change the value of the schemaId to allow + for backwards compatibility. When the data will be transported over + CoAP or HTTP, an EXI Cookie SHOULD NOT be used as it simply makes + things larger and is redundant to information provided in the + Content-Type header. The following is the XSD Schema to be used for strict schema guided EXI processing. It is generated from the RelaxNG. @@ -864,64 +869,110 @@ the first example in Section 5.1.2 in JSON format. Which compresses with EXI to the following displayed in hexdump: - 0000 a0 30 3d cd 95 b9 b5 b0 b9 9d 95 b8 b9 e1 cd 90 |.0=.............| - 0010 80 79 d5 c9 b8 e9 91 95 d8 e9 bd dc e8 c4 c1 94 |.y..............| - 0020 c8 c0 dc cd 84 c0 c4 c0 e0 c0 c0 d8 cc ed 82 5d |...............]| - 0030 9b db 1d 18 59 d9 48 0d 58 ac 42 60 18 e1 2c 6e |....Y.H.X.B`..,n| - 0040 ae 4e 4c ad ce 84 06 82 41 90 0e |.NL.....A..| - 004b + 0000 a0 30 0d 84 80 79 d5 c9 b8 e9 91 95 d8 e9 bd dc |.0...y..........| + 0010 e8 c4 c1 94 c8 c0 dc cd 84 c0 c4 c0 e0 c0 c0 d8 |................| + 0020 cc ed 82 5d 9b db 1d 18 59 d9 48 0d 58 ac 42 60 |...]....Y.H.X.B`| + 0030 18 e1 2c 6e ae 4e 4c ad ce 84 06 82 41 90 0e |..,n.NL.....A..| + 003f The above example used the bit packed form of EXI but it is also possible to use a byte packed form of EXI which can makes it easier for a simple sensor to produce valid EXI without really implementing EXI. Consider the example of a temperature sensor that produces a value in tenths of degrees Celsius over a range of 0.0 to 55.0. It would produce an XML SenML file such as: The compressed form, using the byte alignment option of EXI, for the above XML is the following: - 0000 a0 00 48 81 ee 6c ad cd ad 85 cc ec ad c5 cf 0e |..H..l..........| - 0010 6c 80 01 07 1d 75 72 6e 3a 64 65 76 3a 6f 77 3a |l....urn:dev:ow:| - 0020 31 30 65 32 30 37 33 61 30 31 30 38 30 30 36 33 |10e2073a01080063| - 0030 02 05 43 65 6c 01 00 e7 01 01 00 03 01 |..Cel........| - 003d + 0000 a0 00 48 80 6c 20 01 07 1d 75 72 6e 3a 64 65 76 |..H.l ...urn:dev| + 0010 3a 6f 77 3a 31 30 65 32 30 37 33 61 30 31 30 38 |:ow:10e2073a0108| + 0020 30 30 36 33 02 05 43 65 6c 01 00 e7 01 01 00 03 |0063..Cel.......| + 0030 01 |.| + 0031 A small temperature sensor devices that only generates this one EXI file does not really need an full EXI implementation. It can simply hard code the output replacing the 1-wire device ID starting at byte 0x20 and going to byte 0x2F with it's device ID, and replacing the value "0xe7 0x01" at location 0x37 and 0x38 with the current temperature. The EXI Specification [W3C.REC-exi-20140211] contains the full information 'on how floating point numbers are represented, but for the purpose of this sensor, the temperature can be converted to an integer in tenths of degrees (231 in this example). EXI stores 7 bits of the integer in each byte with the top bit set to one if there are further bytes. So the first bytes at is set to low 7 bits of the integer temperature in tenths of degrees plus 0x80. In this example 231 & 0x7F + 0x80 = 0xE7. The second byte is set to the integer temperature in tenths of degrees right shifted 7 bits. In this example 231 >> 7 = 0x01. -9. Usage Considerations +9. Fragment Identification Methods + + A SenML Pack typically consists of multiple SenML Records and for + some applications it may be useful to be able to refer with a + Fragment Identifier to a single record, or a set of records, in a + Pack. The fragment identifier is only interpreted by a client and + does not impact retrieval of a representation. The SenML Fragment + Identification is modeled after CSV Fragment Identifiers [RFC7111]. + + To select a single SenML Record, the "rec" scheme followed by a + single number is used. For the purpose of numbering records, the + first record is at position 1. A range of records can be selected by + giving the first and the last record number separated by a '-' + character. Instead of the second number, the "*" character can be + used to indicate the last Senml Record in the Pack. A set of records + can also be selected using a comma separated list of record positions + or ranges. + + (We use the term "selecting a record" for identifying it as part of + the fragment, not in the sense of isolating it from the Pack -- the + record still needs to be interpreted as part of the Pack, e.g., using + the base values defined in record 1.) + +9.1. Fragment Identification Examples + + The 3rd SenML Record from "coap://example.com/temp" resource can be + selected with: + + coap://example.com/temp#rec=3 + + Records from 3rd to 6th can be selected with: + + coap://example.com/temp#rec=3-6 + + Records from 19th to the last can be selected with: + + coap://example.com/temp#rec=19-* + + The 3rd and 5th record can be selected with: + + coap://example.com/temp#rec=3,5 + + To select the Records from third to fifth, the 10th record, and all + from 19th to the last: + + coap://example.com/temp#rec=3-5,10,19-* + +10. Usage Considerations The measurements support sending both the current value of a sensor as well as the an integrated sum. For many types of measurements, the sum is more useful than the current value. For example, an electrical meter that measures the energy a given computer uses will typically want to measure the cumulative amount of energy used. This is less prone to error than reporting the power each second and trying to have something on the server side sum together all the power measurements. If the network between the sensor and the meter goes down over some period of time, when it comes back up, the @@ -954,49 +1005,51 @@ 3. Applications cannot make assumptions about when the device started accumulating values into the sum. Typically applications can make some assumptions about specific sensors that will allow them to deal with these problems. A common assumption is that for sensors whose measurement values are always positive, the sum should never get smaller; so if the sum does get smaller, the application will know that one of the situations listed above has happened. -10. CDDL +11. CDDL For reference, the JSON and CBOR representations can be described with the common CDDL [I-D.greevenbosch-appsawg-cbor-cddl] specification in Figure 1. SenML-Pack = [initial-record, * follow-on-record] initial-record = initial-defined .and initial-generic follow-on-record = follow-on-defined .and follow-on-generic ; first do a specification of the labels as defined: initial-defined = { ? bn => tstr, ; Base Name ? bt => numeric, ; Base Time ? bu => tstr, ; Base Units ? bv => numeric, ; Base value + ? bs => numeric, ; Base sum ? bver => uint, ; Base Version follow-on-defined-group, + base-key-value-pair } follow-on-defined-group = ( ? n => tstr, ; Name ? u => tstr, ; Units ? s => numeric, ; Value Sum ? t => numeric, ; Time ? ut => numeric, ; Update Time + ? l => tstr, ; Link * key-value-pair, ? ( v => numeric // ; Numeric Value vs => tstr // ; String Value vb => bool // ; Boolean Value vd => binary-value ) ; Data Value ) follow-on-defined = { follow-on-defined-group } ; now define the generic versions @@ -1023,43 +1077,45 @@ Figure 1: Common CDDL specification for CBOR and JSON SenML For JSON, we use text labels and base64url-encoded binary data (Figure 2). bver = "bver" n = "n" s = "s" bn = "bn" u = "u" t = "t" bt = "bt" v = "v" ut = "ut" bu = "bu" vs = "vs" vd = "vd" bv = "bv" vb = "vb" l = "l" + bs = "bs" binary-value = tstr ; base64url encoded Figure 2: JSON-specific CDDL specification for SenML For CBOR, we use integer labels and native binary data (Figure 3). bver = -1 n = 0 s = 5 bn = -2 u = 1 t = 6 bt = -3 v = 2 ut = 7 bu = -4 vs = 3 vd = 8 bv = -5 vb = 4 l = 9 + bs = -6 binary-value = bstr Figure 3: CBOR-specific CDDL specification for SenML -11. IANA Considerations +12. IANA Considerations Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with the RFC number of this specification. -11.1. Units Registry +12.1. Units Registry IANA will create a registry of SenML unit symbols. The primary purpose of this registry is to make sure that symbols uniquely map to give type of measurement. Definitions for many of these units can be found in location such as [NIST811] and [BIPM]. Units marked with an asterisk are NOT RECOMMENDED to be produced by new implementations, but are in active use and SHOULD be implemented by consumers that can use the related base units. +----------+------------------------------------+-------+-----------+ @@ -1196,21 +1252,21 @@ allocated. 10. A number after a unit typically indicates the previous unit raised to that power, and the / indicates that the units that follow are the reciprocal. A unit should have only one / in the name. 11. A good list of common units can be found in the Unified Code for Units of Measure [UCUM]. -11.2. SenML Label Registry +12.2. SenML Label Registry IANA will create a new registry for SenML labels. The initial content of the registry is: +---------------+-------+------+----------+----+---------+ | Name | Label | CBOR | XML Type | ID | Note | +---------------+-------+------+----------+----+---------+ | Base Name | bn | -2 | string | a | RFCXXXX | | Base Sum | bs | -6 | double | a | RFCXXXX | | Base Time | bt | -3 | double | a | RFCXXXX | @@ -1229,23 +1285,23 @@ | Link | l | 9 | string | a | RFCXXXX | +---------------+-------+------+----------+----+---------+ Table 6: SenML Labels Note to RFC Editor. Please replace RFCXXXX with the number for this RFC. All new entries must define the Label Name, Label, and XML Type but the CBOR labels SHOULD be left empty as CBOR will use the string - encoding for any new labels. The ID fields contains the EXI schemaID - of the first Schema which includes this label or is empty if this - label was not intended for use with EXI. The Note field SHOULD + encoding for any new labels. The ID fields contains the EXI schemaId + value of the first Schema which includes this label or is empty if + this label was not intended for use with EXI. The Note field SHOULD contain information about where to find out more information about this label. The JSON, CBOR, and EXI types are derived from the XML type. All XML numeric types such as double, float, integer and int become a JSON Number. XML boolean and string become a JSON Boolean and String respectively. CBOR represents numeric values with a CBOR type that does not loose any information from the JSON value. EXI uses the XML types. @@ -1257,44 +1313,113 @@ All new SenML labels that have "base" semantics (see Section 4.1) MUST start with character 'b'. Regular labels MUST NOT start with that character. Extensions that add a label that is intended for use with XML need to create a new RelaxNG scheme that includes all the labels in the IANA registry. Extensions that add a label that is intended for use with EXI need to create a new XSD Schema that includes all the labels in the IANA - registry then allocate a new EXI schemaID. Moving to the next letter - in the alphabet is the suggested way to create the new EXI schemaID. - Any labels with previously blank ID values SHOULD be updated in the - IANA table to have their ID set to this new schemaID value. + registry then allocate a new EXI schemaId value. Moving to the next + letter in the alphabet is the suggested way to create the new value + for the EXI schemaId. Any labels with previously blank ID values + SHOULD be updated in the IANA table to have their ID set to this new + schemaId value. -11.3. Media Type Registration +12.3. Media Type Registration The following registrations are done following the procedure - specified in [RFC6838] and [RFC7303]. + specified in [RFC6838] and [RFC7303]. Clipboard formats are defined + for the JSON and XML form of lists but do not make sense for streams + or other formats. Note to RFC Editor - please remove this paragraph. Note that a request for media type review for senml+json was sent to the media- types@iana.org on Sept 21, 2010. A second request for all the types - was sent on October 7, 2016. + was sent on October 31, 2016. -11.3.1. senml+json Media Type Registration +12.3.1. senml+json Media Type Registration Type name: application - Subtype name: senml+json and sensml+json + Subtype name: senml+json + + Required parameters: none + Optional parameters: none + + Encoding considerations: Must be encoded as using a subset of the + encoding allowed in [RFC7159]. See RFC-AAAA for details. This + simplifies implementation of very simple system and does not impose + any significant limitations as all this data is meant for machine to + machine communications and is not meant to be human readable. + + Security considerations: Sensor data can contain a wide range of + information ranging from information that is very public, such the + outside temperature in a given city, to very private information that + requires integrity and confidentiality protection, such as patient + health information. This format does not provide any security and + instead relies on the transport protocol that carries it to provide + security. Given applications need to look at the overall context of + how this media type will be used to decide if the security is + adequate. + + Interoperability considerations: Applications should ignore any JSON + key value pairs that they do not understand. This allows backwards + compatibility extensions to this specification. The "bver" field can + be used to ensure the receiver supports a minimal level of + functionality needed by the creator of the JSON object. + + Published specification: RFC-AAAA + + Applications that use this media type: The type is used by systems + that report e.g., electrical power usage and environmental + information such as temperature and humidity. It can be used for a + wide range of sensor reporting systems. + + Fragment identifier considerations: Fragment identification for + application/senml+json is supported by using fragment identifiers as + specified by RFC-AAAA. + + Additional information: + + Magic number(s): none + + File extension(s): senml + + Windows Clipboard Name: "JSON Sensor Measurement List" + + Macintosh file type code(s): none + + Macintosh Universal Type Identifier code: org.ietf.senml-json + conforms to public.text + Person & email address to contact for further information: Cullen + Jennings + + Intended usage: COMMON + + Restrictions on usage: None + + Author: Cullen Jennings + + Change controller: IESG + +12.3.2. sensml+json Media Type Registration + + Type name: application + + Subtype name: sensml+json Required parameters: none Optional parameters: none + Encoding considerations: Must be encoded as using a subset of the encoding allowed in [RFC7159]. See RFC-AAAA for details. This simplifies implementation of very simple system and does not impose any significant limitations as all this data is meant for machine to machine communications and is not meant to be human readable. Security considerations: Sensor data can contain a wide range of information ranging from information that is very public, such the outside temperature in a given city, to very private information that requires integrity and confidentiality protection, such as patient @@ -1310,44 +1435,48 @@ be used to ensure the receiver supports a minimal level of functionality needed by the creator of the JSON object. Published specification: RFC-AAAA Applications that use this media type: The type is used by systems that report e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems. + Fragment identifier considerations: Fragment identification for + application/senml+json is supported by using fragment identifiers as + specified by RFC-AAAA. + Additional information: Magic number(s): none - File extension(s): senml and sensml + File extension(s): sensml Macintosh file type code(s): none Person & email address to contact for further information: Cullen Jennings Intended usage: COMMON Restrictions on usage: None Author: Cullen Jennings Change controller: IESG -11.3.2. senml+cbor Media Type Registration +12.3.3. senml+cbor Media Type Registration Type name: application - Subtype name: senml+cbor and sensml+cbor + Subtype name: senml+cbor Required parameters: none Optional parameters: none Encoding considerations: Must be encoded as using [RFC7049]. See RFC-AAAA for details. Security considerations: Sensor data can contain a wide range of information ranging from information that is very public, such the @@ -1365,43 +1494,109 @@ be used to ensure the receiver supports a minimal level of functionality needed by the creator of the CBOR object. Published specification: RFC-AAAA Applications that use this media type: The type is used by systems that report e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems. + Fragment identifier considerations: Fragment identification for + application/senml+cbor is supported by using fragment identifiers as + specified by RFC-AAAA. + Additional information: Magic number(s): none - File extension(s): senmlc and sensmlc + File extension(s): senmlc Macintosh file type code(s): none + Macintosh Universal Type Identifier code: org.ietf.senml-cbor + conforms to public.data + Person & email address to contact for further information: Cullen Jennings Intended usage: COMMON + Restrictions on usage: None Author: Cullen Jennings Change controller: IESG -11.3.3. senml+xml Media Type Registration +12.3.4. sensml+cbor Media Type Registration Type name: application - Subtype name: senml+xml and sensml+xml + Subtype name: sensml+cbor + + Required parameters: none + + Optional parameters: none + Encoding considerations: Must be encoded as using [RFC7049]. See + RFC-AAAA for details. + + Security considerations: Sensor data can contain a wide range of + information ranging from information that is very public, such the + outside temperature in a given city, to very private information that + requires integrity and confidentiality protection, such as patient + health information. This format does not provide any security and + instead relies on the transport protocol that carries it to provide + security. Given applications need to look at the overall context of + how this media type will be used to decide if the security is + adequate. + + Interoperability considerations: Applications should ignore any key + value pairs that they do not understand. This allows backwards + compatibility extensions to this specification. The "bver" field can + be used to ensure the receiver supports a minimal level of + functionality needed by the creator of the CBOR object. + + Published specification: RFC-AAAA + + Applications that use this media type: The type is used by systems + that report e.g., electrical power usage and environmental + information such as temperature and humidity. It can be used for a + wide range of sensor reporting systems. + + Fragment identifier considerations: Fragment identification for + application/senml+cbor is supported by using fragment identifiers as + specified by RFC-AAAA. + + Additional information: + + Magic number(s): none + + File extension(s): sensmlc + + Macintosh file type code(s): none + + Person & email address to contact for further information: Cullen + Jennings + + Intended usage: COMMON + + Restrictions on usage: None + + Author: Cullen Jennings + + Change controller: IESG + +12.3.5. senml+xml Media Type Registration + + Type name: application + + Subtype name: senml+xml Required parameters: none Optional parameters: none Encoding considerations: Must be encoded as using [W3C.REC-xml-20081126]. See RFC-AAAA for details. Security considerations: Sensor data can contain a wide range of information ranging from information that is very public, such the @@ -1419,43 +1614,110 @@ in the senml tag can be used to ensure the receiver supports a minimal level of functionality needed by the creator of the XML. Published specification: RFC-AAAA Applications that use this media type: The type is used by systems that report e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems. + Fragment identifier considerations: Fragment identification for + application/senml+xml is supported by using fragment identifiers as + specified by RFC-AAAA. + Additional information: Magic number(s): none - File extension(s): senmlx and sensmlx + File extension(s): senmlx + + Windows Clipboard Name: "XML Sensor Measurement List" Macintosh file type code(s): none + Macintosh Universal Type Identifier code: org.ietf.senml-xml conforms + to public.xml + Person & email address to contact for further information: Cullen Jennings Intended usage: COMMON Restrictions on usage: None Author: Cullen Jennings Change controller: IESG -11.3.4. senml+exi Media Type Registration +12.3.6. sensml+xml Media Type Registration Type name: application - Subtype name: senml+exi and sensml+exi + Subtype name: sensml+xml + + Required parameters: none + + Optional parameters: none + + Encoding considerations: Must be encoded as using + [W3C.REC-xml-20081126]. See RFC-AAAA for details. + + Security considerations: Sensor data can contain a wide range of + information ranging from information that is very public, such the + outside temperature in a given city, to very private information that + requires integrity and confidentiality protection, such as patient + health information. This format does not provide any security and + instead relies on the transport protocol that carries it to provide + security. Given applications need to look at the overall context of + how this media type will be used to decide if the security is + adequate. + + Interoperability considerations: Applications should ignore any tags + or attributes that they do not understand. This allows backwards + compatibility extensions to this specification. The "bver" attribute + in the senml tag can be used to ensure the receiver supports a + minimal level of functionality needed by the creator of the XML. + + Published specification: RFC-AAAA + Applications that use this media type: The type is used by systems + that report e.g., electrical power usage and environmental + information such as temperature and humidity. It can be used for a + wide range of sensor reporting systems. + + Fragment identifier considerations: Fragment identification for + application/senml+xml is supported by using fragment identifiers as + specified by RFC-AAAA. + + Additional information: + + Magic number(s): none + + File extension(s): sensmlx + + Macintosh file type code(s): none + + Person & email address to contact for further information: Cullen + Jennings + + Intended usage: COMMON + + Restrictions on usage: None + + Author: Cullen Jennings + + Change controller: IESG + +12.3.7. senml+exi Media Type Registration + + Type name: application + + Subtype name: senml+exi Required parameters: none Optional parameters: none Encoding considerations: Must be encoded as using [W3C.REC-exi-20140211]. See RFC-AAAA for details. Security considerations: Sensor data can contain a wide range of information ranging from information that is very public, such the @@ -1475,51 +1737,118 @@ Further information on using schemas to guide the EXI can be found in RFC-AAAA. Published specification: RFC-AAAA Applications that use this media type: The type is used by systems that report e.g., electrical power usage and environmental information such as temperature and humidity. It can be used for a wide range of sensor reporting systems. + Fragment identifier considerations: Fragment identification for + application/senml+exi is supported by using fragment identifiers as + specified by RFC-AAAA. + Additional information: Magic number(s): none - File extension(s): senmle and sensmle + File extension(s): senmle Macintosh file type code(s): none + Macintosh Universal Type Identifier code: org.ietf.senml-exi conforms + to public.data + Person & email address to contact for further information: Cullen Jennings Intended usage: COMMON Restrictions on usage: None Author: Cullen Jennings Change controller: IESG -11.4. XML Namespace Registration +12.3.8. sensml+exi Media Type Registration + + Type name: application + + Subtype name: sensml+exi + + Required parameters: none + + Optional parameters: none + + Encoding considerations: Must be encoded as using + [W3C.REC-exi-20140211]. See RFC-AAAA for details. + + Security considerations: Sensor data can contain a wide range of + information ranging from information that is very public, such the + outside temperature in a given city, to very private information that + requires integrity and confidentiality protection, such as patient + health information. This format does not provide any security and + instead relies on the transport protocol that carries it to provide + security. Given applications need to look at the overall context of + how this media type will be used to decide if the security is + adequate. + + Interoperability considerations: Applications should ignore any tags + or attributes that they do not understand. This allows backwards + compatibility extensions to this specification. The "bver" attribute + in the senml tag can be used to ensure the receiver supports a + minimal level of functionality needed by the creator of the XML. + Further information on using schemas to guide the EXI can be found in + RFC-AAAA. + + Published specification: RFC-AAAA + + Applications that use this media type: The type is used by systems + that report e.g., electrical power usage and environmental + information such as temperature and humidity. It can be used for a + wide range of sensor reporting systems. + + Fragment identifier considerations: Fragment identification for + application/senml+exi is supported by using fragment identifiers as + specified by RFC-AAAA. + + Additional information: + + Magic number(s): none + + File extension(s): sensmle + Macintosh file type code(s): none + + Person & email address to contact for further information: Cullen + Jennings + + Intended usage: COMMON + + Restrictions on usage: None + + Author: Cullen Jennings + + Change controller: IESG + +12.4. XML Namespace Registration This document registers the following XML namespaces in the IETF XML registry defined in [RFC3688]. URI: urn:ietf:params:xml:ns:senml Registrant Contact: The IESG. XML: N/A, the requested URIs are XML namespaces -11.5. CoAP Content-Format Registration +12.5. CoAP Content-Format Registration IANA is requested to assign CoAP Content-Format IDs for the SenML media types in the "CoAP Content-Formats" sub-registry, within the "CoRE Parameters" registry [RFC7252]. All IDs are assigned from the "Expert Review" (0-255) range. The assigned IDs are show in Table 7. +-------------------------+-----+ | Media type | ID | +-------------------------+-----+ | application/senml+json | TBD | @@ -1527,115 +1856,115 @@ | application/senml+cbor | TBD | | application/sensml+cbor | TBD | | application/senml+xml | TBD | | application/sensml+xml | TBD | | application/senml+exi | TBD | | application/sensml+exi | TBD | +-------------------------+-----+ Table 7: CoAP Content-Format IDs -12. Security Considerations +13. Security Considerations - See Section 13. Further discussion of security properties can be - found in Section 11.3. + See Section 14. Further discussion of security properties can be + found in Section 12.3. -13. Privacy Considerations +14. Privacy Considerations Sensor data can range from information with almost no security considerations, such as the current temperature in a given city, to highly sensitive medical or location data. This specification provides no security protection for the data but is meant to be used inside another container or transport protocol such as S/MIME or HTTP with TLS that can provide integrity, confidentiality, and authentication information about the source of the data. -14. Acknowledgement +15. Acknowledgement We would like to thank Alexander Pelov, Andrew McClure, Andrew Mcgregor, Bjoern Hoehrmann, Christian Amsuess, Christian Groves, Daniel Peintner, Jan-Piet Mens, Joe Hildebrand, John Klensin, Karl Palsson, Lennart Duhrsen, Lisa Dusseault, Lyndsay Campbell, Martin Thomson, Michael Koster, and Stephen Farrell, for their review comments. -15. References +16. References -15.1. Normative References +16.1. Normative References [BIPM] Bureau International des Poids et Mesures, "The International System of Units (SI)", 8th edition, 2006. [IEEE.754.1985] Institute of Electrical and Electronics Engineers, - "Standard for Binary Floating-Point Arithmetic", - IEEE Standard 754, August 1985. + "Standard for Binary Floating-Point Arithmetic", IEEE + Standard 754, August 1985. [NIST811] Thompson, A. and B. Taylor, "Guide for the Use of the International System of Units (SI)", NIST Special Publication 811, 2008. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate - Requirement Levels", BCP 14, RFC 2119, - DOI 10.17487/RFC2119, March 1997, + Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ + RFC2119, March 1997, . [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, . [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, . [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, DOI 10.17487/RFC5226, May 2008, . [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type - Specifications and Registration Procedures", BCP 13, - RFC 6838, DOI 10.17487/RFC6838, January 2013, + Specifications and Registration Procedures", BCP 13, RFC + 6838, DOI 10.17487/RFC6838, January 2013, . [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013, . [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 2014, . [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained - Application Protocol (CoAP)", RFC 7252, - DOI 10.17487/RFC7252, June 2014, + Application Protocol (CoAP)", RFC 7252, DOI 10.17487/ + RFC7252, June 2014, . [RFC7303] Thompson, H. and C. Lilley, "XML Media Types", RFC 7303, DOI 10.17487/RFC7303, July 2014, . [W3C.REC-exi-20140211] Schneider, J., Kamiya, T., Peintner, D., and R. Kyusakov, "Efficient XML Interchange (EXI) Format 1.0 (Second Edition)", World Wide Web Consortium Recommendation REC- exi-20140211, February 2014, . [W3C.REC-xml-20081126] Bray, T., Paoli, J., Sperberg-McQueen, M., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fifth Edition)", World Wide Web Consortium Recommendation REC- xml-20081126, November 2008, . -15.2. Informative References +16.2. Informative References [I-D.arkko-core-dev-urn] Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource Names for Device Identifiers", draft-arkko-core-dev-urn-03 (work in progress), July 2012. [I-D.greevenbosch-appsawg-cbor-cddl] Vigano, C. and H. Birkholz, "CBOR data definition language (CDDL): a notational convention to express CBOR data structures", draft-greevenbosch-appsawg-cbor-cddl-09 (work @@ -1643,38 +1972,43 @@ [I-D.ietf-core-links-json] Li, K., Rahman, A., and C. Bormann, "Representing CoRE Formats in JSON and CBOR", draft-ietf-core-links-json-06 (work in progress), July 2016. [RFC2141] Moats, R., "URN Syntax", RFC 2141, DOI 10.17487/RFC2141, May 1997, . [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform - Resource Identifier (URI): Generic Syntax", STD 66, - RFC 3986, DOI 10.17487/RFC3986, January 2005, + Resource Identifier (URI): Generic Syntax", STD 66, RFC + 3986, DOI 10.17487/RFC3986, January 2005, . [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally - Unique IDentifier (UUID) URN Namespace", RFC 4122, - DOI 10.17487/RFC4122, July 2005, + Unique IDentifier (UUID) URN Namespace", RFC 4122, DOI + 10.17487/RFC4122, July 2005, . [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 - Address Text Representation", RFC 5952, - DOI 10.17487/RFC5952, August 2010, + Address Text Representation", RFC 5952, DOI 10.17487/ + RFC5952, August 2010, . [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, . + [RFC7111] Hausenblas, M., Wilde, E., and J. Tennison, "URI Fragment + Identifiers for the text/csv Media Type", RFC 7111, DOI + 10.17487/RFC7111, January 2014, + . + [RFC7721] Cooper, A., Gont, F., and D. Thaler, "Security and Privacy Considerations for IPv6 Address Generation Mechanisms", RFC 7721, DOI 10.17487/RFC7721, March 2016, . [UCUM] Schadow, G. and C. McDonald, "The Unified Code for Units of Measure (UCUM)", Regenstrief Institute and Indiana University School of Informatics, 2013, .