< draft-ietf-core-senml-etch-03.txt   draft-ietf-core-senml-etch-04.txt >
Network Working Group A. Keranen Network Working Group A. Keranen
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Standards Track M. Mohajer Intended status: Standards Track M. Mohajer
Expires: September 13, 2019 u-blox UK Expires: January 9, 2020 u-blox UK
March 12, 2019 July 8, 2019
FETCH & PATCH with Sensor Measurement Lists (SenML) FETCH & PATCH with Sensor Measurement Lists (SenML)
draft-ietf-core-senml-etch-03 draft-ietf-core-senml-etch-04
Abstract Abstract
The Sensor Measurement Lists (SenML) media type and data model can be The Sensor Measurement Lists (SenML) media type and data model can be
used to send collections of resources, such as batches of sensor data used to send collections of resources, such as batches of sensor data
or configuration parameters. The CoAP iPATCH, PATCH, and FETCH or configuration parameters. The CoAP iPATCH, PATCH, and FETCH
methods enable accessing and updating parts of a resource or multiple methods enable accessing and updating parts of a resource or multiple
resources with one request. This document defines new media types resources with one request. This document defines new media types
for the CoAP iPATCH, PATCH, and FETCH methods for resources for the CoAP iPATCH, PATCH, and FETCH methods for resources
represented with the SenML data model. represented with the SenML data model.
skipping to change at page 1, line 37 skipping to change at page 1, line 37
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 13, 2019. This Internet-Draft will expire on January 9, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 21 skipping to change at page 2, line 21
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Using FETCH and (i)PATCH with SenML . . . . . . . . . . . . . 3 3. Using FETCH and (i)PATCH with SenML . . . . . . . . . . . . . 3
3.1. SenML FETCH . . . . . . . . . . . . . . . . . . . . . . . 4 3.1. SenML FETCH . . . . . . . . . . . . . . . . . . . . . . . 4
3.2. SenML (i)PATCH . . . . . . . . . . . . . . . . . . . . . 4 3.2. SenML (i)PATCH . . . . . . . . . . . . . . . . . . . . . 4
4. Security Considerations . . . . . . . . . . . . . . . . . . . 5 4. Security Considerations . . . . . . . . . . . . . . . . . . . 5
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
5.1. CoAP Content-Format Registration . . . . . . . . . . . . 6 5.1. CoAP Content-Format Registration . . . . . . . . . . . . 6
5.2. senml-etch+json Media Type . . . . . . . . . . . . . . . 6 5.2. senml-etch+json Media Type . . . . . . . . . . . . . . . 6
5.3. senml-etch+cbor Media Type . . . . . . . . . . . . . . . 7 5.3. senml-etch+cbor Media Type . . . . . . . . . . . . . . . 7
6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 9
7.1. Normative References . . . . . . . . . . . . . . . . . . 8 7.1. Normative References . . . . . . . . . . . . . . . . . . 9
7.2. Informative References . . . . . . . . . . . . . . . . . 9 7.2. Informative References . . . . . . . . . . . . . . . . . 9
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
The Sensor Measurement Lists (SenML) media type [RFC8428] and data The Sensor Measurement Lists (SenML) media type [RFC8428] and data
model can be used to transmit collections of resources, such as model can be used to transmit collections of resources, such as
batches of sensor data or configuration parameters. batches of sensor data or configuration parameters.
An example of a SenML collection is shown below: An example of a SenML collection is shown below:
[ [
{"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, {"bn":"2001:db8::2/3311/0/", "n":"5850", "vb":true},
{"n":"5851", "v":42}, {"n":"5851", "v":42},
{"n":"5750", "vs":"Ceiling light"} {"n":"5750", "vs":"Ceiling light"}
] ]
Here three resources "3306/0/5850", "3306/0/5851", and "3306/0/5750", Here three resources "3311/0/5850", "3311/0/5851", and "3311/0/5750",
of an IPSO dimmable light smart object [IPSO] are represented using a of an IPSO dimmable light smart object [IPSO] are represented using a
single SenML Pack with three SenML Records. All resources share the single SenML Pack with three SenML Records. All resources share the
same base name "2001:db8::2/3306/0/", hence full names for resources same base name "2001:db8::2/3311/0/", hence full names for resources
are "2001:db8::2/3306/0/5850", etc. are "2001:db8::2/3311/0/5850", etc.
The CoAP [RFC7252] iPATCH, PATCH, and FETCH methods [RFC8132] enable The CoAP [RFC7252] iPATCH, PATCH, and FETCH methods [RFC8132] enable
accessing and updating parts of a resource or multiple resources with accessing and updating parts of a resource or multiple resources with
one request. one request.
This document defines two new media types, one using the JavaScript This document defines two new media types, one using the JavaScript
Object Notation (JSON) [RFC8259] and one using the Concise Binary Object Notation (JSON) [RFC8259] and one using the Concise Binary
Object Representation (CBOR) [RFC7049], that can be used with the Object Representation (CBOR) [RFC7049], that can be used with the
CoAP iPATCH, PATCH, and FETCH methods for resources represented with CoAP iPATCH, PATCH, and FETCH methods for resources represented with
the SenML data model. The semantics of the new media types are the the SenML data model. The semantics of the new media types are the
skipping to change at page 4, line 19 skipping to change at page 4, line 19
are selected by giving a set of names that, when resolved, match are selected by giving a set of names that, when resolved, match
resolved names in a SenML Pack. The names for a Fetch Pack are given resolved names in a SenML Pack. The names for a Fetch Pack are given
using the SenML "name" and/or "base name" Fields. The names are using the SenML "name" and/or "base name" Fields. The names are
resolved by concatenating the base name with the name field as resolved by concatenating the base name with the name field as
defined in [RFC8428]. defined in [RFC8428].
For example, to select the IPSO resources "5850" and "5851" from the For example, to select the IPSO resources "5850" and "5851" from the
example in Section 1, the following Fetch Pack can be used: example in Section 1, the following Fetch Pack can be used:
[ [
{"bn":"2001:db8::2/3306/0/", "n":"5850"}, {"bn":"2001:db8::2/3311/0/", "n":"5850"},
{"n":"5851"} {"n":"5851"}
] ]
The result to a FETCH request with the example above would be: The result to a FETCH request with the example above would be:
[ [
{"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":true}, {"bn":"2001:db8::2/3311/0/", "n":"5850", "vb":true},
{"n":"5851", "v":42}, {"n":"5851", "v":42},
] ]
When SenML Records contain also time values, a name may no longer When SenML Records contain also time values, a name may no longer
uniquely identify a single Record. When no time is given in a Fetch uniquely identify a single Record. When no time is given in a Fetch
Record, all SenML Records with the given name are matched (i.e., Record, all SenML Records with the given name are matched (i.e.,
unlike with SenML Records, lack of time field in a Fetch Record does unlike with SenML Records, lack of time field in a Fetch Record does
not imply time value zero). When time is given in the Fetch Record, not imply time value zero). When time is given in the Fetch Record,
only a SenML Record (if any) with equal resolved time value and name only a SenML Record (if any) with equal resolved time value and name
is matched. is matched.
skipping to change at page 5, line 14 skipping to change at page 5, line 14
When the name in a Patch Record matches with the name in an existing When the name in a Patch Record matches with the name in an existing
Record, the resolved time values are compared. If the time values Record, the resolved time values are compared. If the time values
either do not exist in both Records or are equal, the Target Record either do not exist in both Records or are equal, the Target Record
is replaced with the contents of the Patch Record. is replaced with the contents of the Patch Record.
If a Patch Record contains a name, or combination of a time value and If a Patch Record contains a name, or combination of a time value and
a name, that do not exist in any existing Record in the Pack, the a name, that do not exist in any existing Record in the Pack, the
given Record, with all the fields it contains, is added to the Pack. given Record, with all the fields it contains, is added to the Pack.
If a Patch Record has a value field with value null, the matched If a Patch Record has a value ("v") field with value null, the
Record (if any) is removed from the Pack. matched Record (if any) is removed from the Pack.
For example, the following document could be given as (i)PATCH For example, the following document could be given as an (i)PATCH
payload to change/set values of two SenML Records for the example in payload to change/set values of two SenML Records for the example in
Section 1: Section 1:
[ [
{"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, {"bn":"2001:db8::2/3311/0/", "n":"5850", "vb":false},
{"n":"5851", "v":10} {"n":"5851", "v":10}
] ]
If the request is successful, the resulting representation of the If the request is successful, the resulting representation of the
example SenML Pack would be as follows: example SenML Pack would be as follows:
[ [
{"bn":"2001:db8::2/3306/0/", "n":"5850", "vb":false}, {"bn":"2001:db8::2/3311/0/", "n":"5850", "vb":false},
{"n":"5851", "v":10}, {"n":"5851", "v":10},
{"n":"5750", "vs":"Ceiling light"} {"n":"5750", "vs":"Ceiling light"}
] ]
As another example, the following document could be given as an
(i)PATCH payload to remove the two SenML Records:
[
{"bn":"2001:db8::2/3311/0/", "n":"5850", "v":null},
{"n":"5851", "v":null}
]
4. Security Considerations 4. Security Considerations
The security and privacy considerations of SenML apply also with the The security and privacy considerations of SenML apply also with the
FETCH and (i)PATCH methods. FETCH and (i)PATCH methods.
In FETCH and (i)PATCH requests, the client can pass arbitrary names In FETCH and (i)PATCH requests, the client can pass arbitrary names
to the target resource for manipulation. The resource implementer to the target resource for manipulation. The resource implementer
must take care to only allow access to names that are actually part must take care to only allow access to names that are actually part
of (or accessible through) the target resource. of (or accessible through) the target resource.
skipping to change at page 6, line 17 skipping to change at page 6, line 21
This document registers two new media types and CoAP Content-Format This document registers two new media types and CoAP Content-Format
IDs for both media types. IDs for both media types.
Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with Note to RFC Editor: Please replace all occurrences of "RFC-AAAA" with
the RFC number of this document. the RFC number of this document.
5.1. CoAP Content-Format Registration 5.1. CoAP Content-Format Registration
IANA is requested to assign CoAP Content-Format IDs for the SenML IANA is requested to assign CoAP Content-Format IDs for the SenML
PATCH and FETCH media types in the "CoAP Content-Formats" sub- PATCH and FETCH media types in the "CoAP Content-Formats" sub-
registry, within the "CoRE Parameters" registry [RFC7252]. All IDs registry, within the "CoRE Parameters" registry [RFC7252]. The
are assigned from the "IETF Review or IESG Approval" range. The assigned IDs are shown in Table 1.
assigned IDs are show in Table 1.
+-----------------------------+-----+ +-----------------------------+----------+---------+
| Media type | ID | | Media type | Encoding | ID |
+-----------------------------+-----+ +-----------------------------+----------+---------+
| application/senml-etch+json | TBD | | application/senml-etch+json | - | TBD-320 |
| | | | | | |
| application/senml-etch+cbor | TBD | | application/senml-etch+cbor | - | TBD-322 |
+-----------------------------+-----+ +-----------------------------+----------+---------+
Table 1: CoAP Content-Format IDs Table 1: CoAP Content-Format IDs
5.2. senml-etch+json Media Type 5.2. senml-etch+json Media Type
Type name: application Type name: application
Subtype name: senml-etch+json Subtype name: senml-etch+json
Required parameters: none Required parameters: none
skipping to change at page 8, line 42 skipping to change at page 8, line 47
Author: Ari Keranen ari.keranen@ericsson.com Author: Ari Keranen ari.keranen@ericsson.com
Change controller: IESG Change controller: IESG
6. Acknowledgements 6. Acknowledgements
The use of FETCH and (i)PATCH methods with SenML was first introduced The use of FETCH and (i)PATCH methods with SenML was first introduced
by the OMA SpecWorks LwM2M v1.1 specification. This document by the OMA SpecWorks LwM2M v1.1 specification. This document
generalizes the use to any SenML representation. The authors would generalizes the use to any SenML representation. The authors would
like to thank Carsten Bormann, Christian Amsuess, Jaime Jimenez, like to thank Carsten Bormann, Christian Amsuess, Jaime Jimenez,
Klaus Hartke, and other participants from the IETF CoRE and OMA Klaus Hartke, Michael Richardson, and other participants from the
SpecWorks DMSE working groups who have contributed ideas and reviews. IETF CoRE and OMA SpecWorks DMSE working groups who have contributed
ideas and reviews.
7. References 7. References
7.1. Normative References 7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
skipping to change at page 9, line 40 skipping to change at page 9, line 44
DOI 10.17487/RFC8259, December 2017, DOI 10.17487/RFC8259, December 2017,
<https://www.rfc-editor.org/info/rfc8259>. <https://www.rfc-editor.org/info/rfc8259>.
[RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C.
Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, Bormann, "Sensor Measurement Lists (SenML)", RFC 8428,
DOI 10.17487/RFC8428, August 2018, DOI 10.17487/RFC8428, August 2018,
<https://www.rfc-editor.org/info/rfc8428>. <https://www.rfc-editor.org/info/rfc8428>.
7.2. Informative References 7.2. Informative References
[IPSO] IPSO, "IPSO Smart Object Guidelines", 2018, [IPSO] IPSO, "IPSO Light Control Smart Object", 2018,
<https://www.omaspecworks.org/develop-with-oma-specworks/ <http://www.openmobilealliance.org/tech/profiles/
ipso-smart-objects/guidelines/>. lwm2m/3311.xml>.
Authors' Addresses Authors' Addresses
Ari Keranen Ari Keranen
Ericsson Ericsson
Email: ari.keranen@ericsson.com Email: ari.keranen@ericsson.com
Mojan Mohajer Mojan Mohajer
u-blox UK u-blox UK
Email: Mojan.Mohajer@u-blox.com Email: Mojan.Mohajer@u-blox.com
 End of changes. 20 change blocks. 
33 lines changed or deleted 41 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/