idnits 2.17.1 draft-ietf-core-senml-data-ct-00.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 (August 29, 2019) is 1695 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-01 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: March 1, 2020 Universitaet Bremen TZI 6 August 29, 2019 8 SenML Data Value Content-Format Indication 9 draft-ietf-core-senml-data-ct-00 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 March 1, 2020. 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. Using Content-Type and Content-Coding With the "ct" Field . . 3 57 5. SenML Base Content-Format ("bct") Field . . . . . . . . . . . 4 58 6. Security Considerations . . . . . . . . . . . . . . . . . . . 4 59 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 60 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 4 61 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 62 9.1. Normative References . . . . . . . . . . . . . . . . . . 5 63 9.2. Informative References . . . . . . . . . . . . . . . . . 5 64 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 66 1. Introduction 68 The Sensor Measurement Lists (SenML) media type [RFC8428] can be used 69 to send various different kinds of data. In the example given in 70 Figure 1, a temperature value, an indication whether a lock is open, 71 and a data value (with SenML field "vd") read from an NFC reader is 72 sent in a single SenML pack. 74 [ 75 {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":7.1}, 76 {"n":"open","vb":false}, 77 {"n":"nfc-reader","vd":"aGkgCg"} 78 ] 80 Figure 1: SenML pack with unidentified binary data 82 The receiver is expected to know how to decode the data in the "vd" 83 field based on the context, e.g., name of the data source and out-of- 84 band knowledge of the application. However, this context may not 85 always be easily available to entities processing the SenML pack. To 86 facilitate automatic decoding it is useful to be able to indicate an 87 Internet media type and content-coding right in the SenML Record. 88 The CoAP Content-Format (Section 12.3 in [RFC7252]) provides just 89 this information; enclosing a Content-Format number (in this case 90 number 60 as defined for media type application/cbor in [RFC7049]) in 91 the Record is illustrated in Figure 2. All registered CoAP content 92 formats are listed in the Content Formats subregistry of the CoRE 93 Parameters registry [IANA.core-parameters]. 95 {"n":"nfc-reader", "vd":"gmNmb28YKg", "ct":60} 97 Figure 2: SenML Record with binary data identified as CBOR 99 In this example SenML Record the data value contains a string "foo" 100 and a number 42 encoded in a CBOR [RFC7049] array. Since the example 101 above uses the JSON format of SenML, the data value containing the 102 binary CBOR value is base64-encoded. The data value after base64 103 decoding is shown with CBOR diagnostic notation in Figure 3. 105 82 # array(2) 106 63 # text(3) 107 666F6F # "foo" 108 18 2A # unsigned(42) 110 Figure 3: Example Data Value in CBOR diagnostic notation 112 2. Terminology 114 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 115 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 116 "OPTIONAL" in this document are to be interpreted as described in 117 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 118 capitals, as shown here. 120 Readers should also be familiar with the terms and concepts discussed 121 in [RFC8428]. Awareness of terminology issues discussed in 122 [I-D.bormann-core-media-content-type-format] can also be very 123 helpful. 125 3. SenML Content-Format ("ct") Field 127 When a SenML Record contains a Data Value field ("vd"), the Record 128 MAY also include a Content-Format indication field. The Content- 129 Format indication uses label "ct" and an unsigned integer value in 130 the range of 0-65535 indicating the CoAP Content-Format of the data 131 (similar to CoRE Link Format [RFC6690] "ct" attribute, except that 132 the Link Format attribute happens to be encoded as a string). 134 4. Using Content-Type and Content-Coding With the "ct" Field 136 Since some Internet media types and their content coding and 137 parameter alternatives do not have assigned CoAP Content-Format 138 identifiers, the "ct" field can alternatively be used to indicate the 139 Content-Type and Content-Coding of the data. If Content-Coding is 140 not specified with Content-Type, identity (i.e., no) transformation 141 is used. 143 If Content-Coding is used, the content-coding value (e.g., "deflate") 144 MUST be prefixed with "@" and concatenated with the media type and 145 parameters (if any). For example: "application/json@deflate". 147 5. SenML Base Content-Format ("bct") Field 149 The Base Content-Format Field, label "bct", provides a default value 150 for the Content-Format Field (label "ct") within its range. The 151 range of the base field includes the record containing it, up to (but 152 not including) the next record containing a "bct" field, if any, or 153 up to the end of the pack otherwise. Resolution (Section 4.6 of 154 [RFC8428]) of this base field is performed by adding its value with 155 the label "ct" to all records in this range that carry a "vd" field 156 but do not already contain a Content-Format ("ct") field. 158 6. Security Considerations 160 The indication of a media type in the data does not exempt a 161 consuming application from properly checking its inputs. Also, the 162 ability for an attacker to supply crafted SenML data that specify 163 media types chosen by the attacker may expose vulnerabilities of 164 handlers for these media types to the attacker. 166 7. IANA Considerations 168 IANA is requested to assign new labels in the "SenML Labels" 169 subregistry of the SenML registry [IANA.senml] (as defined in 170 [RFC8428]) for the Content-Format indication as per Table 1: 172 +-----------------+-------+---------------+------------+------------+ 173 | Name | Label | JSON Type | XML Type | Reference | 174 +-----------------+-------+---------------+------------+------------+ 175 | Base Content- | bct | Number/String | int/string | this | 176 | Format | | | | document | 177 | | | | | | 178 | Content-Format | ct | Number/String | int/string | this | 179 | | | | | document | 180 +-----------------+-------+---------------+------------+------------+ 182 Table 1: IANA Registration for new SenML Labels 184 Acknowledgements 186 The authors would like to thank Sergio Abreu for the discussions 187 leading to the design of this extension. 189 9. References 191 9.1. Normative References 193 [IANA.senml] 194 IANA, "Sensor Measurement Lists (SenML)", 195 . 197 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 198 Requirement Levels", BCP 14, RFC 2119, 199 DOI 10.17487/RFC2119, March 1997, 200 . 202 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 203 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 204 October 2013, . 206 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 207 Application Protocol (CoAP)", RFC 7252, 208 DOI 10.17487/RFC7252, June 2014, 209 . 211 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 212 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 213 May 2017, . 215 [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 216 Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, 217 DOI 10.17487/RFC8428, August 2018, 218 . 220 9.2. Informative References 222 [I-D.bormann-core-media-content-type-format] 223 Bormann, C., "On Media-Types, Content-Types, and related 224 terminology", draft-bormann-core-media-content-type- 225 format-01 (work in progress), July 2019. 227 [IANA.core-parameters] 228 IANA, "Constrained RESTful Environments (CoRE) 229 Parameters", 230 . 232 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 233 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 234 . 236 Authors' Addresses 238 Ari Keranen 239 Ericsson 240 Jorvas 02420 241 Finland 243 Email: ari.keranen@ericsson.com 245 Carsten Bormann 246 Universitaet Bremen TZI 247 Postfach 330440 248 Bremen D-28359 249 Germany 251 Phone: +49-421-218-63921 252 Email: cabo@tzi.org