idnits 2.17.1 draft-keranen-core-senml-fetch-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 : ---------------------------------------------------------------------------- == There are 1 instance 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 seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (March 5, 2018) is 2237 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-16) exists of draft-ietf-core-senml-13 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 2 comments (--). 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 M. Mohajer 5 Expires: September 6, 2018 u-blox UK 6 March 5, 2018 8 Media Types for FETCH & PATCH with Sensor Measurement Lists (SenML) 9 draft-keranen-core-senml-fetch-00 11 Abstract 13 The Sensor Measurement Lists (SenML) media type and data model can be 14 used to send collections of resources, such as batches of sensor data 15 or configuration parameters. The CoAP PATCH and FETCH methods enable 16 accessing and updating parts of a resource or multiple resources with 17 one request. This document defines two new media types that can be 18 used with the CoAP PATCH and FETCH methods for resources represented 19 with the SenML data model. 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on September 6, 2018. 38 Copyright Notice 40 Copyright (c) 2018 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 57 3. Media Type Definitions . . . . . . . . . . . . . . . . . . . 3 58 3.1. SenML FETCH Media Type . . . . . . . . . . . . . . . . . 3 59 3.1.1. Wild Card Selectors . . . . . . . . . . . . . . . . . 4 60 3.2. SenML PATCH Media Type . . . . . . . . . . . . . . . . . 5 61 4. Security Considerations . . . . . . . . . . . . . . . . . . . 5 62 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 63 5.1. CoAP Content-Format Registration . . . . . . . . . . . . 6 64 5.2. senml-fetch+json Media Type . . . . . . . . . . . . . . . 6 65 5.3. senml-patch+json Media Type . . . . . . . . . . . . . . . 7 66 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 67 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 68 7.1. Normative References . . . . . . . . . . . . . . . . . . 7 69 7.2. Informative References . . . . . . . . . . . . . . . . . 8 70 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 72 1. Introduction 74 The Sensor Measurement Lists (SenML) media type [I-D.ietf-core-senml] 75 and data model can be used to transmit collections of resources, such 76 as batches of sensor data or configuration parameters. 78 Example of a SenML collection is shown below: 80 [ 81 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, 82 {"n":"5851", "v":42}, 83 {"n":"5750", "vs":"Ceiling light"} 84 ] 86 Here three resources "3306/0/5850", "3306/0/5851", and "3306/0/5750", 87 of an IPSO dimmable light smart object [IPSO] are represented using a 88 single SenML Pack with three SenML Records. All resources share the 89 same base name "2001:db8::2/3306/0/", hence full names for resources 90 are "2001:db8::2/3306/0/5850", etc. 92 The CoAP [RFC7252] PATCH and FETCH methods [RFC8132] enable accessing 93 and updating parts of a resource or multiple resources with one 94 request. 96 This document defines two new media types that can be used with the 97 CoAP PATCH and FETCH methods with resources represented with the 98 SenML data model. 100 2. Terminology 102 The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 103 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in this 104 specification are to be interpreted as described in [RFC2119]. 106 Readers should also be familiar with the terms and concepts discussed 107 in [RFC8132] and [I-D.ietf-core-senml]. Also the following terms are 108 used in this document: 110 FETCH Record: One set of parameters that is used to match SenML 111 Record(s). Presented using the SenML data model with extensions 112 defined in this document. 114 FETCH Pack: One or more FETCH Records in an array structure. 116 PATCH Record: One set of parameters similar to FETCH Record but 117 contains also instructions on how to change existing SenML 118 Pack(s). 120 PATCH Pack: One or more PATCH Records in an array structure. 122 3. Media Type Definitions 124 The FETCH and PATCH media types for SenML are both modeled as 125 extensions to the SenML media type to enable re-use of existing SenML 126 parsers and generators, in particular on constrained devices. Unless 127 mentioned otherwise, FETCH and PATCH Packs are constructed with the 128 same rules and constraints as SenML Packs. 130 3.1. SenML FETCH Media Type 132 The FETCH media type is used to select and return parts of one or 133 more SenML Packs. The SenML records are selected by giving the 134 name(s) of the resources using the SenML "name" and/or "base name" 135 Fields. The same rules for concatenating the name and base name 136 Fields apply as for SenML Packs. 138 For example, to select resources "5850" and "5851" from the example 139 in Section 1, the following FETCH Pack can be used: 141 [ 142 {"bn":"2001:db8::2/3306/0/", "n":"5850"}, 143 {"n":"5851"} 144 ] 146 The result to a FETCH request with the example above would be: 148 [ 149 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, 150 {"n":"5851", "v":42}, 151 ] 153 When SenML records contain also time values, a name may no longer 154 uniquely identify a single record. When no time is given in a FETCH 155 Record, all SenML Records with the given name are be matched. When 156 time is given in the FETCH Record, only a SenML Record (if any) with 157 equal time value is matched. 159 3.1.1. Wild Card Selectors 161 Multiple SenML Records can be chosen simply by listing all names, and 162 potentially times, in separate FETCH Records. However, for 163 efficiency, also wild card operations for selecting multiple SenML 164 records with a single FETCH Record MAY be supported. 166 Implementations that do not support wild card operations MUST return 167 4.00 "Bad Request" when receiving a request with wild cards. 169 TBD: better response code than 400? 171 The format for SenML wild card operations is for further study. This 172 section proposes one possible format for discussion. 174 SenML names are often split to multiple segments using the "/" and/or 175 ":" characters. For example, "3306/0/5850" contains three segments: 176 "3306", "0", and "5850". 178 A new SenML Field, FETCH filter ("ff"), is defined for use with wild 179 card operations. The filter expression is concatenated to the base 180 name like the name field. The filter can contain asterisk ("*") 181 characters that are used to match any set of characters within a 182 SenML name until the next segment separator ("/" or ":"). 184 TBD: more formal specification of matching rules 186 For example, the filter expression "3306/0/*" together with the base 187 name "2001:db8::2/" would match all three Records in the example 188 SenML Pack from Section 1. 190 Note that the "*" character is not a valid character in SenML names. 192 The "n" and "ff" Fields MUST NOT be used together. 194 Example of using the filter expression "3306/0/*" in a FETCH Pack is 195 shown below: 197 [ 198 {"bn":"2001:db8::2/", "ff":"3306/0/*"} 199 ] 201 Similarly, when used with the same base name, the filter expression 202 "*/0/*" would match all the three Records and the filter expression 203 "*/0/5850" would match only the Record with name "5850". 205 3.2. SenML PATCH Media Type 207 The PATCH media type is used to change the values of SenML Records. 208 The names and times of the Records are given in same way as for the 209 FETCH media type but PATCH Packs can include also new values and 210 other SenML Fields for the Records. 212 For example, the following document could be given as PATCH payload 213 to change/set values of two SenML Records for the example in 214 Section 1: 216 [ 217 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, 218 {"n":"5851", "v":10} 219 ] 221 If the request is successful, the resulting representation of the 222 example SenML Pack would be as follows: 224 [ 225 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, 226 {"n":"5851", "v":10}, 227 {"n":"5750", "vs":"Ceiling light"} 228 ] 230 4. Security Considerations 232 TBD 234 5. IANA Considerations 236 This document registers two new media types, one for the FETCH and 237 one for the PATCH use, and CoAP Content-Format IDs for both media 238 types. 240 5.1. CoAP Content-Format Registration 242 IANA is requested to assign CoAP Content-Format IDs for the SenML 243 PATCH and FETCH media types in the "CoAP Content-Formats" sub- 244 registry, within the "CoRE Parameters" registry [RFC7252]. All IDs 245 are assigned from the "Expert Review" (0-255) range. The assigned 246 IDs are show in Table 1. 248 +------------------------------+-----+ 249 | Media type | ID | 250 +------------------------------+-----+ 251 | application/senml-patch+json | TBD | 252 | | | 253 | application/senml-fetch+json | TBD | 254 +------------------------------+-----+ 256 Table 1: CoAP Content-Format IDs 258 5.2. senml-fetch+json Media Type 260 Type name: application 262 Subtype name: senml-fetch+json 264 Required parameters: none 266 Optional parameters: none 268 Encoding considerations: Must be encoded as using a subset of the 269 encoding allowed in [RFC8259]. See RFC-AAAA for details. This 270 simplifies implementation of very simple system and does not impose 271 any significant limitations as all this data is meant for machine to 272 machine communications and is not meant to be human readable. 274 Security considerations: See Section 4 of RFC-AAAA. 276 Interoperability considerations: TBD 278 Published specification: RFC-AAAA 280 Applications that use this media type: Applications that use the 281 SenML media type for resource representation. 283 Fragment identifier considerations: TBD 285 Additional information: 287 Magic number(s): none 289 File extension(s): senml-fetch-json 291 Windows Clipboard Name: "SenML fetch format" 293 Macintosh file type code(s): none 295 Macintosh Universal Type Identifier code: org.ietf.senml-fetch-json 296 conforms to public.text 298 Person & email address to contact for further information: Ari 299 Keranen ari.keranen@ericsson.com 301 Intended usage: COMMON 303 Restrictions on usage: None 305 Author: Ari Keranen ari.keranen@ericsson.com 307 Change controller: IESG 309 5.3. senml-patch+json Media Type 311 TBD (similar to senml-fetch) 313 6. Acknowledgements 315 TBD 317 7. References 319 7.1. Normative References 321 [I-D.ietf-core-senml] 322 Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 323 Bormann, "Media Types for Sensor Measurement Lists 324 (SenML)", draft-ietf-core-senml-13 (work in progress), 325 March 2018. 327 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 328 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 329 RFC2119, March 1997, . 332 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 333 Application Protocol (CoAP)", RFC 7252, DOI 10.17487/ 334 RFC7252, June 2014, . 337 [RFC8132] van der Stok, P., Bormann, C., and A. Sehgal, "PATCH and 338 FETCH Methods for the Constrained Application Protocol 339 (CoAP)", RFC 8132, DOI 10.17487/RFC8132, April 2017, 340 . 342 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 343 Interchange Format", STD 90, RFC 8259, DOI 10.17487/ 344 RFC8259, December 2017, . 347 7.2. Informative References 349 [IPSO] IPSO, "IP for Smart Objects - IPSO Objects", 2018, 350 . 352 Authors' Addresses 354 Ari Keranen 355 Ericsson 357 Email: ari.keranen@ericsson.com 359 Mojan Mohajer 360 u-blox UK 362 Email: Mojan.Mohajer@u-blox.com