Network Working Group A. Keranen Internet-Draft Ericsson Intended status: Standards Track C. Amsuess Expires: January 23, 2020 July 22, 2019 SenML Base Name Prefix Indication draft-keranen-core-senml-base-prefix-00 Abstract The Sensor Measurement Lists (SenML) media type uses globally unique names to facilitate information exchange across systems. This requirement often leads to long names and hence large amount of data to be transmitted with each SenML Pack. This document defines an efficient mechanism to indicate a globally unique prefix for names. 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 January 23, 2020. Copyright Notice Copyright (c) 2019 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. Keranen & Amsuess Expires January 23, 2020 [Page 1] Internet-Draft SenML Base Name Prefix Indication July 2019 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Indicating base name prefix . . . . . . . . . . . . . . . . . 3 3.1. IP address . . . . . . . . . . . . . . . . . . . . . . . 4 3.2. Request Base URI . . . . . . . . . . . . . . . . . . . . 4 3.3. Public key fingerprint . . . . . . . . . . . . . . . . . 4 3.4. TLS PSK Identity . . . . . . . . . . . . . . . . . . . . 5 3.5. CoRE Resource Directory endpoint ID . . . . . . . . . . . 5 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 6 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 6.1. Normative References . . . . . . . . . . . . . . . . . . 6 6.2. Informative References . . . . . . . . . . . . . . . . . 7 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 1. Introduction The Sensor Measurement Lists (SenML) media type [RFC8428] indicates sources of information with globally unique names. A SenML Pack can indicate "base names" ("bn" field) that are prefixed to all names ("n" fields) in the SenML Records where the "bn" appears and all subsequent records until a new base name is indicated. Example of a SenML Pack with two sources of measurement data that share a base name is shown in Figure 1. [ {"bn":"2001:db8:1234:5678::1/", "n":"temperature", "u":"Cel", "v":25.2}, {"n":"humidity", "u":"%RH", "v":30} ] Figure 1: SenML Pack with two sources of measurements The base name construct enables indicating the globally unique part of the name only once for a set of Records. However, the globally unique part still needs to be indicated in each Pack. Since base name is often relatively long, in some scenarios it would be useful to be able to further compress or omit this information. Since the sender and receiver of a SenML Pack often share context information beyond what is in the SenML Pack, e.g., request URI when a RESTful protocol is used, sender IP address, or security association information. This information can be used to assist constructing the globally unique part of a name. However, the sender of the Pack needs to be able to indicate unambiguously what Keranen & Amsuess Expires January 23, 2020 [Page 2] Internet-Draft SenML Base Name Prefix Indication July 2019 information is used and how the name is generated from that information. This document registers a new SenML field to indicate what information outside of the SenML Pack should be used as a prefix to the base name(s). Also rules for consistently creating SenML names from this information is specified for each information source. Since SenML has only a small set of characters that are allowed in names (see Section 4.5.1 in [RFC8428]) replacing rules for characters outside of this set (e.g., brackets and semicolons) are also defined. 2. Terminology 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. Readers should also be familiar with the terms and concepts discussed in [RFC8428]. 3. Indicating base name prefix SenML field "bpi" contains an integer value that indicates what information should be used by the receiver to construct a prefix to the base names. This document defines following modes: 1: IPv4 or IPv6 address of the sender 2: IPv4 or IPv6 address and port of the sender 3: Base URI of the request URI 5: Fingerprint of the public key of the sender 6: TLS PSK Identity 10: CoRE Resource Directory endpoint ID The following sub-sections define rules for generating SenML basename prefix for each mode. Some rules require replacing characters from the input identifiers with characters that are safe for SenML names. Applying these rules may result in multiple different input identifiers being mapped to the same output identifer. The sender of the SenML Pack MUST ensure that such mapping does not result in conflicting names from that sender. Keranen & Amsuess Expires January 23, 2020 [Page 3] Internet-Draft SenML Base Name Prefix Indication July 2019 3.1. IP address The SenML Pack sender IP address can be used without (mode 1) or with (mode 2) port number to generate the base name prefix. For IPv6 addresses the format defined in [RFC5952] without brackets ("[" and "]") MUST be used. Example: "2001:db8::1" For IPv6 address and port underscore ("_") for port separator MUST be used. Example: "2001:db8::1_5683" For IPv4 addresses the "dot decimal" notation MUST be used. Example: "192.0.2.1" For IPv4 addresses colon (":") MUST be used for port separator. Example: "192.0.2.1:5684" 3.2. Request Base URI When a RESTful protocol (e.g., CoAP [RFC7252] or HTTP [RFC7230]) is used to request a SenML Pack, the base of the target request URI can be used as the base name prefix. If IP address is used in the authority part of the URI, rules in Section 3.1 MUST be followed for it. Characters in the URI that are not in the character set allowed for SenML names MUST be replaced with the underscore ("_") character. Example: "coap://example.com/room1/" 3.3. Public key fingerprint When X.509 certificate or raw public key is used to setup the security association (e.g., a TLS connection) to retrieve a SenML Pack, a fingerprint of the public key of the sender of the SenML Pack can be used as the base name prefix. For a public key fingerprint the "URL Segment Format" of [RFC6920] with ";" characters replaced with "_" MUST be used. Example: "sha-256_UyaQV-Ev4rdLoHyJJWCi11OHfrYv9E1aGQAlMO2X_-Q" Keranen & Amsuess Expires January 23, 2020 [Page 4] Internet-Draft SenML Base Name Prefix Indication July 2019 3.4. TLS PSK Identity When a pre-shared key (PSK) ciphersuites (e.g., [RFC4279])) are used to establish a TLS connection, the PSK identity can be used as the base name prefix. In this mode the PSK identity from the TLS handshake with characters not allowed for SenML names replaced with "_" MUST be used. Example: "foo.example.com" 3.5. CoRE Resource Directory endpoint ID When the sender has registered with the receiving system using the CoRE Resource Directory [I-D.ietf-core-resource-directory] interface, and has defined an "endpoint name" during the registration, the endpoint name can be used as the base name prefix. Characters not allowed for SenML names MUST be replaced with "_". Example: "urn:dev:ow:10e2073a01080063" 4. IANA Considerations IANA is requested to assign a new label in the "SenML Labels" subregistry of the SenML registry [IANA.senml] (as defined in [RFC8428]) for the "Base Name Prefix Indicator" as follows: +-----------------------+-------+----------+---------+--------------+ | Name | Label | JSON | XML | Reference | | | | Type | Type | | +-----------------------+-------+----------+---------+--------------+ | Base Name Prefix | bpi | Number | int | this | | Indicator | | | | document | +-----------------------+-------+----------+---------+--------------+ IANA is requested to create a new "SenML Base Name Prefix Indicator modes" subregistry to the SenML registry. Initial contents of the subregistry is shown below: Keranen & Amsuess Expires January 23, 2020 [Page 5] Internet-Draft SenML Base Name Prefix Indication July 2019 +-------------------+-------+---------------+ | Name | Value | Reference | +-------------------+-------+---------------+ | IP address | 1 | this document | | | | | | IP address & port | 2 | this document | | | | | | Base URI | 3 | this document | | | | | | Public key | 5 | this document | | | | | | TLS PSK ID | 6 | this document | | | | | | CoRE RD endpoint | 10 | this document | +-------------------+-------+---------------+ Acknowledgements TBD 6. References 6.1. Normative References [I-D.ietf-core-resource-directory] Shelby, Z., Koster, M., Bormann, C., Stok, P., and C. Amsuess, "CoRE Resource Directory", draft-ietf-core- resource-directory-23 (work in progress), July 2019. [IANA.senml] IANA, "Sensor Measurement Lists (SenML)", . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4279] Eronen, P., Ed. and H. Tschofenig, Ed., "Pre-Shared Key Ciphersuites for Transport Layer Security (TLS)", RFC 4279, DOI 10.17487/RFC4279, December 2005, . [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 Address Text Representation", RFC 5952, DOI 10.17487/RFC5952, August 2010, . Keranen & Amsuess Expires January 23, 2020 [Page 6] Internet-Draft SenML Base Name Prefix Indication July 2019 [RFC6920] Farrell, S., Kutscher, D., Dannewitz, C., Ohlman, B., Keranen, A., and P. Hallam-Baker, "Naming Things with Hashes", RFC 6920, DOI 10.17487/RFC6920, April 2013, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC8428] Jennings, C., Shelby, Z., Arkko, J., Keranen, A., and C. Bormann, "Sensor Measurement Lists (SenML)", RFC 8428, DOI 10.17487/RFC8428, August 2018, . 6.2. Informative References [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, . [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10.17487/RFC7252, June 2014, . Authors' Addresses Ari Keranen Ericsson Jorvas 02420 Finland Email: ari.keranen@ericsson.com Christian Amsuess Hollandstr. 12/4 1020 Austria Phone: +43-664-9790639 Email: christian@amsuess.com Keranen & Amsuess Expires January 23, 2020 [Page 7]