Internet-Draft | Parametrized Content-Format for CoAP | June 2022 |
Fossati & Birkholz | Expires 12 December 2022 | [Page] |
This document specifies a "parametrized" CoAP Content-Format data item that allows supplementing a Content-Format with additional media type parameters.¶
This document also defines two new CoAP Options, Parmetrized-Content-Format and Parametrized-Multi-Valued-Accept, that build upon the "parametrized" Content-Format data item to work around some of the limitations of the existing Accept and Content-Format Options.¶
This note is to be removed before publishing as an RFC.¶
The latest revision of this draft can be found at https://thomas-fossati.github.io/draft-coap-parametrized-cf/draft-fossati-core-parametrized-cf.html. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-fossati-core-parametrized-cf/.¶
Discussion of this document takes place on the Constrained RESTful Environments Working Group mailing list (mailto:core@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/core/.¶
Source for this draft and an issue tracker can be found at https://github.com/thomas-fossati/draft-coap-parametrized-cf.¶
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 12 December 2022.¶
Copyright (c) 2022 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
CoAP squashes the combination of a media type, media type parameters and content coding into a single Content-Format number. (For an example, see Section 16.10 of [RFC8152].) This number is carried in the Content-Format and Accept Options.¶
This compression strategy is ideal in cases where the set of possible combinations is known upfront and has small cardinality. However, it lacks the flexibility to deal smoothly with situations where the number of combinations can grow unbounded.¶
An example is [I-D.lundblade-rats-eat-media-type], in which the "profile" media type parameter can carry a number of different values that are constantly minted through a loosely regulated process.¶
To avoid the combinatorial explosion that derives from such premises, this document defines the "parametrized" Content-Format data item (Section 3) as a mechanism to enrich a given Content-Format with additional media type parameters.¶
Two new CoAP Options that build upon such data item are also defined:¶
The latter also works around the limited content negotiation capabilities of the CoAP Accept Option by allowing to accept more than one Content-Format per request.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
The Parametrized Content-Format is a CBOR [STD94] data item defined by the CDDL [RFC8610] in Figure 1.¶
The first element in the tuple is the Content-Format identifier, followed by zero or more name-value pairs representing the additional media type parameters.¶
The name-value pairs are optional to support the case where the Parametrized Content-Format is used in Parametrized Multi-Valued Accept Option (Section 5).¶
TODO describe use of numeric identifiers as alias for parameter names (requires a new registry).¶
The list that follows details the semantic requirements that a Parametrized Content-Format data item must satisfy:¶
If any of the conditions listed above is not met, the entire data item is considered invalid and MUST NOT be processed further.¶
Number | C | U | N | R | Name | Format | Length | Default |
---|---|---|---|---|---|---|---|---|
TBD24 | Parametrized Content-Format Option | See Figure 3 | none |
The Parametrized Content-Format Option carries a CBOR-encoded Parametrized Content-Format data item.¶
The semantic is identical to the Content-Format Option described in Section 5.10.3 of [RFC7252].¶
Number | C | U | N | R | Name | Format | Length | Default |
---|---|---|---|---|---|---|---|---|
TBD13 | x | Parametrized Multi-Valued Accept Option | See Figure 4 | none |
The Parametrized Multi-Valued Accept Option carries a single CBOR-encoded Parametrized Content-Format data item or two or more Parametrized Content-Format data items as a CBOR array.¶
The semantic is identical to the Accept Option described in Section 5.10.4 of [RFC7252], except for the ability to list more than one acceptable (parametrized) Content-Format, which is key to enable finer-grained content negotiation.¶
The Content-Formats are listed in order of preference. If more than one match is found, the entry with the lowest index in the array MUST be selected.¶
TODO Security¶
TODO IANA¶
TODO acknowledge.¶