idnits 2.17.1 draft-keranen-core-senml-data-ct-01.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 12, 2019) is 1872 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) ** Obsolete normative reference: RFC 7049 (Obsoleted by RFC 8949) == Outdated reference: A later version (-04) exists of draft-bormann-core-media-content-type-format-00 Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group A. Keranen 3 Internet-Draft Ericsson 4 Intended status: Standards Track C. Bormann 5 Expires: September 13, 2019 Universitaet Bremen TZI 6 March 12, 2019 8 SenML Data Value Content-Format Indication 9 draft-keranen-core-senml-data-ct-01 11 Abstract 13 The Sensor Measurement Lists (SenML) media type supports multiple 14 types of values, from numbers to text strings and arbitrary binary 15 data values. In order to simplify processing of the data values this 16 document proposes to specify a new SenML field for indicating the 17 Content-Format of the data. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on September 13, 2019. 36 Copyright Notice 38 Copyright (c) 2019 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 55 3. SenML Content-Format ("ct") Field . . . . . . . . . . . . . . 3 56 4. SenML Content-Type ("content-type") and Content-Coding 57 ("content-coding") Fields . . . . . . . . . . . . . . . . . . 3 58 5. SenML Base Content-Format ("bct"), Base Content-Type 59 ("bcontent-type), and Base Content-Coding ("bcontent-coding") 60 Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 6. Security Considerations . . . . . . . . . . . . . . . . . . . 4 62 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 63 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 5 64 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 65 9.1. Normative References . . . . . . . . . . . . . . . . . . 5 66 9.2. Informative References . . . . . . . . . . . . . . . . . 6 67 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 69 1. Introduction 71 The Sensor Measurement Lists (SenML) media type [RFC8428] can be used 72 to send various different kinds of data. In the example given in 73 Figure 1, a temperature value, an indication whether a lock is open, 74 and a data value (with SenML field "vd") read from an NFC reader is 75 sent in a single SenML pack. 77 [ 78 {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":7.1}, 79 {"n":"open","vb":false}, 80 {"n":"nfc-reader","vd":"aGkgCg"} 81 ] 83 Figure 1: SenML pack with unidentified binary data 85 The receiver is expected to know how to decode the data in the "vd" 86 field based on the context, e.g., name of the data source and out-of- 87 band knowledge of the application. However, this context may not 88 always be easily available to entities processing the SenML pack. To 89 facilitate automatic decoding it is useful to be able to indicate an 90 Internet media type and content-coding right in the SenML Record. 91 The CoAP Content-Format (Section 12.3 in [RFC7252]) provides just 92 this information; enclosing a Content-Format number (in this case 93 number 60 as defined for media type application/cbor in [RFC7049]) in 94 the Record is illustrated in Figure 2. All registered CoAP content 95 formats are listed in the Content Formats subregistry of the CoRE 96 Parameters registry [IANA.core-parameters]. 98 {"n":"nfc-reader", "vd":"gmNmb28YKg", "ct":60} 100 Figure 2: SenML Record with binary data identified as CBOR 102 In this example SenML Record the data value contains a string "foo" 103 and a number 42 encoded in a CBOR [RFC7049] array. Since the example 104 above uses the JSON format of SenML, the data value containing the 105 binary CBOR value is base64-encoded. The data value after base64 106 decoding is shown with CBOR diagnostic notation in Figure 3. 108 82 # array(2) 109 63 # text(3) 110 666F6F # "foo" 111 18 2A # unsigned(42) 113 Figure 3: Example Data Value in CBOR diagnostic notation 115 2. Terminology 117 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 118 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 119 "OPTIONAL" in this document are to be interpreted as described in 120 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 121 capitals, as shown here. 123 Readers should also be familiar with the terms and concepts discussed 124 in [RFC8428]. Awareness of terminology issues discussed in 125 [I-D.bormann-core-media-content-type-format] can also be very 126 helpful. 128 3. SenML Content-Format ("ct") Field 130 When a SenML Record contains a Data Value field ("vd"), the Record 131 MAY also include a Content-Format indication field. The Content- 132 Format indication uses label "ct" and an unsigned integer value in 133 the range of 0-65535 indicating the CoAP Content-Format of the data 134 (similar to CoRE Link Format [RFC6690] "ct" attribute, except that 135 the Link Format attribute happens to be encoded as a string). 137 4. SenML Content-Type ("content-type") and Content-Coding ("content- 138 coding") Fields 140 Since some Internet media types and their content coding and 141 parameter alternatives do not have assigned CoAP Content-Format 142 identifiers, a Content-Type field ("content-type") can be 143 alternatively used to indicate the Content-Type of the data. 144 Content-Coding of the Content-Type can be identified using a 145 "content-coding" field. If Content-Coding is not specified with 146 Content-Type, identity (i.e., no) transformation is used. The 147 Content-Type field MUST NOT be used in the same record as a Content- 148 Format field and records with Content-Format field MUST NOT contain a 149 Content-Coding field. 151 5. SenML Base Content-Format ("bct"), Base Content-Type ("bcontent- 152 type), and Base Content-Coding ("bcontent-coding") Fields 154 The Base Content-Format Field, label "bct", provides a default value 155 for the Content-Format Field (label "ct") within its range. The 156 range of the base field includes the record containing it, up to (but 157 not including) the next record containing a "bct" field, if any, or 158 up to the end of the pack otherwise. Resolution (Section 4.6 of 159 [RFC8428]) of this base field is performed by adding its value with 160 the label "ct" to all records in this range that carry a "vd" field 161 but do not already contain a Content-Format ("ct") field. 163 The Base Content-Type Field, label "bcontent-type", provides a 164 default value for the Content-Type Field (label "content-type") 165 within its range. The Base Content-Coding Field, label "bcontent- 166 coding", provides a default value for the Content-Coding Field (label 167 "content-coding") within its range. The range and resolution rules 168 for both are identical to Base Content-Format Field, except that the 169 value is added with label "content-coding" (for Base Content-Coding) 170 or with label "content-type" (for Base Content-Type). 172 6. Security Considerations 174 The indication of a media type in the data does not exempt a 175 consuming application from properly checking its inputs. Also, the 176 ability for an attacker to supply crafted SenML data that specify 177 media types chosen by the attacker may expose vulnerabilities of 178 handlers for these media types to the attacker. 180 7. IANA Considerations 182 IANA is requested to assign new labels in the "SenML Labels" 183 subregistry of the SenML registry [IANA.senml] (as defined in 184 [RFC8428]) for the Content-Format indication as per Table 1: 186 +----------------+-----------------+---------+---------+------------+ 187 | Name | Label | JSON | XML | Reference | 188 | | | Type | Type | | 189 +----------------+-----------------+---------+---------+------------+ 190 | Base Content- | bct | Number | int | this | 191 | Format | | | | document | 192 | | | | | | 193 | Content-Format | ct | Number | int | this | 194 | | | | | document | 195 | | | | | | 196 | Base Content- | bcontent-type | String | string | this | 197 | Type | | | | document | 198 | | | | | | 199 | Content-Type | content-type | String | string | this | 200 | | | | | document | 201 | | | | | | 202 | Base Content- | bcontent-coding | String | string | this | 203 | Coding | | | | document | 204 | | | | | | 205 | Content-Coding | content-coding | String | string | this | 206 | | | | | document | 207 +----------------+-----------------+---------+---------+------------+ 209 Table 1: IANA Registration for new SenML Labels 211 Acknowledgements 213 The authors would like to thank Sergio Abreu for the discussions 214 leading to the design of this extension. 216 9. References 218 9.1. Normative References 220 [IANA.senml] 221 IANA, "Sensor Measurement Lists (SenML)", 222 . 224 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 225 Requirement Levels", BCP 14, RFC 2119, 226 DOI 10.17487/RFC2119, March 1997, 227 . 229 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 230 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 231 October 2013, . 233 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 234 Application Protocol (CoAP)", RFC 7252, 235 DOI 10.17487/RFC7252, June 2014, 236 . 238 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 239 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 240 May 2017, . 242 [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 243 Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, 244 DOI 10.17487/RFC8428, August 2018, 245 . 247 9.2. Informative References 249 [I-D.bormann-core-media-content-type-format] 250 Bormann, C., "On Media-Types, Content-Types, and related 251 terminology", draft-bormann-core-media-content-type- 252 format-00 (work in progress), March 2019. 254 [IANA.core-parameters] 255 IANA, "Constrained RESTful Environments (CoRE) 256 Parameters", 257 . 259 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 260 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 261 . 263 Authors' Addresses 265 Ari Keranen 266 Ericsson 267 Jorvas 02420 268 Finland 270 Email: ari.keranen@ericsson.com 272 Carsten Bormann 273 Universitaet Bremen TZI 274 Postfach 330440 275 Bremen D-28359 276 Germany 278 Phone: +49-421-218-63921 279 Email: cabo@tzi.org