draft-ietf-core-multipart-ct-00.txt   draft-ietf-core-multipart-ct-01.txt 
CoRE T. Fossati CoRE T. Fossati
Internet-Draft Nokia Internet-Draft Nokia
Intended status: Standards Track K. Hartke Intended status: Standards Track K. Hartke
Expires: December 27, 2018 Ericsson Expires: January 3, 2019 Ericsson
C. Bormann C. Bormann
Universitaet Bremen TZI Universitaet Bremen TZI
June 25, 2018 July 02, 2018
Multipart Content-Format for CoAP Multipart Content-Format for CoAP
draft-ietf-core-multipart-ct-00 draft-ietf-core-multipart-ct-01
Abstract Abstract
This memo defines application/multipart-core, an application- This memo defines application/multipart-core, an application-
independent media-type that can be used to combine representations of independent media-type that can be used to combine representations of
several different media types into a single CoAP message-body with several different media types into a single CoAP message-body with
minimal framing overhead, each along with a CoAP Content-Format minimal framing overhead, each along with a CoAP Content-Format
identifier. identifier.
Status of This Memo Status of This Memo
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 December 27, 2018. This Internet-Draft will expire on January 3, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Multipart Content-Format Encoding . . . . . . . . . . . . . . 3 2. Multipart Content-Format Encoding . . . . . . . . . . . . . . 3
3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 3 3. Usage Examples . . . . . . . . . . . . . . . . . . . . . . . 3
3.1. Registration of media type application/multipart-core . . 3 3.1. Observing Resources . . . . . . . . . . . . . . . . . . . 3
3.2. Registration of a Content-Format identifier for 3.2. Implementation hints . . . . . . . . . . . . . . . . . . 4
application/multipart-core . . . . . . . . . . . . . . . 4 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
4. Security Considerations . . . . . . . . . . . . . . . . . . . 5 4.1. Registration of media type application/multipart-core . . 5
5. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 4.2. Registration of a Content-Format identifier for
5.1. Normative References . . . . . . . . . . . . . . . . . . 5 application/multipart-core . . . . . . . . . . . . . . . 6
5.2. Informative References . . . . . . . . . . . . . . . . . 5 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 5 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 6.1. Normative References . . . . . . . . . . . . . . . . . . 7
6.2. Informative References . . . . . . . . . . . . . . . . . 7
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction 1. Introduction
This memo defines application/multipart-core, an application- This memo defines application/multipart-core, an application-
independent media-type that can be used to combine representations of independent media-type that can be used to combine representations of
several different media types into a single CoAP [RFC7252] message- several different media types into a single CoAP [RFC7252] message-
body with minimal framing overhead, each along with a CoAP Content- body with minimal framing overhead, each along with a CoAP Content-
Format identifier. Format identifier.
This simple and efficient binary framing mechanism can be employed to This simple and efficient binary framing mechanism can be employed to
skipping to change at page 3, line 16 skipping to change at page 3, line 16
A representation of media-type application/multipart-core contains a A representation of media-type application/multipart-core contains a
collection of zero or more representations, each along with their collection of zero or more representations, each along with their
respective content format. respective content format.
The collection is encoded as a CBOR [RFC7049] array with an even The collection is encoded as a CBOR [RFC7049] array with an even
number of elements. The second, fourth, sixth, etc. element is a number of elements. The second, fourth, sixth, etc. element is a
byte string containing a representation, or the value "null" if an byte string containing a representation, or the value "null" if an
optional part is indicated as not given. The first, third, fifth, optional part is indicated as not given. The first, third, fifth,
etc. element is an unsigned integer specifying the content format ID etc. element is an unsigned integer specifying the content format ID
of the representation following it. Where needed by an application, of the representation following it. (Future extensions might want to
each such format identifying element alternatively can be a text include additional alternative ways of specifying the media type of a
string giving the media type name plus potentially some parameters. representation in such a position.)
For example, a collection containing two representations, one with For example, a collection containing two representations, one with
content format ID 42 and one with content format ID 0, looks like content format ID 42 and one with content format ID 0, looks like
this in CBOR diagnostic notation: this in CBOR diagnostic notation:
[42, h'0123456789abcdef', 0, h'3031323334'] [42, h'0123456789abcdef', 0, h'3031323334']
For illustration, the structure of an application/multipart-core For illustration, the structure of an application/multipart-core
representation can be described by the CDDL [I-D.ietf-cbor-cddl] representation can be described by the CDDL [I-D.ietf-cbor-cddl]
specification in Figure 1: specification in Figure 1:
multipart-core = [* multipart-part] multipart-core = [* multipart-part]
multipart-part = (type: uint .size 2 / text, part: bytes / null) multipart-part = (type: uint .size 2, part: bytes / null)
Figure 1: CDDL for application/multipart-core Figure 1: CDDL for application/multipart-core
3. IANA Considerations 3. Usage Examples
3.1. Registration of media type application/multipart-core 3.1. Observing Resources
When a client registers to observe a resource [RFC7641] for which no
representation is available yet, the server may send one or more 2.05
(Content) notifications before sending the first actual 2.05
(Content) or 2.03 (Valid) notification. The possible resulting
sequence of notifications is shown in Figure 1.
__________ __________ __________
| | | | | |
---->| 2.05 |---->| 2.05 / |---->| 4.xx / |
| Pending | | 2.03 | | 5.xx |
|__________| |__________| |__________|
^ \ \ ^ \ ^
\__/ \ \___/ /
\_______________________/
Figure 2: Sequence of Notifications:
The specification of the Observe option requires that all
notifications carry the same Content-Format. The application/
multipart-core media type can be used to provide that Content-Format:
e.g., carrying an empty list of representations in the case marked as
"Pending" in Figure 2, and carrying a single representation specified
as the target content-format in the case in the middle of the figure.
3.2. Implementation hints
This section describes the serialization for readers that may be new
to CBOR. It does not contain any new information.
An application/multipart-core representation carrying no
representations is represented by an empty CBOR array, which is
serialized as a single byte with the value 0x80.
An application/multipart-core representation carrying a single
representation is represented by a two-element CBOR array, which is
serialized as 0x82 followed by the two elements. The first element
is an unsigned integer for the Content-Format value, which is
represented as described in Table 1. The second element is the
object as a byte string, which is represented as a length as
described in Table 2 followed by the bytes of the object.
+----------------+------------+
| Serialization | Value |
+----------------+------------+
| 0x00..0x17 | 0..23 |
| 0x18 0xnn | 24..255 |
| 0x19 0xnn 0xnn | 256..66535 |
+----------------+------------+
Table 1: Serialization of content-format
+-----------------------------+-------------------+
| Serialization | Length |
+-----------------------------+-------------------+
| 0x40..0x57 | 0..23 |
| 0x58 0xnn | 24..255 |
| 0x59 0xnn 0xnn | 256..66535 |
| 0x5a 0xnn 0xnn 0xnn 0xnn | 66536..4294967295 |
| 0x5b 0xnn .. 0xnn (8 bytes) | 4294967296.. |
+-----------------------------+-------------------+
Table 2: Serialization of object length
For example, a single text/plain object (content-format 0) of value
"Hello World" (11 characters) would be serialized as
0x82 0x00 0x4b H e l l o 0x20 w o r l d
In effect, the serialization for a single object is done by prefixing
the object with information about its content-format (here: 0x82
0x00) and its length (here: 0x4b).
For more than one representation included in an application/
multipart-core representation, the head of the CBOR array is adjusted
(0x84 for two representations, 0x86 for three, ...) and the sequences
of content-format and embedded representations follow.
4. IANA Considerations
4.1. Registration of media type application/multipart-core
IANA is requested to register the following media type [RFC6838]: IANA is requested to register the following media type [RFC6838]:
Type name: application Type name: application
Subtype name: multipart-core Subtype name: multipart-core
Required parameters: N/A Required parameters: N/A
Optional parameters: N/A Optional parameters: N/A
skipping to change at page 4, line 38 skipping to change at page 6, line 33
Intended usage: COMMON Intended usage: COMMON
Restrictions on usage: N/A Restrictions on usage: N/A
Author: CoRE WG Author: CoRE WG
Change controller: IESG Change controller: IESG
Provisional registration? (standards tree only): no Provisional registration? (standards tree only): no
3.2. Registration of a Content-Format identifier for application/ 4.2. Registration of a Content-Format identifier for application/
multipart-core multipart-core
IANA is requested to register the following Content-Format to the IANA is requested to register the following Content-Format to the
"CoAP Content-Formats" subregistry, within the "Constrained RESTful "CoAP Content-Formats" subregistry, within the "Constrained RESTful
Environments (CoRE) Parameters" registry, from the IETF Review space Environments (CoRE) Parameters" registry, from the IETF Review space
(specifically, 256..999): (specifically, 256..999):
+----------------------------+----------+------+-----------+ +----------------------------+----------+------+-----------+
| Media Type | Encoding | ID | Reference | | Media Type | Encoding | ID | Reference |
+----------------------------+----------+------+-----------+ +----------------------------+----------+------+-----------+
| application/multipart-core | -- | TBD1 | RFCthis | | application/multipart-core | -- | TBD1 | RFCthis |
+----------------------------+----------+------+-----------+ +----------------------------+----------+------+-----------+
4. Security Considerations 5. Security Considerations
The security considerations of [RFC7049] apply. In particular, The security considerations of [RFC7049] apply. In particular,
resource exhaustion attacks may employ large values for the byte resource exhaustion attacks may employ large values for the byte
string size fields, or deeply nested structures of recursively string size fields, or deeply nested structures of recursively
embedded application/multipart-core representations. embedded application/multipart-core representations.
5. References 6. References
5.1. Normative References 6.1. Normative References
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <https://www.rfc-editor.org/info/rfc7049>. October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained
Application Protocol (CoAP)", RFC 7252, Application Protocol (CoAP)", RFC 7252,
DOI 10.17487/RFC7252, June 2014, DOI 10.17487/RFC7252, June 2014,
<https://www.rfc-editor.org/info/rfc7252>. <https://www.rfc-editor.org/info/rfc7252>.
5.2. Informative References [RFC7641] Hartke, K., "Observing Resources in the Constrained
Application Protocol (CoAP)", RFC 7641,
DOI 10.17487/RFC7641, September 2015,
<https://www.rfc-editor.org/info/rfc7641>.
6.2. Informative References
[I-D.ietf-ace-coap-est] [I-D.ietf-ace-coap-est]
Stok, P., Kampanakis, P., Kumar, S., Richardson, M., Stok, P., Kampanakis, P., Kumar, S., Richardson, M.,
Furuhed, M., and S. Raza, "EST over secure CoAP (EST- Furuhed, M., and S. Raza, "EST over secure CoAP (EST-
coaps)", draft-ietf-ace-coap-est-03 (work in progress), coaps)", draft-ietf-ace-coap-est-03 (work in progress),
June 2018. June 2018.
[I-D.ietf-cbor-cddl] [I-D.ietf-cbor-cddl]
Birkholz, H., Vigano, C., and C. Bormann, "Concise data Birkholz, H., Vigano, C., and C. Bormann, "Concise data
definition language (CDDL): a notational convention to definition language (CDDL): a notational convention to
 End of changes. 14 change blocks. 
25 lines changed or deleted 114 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/