core K. Li Internet-Draft Huawei Technologies Intended status: Standards Track G. Wei Expires: December 26, 2014 BUPT June 24, 2014 CoAP Option Extension: NodeId draft-li-core-coap-node-id-option-01 Abstract CoAP is a RESTful application protocol for constrained nodes and networks. This specification provides a simple extension for CoAP, the NodeId Option. This Option can be used to identify the node, either the client or the server. Note Discussion and suggestions for improvement are requested, and should be sent to core@ietf.org. 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 December 26, 2014. Copyright Notice Copyright (c) 2014 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 Li & Wei Expires December 26, 2014 [Page 1] Internet-Draft CoAP NodeId Option June 2014 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. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Justification . . . . . . . . . . . . . . . . . . . . . . 2 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 2. NodeId Option Extension . . . . . . . . . . . . . . . . . . . 3 2.1. NodeId Option Definition . . . . . . . . . . . . . . . . 3 2.2. Using the NodeId Option . . . . . . . . . . . . . . . . . 3 2.2.1. Registration . . . . . . . . . . . . . . . . . . . . 3 2.2.2. Usage . . . . . . . . . . . . . . . . . . . . . . . . 4 3. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Registration example . . . . . . . . . . . . . . . . . . 4 3.2. Notification example . . . . . . . . . . . . . . . . . . 5 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 6 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 7.1. Normative References . . . . . . . . . . . . . . . . . . 6 7.2. Informative References . . . . . . . . . . . . . . . . . 6 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 1. Introduction This specification adds a new option NodeId to CoAP [I-D.ietf-core-coap]. The main purpose is for a node to have a unique identity, named as NodeId. The NodeId is used by the node, as a sender, to identify itself to the recipient, during registration and communications. 1.1. Justification A node is set to have a NodeId and the node nerver changes its NodeId. There are several scenarios to have the NodeId to identify the nodes. In the network, it is quite common for a node to change its IP address due to rebooting. After the server or client changes its IP address, the peer of the other side lacks a facility to correlate the old IP address and the new IP address as the same node. This will cause the other side to lose some contexts. If the node can use NodeId after its IP address being changed, it is very easy for the node to correlate the old IP address and the new one by NodeId. Li & Wei Expires December 26, 2014 [Page 2] Internet-Draft CoAP NodeId Option June 2014 In the multicast observation case, after a client sends a multicast observation request to a group URI, e.g. all.bldg6.example.com, the client will receive multiple notifications from different servers of the multicast group with the same token as specified in the multicast request. As a result, the client can't use token to correlate multicast request and notification responses. The client may use the IP address extracted from UDP/IP transport/network layers to differentiate servers and responses. If a server changes its IP address and sends back the notification, the client can't determine where the notification message comes from any more. In this case, if NodeId is included in the notifications, it can be used to correlate multicast request and subsequent notifications by the node. The NodeId can also be used for authentication and authorization of the node. 1.2. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. 2. NodeId Option Extension 2.1. NodeId Option Definition +------+---+---+---+---+--------+--------+--------+---------+ | Type | C | U | N | R | Name | Format | Length | Default | +------+---+---+---+---+--------+--------+--------+---------+ | TBD | - | - | - | - | NodeId | string | 1-255 B| (none) | +------+---+---+---+---+--------+--------+--------+---------+ The NodeId option is used to identify the node.The value SHOULD be unique for each node within a Resource Directory server. The value can be in the form of Binary bits, IMEI (International Mobile Equipment Identity number), IEEE 802 MAC Address, or other identifiers which can uniquely identify itself. Usually the value is pre-configured or pre-previsioned in the node. 2.2. Using the NodeId Option 2.2.1. Registration When a node registers itself to the Resource Directory server, the registration request SHOULD contain its node identifier. This node identifier MAY be included in the NodeId option in the registration request, or MAY be included in the URI-Query option as specified in [I-D.ietf-core-resource-directory]. Li & Wei Expires December 26, 2014 [Page 3] Internet-Draft CoAP NodeId Option June 2014 2.2.2. Usage This option MAY be used in a CoAP request or response. And it can be used to correlate the messages for a node in case of IP address change. As long as a node changes its IP address, the NodeId SHALL be included in the first request and response and sent in CON message. Whenever the node reboots or moves, the NodeId MUST NOT change. And the node SHOULD send the updated IP address with the NodeId to the RD server, using the update interface as specified in [I-D.ietf-core-resource-directory]. This informs the RD server a mapping relation between the new IP address and the NodeId identified node. For the usage of notifications in the observe, when a server in a group receives a multicast observe request, it SHOULD include a NodeId option in the notifications. In this way, even the server changes the IP address, the client can still correlate all the notifications with this server. It is recommended to use NodeId as identifier during authentication and authorization. Todo: How to use it for authentication and authorization? This option is "elective". It MUST NOT occur more than once. 3. Example 3.1. Registration example This section gives a short example with a message flow that illustrates the use of the NodeId option in a registration request. This example (Figure 1) shows that the requester includes its NodeId in the registration request. Li & Wei Expires December 26, 2014 [Page 4] Internet-Draft CoAP NodeId Option June 2014 Node RD | | | | +----->| Header: POST (T=CON, Code=1, MID=0x7d38) | POST | Token: 0x53 | | NodeId: node12345 | | Uri-Path: "rd" | | |<-----+ Header: 2.01 Created (T=ACK, Code=69, MID=0x7d38) | 2.01 | Token: 0x53 | | | | Figure 1: NodeId Option in a registration request 3.2. Notification example This section gives a short example with a message flow that illustrates the use of the NodeId option in an observe notification. This example (Section 3.2) shows that the server includes its NodeId option in an observe notification after IP address changes. Client Server | | | | +----->| Header: GET (T=CON, Code=1, MID=0x7d38) | GET | Token: 0x53 | | Observe: 0 | | Uri-host: "all.bldg6.example.com" | | Uri-Path: "temperature" | | |<-----+ Header: 2.05 Content (T=ACK, Code=69, MID=0x7d38) | 2.05 | Token: 0x53 | | NodeId: node12345 | | Payload: "22.3 C" | | | | Figure 2: NodeId Option in an observe notification Li & Wei Expires December 26, 2014 [Page 5] Internet-Draft CoAP NodeId Option June 2014 4. Security Considerations This presents no security considerations beyond those in section 9 and 11 of the base CoAP specification [I-D.ietf-core-coap]. 5. IANA Considerations The IANA is requested to add the following "CoAP Option Numbers" entry as per Section 12.2 of [I-D.ietf-core-coap]. +--------+------------------+----------------+ | Number | Name | Reference | +--------+------------------+----------------+ | TBD | NodeId | Section 2 | +--------+------------------+----------------+ 6. Acknowledgements The authors of this draft would like to thank the Esko Dijk, Carsten Bormann, Bert Greevenbosch and Klaus Hartke for the email discussions on this issue. 7. References 7.1. Normative References [I-D.ietf-core-coap] Shelby, Z., Hartke, K., and C. Bormann, "Constrained Application Protocol (CoAP)", draft-ietf-core-coap-18 (work in progress), June 2013. [I-D.ietf-core-observe] Hartke, K., "Observing Resources in CoAP", draft-ietf- core-observe-13 (work in progress), April 2014. [I-D.ietf-core-resource-directory] Shelby, Z., Bormann, C., and S. Krco, "CoRE Resource Directory", draft-ietf-core-resource-directory-01 (work in progress), December 2013. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. 7.2. Informative References Li & Wei Expires December 26, 2014 [Page 6] Internet-Draft CoAP NodeId Option June 2014 [I-D.bormann-coap-misc] Bormann, C. and K. Hartke, "Miscellaneous additions to CoAP", draft-bormann-coap-misc-26 (work in progress), December 2013. Authors' Addresses Kepeng Li Huawei Technologies Huawei Base, Bantian, Longgang District Shenzhen, Guangdong 518129 P. R. China Phone: +86-755-28974289 Email: likepeng@huawei.com Gengyu Wei Beijing University of Posts & Telecommunications No.10 Xitucheng Road, Haidian District Beijing 100876 P. R. China Phone: +86-10-62283067 Email: weigengyu@bupt.edu.cn Li & Wei Expires December 26, 2014 [Page 7]