CoRE Working Group | A. Rahman, Ed. |
Internet-Draft | InterDigital Communications, LLC |
Intended status: Informational | E.O. Dijk, Ed. |
Expires: June 23, 2013 | Philips Research |
December 20, 2012 |
Group Communication for CoAP
draft-ietf-core-groupcomm-04
CoAP is a RESTful transfer protocol for constrained devices and networks. It is anticipated that constrained devices will often naturally operate in groups (e.g. in a building automation scenario all lights in a given room may need to be switched on/off as a group). This document defines how the CoAP protocol should be used in a group communication context. An approach for using CoAP on top of IP multicast is detailed for both constrained and un-constrained networks. Also, various use causes and corresponding protocol flows are provided to illustrate important concepts. Finally, guidance is provided for deployment in various network topologies.
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 23, 2013.
Copyright (c) 2012 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.
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].
This document assumes readers are familiar with the terms and concepts that are used in [I-D.ietf-core-coap]. In addition, this document defines the following terminology:
The Constrained Application Protocol (CoAP) is an application protocol (analogous to HTTP) for resource constrained devices operating in an IP network [I-D.ietf-core-coap]. Constrained devices can be large in number, but are often highly correlated to each other (e.g. by type or location). For example, all the light switches in a building may belong to one group and all the thermostats may belong to another group. Groups may be composed by function. For example, the group "all lights in building one" may consist of the groups "all lights on floor one of building one", "all lights on floor two of building one", etc. Groups may be preconfigured or dynamically formed. If information needs to be sent to or received from a group of devices, group communication mechanisms can improve efficiency and latency of communication and reduce bandwidth requirements for a given application. HTTP does not support any equivalent functionality to CoAP group communication.
This document describes how to use the CoAP protocol in a group communication context with IP Multicast running underneath CoAP. No changes to either CoAP or IP Multicast are required for this purpose. However, proper operation of group communication does require judicious use of these and a variety of other IETF protocols. The main contribution of this document lies in explaining how various IETF mechanisms may be used together to fulfill CoAP group communication needs for specific use cases and deployments.
IP Multicast routing protocols have been evolving for decades, resulting in proposed standards such as Protocol Independent Multicast - Sparse Mode (PIM-SM) [RFC4601]. Yet, due to various technical and marketing reasons, IP Multicast routing is not widely deployed on the general Internet. However, IP Multicast is very popular in specific deployments such as in enterprise networks (e.g. for video conferencing), smart home networks (e.g. UPnP) and carrier IPTV deployments. The packet economy and minimal host complexity of IP multicast make it attractive for group communication in constrained environments. Therefore IP multicast is the recommended underlying mechanism for CoAP group communication, and the approach assumed in this document.
To achieve IP multicast beyond a subnet, an IP multicast routing protocol needs to be active on routers. The RPL protocol [RFC6550] for example is able to route multicast traffic in constrained LLNs. While PIM-SM [RFC4601] is often used for multicast routing in un-constrained networks.
IP multicast can also be run in a Link-Local (LL) scope. This means that there is no routing involved and an IP multicast message is only received on the network link on which it was sent.
A group is defined as a set of CoAP endpoints, where each endpoint is configured to receive a multicast CoAP request that is sent to the group's associated IP multicast address. The group MAY have more than one associated IP multicast address. An endpoint MAY be a member of multiple groups. Group membership of an endpoint MAY dynamically change over time.
A CoAP group member listens for CoAP messages on the group's IP multicast address, assuming the default CoAP UDP port. Note that a non-default UDP port MAY be specified for the group; in which case implementers MUST ensure that all group members are configured to use this same port.
For group communications, the Group URI will be the CoAP request URI. A Group URI has the scheme 'coap' and includes in the authority part either a group IP multicast address or a hostname that can be resolved to the group IP multicast address (e.g., a Group Name or Group FQDN). Group URIs follow the CoAP URI syntax [I-D.ietf-core-coap]. It is recommended for sending nodes to use the IP multicast address literal in the authority for the Group URI as the default.
URI authority Targeted group all.bldg6.example.com "all nodes in building 6" all.west.bldg6.example.com "all nodes in west wing, building 6" all.floor1.west.bldg6.examp... "all nodes in floor 1, west wing, building 6" all.bu036.floor1.west.bldg6... "all nodes in office bu036, floor1, west wing, building 6"
The Group FQDN can be uniquely mapped to a site-local or global multicast IP address via DNS resolution (if supported). Some examples of hierarchical Group FQDN naming (and scoping) for a building control application are shown below ([I-D.vanderstok-core-dna]):
Reverse mapping (from IP multicast address to Group FQDN) is supported using the reverse DNS resolution technique ([I-D.vanderstok-core-dna]).
CoAP defines a resource discovery capability [RFC6690], but does not specify how to discover groups (e.g. find a group to join or send a multicast message to) or how to discover members of a group (e.g. to address selected group members by unicast). A simple ad-hoc method to discover members of a CoAP group would be to send a multicast "CoAP ping" [I-D.ietf-core-coap]. The collected responses to the ping would then give an indication of the group members.
Group communications SHALL only be used for idempotent methods (i.e. CoAP GET, PUT,and DELETE). The CoAP messages that are sent via multicast SHALL be Non-Confirmable.
A unicast response per server MAY be sent back to answer the group request (e.g. response "2.05 Content" to a group GET request) taking into account the congestion control rules defined in Section 3.6. The unicast responses may be a mixture of success (e.g. 2.05 Content) and failure (e.g. 4.04 Not Found) codes depending on the individual server processing result.
Group communications SHALL NOT be used for non-idempotent methods (i.e. CoAP POST). This is because not all group members are guaranteed to receive the multicast request, and the sender can not readily find out which group members did not receive it.
All nodes in a given group should receive the same request with high probability. This will not be the case if there is diversity in the authority port (i.e. a diversity of dynamic port addresses across the group) or if the targeted resource is located at different paths on different nodes.
Therefore, some measures must be present to ensure uniformity in port number and resource names/locations within a group. The following are recommended measures:
In some use cases, the group membership of endpoints needs to be configurable after the network has been deployed. Example use cases can be found in building control. A commissioning tool determines to which groups a light or sensor node belongs, and writes this information to all nodes, which can subsequently join the correct IP multicast group.
To achieve smoother interoperability between nodes/endpoints from different manufacturers, an OPTIONAL RESTful method of configuring CoAP endpoints with relevant group information is specified here.
CoAP endpoints implementing this mechanism MUST support at least one discoverable "Group Configuration" resource of resource type (rt) [RFC6690] "core.gp". This resource is used by an authorized endpoint to manage group membership of the CoAP endpoint.
Req: GET /gp Res: 2.05 Content (Content-Format: application/json) [ { "n": "Room-A-Lights.floor1.west.bldg6.example.com", "ip": "ff05::4200:f7fe:ed37:14ca" } ]
Req: POST /gp (Content-Format: application/json) { "n": "floor1.west.bldg6.example.com", "ip": "ff05::4200:f7fe:ed37:14cb" } Res: 2.04 Changed
The resource of type "core.gp" has a JSON content format. A GET on this resource returns a JSON array of group objects, each group object formatted as shown below:
Multicast CoAP requests may result in a multitude of replies from different nodes, potentially causing congestion. Therefore sending multicast requests should be conservatively controlled.
The base CoAP draft [I-D.ietf-core-coap] reduces multicast-specific congestion risks through the following measures:
Additional guidelines to reduce congestion risks are:
The use of CoAP group communication is shown in the context of the following two use cases and corresponding protocol flows:
To illustrate all use cases we define two network configurations. Both are based on the topology as shown in Figure 1. The two configurations using this topology are:
Both configurations are further specified by the following:
Network Backbone | ################################################ | # Room-A # | # ********************** # | # ** Subnet-1 ** # | # * * # | # * +----------+ * # | # * | Light |-------+ * # | # * | Switch | | * # | # * +----------+ +---------+ * # | # * | Rtr-1 |-----------------------------| # * +---------+ * # | # * +----------+ | * # | # * | Light-1 |--------+ * # | # * +----------+ * # | # * * # | # ** ** # | # ********************** # | # # | # # | # ********************** # | # ** Subnet-2 ** # | # * * # | # * +----------+ * # | # * | Light-2 |-------+ * # | # * | | | * # | # * +----------+ +---------+ * # | # * | Rtr-2 |-----------------------------| # * +---------+ * # | # * +----------+ | * # | # * | Light-3 |--------+ * # | # * +----------+ * # | # * * # | # ** ** # | # ********************** # | # # | ################################################# | | +------------+ | | DNS | | | Server |-----------------+ | (Optional) | +------------+
Figure 1: Network Topology of a Large Room (Room-A)
The protocol flow for discovery of a RD for the given network (of Figure 1) is shown in Figure 2:
The RD may also be discovered by other means such as by assuming a default location (e.g. on a 6LBR), using DHCP, anycast address, etc. However, these approaches do not invoke CoAP group communication so are not further discussed here.
For other discovery use cases such as discovering local CoAP servers, services or resources group communication can be used in a similar fashion as in the above use case. Both Link-Local (LL) and site-local discovery are possible this way.
Light Rtr-1 Rtr-2 Network Light-1 Light-2 Light-3 Switch (RD-1) (RD-2) Backbone | | | | | | | | | | | | | | ********************************** | | | * Light-2 is installed * | | | * and powers on for first time * | | | ********************************** | | | | | | | | | | | | | | | | | | | COAP NON Mcast(GET | | | | /.well-known/core?rt=core.rd) | | | |--------->-------------------------------->| | | | | | | | | | | | | | | | | | | | | | | | | COAP NON (2.05 Content | | | | </rd>;rt="core.rd";ins="Primary") | | | |<------------------------------------------| | | | | | | | |
Figure 2: Resource Directory Discovery via Multicast Message
The protocol flow for a building automation lighting control scenario for the network (Figure 1) in 6LoWPAN configuration is shown in sequence in Figure 3 for the case that the CoAP servers in each Light are configured to not generate a CoAP response to lighting control CoAP multicast requests. (Following section 8.2 of [I-D.ietf-core-coap], a server MAY choose not to generate a response to a multicast request.)
In addition, Figure 4 shows an additional protocol flow example for the case that servers do respond to a lighting control multicast request. There are two success responses and one 5.00 error response. In this particular use case the Light Switch does not check, based on the responses, that all Lights in the group actually received the multicast request, because it is not configured with an exhaustive list of IP addresses of all Lights belonging to the group. However, based on received error responses it could take additional action such as logging a fault in its log or alerting the user via its LCD display.
We assume the following steps have already occurred before the illustrated flows:
Note for the Commissioning phase: the switch's software supports sending unicast, multicast or proxied unicast/multicast CoAP requests, including processing of the multiple responses that may be generated by a multicast CoAP request.
Light Network Light-1 Light-2 Light-3 Switch Rtr-1 Rtr-2 Backbone | | | | | | | | | | | | | | | | *********************** | | | | * User flips on * | | | | * light switch to * | | | | * turn on all the * | | | | * lights in Room A * | | | | *********************** | | | | | | | | | | | | ______|______ | | | | | | COAP NON (PUT | | | | | | Destination IP Address = | | | | | IP multicast address | | | | | for Group (Room-A-Lights) | | | | | Payload=lights on) | | |<-------------------------------+--------->| | | ON | | | |-------------------->| | | | | | |<---------| | |<---------|<-------------------------------| | | ON ON | | | | ^ ^ ^ | | | | *********************** | | | | * Lights in Room-A * | | | | * turn on (nearly * | | | | * simultaneously) * | | | | *********************** | | | | | | | | | | |
Figure 3: Light Switch Sends Multicast Control Message
Light Network Light-1 Light-2 Light-3 Switch Rtr-1 Rtr-2 Backbone | | | | | | | | COAP NON (2.04 Changed) | | | | |------------------------------->| | | | | | | | | | | | | | | | | | | COAP NON (2.04 Changed) | | | | |------------------------------------------>| | | | | | | |--------->| | | | | |<--------------------| | | | |<---------| | | | | | | | | | | | COAP NON (5.00 Internal Server Error) | | | |------------------------------->| | | | | | | |--------->| | | | | |<--------------------| | | | |<---------| | | | | | | | | |
Figure 4: Lights (Optionally) Respond to Multicast CoAP Request
The use case of previous section can also apply in networks where nodes support the MLD protocol [RFC3810]. The Lights then take on the role of MLDv2 listener and the routers (Rtr-1, Rtr-2) are MLDv2 Routers. In the Ethernet based network configuration, MLD may be available on all involved network interfaces. Use of MLD in the 6LoWPAN based configuration is also possible, but requires MLD support in all nodes in the 6LoWPAN which is usually not implemented in many deployments.
The resulting protocol flow is shown in Figure 5. This flow is executed after the commissioning phase, as soon as Lights are configured with a group address to listen to. The MLD Reports may require periodic refresh activity as specified by the MLD protocol.
After the shown sequence of MLD Report messages has been executed, both Rtr-1 and Rtr-2 are automatically configured to forward multicast traffic destined to Room-A-Lights onto their connected subnet. Hence, no manual Network Configuration of routers, as previously indicated in Section 4.4, is needed anymore.
Light Network Light-1 Light-2 Light-3 Switch Rtr-1 Rtr-2 Backbone | | | | | | | | | | | | | | | | | | | | | | MLD Report: Join | | | | | | Group (Room-A-Lights) | | | | |---LL------------------------------------->| | | | | | | |MLD Report: Join | | | | | |Group (Room-A-Lights)| | | | | |---LL--------------->| | | | | | | | | | MLD Report: Join | | | | | | Group (Room-A-Lights) | | | | |---LL------------------------------------->| | | | | | | | | | | | MLD Report: Join | | | | | | Group (Room-A-Lights) | | | | |---LL-------------------------->| | | | | | | | | | | | | |MLD Report: Join | | | | | |Group (Room-A-Lights)| | | | | | |---LL---->| | | | | | | | | | | | | | |
Figure 5: Joining Lighting Groups Using MLD
This section provides guidelines how an IP Multicast based solution for CoAP group communication can be deployed in various network configurations.
CoAP group communication can be deployed in various network topologies. First, the target network may be a regular IP network, or a LLN such as a 6LoWPAN network, or consist of mixed constrained/unconstrained network segments. Second, it may be a single subnet only or multi-subnet; e.g. multiple 6LoWPAN networks joined by a single backbone LAN. Third, a wireless network segment may have all nodes reachable in a single IP hop, or it may require multiple IP hops for some pairs of nodes to reach each other.
Each topology may pose different requirements on the configuration of routers and protocol(s), in order to enable efficient CoAP group communication.
If a network (segment) requires multiple IP hops to reach certain nodes, a multicast routing protocol is required to propagate multicast UDP packets to these nodes. Examples of routing/forwarding protocols specifically for LLNs, able to route multicast, are RPL (Section 12 of [RFC6550]) and MPL [I-D.ietf-roll-trickle-mcast].
If a multicast routing/forwarding protocol is used in a network, server nodes that intend to receive CoAP multicast requests generally require a method to advertise the specific IP multicast address(es) they want to receive, i.e. a method to join specific IP multicast groups. This section identifies the ways in which this can be accomplished.
CoAP nodes that are IP hosts (i.e. not routers) are generally unaware of the specific multicast routing protocol being used. When such a host needs to join a specific (CoAP) multicast group, it usually requires a way to signal to the multicast routers which multicast traffic it wants to receive. For efficient multicast routing (i.e. avoid always flooding multicast IP packets), routers must know which hosts need to receive packets addressed to specific IP multicast destinations.
The Multicast Listener Discovery (MLD) protocol ([RFC3810], Appendix A) is the standard IPv6 method to achieve this. [RFC6636] discusses tuning of MLD for mobile and wireless networks. These guidelines may be useful when implementing MLD in LLNs.
Alternatively, to avoid the addition of MLD in LLN deployments, all nodes can be configured as multicast routers in an LLN.
The RPL routing protocol [RFC6550] defines in Section 12 the advertisement of IP multicast destinations using DAO messages. This mechanism can be used by CoAP nodes (which are also RPL routers) to advertise IP multicast group membership to other RPL nodes. Then, the RPL protocol can route multicast CoAP requests over multiple hops to the correct CoAP servers.
This mechanism could also be used as a means to convey IP multicast group membership information to an edge router (e.g. 6LBR), in case the edge router is also the root of the RPL DODAG. This could be useful in LLN segments where MLD is not available.
The MPL forwarding protocol [I-D.ietf-roll-trickle-mcast] can be used in a predefined network domain for propagation of IP multicast packets to all MPL routers, over multiple hops. MPL is designed to work in LLN deployments. Due to its property of propagating all (non-link-local) IP multicast packets to all MPL routers, there is in principle no need for CoAP server nodes to advertise IP multicast group membership assuming that any IP multicast source is also part of the MPL domain.
To support multi-LoWPAN scenarios for CoAP group communication, it is RECOMMENDED that a 6LoWPAN Border Router (6LBR) will act in an MLD Router role on the backbone link. If this is not possible then the 6LBR SHOULD be configured to act as an MLD Multicast Address Listener and/or MLD Snooper (Appendix A) on the backbone link.
To avoid that backbone IP multicast traffic needlessly congests 6LoWPAN network segments, it is RECOMMENDED that a filtering means is implemented to block IP multicast traffic from 6LoWPAN segments where none of the 6LoWPAN nodes listen to this traffic. Possible means are:
As defined in [I-D.ietf-core-coap], CoAP group communications based on IP multicast must use the following security approach: [I-D.ietf-core-coap] for the NoSec mode. For sensitive data or safety-critical control, appropriate link-layer security or application-level object security SHOULD be used instead of DTLS security.
A consequence is that CoAP group communications is vulnerable to all attacks mentioned in
Also, there is an approach for DTLS-based IP multicast security for CoAP networks (see [I-D.keoh-tls-multicast-security]) that should be considered once it matures.
No request is made to IANA. (Note to RFC Editor: The required multicast address request to IANA is made in [I-D.ietf-core-coap]).
Thanks to Peter Bigot, Carsten Bormann, Anders Brandt, Angelo Castellani, Guang Lu, Salvatore Loreto, Kerry Lynn, Dale Seed, Zach Shelby, Peter van der Stok, and Juan Carlos Zuniga for their helpful comments and discussions that have helped shape this document.
[I-D.vanderstok-core-dna] | Stok, P, Lynn, K and A Brandt, "CoRE Discovery, Naming, and Addressing", Internet-Draft draft-vanderstok-core-dna-01, March 2012. |
[I-D.ietf-roll-trickle-mcast] | Hui, J and R Kelsey, "Multicast Forwarding Using Trickle", Internet-Draft draft-ietf-roll-trickle-mcast-00, April 2011. |
[I-D.keoh-tls-multicast-security] | Keoh, S, Kumar, S and E Dijk, "DTLS-based Multicast Security for Low-Power and Lossy Networks (LLNs)", Internet-Draft draft-keoh-tls-multicast-security-00, October 2012. |
In order to extend the scope of IP multicast beyond link-local scope, an IP multicast routing protocol has to be active in routers on an LLN. To achieve efficient multicast routing (i.e. avoid always flooding multicast IP packets), routers have to learn which hosts need to receive packets addressed to specific IP multicast destinations.
The Multicast Listener Discovery (MLD) protocol [RFC3810] (or its IPv4 pendant IGMP) is today the method of choice used by an (IP multicast enabled) router to discover the presence of multicast listeners on directly attached links, and to discover which multicast addresses are of interest to those listening nodes. MLD was specifically designed to cope with fairly dynamic situations in which multicast listeners may join and leave at any time.
IGMP/MLD Snooping is a technique implemented in some corporate LAN routing/switching devices. An MLD snooping switch listens to MLD State Change Report messages from MLD listeners on attached links. Based on this, the switch learns on what LAN segments there is interest for what IP multicast traffic. If the switch receives at some point an IP multicast packet, it uses the stored information to decide onto which LAN segment(s) to send the packet. This improves network efficiency compared to the regular behavior of forwarding every incoming multicast packet onto all LAN segments. An MLD snooping switch may also send out MLD Query messages (which is normally done by a device in MLD Router role) if no MLD Router is present.
[RFC6636] discusses optimal tuning of the parameters of MLD for routers for mobile and wireless networks. These guidelines may be useful when implementing MLD in LLNs.
Changes from ietf-03 to ietf-04:
Changes from ietf-02 to ietf-03:
Changes from ietf-01 to ietf-02:
Changes from ietf-00 to ietf-01:
Changes from rahman-07 to ietf-00: