idnits 2.17.1 draft-keranen-core-senml-fetch-02.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 (July 24, 2018) is 2103 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: January 25, 2019 u-blox UK 6 July 24, 2018 8 FETCH & PATCH with Sensor Measurement Lists (SenML) 9 draft-keranen-core-senml-fetch-02 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 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 January 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 (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. 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 [I-D.ietf-core-senml] 70 and data model can be used to transmit collections of resources, such 71 as 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 [I-D.ietf-core-senml]. Also the following terms are 105 used in 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 3.1. SenML FETCH 130 The FETCH method can be used to select and return parts of one or 131 more SenML Packs. The SenML Records are selected by giving the 132 name(s) of the resources using the SenML "name" and/or "base name" 133 Fields. 135 For example, to select resources "5850" and "5851" from the example 136 in Section 1, the following Fetch Pack can be used: 138 [ 139 {"bn":"2001:db8::2/3306/0/", "n":"5850"}, 140 {"n":"5851"} 141 ] 142 The result to a FETCH request with the example above would be: 144 [ 145 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, 146 {"n":"5851", "v":42}, 147 ] 149 When SenML Records contain also time values, a name may no longer 150 uniquely identify a single Record. When no time is given in a Fetch 151 Record, all SenML Records with the given name are matched. When time 152 is given in the Fetch Record, only a SenML Record (if any) with equal 153 time value and name is matched. 155 The resolved form of records (Section 4.6 of [I-D.ietf-core-senml]) 156 is used when comparing the names and times of the Target and Fetch 157 Records to accommodate for differences in use of the base values. 159 3.2. SenML iPATCH 161 The iPATCH method can be used to change the values of SenML Records, 162 to add new Records, and to remove existing Records. The names and 163 times of the Patch Records are given and matched in same way as for 164 the Fetch Records, except each Patch Record can match at most one 165 Target Record. Patch Packs can also include new values and other 166 SenML Fields for the Records. 168 When the name in a Patch Record matches with the name in an existing 169 Record, the time values are compared. If the time values do not 170 exist or are equal in both Records, the Target Record is replaced 171 with the contents of the Patch Record. 173 If a Patch Record contains a name, or combination of a time value and 174 a name, that do not exist in any existing Record in the Pack, the 175 given Record, with all the fields it contains, is added to the Pack. 177 If a Patch Record has a value field with value null, the matched 178 Record (if any) is removed from the Pack. 180 For example, the following document could be given as iPATCH payload 181 to change/set values of two SenML Records for the example in 182 Section 1: 184 [ 185 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, 186 {"n":"5851", "v":10} 187 ] 188 If the request is successful, the resulting representation of the 189 example SenML Pack would be as follows: 191 [ 192 {"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, 193 {"n":"5851", "v":10}, 194 {"n":"5750", "vs":"Ceiling light"} 195 ] 197 4. Security Considerations 199 The security and privacy considerations of SenML apply also with the 200 FETCH and iPATCH methods. 202 Since the the FETCH and iPATCH methods potentially allow retrieving 203 or changing many resources at once, particular care must be taken to 204 ensure that access control rules for different resources are 205 respected. 207 5. Acknowledgements 209 The use of FETCH and iPATCH methods with SenML was first introduced 210 by the OMA SpecWorks LwM2M v1.1 specification. This document 211 generalizes the use to any SenML representation. The authors would 212 like to thank Jaime Jimenez, Klaus Hartke, Carsten Bormann, and also 213 everyone in the IETF CoRE and OMA SpecWorks DMSE working groups for 214 their contributions and reviews. 216 6. References 218 6.1. Normative References 220 [I-D.ietf-core-senml] 221 Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. 222 Bormann, "Sensor Measurement Lists (SenML)", draft-ietf- 223 core-senml-16 (work in progress), May 2018. 225 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 226 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 227 RFC2119, March 1997, . 230 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 231 Application Protocol (CoAP)", RFC 7252, DOI 10.17487/ 232 RFC7252, June 2014, . 235 [RFC8132] van der Stok, P., Bormann, C., and A. Sehgal, "PATCH and 236 FETCH Methods for the Constrained Application Protocol 237 (CoAP)", RFC 8132, DOI 10.17487/RFC8132, April 2017, 238 . 240 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 241 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 242 May 2017, . 244 6.2. Informative References 246 [IPSO] IPSO, "IP for Smart Objects - IPSO Objects", 2018, 247 . 249 Authors' Addresses 251 Ari Keranen 252 Ericsson 254 Email: ari.keranen@ericsson.com 256 Mojan Mohajer 257 u-blox UK 259 Email: Mojan.Mohajer@u-blox.com