ETSI TS 118 108 V2.6.1 (2020-03)
oneM2M; CoAP Protocol Binding (oneM2M TS-0008 version 2.6.1 Release 2A)
oneM2M; CoAP Protocol Binding (oneM2M TS-0008 version 2.6.1 Release 2A)
RTS/oneM2M-000008v2A
General Information
Standards Content (Sample)
ETSI TS 118 108 V2.6.1 (2020-03)
TECHNICAL SPECIFICATION
oneM2M;
CoAP Protocol Binding
(oneM2M TS-0008 version 2.6.1 Release 2A)
---------------------- Page: 1 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 2 ETSI TS 118 108 V2.6.1 (2020-03)
Reference
RTS/oneM2M-000008v2A
Keywords
IoT, M2M, protocol
ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE
Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16
Siret N° 348 623 562 00017 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88
Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying
and microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.
© ETSI 2020.
All rights reserved.
DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
3GPP™ and LTE™ are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners.
®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
---------------------- Page: 2 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 3 ETSI TS 118 108 V2.6.1 (2020-03)
Contents
Intellectual Property Rights . 5
Foreword . 5
1 Scope . 6
2 References . 6
2.1 Normative references . 6
2.2 Informative references . 6
3 Definition of terms, symbols and abbreviations . 7
3.1 Terms . 7
3.2 Symbols . 7
3.3 Abbreviations . 7
4 Conventions . 7
5 Overview . 8
5.0 Introduction . 8
5.1 Required Features . 8
5.2 Introduction of CoAP . 8
5.2.0 Introduction. 8
5.2.1 Message Format . 8
5.2.2 Caching . 9
5.2.2.0 Introduction . 9
5.2.2.1 Freshness . 9
5.2.2.2 Validity . 9
5.2.3 Blockwise Transfers . 9
6 CoAP Message Mapping . 9
6.1 Introduction . 9
6.2 Primitive Mapping to CoAP Message . 10
6.2.0 Introduction. 10
6.2.1 Header . 10
6.2.2 Configuration of Token and Options . 10
6.2.2.0 Introduction . 10
6.2.2.1 Token . 11
6.2.2.2 Content Format Negotiation Options . 11
6.2.2.3 URI Options . 11
6.2.2.4 Definition of New Options . 12
6.2.2.4.0 Introduction . 12
6.2.2.4.1 From . 12
6.2.2.4.2 Request Identifier . 13
6.2.2.4.3 Void . 13
6.2.2.4.4 Originating Timestamp . 13
6.2.2.4.5 Request Expiration Timestamp . 13
6.2.2.4.6 Result Expiration Timestamp . 13
6.2.2.4.7 Operation Execution Time. 13
6.2.2.4.8 notificationURI of Response Type . 13
6.2.2.4.9 Event Category . 13
6.2.2.4.10 Response Status Code . 13
6.2.2.4.11 Group Request Identifier . 13
6.2.2.4.12 Resource Type . 13
6.2.2.4.13 Content Offset . 13
6.2.2.4.14 Content Status . 13
6.2.2.4.15 Assigned Token Identifiers . 13
6.2.2.4.16 Release Version Indicator . 14
6.2.2.4.17 Vendor Information . 14
6.2.3 Payload . 14
6.2.4 Response Codes Mapping . 14
6.3 Accessing Resources in CSEs . 15
ETSI
---------------------- Page: 3 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 4 ETSI TS 118 108 V2.6.1 (2020-03)
6.3.0 Introduction. 15
6.3.1 Blocking case . 16
6.3.2 Non-Blocking Asynchronous case . 16
6.3.3 Non-Blocking Synchronous case . 17
6.4 Mapping rules of caching . 17
6.5 Usage of Blockwise Transfers . 17
7 Security Consideration . 18
Annex A (informative): Example Procedures . 19
A.1 Blocking case of AE Registration . 19
A.2 Non-blocking synchronous case of AE Registration . 20
History . 21
ETSI
---------------------- Page: 4 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 5 ETSI TS 118 108 V2.6.1 (2020-03)
Intellectual Property Rights
Essential patents
IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information
pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found
in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web
server (https://ipr.etsi.org/).
Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee
can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web
server) which are, or may be, or may become, essential to the present document.
Trademarks
The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no
right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does
not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.
Foreword
This Technical Specification (TS) has been produced by ETSI Partnership Project oneM2M (oneM2M).
ETSI
---------------------- Page: 5 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 6 ETSI TS 118 108 V2.6.1 (2020-03)
1 Scope
The present document will cover the protocol specific part of communication protocol used by oneM2M compliant
systems as 'RESTful CoAP binding'.
The scope of the present document is (not limited to as shown below):
• Binding oneM2M primitives to CoAP messages.
• Binding oneM2M Response Status Codes to CoAP Response Codes.
• Defining behaviour of a CoAP Client and Server depending on oneM2M parameters.
2 References
2.1 Normative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
Referenced documents which are not found to be publicly available in the expected location might be found at
https://docbox.etsi.org/Reference/.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long term validity.
The following referenced documents are necessary for the application of the present document.
[1] IETF RFC 7252: "The Constrained Application Protocol (CoAP)".
[2] ETSI TS 118 104: "oneM2M; Service Layer Core Protocol Specification (oneM2M TS-0004)".
[3] IETF RFC 7959: "Block-Wise Transfers in the Constrained Application Protocol (CoAP)".
[4] ETSI TS 118 103: "oneM2M; Security Solutions (oneM2M TS-0003)".
[5] IETF RFC 6347: "Datagram Transport Layer Security Version 1.2".
2.2 Informative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long term validity.
The following referenced documents are not necessary for the application of the present document but they assist the
user with regard to a particular subject area.
[i.1] oneM2M Drafting Rules.
NOTE: Available http://www.onem2m.org/images/files/oneM2M-Drafting-Rules.pdf.
ETSI
---------------------- Page: 6 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 7 ETSI TS 118 108 V2.6.1 (2020-03)
3 Definition of terms, symbols and abbreviations
3.1 Terms
Void.
3.2 Symbols
Void.
3.3 Abbreviations
For the purposes of the present document, the following abbreviations apply:
ACK ACKnowledgement
AE Application Entity
ATI Assigned Token Identifiers
CON CONfirmable
CSE Common Service Entity
CTO Content Offset
CTS Content Status
DTLS Datagram Transport Layer Security
EC Event Category
GID Group Request Identifier
HTTP Hyper Text Transfer Protocol
IANA Internet Assigned Numbers Authority
IP Internet Protocol
OET Operation Execution Time
OT Originating Timestamp
RQI Request Identifier
RSC Response Status Code
RST CoAP ReSeT message
RTURI notificationURI
RVI Release Version Indicator
TCP Transport Control Protocol
TLS Transport Layer Security
TLV Tag - Length - Value (data structure)
TY Resource Type
UDP User Datagram Protocol
URI Uniform Resource Identifier
VSI Vendor Information
XML eXtensible Markup Language
4 Conventions
The keywords "Shall", "Shall not", "May", "Need not", "Should", "Should not" in the present document are to be
interpreted as described in the oneM2M Drafting Rules [i.1].
ETSI
---------------------- Page: 7 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 8 ETSI TS 118 108 V2.6.1 (2020-03)
5 Overview
5.0 Introduction
The clause describes which features need to be supported in CoAP layer and introduces a message format and several
features of CoAP used in this protocol binding specification.
5.1 Required Features
This clause explicitly specifies the required features of the CoAP layer for oneM2M to properly bind oneM2M
primitives into CoAP messages:
• The 4-byte binary CoAP message header is defined in section 3 of IETF RFC 7252 [1].
• Confirmable (CON), Acknowledgement (ACK) and Reset (RST) messages shall be supported. The Reset
message is used to send an error message in response to a malformed Confirmable message in CoAP layer.
• GET, PUT, POST and DELETE methods shall be supported. oneM2M primitives map to these methods.
• A subset of Response Code specified in clause 6.2.4 shall be supported for oneM2M Response Status Code
parameter mapping.
• The Uri-Host, Uri-Port, Uri-Path, and Uri-Query shall be supported.
• The Content-Type Option shall be used to indicate the media types of the payload.
• The Token Option may be used.
• Block-wise transfers feature may be supported to carry large payloads.
• Caching feature may be supported.
5.2 Introduction of CoAP
5.2.0 Introduction
This clause describes a message format, and caching and block-wise transfers features which may be used to map
oneM2M primitives to CoAP messages.
5.2.1 Message Format
This clause specifies details about the CoAP (IETF RFC 7252 [1]) message format:
• CoAP message occupies the data section of one UDP datagram.
• CoAP message format supports a 4-byte fixed-size header.
• Fixed-size header is followed by a Token value of length 0 to 8 bytes.
• The Token value is followed by a sequence of zero or more CoAP Options in TLV format.
• CoAP Options are followed by the payload part.
For more details on the CoAP message format and the supported header fields, see IETF RFC 7252 [1].
ETSI
---------------------- Page: 8 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 9 ETSI TS 118 108 V2.6.1 (2020-03)
5.2.2 Caching
5.2.2.0 Introduction
CoAP (IETF RFC 7252 [1]) supports caching of responses to fulfil future equivalent requests to the same resource.
Caching is supported using freshness and validity information carried with CoAP (IETF RFC 7252 [1]) responses.
5.2.2.1 Freshness
• CoAP server shall use Max-Age CoAP Option to specify the explicit expiration time for the CoAP Response's
resource representation. This indicates that the response is not fresh after its age is greater than the specified
number of seconds.
• Max-Age Option defaults to a value of 60 (seconds). In case, Max-Age Option is not present in the cacheable
response, the response shall not be considered fresh after its age is greater than 60 seconds.
• The CoAP server shall set the Max-Age Option value to 0 (zero) to prevent or disable caching.
• The CoAP client, having a fresh stored response, can make new request matching the request for that stored
response. In this case, the new response shall invalidate the old response.
5.2.2.2 Validity
• A CoAP endpoint with stored responses but not able to satisfy subsequent requests (for example, the response
is not fresh), shall use the Etag Option to perform a conditional request to the CoAP server where the resource
is hosted.
• If the cached response with the CoAP client is still valid, the server shall include the Max-Age Option in the
response along with a code of 2.03 - Valid. This shall update the freshness of the cached response at the CoAP
client.
• If the cached response with the CoAP client is not valid, the server shall respond with an updated
representation of the resource with response code 2.05 - Content. The CoAP client shall use the updated
response to satisfy request and may also replace/update the stored or cached response.
5.2.3 Blockwise Transfers
CoAP Block (IETF RFC 7959 [3]) Options may be used when CoAP endpoints need to transfer large payloads
e.g. firmware, software updates. Instead of relying on IP fragmentation, CoAP Block Option should be used for
transferring multiple blocks of information in multiple request-response pairs.
6 CoAP Message Mapping
6.1 Introduction
When AE or CSE binds oneM2M primitives to CoAP messages, or binds CoAP messages to oneM2M primitives, it is
required that:
• AE shall host a CoAP client and should host a CoAP server; or
• CSE shall host both a CoAP client and a CoAP server.
Basically single oneM2M request primitive is mapped to single CoAP request message, and single oneM2M response
primitive is mapped to single CoAP response message. However, single oneM2M request/response primitive is mapped
to multiple CoAP request/response messages respectively when CoAP block-wise transfers feature is used.
ETSI
---------------------- Page: 9 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 10 ETSI TS 118 108 V2.6.1 (2020-03)
Mapping between CoAP message and oneM2M primitive shall be applied in the following cases:
• when the Originator sends a request primitive;
• when the Receiver receives a CoAP message(s);
• when the Receiver sends a response primitive;
• when the Originator receives a CoAP message(s).
The following sub-clauses specify how to map each oneM2M primitive parameter defined in ETSI TS 118 104 [2] to a
corresponding CoAP message field to compose a CoAP request/response message.
6.2 Primitive Mapping to CoAP Message
6.2.0 Introduction
This clause describes where to map oneM2M parameters in a primitive to header, Option and payload fields in a CoAP
message.
6.2.1 Header
This clause specifies how to configure CoAP header information:
• The Version field shall be configured as 1.
• The Type field shall be configured according to clause 6.3. The Reset message is used to send an error
message in response to a malformed Confirmable message in CoAP layer.
• In case of a request, the Code field indicates CoAP Method. The oneM2M Operation parameter shall be
mapped to a CoAP Method according to the table 6.2.1-1.
• In case of a response, the Code field indicates CoAP Response Code. The oneM2M Response Status Code
parameter shall be mapped to CoAP Response Code as specified in clause 6.2.4.
The configurations of Token Length and Message ID are left to implementation.
Table 6.2.1-1: oneM2M Operation Parameter Mapping
oneM2M Operation Parameter CoAP Method
CREATE POST
RETRIEVE GET
UPDATE PUT
DELETE DELETE
NOTIFY POST
At the Receiver, CoAP request message with POST method shall be mapped to oneM2M CREATE or NOTIFY
Operation parameter in accordance with the existence of Resource Type parameter. If Resource Type parameter exists
then value of the Operation parameter is CREATE and if Resource Type parameter does not exist, the value of
Operation parameter is NOTIFY.
6.2.2 Configuration of Token and Options
6.2.2.0 Introduction
This clause describes configuration of Token and Options based on oneM2M parameters.
ETSI
---------------------- Page: 10 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 11 ETSI TS 118 108 V2.6.1 (2020-03)
6.2.2.1 Token
Due to size limitation, Request Identifier is not mapped to Token option. However, Token may be used in CoAP layer
to match a CoAP request and response.
6.2.2.2 Content Format Negotiation Options
The CoAP Accept Option may be used to indicate which Content-Format is acceptable to an Originator. If a Hosting
CSE supports the Content-Format specified in Accept Option of the request, the Hosting CSE shall respond with that
Content-Format. If the Hosting CSE does not support the Content-Format specified in Accept Option of the request,
4.06 "Not Acceptable" shall be sent as a response, unless another error code takes precedence for this response.
Possible values for Content-Format and Accept options are listed below:
• application/xml (41);
• application/json (50);
• application/cbor (60);
• media types specified in clause 6.7 "oneM2M specific MIME media types" of ETSI TS 118 104 [2].
Numeric values for oneM2M defined media types are listed in table 6.2.2.2-1.
Table 6.2.2.2-1: CoAP oneM2M Specific Content-Formats
oneM2M Specific Media Type ID
vnd.onem2m-res+xml 10014
vnd.onem2m-res+json 10001
vnd.onem2m-ntfy+xml 10002
vnd.onem2m-ntfy+json 10003
vnd.onem2m-preq+xml 10006
vnd.onem2m-preq+json 10007
vnd.onem2m-prsp+xml 10008
vnd.onem2m-prsp+json 10009
vnd.onem2m-res+cbor 10010
vnd.onem2m-ntfy+cbor 10011
vnd.onem2m-preq+cbor 10012
vnd.onem2m-prsp+cbor 10013
NOTE: ID values for oneM2M specific media type
are subject to change after IANA
registration.
6.2.2.3 URI Options
This clause describes how to configure CoAP Uri-Host, Uri-Port, Uri-Path, and Uri-Query Options.
Host and port part of the address specified in pointOfAccess attribute of resource shall be mapped to
Uri-Host and Uri-Port respectively.
If To parameter contains absolute format, then the first URI-Path Option shall contain a letter "_" and map To parameter
removing starting "//" into next URI-Path Option(s).
If To parameter contains SP-relative format, then the first URI-Path Option shall contain a letter "~" and map To
parameter removing starting "/" into next URI-Path Option(s).
If To parameter contains CSE-relative format, then To parameter shall be mapped to URI-Path Option(s).
Table 6.2.2.3-1 shows valid mappings between the To request primitive parameter and the Uri-Path of the CoAP.
CSEBase represents the resource name of a resource, CSEBase/ae12/cont27/contInst696 represents a
structured CSE-relative resource ID, and cin00856 an unstructured CSE-relative resource ID.
ETSI
---------------------- Page: 11 ----------------------
oneM2M TS-0008 version 2.6.1 Release 2A 12 ETSI TS 118 108 V2.6.1 (2020-03)
Table 6.2.2.3-1: Mapping examples between To parameter and Uri-Path of the CoAP
Request Scope
Method
CSE-Relative SP-Relative Absolute
CSEBase/ae12/cont27/contI /CSE178/CSEBase/ae12/cont2 //mym2msp.org/CSE178/CSEB
To
nst696 7/contInst696 ase/ae12/cont27/contInst696
_
~ mym2msp.org
CSEBase
CSE178 CSE178
Structured
Uri-
CSEBase CSEBase
Path
ae12 ae12 ae12
cont27 cont27 cont27
contInst696 contInst696 contInst696
//mym2msp.org/CSE178/cin008
To cin00856 /CSE178/cin00856
56
_
Unstructured
Uri- ~ mym2msp.org
cin00856
Path CSE178 CSE178
cin00856 cin00856
NOTE: How to read this table: To primitive - from left to right, Uri-Path - from top to bottom.
The responseTypeValue element of Response Type, Result Persistence, Delivery Aggregation, Result Content,
parameters of Filter Criteria, Discovery Result Type, Token Request Indicator, Tokens, Token IDs and Local Token
IDs parameters shall be carried in Uri-Query Option in a short name form as specified in clause 8.2.2 of ETSI
TS 118 104 [2].
6.2.2.4 Definition of New Options
6.2.2.4.0 Introduction
This clause describes new CoAP Options used for binding several oneM2M request/response parameters.
Table 6.2.2.4.0-1 contains definitions of the new CoAP Options and sub-clauses specify oneM2M parameter mapping
with the newly defined CoAP Options in the table 6.2.2.4.0-1.
Table 6.2.2.4.0-1: Definition of New Options
No C U N R Name Format Length Default
256 oneM2M-FR string 0-255 (None)
257 oneM2M-RQI string 0-255 (None)
259 oneM2M-OT string 15 (None)
260 oneM2M-RQET string 15 (None)
261 oneM2M
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.