< draft-keranen-core-senml-data-ct-01.txt   draft-keranen-core-senml-data-ct-02.txt >
Network Working Group A. Keranen Network Working Group A. Keranen
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Standards Track C. Bormann Intended status: Standards Track C. Bormann
Expires: September 13, 2019 Universitaet Bremen TZI Expires: January 9, 2020 Universitaet Bremen TZI
March 12, 2019 July 8, 2019
SenML Data Value Content-Format Indication SenML Data Value Content-Format Indication
draft-keranen-core-senml-data-ct-01 draft-keranen-core-senml-data-ct-02
Abstract Abstract
The Sensor Measurement Lists (SenML) media type supports multiple The Sensor Measurement Lists (SenML) media type supports multiple
types of values, from numbers to text strings and arbitrary binary types of values, from numbers to text strings and arbitrary binary
data values. In order to simplify processing of the data values this data values. In order to simplify processing of the data values this
document proposes to specify a new SenML field for indicating the document proposes to specify a new SenML field for indicating the
Content-Format of the data. Content-Format of the data.
Status of This Memo Status of This Memo
skipping to change at page 1, line 35 skipping to change at page 1, line 35
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 12 skipping to change at page 2, line 12
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. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. SenML Content-Format ("ct") Field . . . . . . . . . . . . . . 3 3. SenML Content-Format ("ct") Field . . . . . . . . . . . . . . 3
4. SenML Content-Type ("content-type") and Content-Coding 4. Using Content-Type and Content-Coding With the "ct" Field . . 3
("content-coding") Fields . . . . . . . . . . . . . . . . . . 3 5. SenML Base Content-Format ("bct") Field . . . . . . . . . . . 4
5. SenML Base Content-Format ("bct"), Base Content-Type
("bcontent-type), and Base Content-Coding ("bcontent-coding")
Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
6. Security Considerations . . . . . . . . . . . . . . . . . . . 4 6. Security Considerations . . . . . . . . . . . . . . . . . . . 4
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 5 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 4
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 5
9.1. Normative References . . . . . . . . . . . . . . . . . . 5 9.1. Normative References . . . . . . . . . . . . . . . . . . 5
9.2. Informative References . . . . . . . . . . . . . . . . . 6 9.2. Informative References . . . . . . . . . . . . . . . . . 5
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6
1. Introduction 1. Introduction
The Sensor Measurement Lists (SenML) media type [RFC8428] can be used The Sensor Measurement Lists (SenML) media type [RFC8428] can be used
to send various different kinds of data. In the example given in to send various different kinds of data. In the example given in
Figure 1, a temperature value, an indication whether a lock is open, Figure 1, a temperature value, an indication whether a lock is open,
and a data value (with SenML field "vd") read from an NFC reader is and a data value (with SenML field "vd") read from an NFC reader is
sent in a single SenML pack. sent in a single SenML pack.
skipping to change at page 3, line 46 skipping to change at page 3, line 44
3. SenML Content-Format ("ct") Field 3. SenML Content-Format ("ct") Field
When a SenML Record contains a Data Value field ("vd"), the Record When a SenML Record contains a Data Value field ("vd"), the Record
MAY also include a Content-Format indication field. The Content- MAY also include a Content-Format indication field. The Content-
Format indication uses label "ct" and an unsigned integer value in Format indication uses label "ct" and an unsigned integer value in
the range of 0-65535 indicating the CoAP Content-Format of the data the range of 0-65535 indicating the CoAP Content-Format of the data
(similar to CoRE Link Format [RFC6690] "ct" attribute, except that (similar to CoRE Link Format [RFC6690] "ct" attribute, except that
the Link Format attribute happens to be encoded as a string). the Link Format attribute happens to be encoded as a string).
4. SenML Content-Type ("content-type") and Content-Coding ("content- 4. Using Content-Type and Content-Coding With the "ct" Field
coding") Fields
Since some Internet media types and their content coding and Since some Internet media types and their content coding and
parameter alternatives do not have assigned CoAP Content-Format parameter alternatives do not have assigned CoAP Content-Format
identifiers, a Content-Type field ("content-type") can be identifiers, the "ct" field can alternatively be used to indicate the
alternatively used to indicate the Content-Type of the data. Content-Type and Content-Coding of the data. If Content-Coding is
Content-Coding of the Content-Type can be identified using a not specified with Content-Type, identity (i.e., no) transformation
"content-coding" field. If Content-Coding is not specified with is used.
Content-Type, identity (i.e., no) transformation is used. The
Content-Type field MUST NOT be used in the same record as a Content-
Format field and records with Content-Format field MUST NOT contain a
Content-Coding field.
5. SenML Base Content-Format ("bct"), Base Content-Type ("bcontent- If Content-Coding is used, the content-coding value (e.g., "deflate")
type), and Base Content-Coding ("bcontent-coding") Fields MUST be prefixed with "@" and concatenated with the media type and
parameters (if any). For example: "application/json@deflate".
5. SenML Base Content-Format ("bct") Field
The Base Content-Format Field, label "bct", provides a default value The Base Content-Format Field, label "bct", provides a default value
for the Content-Format Field (label "ct") within its range. The for the Content-Format Field (label "ct") within its range. The
range of the base field includes the record containing it, up to (but range of the base field includes the record containing it, up to (but
not including) the next record containing a "bct" field, if any, or not including) the next record containing a "bct" field, if any, or
up to the end of the pack otherwise. Resolution (Section 4.6 of up to the end of the pack otherwise. Resolution (Section 4.6 of
[RFC8428]) of this base field is performed by adding its value with [RFC8428]) of this base field is performed by adding its value with
the label "ct" to all records in this range that carry a "vd" field the label "ct" to all records in this range that carry a "vd" field
but do not already contain a Content-Format ("ct") field. but do not already contain a Content-Format ("ct") field.
The Base Content-Type Field, label "bcontent-type", provides a
default value for the Content-Type Field (label "content-type")
within its range. The Base Content-Coding Field, label "bcontent-
coding", provides a default value for the Content-Coding Field (label
"content-coding") within its range. The range and resolution rules
for both are identical to Base Content-Format Field, except that the
value is added with label "content-coding" (for Base Content-Coding)
or with label "content-type" (for Base Content-Type).
6. Security Considerations 6. Security Considerations
The indication of a media type in the data does not exempt a The indication of a media type in the data does not exempt a
consuming application from properly checking its inputs. Also, the consuming application from properly checking its inputs. Also, the
ability for an attacker to supply crafted SenML data that specify ability for an attacker to supply crafted SenML data that specify
media types chosen by the attacker may expose vulnerabilities of media types chosen by the attacker may expose vulnerabilities of
handlers for these media types to the attacker. handlers for these media types to the attacker.
7. IANA Considerations 7. IANA Considerations
IANA is requested to assign new labels in the "SenML Labels" IANA is requested to assign new labels in the "SenML Labels"
subregistry of the SenML registry [IANA.senml] (as defined in subregistry of the SenML registry [IANA.senml] (as defined in
[RFC8428]) for the Content-Format indication as per Table 1: [RFC8428]) for the Content-Format indication as per Table 1:
+----------------+-----------------+---------+---------+------------+ +-----------------+-------+---------------+------------+------------+
| Name | Label | JSON | XML | Reference | | Name | Label | JSON Type | XML Type | Reference |
| | | Type | Type | | +-----------------+-------+---------------+------------+------------+
+----------------+-----------------+---------+---------+------------+ | Base Content- | bct | Number/String | int/string | this |
| Base Content- | bct | Number | int | this | | Format | | | | document |
| Format | | | | document | | | | | | |
| | | | | | | Content-Format | ct | Number/String | int/string | this |
| Content-Format | ct | Number | int | this | | | | | | document |
| | | | | document | +-----------------+-------+---------------+------------+------------+
| | | | | |
| Base Content- | bcontent-type | String | string | this |
| Type | | | | document |
| | | | | |
| Content-Type | content-type | String | string | this |
| | | | | document |
| | | | | |
| Base Content- | bcontent-coding | String | string | this |
| Coding | | | | document |
| | | | | |
| Content-Coding | content-coding | String | string | this |
| | | | | document |
+----------------+-----------------+---------+---------+------------+
Table 1: IANA Registration for new SenML Labels Table 1: IANA Registration for new SenML Labels
Acknowledgements Acknowledgements
The authors would like to thank Sergio Abreu for the discussions The authors would like to thank Sergio Abreu for the discussions
leading to the design of this extension. leading to the design of this extension.
9. References 9. References
 End of changes. 11 change blocks. 
54 lines changed or deleted 27 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/