CoRE Working Group K. Li Internet-Draft Alibaba Group Intended status: Standards Track A. Rahman Expires: January 9, 2017 InterDigital C. Bormann, Ed. Universitaet Bremen TZI July 08, 2016 Representing CoRE Groupcomm Formats in CBOR draft-bormann-core-groupcomm-cbor-00 Abstract Group Communication for the Constrained Application Protocol (RFC7390) defines a number of JSON formats for controlling communication between groups of nodes employing the Constrained Application Protocol (CoAP). This specification defines CBOR variants of these formats. 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 http://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 9, 2017. Copyright Notice Copyright (c) 2016 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 (http://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 Li, et al. Expires January 9, 2017 [Page 1] Internet-Draft Groupcomm-in-CBOR July 2016 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. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 2 2. Group Communication Management Objects in CBOR . . . . . . . 3 2.1. Background . . . . . . . . . . . . . . . . . . . . . . . 3 2.2. Information Model . . . . . . . . . . . . . . . . . . . . 3 2.3. Mapping . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.4. Group Communication Example . . . . . . . . . . . . . . . 3 3. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 6.1. Normative References . . . . . . . . . . . . . . . . . . 6 6.2. Informative References . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 1. Introduction (See abstract for now.) 1.1. 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 [RFC2119] when they appear in ALL CAPS. These words may also appear in this document in lower case as plain English words, absent their normative meanings. The term "byte" is used in its now customary sense as a synonym for "octet". CoAP: Constrained Application Protocol [RFC7252] CBOR: Concise Binary Object Representation [RFC7049] CoRE: Constrained RESTful Environments, the field of work underlying [RFC6690], [RFC7049], [RFC7252], and [RFC7641] IoT: Internet of Things JSON: JavaScript Object Notation [RFC7159] Li, et al. Expires January 9, 2017 [Page 2] Internet-Draft Groupcomm-in-CBOR July 2016 2. Group Communication Management Objects in CBOR 2.1. Background The CoAP Group Communications specification [RFC7390] defines group management objects in JSON format. These objects are used to represent IP multicast group information for CoAP endpoints. See [I-D.ietf-core-resource-directory] for more examples of using these objects. 2.2. Information Model This section discusses the information model underlying the CoAP Group Communication management object payload. A group membership JSON object contains one or more key/value pairs, and represents a single IP multicast group membership for the CoAP endpoint. Each key/value pair is encoded as a member of the JSON object, where the key is the member name and the value is the member's value. The information model of the CoAP Group Communication management object can be summarized in CDDL [I-D.greevenbosch-appsawg-cbor-cddl] below: collection = { * index => membership } index = tstr .regexp "[A-Za-z0-9]{1,2}" membership = { ? n: groupname, ? a: groupaddress, } groupname = tstr ; host [":" port] groupaddress = tstr ; IPv4address [ ":" port ] ; / "[" IPv6address "]" [":" port ] Figure 1: CoAP Group Communication Data Model 2.3. Mapping The objective of the mapping defined in this section is to map information from the JSON formats specified in [RFC7390] into CBOR format, using the rules of Section 4.2 of [RFC7049]. 2.4. Group Communication Example Li, et al. Expires January 9, 2017 [Page 3] Internet-Draft Groupcomm-in-CBOR July 2016 { "8" :{ "a": "[ff15::4200:f7fe:ed37:14ca]" }, "11":{ "n": "sensors.floor1.west.bldg6.example.com", "a": "[ff15::4200:f7fe:ed37:25cb]" }, "12":{ "n": "All-Devices.floor1.west.bldg6.example.com", "a": "[ff15::4200:f7fe:ed37:abcd]:4567" } } Figure 2: Example from section 2.6.2.4 of [RFC7390] becomes: Li, et al. Expires January 9, 2017 [Page 4] Internet-Draft Groupcomm-in-CBOR July 2016 a3 # map(3) 61 # text(1) 38 # "8" a1 # map(1) 61 # text(1) 61 # "a" 78 1b # text(27) 5b666631353a3a343230 303a663766653a656433 373a313463615d # "[ff15::4200:f7fe:ed37:14ca]" 62 # text(2) 3131 # "11" a2 # map(2) 61 # text(1) 6e # "n" 78 25 # text(37) 73656e736f72732e666c 6f6f72312e776573742e 626c6467362e6578616d 706c652e636f6d # "sensors.floor1.west.bldg6.example.com" 61 # text(1) 61 # "a" 78 1b # text(27) 5b666631353a3a343230 303a663766653a656433 373a323563625d # "[ff15::4200:f7fe:ed37:25cb]" 62 # text(2) 3132 # "12" a2 # map(2) 61 # text(1) 6e # "n" 78 29 # text(41) 416c6c2d446576696365 732e666c6f6f72312e77 6573742e626c6467362e 6578616d706c652e636f 6d # "All-Devices.floor1.west.bldg6.example.com" 61 # text(1) 61 # "a" 78 20 # text(32) 5b666631353a3a343230 303a663766653a656433 373a616263645d3a34353637 # "[ff15::4200:f7fe:ed37:abcd]:4567" Figure 3: Group Communication Management Object Encoded in CBOR Li, et al. Expires January 9, 2017 [Page 5] Internet-Draft Groupcomm-in-CBOR July 2016 3. IANA Considerations This specification registers the following additional Internet Media Types: TBD 4. Security Considerations The security considerations relevant to the data models of [RFC7390], as well as those of [RFC7049] and [RFC7159] apply. 5. Acknowledgements Special thanks to Bert Greevenbosch who was an author on the initial version of a contributing document as well as the original author on the CDDL notation. Hannes Tschofenig made many helpful suggestions for improving this document, in particular splitting off the [RFC7390] parts from [I-D.ietf-core-links-json]. 6. References 6.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, . [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013, . [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 2014, . 6.2. Informative References Li, et al. Expires January 9, 2017 [Page 6] Internet-Draft Groupcomm-in-CBOR July 2016 [I-D.greevenbosch-appsawg-cbor-cddl] Vigano, C. and H. Birkholz, "CBOR data definition language (CDDL): a notational convention to express CBOR data structures", draft-greevenbosch-appsawg-cbor-cddl-08 (work in progress), March 2016. [I-D.ietf-core-links-json] Li, K., Rahman, A., and D. Bormann, "Representing CoRE Formats in JSON and CBOR", draft-ietf-core-links-json-05 (work in progress), April 2016. [I-D.ietf-core-resource-directory] Shelby, Z., Koster, M., Bormann, D., and P. Stok, "CoRE Resource Directory", draft-ietf-core-resource-directory-08 (work in progress), July 2016. [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10.17487/RFC7252, June 2014, . [RFC7390] Rahman, A., Ed. and E. Dijk, Ed., "Group Communication for the Constrained Application Protocol (CoAP)", RFC 7390, DOI 10.17487/RFC7390, October 2014, . [RFC7641] Hartke, K., "Observing Resources in the Constrained Application Protocol (CoAP)", RFC 7641, DOI 10.17487/RFC7641, September 2015, . Authors' Addresses Kepeng LI Alibaba Group Wenyixi Road, Yuhang District Hangzhou, Zhejiang 311121 China Email: kepeng.lkp@alibaba-inc.com Li, et al. Expires January 9, 2017 [Page 7] Internet-Draft Groupcomm-in-CBOR July 2016 Akbar Rahman InterDigital Communications, LLC 1000 Sherbrooke Street West Montreal, Quebec H3A 3G4 Canada Phone: +1-514-585-0761 Email: akbar.rahman@interdigital.com Carsten Bormann (editor) Universitaet Bremen TZI Postfach 330440 Bremen D-28359 Germany Phone: +49-421-218-63921 Email: cabo@tzi.org Li, et al. Expires January 9, 2017 [Page 8]