CoRE C. Bormann Internet-Draft Universitaet Bremen TZI Intended status: Standards Track June 05, 2018 Expires: December 7, 2018 Multipart Content-Format for CoAP draft-fossati-core-multipart-ct-04 Abstract This memo defines multipart/core, an application-independent media- type that can be used to combine (even recursively) several different media types into a single CoAP message-body with minimal framing overhead, along with a CoAP Content-Format identifier. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on December 7, 2018. Copyright Notice Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Bormann Expires December 7, 2018 [Page 1] Internet-Draft Multipart Content-Format for CoAP June 2018 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Multipart Content-Format Encoding . . . . . . . . . . . . . . 2 3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 3 3.1. Registration of media type multipart/core . . . . . . . . 3 3.2. Registration of a Content-Format identifier for multipart/core . . . . . . . . . . . . . . . . . . . . . 4 4. Security Considerations . . . . . . . . . . . . . . . . . . . 4 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 4 5.1. Normative References . . . . . . . . . . . . . . . . . . 4 5.2. Informative References . . . . . . . . . . . . . . . . . 5 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction This memo defines multipart/core, an application-independent media- type that can be used to combine several different media types into a single CoAP [RFC7252] message-body with minimal framing overhead, along with a CoAP Content-Format identifier. This simple and efficient binary framing mechanism can be employed to create application specific request and response bodies which build on multiple already existing media types. Applications using the multipart/core Content-Format define the internal structure of the multipart/core representation. Optionally, they might also register a new media type and an associated Content- Format identifier -- typically one in the range 10000-64999. One way to structure the sub-types specific to a multipart/core container is to always include them at the same fixed position. This specification allows to indicate that an optional part is not present by substituting a null value for the representation of the part. 2. Multipart Content-Format Encoding A representation of media-type multipart/core contains a collection of zero or more representations, each along with their respective content format. The collection is encoded as a CBOR [RFC7049] array with an even number of elements. The second, fourth, sixth, etc. element is a byte string containing a representation, or the value "null" if an optional part is indicated as not given. The first, third, fifth, etc. element is an unsigned integer specifying the content format ID of the representation following it. Bormann Expires December 7, 2018 [Page 2] Internet-Draft Multipart Content-Format for CoAP June 2018 For example, a collection containing two representations, one with content format ID 42 and one with content format ID 0, looks like this in CBOR diagnostic notation: [42, h'0123456789abcdef', 0, h'3031323334'] For illustration, the structure of a multipart/core representation can be described by the CDDL [I-D.ietf-cbor-cddl] specification in Figure 1: multipart-core = [* multipart-part] multipart-part = (type: uint .size 2, part: bytes / null) Figure 1: CDDL for multipart/core 3. IANA Considerations 3.1. Registration of media type multipart/core IANA is requested to register the following media type [RFC6838]: Type name: multipart Subtype name: core Required parameters: N/A Optional parameters: N/A Encoding considerations: binary Security considerations: See the Security Considerations Section of RFCthis Interoperability considerations: N/A Published specification: RFCthis Applications that use this media type: Applications that need to combine representations of potentially several media types into one, e.g. EST-CoAP [I-D.ietf-ace-coap-est] Fragment identifier considerations: N/A Additional information: Deprecated alias names for this type: N/A Bormann Expires December 7, 2018 [Page 3] Internet-Draft Multipart Content-Format for CoAP June 2018 Magic number(s): N/A File extension(s): N/A Macintosh file type code(s): N/A Person & email address to contact for further information: iesg&ietf.org Intended usage: COMMON Restrictions on usage: N/A Author: CoRE WG Change controller: IESG Provisional registration? (standards tree only): no 3.2. Registration of a Content-Format identifier for multipart/core IANA is requested to register the following Content-Format to the "CoAP Content-Formats" subregistry, within the "Constrained RESTful Environments (CoRE) Parameters" registry, from the IETF Review space (specifically, 256..999): +----------------+----------+-----+-----------+ | Media Type | Encoding | ID | Reference | +----------------+----------+-----+-----------+ | multipart/core | -- | TBD | RFCthis | +----------------+----------+-----+-----------+ 4. Security Considerations The security considerations of [RFC7049] apply. In particular, resource exhaustion attacks may emply large values for the byte string size fields, or deeply nested structures of recursively embedded multipart/core representations. 5. References 5.1. Normative References [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013, . Bormann Expires December 7, 2018 [Page 4] Internet-Draft Multipart Content-Format for CoAP June 2018 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10.17487/RFC7252, June 2014, . 5.2. Informative References [I-D.ietf-ace-coap-est] Stok, P., Kampanakis, P., Kumar, S., Richardson, M., Furuhed, M., and S. Raza, "EST over secure CoAP (EST- coaps)", draft-ietf-ace-coap-est-00 (work in progress), February 2018. [I-D.ietf-cbor-cddl] Birkholz, H., Vigano, C., and C. Bormann, "Concise data definition language (CDDL): a notational convention to express CBOR data structures", draft-ietf-cbor-cddl-02 (work in progress), February 2018. [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, DOI 10.17487/RFC6838, January 2013, . Acknowledgements Most of the text in this draft is from earlier contributions by Thomas Fossati and Klaus Hartke. The re-mix in this document is based on the requirements in [I-D.ietf-ace-coap-est]. Author's Address Carsten Bormann Universitaet Bremen TZI Postfach 330440 Bremen D-28359 Germany Phone: +49-421-218-63921 Email: cabo@tzi.org Bormann Expires December 7, 2018 [Page 5]