idnits 2.17.1 draft-keranen-core-senml-fetch-03.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 : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document date (October 22, 2018) is 2006 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) No issues found here. 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 M. Mohajer 5 Expires: April 25, 2019 u-blox UK 6 October 22, 2018 8 FETCH & PATCH with Sensor Measurement Lists (SenML) 9 draft-keranen-core-senml-fetch-03 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 iPATCH, PATCH, and FETCH 16 methods enable accessing and updating parts of a resource or multiple 17 resources with one request. This document defines semantics for the 18 CoAP iPATCH, and FETCH methods for resources represented with the 19 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 https://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 April 25, 2019. 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 (https://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. Using FETCH and iPATCH with SenML . . . . . . . . . . . . . . 3 58 3.1. SenML FETCH . . . . . . . . . . . . . . . . . . . . . . . 3 59 3.2. SenML iPATCH . . . . . . . . . . . . . . . . . . . . . . 4 60 4. Security Considerations . . . . . . . . . . . . . . . . . . . 5 61 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 62 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 63 6.1. Normative References . . . . . . . . . . . . . . . . . . 5 64 6.2. Informative References . . . . . . . . . . . . . . . . . 6 65 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 67 1. Introduction 69 The Sensor Measurement Lists (SenML) media type {{RFC8428} and data 70 model can be used to transmit collections of resources, such as 71 batches of sensor data or configuration parameters. 73 Example of a SenML collection is shown below: 75 [ 76 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, 77 {"n":"5851", "v":42}, 78 {"n":"5750", "vs":"Ceiling light"} 79 ] 81 Here three resources "3306/0/5850", "3306/0/5851", and "3306/0/5750", 82 of an IPSO dimmable light smart object [IPSO] are represented using a 83 single SenML Pack with three SenML Records. All resources share the 84 same base name "2001:db8::2/3306/0/", hence full names for resources 85 are "2001:db8::2/3306/0/5850", etc. 87 The CoAP [RFC7252] iPATCH and FETCH methods [RFC8132] enable 88 accessing and updating parts of a resource or multiple resources with 89 one request. 91 This document defines semantics for the CoAP iPATCH and FETCH methods 92 for resources represented with the SenML data model. Same semantics 93 apply also for the CoAP PATCH method. 95 2. Terminology 97 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 98 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 99 "OPTIONAL" in this document are to be interpreted as described in BCP 100 14 [RFC2119] [RFC8174] when, and only when, they appear in all 101 capitals, as shown here. 103 Readers should also be familiar with the terms and concepts discussed 104 in [RFC8132] and [RFC8428]. Also the following terms are used in 105 this document: 107 Fetch Record: One set of parameters that is used to match SenML 108 Record(s). 110 Fetch Pack: One or more Fetch Records in an array structure. 111 Presented using the SenML media type. 113 Patch Record: One set of parameters similar to Fetch Record but also 114 containing instructions on how to change existing SenML Pack(s). 116 Patch Pack: One or more Patch Records in an array structure. 118 Target Record: A Record in a SenML Pack that is matching the 119 selection criteria of a Fetch or Patch Record and hence is a 120 target for a Fetch or Patch operation. 122 3. Using FETCH and iPATCH with SenML 124 The FETCH and iPATCH methods use the same SenML media type to enable 125 re-use of existing SenML parsers and generators, in particular on 126 constrained devices. 128 NOTE: it is currently under consideration whether new media types 129 should be registered for FETCH/iPATCH instead of re-using the SenML 130 media types. 132 3.1. SenML FETCH 134 The FETCH method can be used to select and return parts of one or 135 more SenML Packs. The SenML Records are selected by giving the 136 name(s) of the resources using the SenML "name" and/or "base name" 137 Fields. 139 For example, to select resources "5850" and "5851" from the example 140 in Section 1, the following Fetch Pack can be used: 142 [ 143 {"bn":"2001:db8::2/3306/0/", "n":"5850"}, 144 {"n":"5851"} 145 ] 147 The result to a FETCH request with the example above would be: 149 [ 150 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, 151 {"n":"5851", "v":42}, 152 ] 154 When SenML Records contain also time values, a name may no longer 155 uniquely identify a single Record. When no time is given in a Fetch 156 Record, all SenML Records with the given name are matched. When time 157 is given in the Fetch Record, only a SenML Record (if any) with equal 158 time value and name is matched. 160 The resolved form of records (Section 4.6 of [RFC8428]) is used when 161 comparing the names and times of the Target and Fetch Records to 162 accommodate for differences in use of the base values. 164 3.2. SenML iPATCH 166 The iPATCH method can be used to change the values of SenML Records, 167 to add new Records, and to remove existing Records. The names and 168 times of the Patch Records are given and matched in same way as for 169 the Fetch Records, except each Patch Record can match at most one 170 Target Record. Patch Packs can also include new values and other 171 SenML Fields for the Records. 173 When the name in a Patch Record matches with the name in an existing 174 Record, the time values are compared. If the time values do not 175 exist or are equal in both Records, the Target Record is replaced 176 with the contents of the Patch Record. 178 If a Patch Record contains a name, or combination of a time value and 179 a name, that do not exist in any existing Record in the Pack, the 180 given Record, with all the fields it contains, is added to the Pack. 182 If a Patch Record has a value field with value null, the matched 183 Record (if any) is removed from the Pack. 185 For example, the following document could be given as iPATCH payload 186 to change/set values of two SenML Records for the example in 187 Section 1: 189 [ 190 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, 191 {"n":"5851", "v":10} 192 ] 194 If the request is successful, the resulting representation of the 195 example SenML Pack would be as follows: 197 [ 198 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, 199 {"n":"5851", "v":10}, 200 {"n":"5750", "vs":"Ceiling light"} 201 ] 203 4. Security Considerations 205 The security and privacy considerations of SenML apply also with the 206 FETCH and iPATCH methods. 208 In FETCH and iPATCH requests, the client can pass arbitrary names to 209 the target resource for manipulation. The resource implementer must 210 take care to only allow access to names that are actually part of (or 211 accessible through) the target resource. 213 If the client is not allowed to do a GET or PUT on the full target 214 resource (and thus all the names accessible through it), access 215 control rules must be evaluated for each record in the pack. 217 5. Acknowledgements 219 The use of FETCH and iPATCH methods with SenML was first introduced 220 by the OMA SpecWorks LwM2M v1.1 specification. This document 221 generalizes the use to any SenML representation. The authors would 222 like to thank Carsten Bormann, Christian Amsuess, Jaime Jimenez, 223 Klaus Hartke, and also everyone in the IETF CoRE and OMA SpecWorks 224 DMSE working groups for their contributions and reviews. 226 6. References 228 6.1. Normative References 230 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 231 Requirement Levels", BCP 14, RFC 2119, 232 DOI 10.17487/RFC2119, March 1997, 233 . 235 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 236 Application Protocol (CoAP)", RFC 7252, 237 DOI 10.17487/RFC7252, June 2014, 238 . 240 [RFC8132] van der Stok, P., Bormann, C., and A. Sehgal, "PATCH and 241 FETCH Methods for the Constrained Application Protocol 242 (CoAP)", RFC 8132, DOI 10.17487/RFC8132, April 2017, 243 . 245 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 246 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 247 May 2017, . 249 [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 250 Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, 251 DOI 10.17487/RFC8428, August 2018, 252 . 254 6.2. Informative References 256 [IPSO] IPSO, "IP for Smart Objects - IPSO Objects", 2018, 257 . 259 Authors' Addresses 261 Ari Keranen 262 Ericsson 264 Email: ari.keranen@ericsson.com 266 Mojan Mohajer 267 u-blox UK 269 Email: Mojan.Mohajer@u-blox.com