core | K. Li |
Internet-Draft | R. Sun |
Intended status: Standards Track | Huawei Technologies |
Expires: June 19, 2015 | G. Wei |
BUPT | |
December 16, 2014 |
CoAP Option Extension: NodeId
draft-li-core-coap-node-id-option-02
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.
Discussion and suggestions for improvement are requested, and should be sent to core@ietf.org.
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 June 19, 2015.
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 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.
This specification adds a new option NodeId to CoAP [RFC7252]. 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.
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.
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.
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].
+------+---+---+---+---+--------+--------+--------+---------+ | 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.
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].
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.
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.
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
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
This presents no security considerations beyond those in section 9 and 11 of the base CoAP specification [RFC7252].
The IANA is requested to add the following "CoAP Option Numbers" entry as per Section 12.2 of [RFC7252].
+--------+------------------+----------------+ | Number | Name | Reference | +--------+------------------+----------------+ | TBD | NodeId | Section 2 | +--------+------------------+----------------+
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.
[I-D.ietf-core-observe] | Hartke, K., "Observing Resources in CoAP", Internet-Draft draft-ietf-core-observe-08, February 2013. |
[I-D.ietf-core-resource-directory] | Shelby, Z., Krco, S. and C. Bormann, "CoRE Resource Directory", Internet-Draft draft-ietf-core-resource-directory-00, June 2013. |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[RFC7252] | Shelby, Z., Hartke, K. and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, June 2014. |
[I-D.bormann-coap-misc] | Bormann, C. and K. Hartke, "Miscellaneous additions to CoAP", Internet-Draft draft-bormann-coap-misc-24, March 2013. |