idnits 2.17.1 draft-keranen-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 (February 11, 2019) is 1894 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) Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 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: August 15, 2019 Universitaet Bremen TZI 6 February 11, 2019 8 SenML Data Value Content-Format Indication 9 draft-keranen-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 August 15, 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 Field ("ct") . . . . . . . . . . . . . . 3 56 4. SenML Base Content-Format Field ("bct") . . . . . . . . . . . 3 57 5. Security Considerations . . . . . . . . . . . . . . . . . . . 3 58 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 59 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 4 60 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 8.1. Normative References . . . . . . . . . . . . . . . . . . 4 62 8.2. Informative References . . . . . . . . . . . . . . . . . 5 63 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 5 65 1. Introduction 67 The Sensor Measurement Lists (SenML) media type [RFC8428] can be used 68 to send various different kinds of data. In the example given in 69 Figure 1, a temperature value, an indication whether a lock is open, 70 and a data value (with SenML field "vd") read from an NFC reader is 71 sent in a single SenML pack. 73 [ 74 {"bn":"urn:dev:ow:10e2073a01080063:","n":"temp","u":"Cel","v":23.1}, 75 {"n":"open","vb":false}, 76 {"n":"nfc-reader","vd":"aGkgCg"} 77 ] 79 Figure 1: SenML pack with unidentified binary data 81 The receiver is expected to know how to decode the data in the "vd" 82 field based on the context, e.g., name of the data source and out-of- 83 band knowledge of the application. However, this context may not 84 always be easily available to entities processing the SenML pack. To 85 facilitate automatic decoding it is useful to be able to indicate an 86 Internet media type and content-coding right in the SenML Record. 87 The CoAP Content-Format (Section 12.3 in [RFC7252]) provides just 88 this information; enclosing a Content-Format number (in this case 89 number 60 as defined for media type application/cbor in [RFC7049]) in 90 the Record is illustrated in Figure 2. 92 {"n":"nfc-reader", "vd":"gmNmb28YKg", "ct":60} 94 Figure 2: SenML Record with binary data identified as CBOR 96 In this example SenML Record the data value contains a string "foo" 97 and a number 42 encoded in a CBOR [RFC7049] array. Since the example 98 above uses the JSON format of SenML, the data value containing the 99 binary CBOR value is base64-encoded. 101 2. Terminology 103 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 104 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 105 "OPTIONAL" in this document are to be interpreted as described in 106 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all 107 capitals, as shown here. 109 Readers should also be familiar with the terms and concepts discussed 110 in [RFC8428]. 112 3. SenML Content-Format Field ("ct") 114 When a SenML Record contains a Data Value field ("vd"), the Record 115 MAY also include a Content-Format indication field. The Content- 116 Format indication uses label "ct" and an unsigned integer value in 117 the range of 0-65535 indicating the CoAP Content-Format of the data 118 (similar to CoRE Link Format [RFC6690] "ct" attribute, except that 119 this attribute happens to be encoded as a string). 121 4. SenML Base Content-Format Field ("bct") 123 The Base Content-Format Field, label "bct", provides a default value 124 for the Content-Format Field (label "ct") within its range. The 125 range of the base field includes the record containing it, up to (but 126 not including) the next record containing a "bct" field, if any, or 127 up to the end of the pack otherwise. Resolution (Section 4.6 of 128 [RFC8428]) of this base field is performed by adding its value with 129 the label "ct" to all records in this range that carry a "vd" field 130 but do not already contain a Content-Format ("ct") field. 132 5. Security Considerations 134 The indication of a media type in the data does not exempt a 135 consuming application from properly checking its inputs. Also, the 136 ability for an attacker to supply crafted SenML data that specify 137 media types chosen by the attacker may expose vulnerabilities of 138 handlers for these media types to the attacker. 140 6. IANA Considerations 142 IANA is requested to assign new labels in the "SenML Labels" 143 subregistry of the SenML registry [IANA.senml] (as defined in 144 [RFC8428]) for the Content-Format indication as per Table 1: 146 +--------------------+-------+-----------+----------+---------------+ 147 | Name | Label | JSON Type | XML Type | Reference | 148 +--------------------+-------+-----------+----------+---------------+ 149 | Base Content- | bct | Number | int | this document | 150 | Format | | | | | 151 | | | | | | 152 | Content-Format | ct | Number | int | this document | 153 +--------------------+-------+-----------+----------+---------------+ 155 Table 1: IANA Registration for bct and ct Labels 157 Acknowledgements 159 The authors would like to thank Sergio Abreu for the discussions 160 leading to the design of this extension. 162 8. References 164 8.1. Normative References 166 [IANA.senml] 167 IANA, "Sensor Measurement Lists (SenML)", 168 . 170 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 171 Requirement Levels", BCP 14, RFC 2119, 172 DOI 10.17487/RFC2119, March 1997, 173 . 175 [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object 176 Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, 177 October 2013, . 179 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 180 Application Protocol (CoAP)", RFC 7252, 181 DOI 10.17487/RFC7252, June 2014, 182 . 184 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 185 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 186 May 2017, . 188 [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 189 Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, 190 DOI 10.17487/RFC8428, August 2018, 191 . 193 8.2. Informative References 195 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 196 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 197 . 199 Authors' Addresses 201 Ari Keranen 202 Ericsson 203 Jorvas 02420 204 Finland 206 Email: ari.keranen@ericsson.com 208 Carsten Bormann 209 Universitaet Bremen TZI 210 Postfach 330440 211 Bremen D-28359 212 Germany 214 Phone: +49-421-218-63921 215 Email: cabo@tzi.org