draft-ietf-core-resource-directory-12.txt   draft-ietf-core-resource-directory-13.txt 
CoRE Z. Shelby CoRE Z. Shelby
Internet-Draft ARM Internet-Draft ARM
Intended status: Standards Track M. Koster Intended status: Standards Track M. Koster
Expires: May 3, 2018 SmartThings Expires: September 2, 2018 SmartThings
C. Bormann C. Bormann
Universitaet Bremen TZI Universitaet Bremen TZI
P. van der Stok P. van der Stok
consultant consultant
C. Amsuess, Ed. C. Amsuess, Ed.
Energy Harvesting Solutions March 01, 2018
October 30, 2017
CoRE Resource Directory CoRE Resource Directory
draft-ietf-core-resource-directory-12 draft-ietf-core-resource-directory-13
Abstract Abstract
In many M2M applications, direct discovery of resources is not In many M2M applications, direct discovery of resources is not
practical due to sleeping nodes, disperse networks, or networks where practical due to sleeping nodes, disperse networks, or networks where
multicast traffic is inefficient. These problems can be solved by multicast traffic is inefficient. These problems can be solved by
employing an entity called a Resource Directory (RD), which hosts employing an entity called a Resource Directory (RD), which hosts
descriptions of resources held on other servers, allowing lookups to descriptions of resources held on other servers, allowing lookups to
be performed for those resources. This document specifies the web be performed for those resources. This document specifies the web
interfaces that a Resource Directory supports in order for web interfaces that a Resource Directory supports in order for web
skipping to change at page 1, line 39 skipping to change at page 1, line 38
useful in conjunction with an RD are defined. useful in conjunction with an RD are defined.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 3, 2018. This Internet-Draft will expire on September 2, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. Architecture and Use Cases . . . . . . . . . . . . . . . . . 5 3. Architecture and Use Cases . . . . . . . . . . . . . . . . . 6
3.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 5 3.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 6
3.2. Architecture . . . . . . . . . . . . . . . . . . . . . . 6 3.2. Architecture . . . . . . . . . . . . . . . . . . . . . . 6
3.3. Content model . . . . . . . . . . . . . . . . . . . . . . 7 3.3. RD Content Model . . . . . . . . . . . . . . . . . . . . 8
3.4. Use Case: Cellular M2M . . . . . . . . . . . . . . . . . 11 3.4. Use Case: Cellular M2M . . . . . . . . . . . . . . . . . 12
3.5. Use Case: Home and Building Automation . . . . . . . . . 12 3.5. Use Case: Home and Building Automation . . . . . . . . . 13
3.6. Use Case: Link Catalogues . . . . . . . . . . . . . . . . 12 3.6. Use Case: Link Catalogues . . . . . . . . . . . . . . . . 13
4. Finding a Resource Directory . . . . . . . . . . . . . . . . 13 4. Finding a Resource Directory . . . . . . . . . . . . . . . . 14
4.1. Resource Directory Address Option (RDAO) . . . . . . . . 14 4.1. Resource Directory Address Option (RDAO) . . . . . . . . 15
5. Resource Directory . . . . . . . . . . . . . . . . . . . . . 15 5. Resource Directory . . . . . . . . . . . . . . . . . . . . . 17
5.1. Content Formats . . . . . . . . . . . . . . . . . . . . . 16 5.1. Payload Content Formats . . . . . . . . . . . . . . . . . 18
5.2. URI Discovery . . . . . . . . . . . . . . . . . . . . . . 16 5.2. URI Discovery . . . . . . . . . . . . . . . . . . . . . . 18
5.3. Registration . . . . . . . . . . . . . . . . . . . . . . 18 5.3. Registration . . . . . . . . . . . . . . . . . . . . . . 21
5.3.1. Simple Registration . . . . . . . . . . . . . . . . . 22 5.3.1. Simple Registration . . . . . . . . . . . . . . . . . 25
5.3.2. Third-party registration . . . . . . . . . . . . . . 23 5.3.2. Third-party registration . . . . . . . . . . . . . . 26
5.4. Operations on the Registration Resource . . . . . . . . . 23 5.4. Operations on the Registration Resource . . . . . . . . . 26
5.4.1. Registration Update . . . . . . . . . . . . . . . . . 24 5.4.1. Registration Update . . . . . . . . . . . . . . . . . 27
5.4.2. Registration Removal . . . . . . . . . . . . . . . . 26 5.4.2. Registration Removal . . . . . . . . . . . . . . . . 30
5.4.3. Read Endpoint Links . . . . . . . . . . . . . . . . . 27 5.4.3. Read Endpoint Links . . . . . . . . . . . . . . . . . 31
5.4.4. Update Endpoint Links . . . . . . . . . . . . . . . . 28 5.4.4. Update Endpoint Links . . . . . . . . . . . . . . . . 32
6. RD Groups . . . . . . . . . . . . . . . . . . . . . . . . . . 29 6. RD Groups . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.1. Register a Group . . . . . . . . . . . . . . . . . . . . 29 6.1. Register a Group . . . . . . . . . . . . . . . . . . . . 32
6.2. Group Removal . . . . . . . . . . . . . . . . . . . . . . 31 6.2. Group Removal . . . . . . . . . . . . . . . . . . . . . . 34
7. RD Lookup . . . . . . . . . . . . . . . . . . . . . . . . . . 31 7. RD Lookup . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.1. Resource lookup . . . . . . . . . . . . . . . . . . . . . 32 7.1. Resource lookup . . . . . . . . . . . . . . . . . . . . . 36
7.2. Endpoint and group lookup . . . . . . . . . . . . . . . . 33 7.2. Endpoint and group lookup . . . . . . . . . . . . . . . . 36
7.3. Lookup filtering . . . . . . . . . . . . . . . . . . . . 33 7.3. Lookup filtering . . . . . . . . . . . . . . . . . . . . 37
7.4. Lookup examples . . . . . . . . . . . . . . . . . . . . . 35 7.4. Lookup examples . . . . . . . . . . . . . . . . . . . . . 39
8. Security Considerations . . . . . . . . . . . . . . . . . . . 38 8. Security Considerations . . . . . . . . . . . . . . . . . . . 43
8.1. Endpoint Identification and Authentication . . . . . . . 38 8.1. Endpoint Identification and Authentication . . . . . . . 43
8.2. Access Control . . . . . . . . . . . . . . . . . . . . . 39 8.2. Access Control . . . . . . . . . . . . . . . . . . . . . 44
8.3. Denial of Service Attacks . . . . . . . . . . . . . . . . 39 8.3. Denial of Service Attacks . . . . . . . . . . . . . . . . 44
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 39 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 45
9.1. Resource Types . . . . . . . . . . . . . . . . . . . . . 40 9.1. Resource Types . . . . . . . . . . . . . . . . . . . . . 45
9.2. IPv6 ND Resource Directory Address Option . . . . . . . . 40 9.2. IPv6 ND Resource Directory Address Option . . . . . . . . 45
9.3. RD Parameter Registry . . . . . . . . . . . . . . . . . . 40 9.3. RD Parameter Registry . . . . . . . . . . . . . . . . . . 45
9.3.1. Full description of the "Endpoint Type" Registration 9.3.1. Full description of the "Endpoint Type" Registration
Parameter . . . . . . . . . . . . . . . . . . . . . . 42 Parameter . . . . . . . . . . . . . . . . . . . . . . 47
9.4. "Endpoint Type" (et=) RD Parameter values . . . . . . . . 42 9.4. "Endpoint Type" (et=) RD Parameter values . . . . . . . . 47
10. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 42 9.5. Multicast Address Registration . . . . . . . . . . . . . 48
10.1. Lighting Installation . . . . . . . . . . . . . . . . . 43 10. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 48
10.1.1. Installation Characteristics . . . . . . . . . . . . 43 10.1. Lighting Installation . . . . . . . . . . . . . . . . . 48
10.1.2. RD entries . . . . . . . . . . . . . . . . . . . . . 44 10.1.1. Installation Characteristics . . . . . . . . . . . . 48
10.2. OMA Lightweight M2M (LWM2M) Example . . . . . . . . . . 47 10.1.2. RD entries . . . . . . . . . . . . . . . . . . . . . 49
10.2.1. The LWM2M Object Model . . . . . . . . . . . . . . . 47 10.2. OMA Lightweight M2M (LWM2M) Example . . . . . . . . . . 52
10.2.2. LWM2M Register Endpoint . . . . . . . . . . . . . . 49 10.2.1. The LWM2M Object Model . . . . . . . . . . . . . . . 53
10.2.3. LWM2M Update Endpoint Registration . . . . . . . . . 50 10.2.2. LWM2M Register Endpoint . . . . . . . . . . . . . . 54
10.2.4. LWM2M De-Register Endpoint . . . . . . . . . . . . . 51 10.2.3. LWM2M Update Endpoint Registration . . . . . . . . . 56
11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 51 10.2.4. LWM2M De-Register Endpoint . . . . . . . . . . . . . 56
12. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 51 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 56
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 56 12. Changelog . . . . . . . . . . . . . . . . . . . . . . . . . . 56
13.1. Normative References . . . . . . . . . . . . . . . . . . 56 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 62
13.2. Informative References . . . . . . . . . . . . . . . . . 57 13.1. Normative References . . . . . . . . . . . . . . . . . . 62
Appendix A. Web links and the Resource Directory . . . . . . . . 58 13.2. Informative References . . . . . . . . . . . . . . . . . 63
A.1. A simple example . . . . . . . . . . . . . . . . . . . . 58 Appendix A. Web links and the Resource Directory . . . . . . . . 64
A.1.1. Resolving the URIs . . . . . . . . . . . . . . . . . 59 A.1. A simple example . . . . . . . . . . . . . . . . . . . . 64
A.1.2. Interpreting attributes and relations . . . . . . . . 59 A.1.1. Resolving the URIs . . . . . . . . . . . . . . . . . 64
A.2. A slightly more complex example . . . . . . . . . . . . . 59 A.1.2. Interpreting attributes and relations . . . . . . . . 65
A.3. Enter the Resource Directory . . . . . . . . . . . . . . 60 A.2. A slightly more complex example . . . . . . . . . . . . . 65
A.3. Enter the Resource Directory . . . . . . . . . . . . . . 66
A.4. A note on differences between link-format and Link A.4. A note on differences between link-format and Link
headers . . . . . . . . . . . . . . . . . . . . . . . . . 62 headers . . . . . . . . . . . . . . . . . . . . . . . . . 67
Appendix B. Syntax examples for Protocol Negotiation . . . . . . 62 Appendix B. Syntax examples for Protocol Negotiation . . . . . . 68
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 63 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 69
1. Introduction 1. Introduction
The work on Constrained RESTful Environments (CoRE) aims at realizing The work on Constrained RESTful Environments (CoRE) aims at realizing
the REST architecture in a suitable form for the most constrained the REST architecture in a suitable form for the most constrained
nodes (e.g., 8-bit microcontrollers with limited RAM and ROM) and nodes (e.g., 8-bit microcontrollers with limited RAM and ROM) and
networks (e.g. 6LoWPAN). CoRE is aimed at machine-to-machine (M2M) networks (e.g. 6LoWPAN). CoRE is aimed at machine-to-machine (M2M)
applications such as smart energy and building automation. applications such as smart energy and building automation.
The discovery of resources offered by a constrained server is very The discovery of resources offered by a constrained server is very
skipping to change at page 4, line 32 skipping to change at page 4, line 33
2. Terminology 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. The term "byte" is used in its now customary sense as a [RFC2119]. The term "byte" is used in its now customary sense as a
synonym for "octet". synonym for "octet".
This specification requires readers to be familiar with all the terms This specification requires readers to be familiar with all the terms
and concepts that are discussed in [RFC5988] and [RFC6690]. Readers and concepts that are discussed in [RFC3986], [RFC5988] and
should also be familiar with the terms and concepts discussed in [RFC6690]. Readers should also be familiar with the terms and
[RFC7252]. To describe the REST interfaces defined in this concepts discussed in [RFC7252]. To describe the REST interfaces
specification, the URI Template format is used [RFC6570]. defined in this specification, the URI Template format is used
[RFC6570].
This specification makes use of the following additional terminology: This specification makes use of the following additional terminology:
resolve against
The expression "a URI-reference is _resolved against_ a base URI"
is used to describe the process of [RFC3986] Section 5.2.
Noteworthy corner cases are that resolving an absolute URI against
any base URI gives the original URI, and that resolving an empty
URI reference gives the base URI.
Resource Directory Resource Directory
A web entity that stores information about web resources and A web entity that stores information about web resources and
implements the REST interfaces defined in this specification for implements the REST interfaces defined in this specification for
registration and lookup of those resources. registration and lookup of those resources.
Domain Domain
In the context of a Resource Directory, a domain is a logical In the context of a Resource Directory, a domain is a logical
grouping of endpoints. grouping of endpoints.
Group Group
skipping to change at page 6, line 7 skipping to change at page 6, line 19
The Resource Directory is primarily a tool to make discovery The Resource Directory is primarily a tool to make discovery
operations more efficient than querying /.well-known/core on all operations more efficient than querying /.well-known/core on all
connected device, or across boundaries that would be limiting those connected device, or across boundaries that would be limiting those
operations. operations.
It provides a cache (in the high-level sense, not as defined in It provides a cache (in the high-level sense, not as defined in
[RFC7252]/[RFC2616]) of data that could otherwise only be obtained by [RFC7252]/[RFC2616]) of data that could otherwise only be obtained by
directly querying the /.well-known/core resource on the target directly querying the /.well-known/core resource on the target
device, or by accessing those resources with a multicast request. device, or by accessing those resources with a multicast request.
From that, it follows that no information should be stored in the From that, it follows that only information should be stored in the
resource directory that cannot be discovered from querying the resource directory that is discovered from querying the described
described device's /.well-known/core resource directly. device's /.well-known/core resource directly.
It also follows that data in the resource directory can only be It also follows that data in the resource directory can only be
provided by the device whose descriptions are cached or a dedicated provided by the device whose descriptions are cached or a dedicated
Commissioning Tool (CT). These CTs are thought to act on behalf Commissioning Tool (CT). These CTs are thought to act on behalf
agents too constrained, or generally unable, to present that agents too constrained, or generally unable, to present that
information themselves. No other client can modify data in the information themselves. No other client can modify data in the
resource directory or even expect those changes to propagate back to resource directory. Changes in the Resource Directory do not
its source. propagate automatically back to its source.
3.2. Architecture 3.2. Architecture
The resource directory architecture is illustrated in Figure 1. A The resource directory architecture is illustrated in Figure 1. A
Resource Directory (RD) is used as a repository for Web Links Resource Directory (RD) is used as a repository for Web Links
[RFC5988] about resources hosted on other web servers, which are [RFC5988] about resources hosted on other web servers, which are
called endpoints (EP). An endpoint is a web server associated with a called endpoints (EP). An endpoint is a web server associated with a
scheme, IP address and port, thus a physical node may host one or scheme, IP address and port. A physical node may host one or more
more endpoints. The RD implements a set of REST interfaces for endpoints. The RD implements a set of REST interfaces for endpoints
endpoints to register and maintain sets of Web Links (called resource to register and maintain sets of Web Links (called resource directory
directory registration entries), and for clients to lookup resources registration entries), and for clients to lookup resources from the
from the RD or maintain groups. Endpoints themselves can also act as RD or maintain groups. Endpoints themselves can also act as clients.
clients. An RD can be logically segmented by the use of Domains. An RD can be logically segmented by the use of Groups. The group an
The domain an endpoint is associated with can be defined by the RD or endpoint is part of, can be defined by the RD or configured by a
configured by an outside entity. This information hierarchy is shown Commissioning Tool. This information hierarchy is shown in Figure 2.
in Figure 2.
A mechanism to discover an RD using CoRE Link Format [RFC6690] is A mechanism to discover an RD using CoRE Link Format [RFC6690] is
defined. defined.
Endpoints proactively register and maintain resource directory Endpoints proactively register and maintain resource directory
registration entries on the RD, which are soft state and need to be registration entries on the RD, which are soft state and need to be
periodically refreshed. periodically refreshed.
An endpoint is provided with interfaces to register, update and An endpoint uses specific interfaces to register, update and remove a
remove a resource directory registration entry. It is also possible resource directory registration entry. It is also possible for an RD
for an RD to fetch Web Links from endpoints and add them as resource to fetch Web Links from endpoints and add them as resource directory
directory registration entries. registration entries.
At the first registration of a set of entries, a "registration At the first registration of a set of entries, a "registration
resource" is created, the location of which is returned to the resource" is created, the location of which is returned to the
registering endpoint. The registering endpoint uses this registering endpoint. The registering endpoint uses this
registration resource to manage the contents of the registration registration resource to manage the contents of registration entries.
entry.
A lookup interface for discovering any of the Web Links held in the A lookup interface for discovering any of the Web Links held in the
RD is provided using the CoRE Link Format. RD is provided using the CoRE Link Format.
Registration Lookup, Group Registration Lookup, Group
Interface Interfaces Interface Interfaces
+----+ | | +----+ | |
| EP |---- | | | EP |---- | |
+----+ ---- | | +----+ ---- | |
--|- +------+ | --|- +------+ |
skipping to change at page 7, line 25 skipping to change at page 7, line 35
| EP | ---------|-----| RD |----|-----| Client | | EP | ---------|-----| RD |----|-----| Client |
+----+ | ----| | | +--------+ +----+ | ----| | | +--------+
--|- +------+ | --|- +------+ |
+----+ ---- | | +----+ ---- | |
| EP |---- | | | EP |---- | |
+----+ +----+
Figure 1: The resource directory architecture. Figure 1: The resource directory architecture.
+------------+ +------------+
| Domain | <-- Name | Group | <-- Name, Scheme, IP, Port
+------------+ +------------+
| | |
| +------------+ |
| | Group | <-- Name, Scheme, IP, Port
| +------------+
| |
+------------+ +------------+
| Endpoint | <-- Name, Scheme, IP, Port | Endpoint | <-- Name, Scheme, IP, Port
+------------+ +------------+
| |
| |
+------------+ +------------+
| Resource | <-- Target, Parameters | Resource | <-- Target, Parameters
+------------+ +------------+
Figure 2: The resource directory information hierarchy. Figure 2: The resource directory information hierarchy.
3.3. Content model 3.3. RD Content Model
The Entity-Relationship (ER) models shown in Figure 3 and Figure 4 The Entity-Relationship (ER) models shown in Figure 3 and Figure 4
model the contents of /.well-known/core and the resource directory model the contents of /.well-known/core and the resource directory
respectively, with entity-relationship diagrams [ER]. Entities respectively, with entity-relationship diagrams [ER]. Entities
(rectangles) are used for concepts that exist independently. (rectangles) are used for concepts that exist independently.
Attributes (ovals) are used for concepts that exist only in Attributes (ovals) are used for concepts that exist only in
connection with a related entity. Relations (diamonds) give a connection with a related entity. Relations (diamonds) give a
semantic meaning to the relation between entities. Numbers specify semantic meaning to the relation between entities. Numbers specify
the cardinality of the relations. the cardinality of the relations.
skipping to change at page 9, line 14 skipping to change at page 9, line 46
o a set of links belonging to the host o a set of links belonging to the host
The host is free to choose links it deems appropriate to be exposed The host is free to choose links it deems appropriate to be exposed
in its ".well-known/core". Typically, the links describe resources in its ".well-known/core". Typically, the links describe resources
that are served by the host, but the set can also contain links to that are served by the host, but the set can also contain links to
resources on other servers (see examples in [RFC6690] page 14). The resources on other servers (see examples in [RFC6690] page 14). The
set does not necessarily contain links to all resources served by the set does not necessarily contain links to all resources served by the
host. host.
A link has the following attributes: A link has the following attributes (see [RFC5988]):
o Zero or more link relations: They describe a relations between the o Zero or more link relations: They describe relations between the
link context and the link target. link context and the link target.
In link-format serialization, they are expressed as space- In link-format serialization, they are expressed as space-
separated values in the "rel" attribute, and default to "hosts". separated values in the "rel" attribute, and default to "hosts".
o A link context URI: It defines the source of the relation, eg. o A link context URI: It defines the source of the relation, eg.
_who_ "hosts" something. _who_ "hosts" something.
In link-format serialization, it is expressed in the "anchor" In link-format serialization, it is expressed in the "anchor"
attribute. There, it can be a relative reference, in which case attribute. There, it can be a relative reference, in which case
it gets resolved against the URI of the ".well-known/core" it gets resolved against the URI of the ".well-known/core"
document it was obtained from . It defaults to that document's document it was obtained from. It defaults to that document's
URI. URI.
In the serialization, the context also serves as the Base URI for
resolving the target reference.
o A link target URI: It defines the destination of the relation (eg. o A link target URI: It defines the destination of the relation (eg.
_what_ is hosted), and is the topic of all target attributes. _what_ is hosted), and is the topic of all target attributes.
In link-format serialization, it is expressed between angular In link-format serialization, it is expressed between angular
brackets, and sometimes called the "href". If it is a relative URI, brackets, and sometimes called the "href".
it gets resolved against the link context URI.
If there is an anchor attribute present and the link is serialized in
[RFC6690] link format, this document will require that the link is an
absolute reference to avoid the ambiguities outlined in Appendix A.4.
Otherwise, it can be serialized as a relative URI, and gets resolved
against the document's URI.
o Other target attributes (eg. resource type (rt), interface (if), o Other target attributes (eg. resource type (rt), interface (if),
cor content-type (ct)). These provide additional information cor content-type (ct)). These provide additional information
about the target URI. about the target URI.
+----------------------+ +----------------------+
| resource-directory | | resource-directory |
+----------------------+ +----------------------+
| |
| oooooooooooo 0-1 | oooooooooooo 0-1
skipping to change at page 11, line 24 skipping to change at page 12, line 24
o one con (a string describing the scheme://authority part) o one con (a string describing the scheme://authority part)
o one lt (lifetime), o one lt (lifetime),
o one loc (location in the RD) o one loc (location in the RD)
o optional one d (domain for query filtering), o optional one d (domain for query filtering),
o optional additional endpoint attributes (from Section 9.3) o optional additional endpoint attributes (from Section 9.3)
The cardinality of con is currently 1. Its value is used as a Base The cardinality of con is currently 1; future documents are invited
URI when resolving URIs in the links contained in the endpoint. to extend the RD specification to support multiple values (eg.
[I-D.silverajan-core-coap-protocol-negotiation]). Its value is used
as a Base URI when resolving URIs in the links contained in the
endpoint.
Links are modelled as they are in Figure 3. Links are modelled as they are in Figure 3.
3.4. Use Case: Cellular M2M 3.4. Use Case: Cellular M2M
Over the last few years, mobile operators around the world have Over the last few years, mobile operators around the world have
focused on development of M2M solutions in order to expand the focused on development of M2M solutions in order to expand the
business to the new type of users: machines. The machines are business to the new type of users: machines. The machines are
connected directly to a mobile network using an appropriate embedded connected directly to a mobile network using an appropriate embedded
wireless interface (GSM/GPRS, WCDMA, LTE) or via a gateway providing wireless interface (GSM/GPRS, WCDMA, LTE) or via a gateway providing
skipping to change at page 12, line 4 skipping to change at page 13, line 6
the crucial enablers of such design is the ability to discover the crucial enablers of such design is the ability to discover
resources (machines -- endpoints) capable of providing required resources (machines -- endpoints) capable of providing required
information at a given time or acting on instructions from the end information at a given time or acting on instructions from the end
users. users.
Imagine a scenario where endpoints installed on vehicles enable Imagine a scenario where endpoints installed on vehicles enable
tracking of the position of these vehicles for fleet management tracking of the position of these vehicles for fleet management
purposes and allow monitoring of environment parameters. During the purposes and allow monitoring of environment parameters. During the
boot-up process endpoints register with a Resource Directory, which boot-up process endpoints register with a Resource Directory, which
is hosted by the mobile operator or somewhere in the cloud. is hosted by the mobile operator or somewhere in the cloud.
Periodically, these endpoints update their registration and may Periodically, these endpoints update their registration and may
modify resources they offer. modify resources they offer.
When endpoints are not always connected, for example because they When endpoints are not always connected, for example because they
enter a sleep mode, a remote server is usually used to provide proxy enter a sleep mode, a remote server is usually used to provide proxy
access to the endpoints. Mobile apps or web applications for access to the endpoints. Mobile apps or web applications for
environment monitoring contact the RD, look up the endpoints capable environment monitoring contact the RD, look up the endpoints capable
of providing information about the environment using appropriate set of providing information about the environment using an appropriate
of link parameters, obtain information on how to contact them (URLs set of link parameters, obtain information on how to contact them
of the proxy server) and then initiate interaction to obtain (URLs of the proxy server), and then initiate interaction to obtain
information that is finally processed, displayed on the screen and information that is finally processed, displayed on the screen and
usually stored in a database. Similarly, fleet management systems usually stored in a database. Similarly, fleet management systems
provide the appropriate link parameters to the RD to look up for EPs provide the appropriate link parameters to the RD to look up for EPs
deployed on the vehicles the application is responsible for. deployed on the vehicles the application is responsible for.
3.5. Use Case: Home and Building Automation 3.5. Use Case: Home and Building Automation
Home and commercial building automation systems can benefit from the Home and commercial building automation systems can benefit from the
use of M2M web services. The discovery requirements of these use of M2M web services. The discovery requirements of these
applications are demanding. Home automation usually relies on run- applications are demanding. Home automation usually relies on run-
skipping to change at page 13, line 18 skipping to change at page 14, line 22
be sufficient to store external metadata in Resource Directories. be sufficient to store external metadata in Resource Directories.
The additional features of Resource Directory allow domains to be The additional features of Resource Directory allow domains to be
defined to enable access to a particular set of resources from defined to enable access to a particular set of resources from
particular applications. This provides isolation and protection of particular applications. This provides isolation and protection of
sensitive data when needed. Resource groups may defined to allow sensitive data when needed. Resource groups may defined to allow
batched reads from multiple resources. batched reads from multiple resources.
4. Finding a Resource Directory 4. Finding a Resource Directory
A device coming up may want to find one or more resource directories A (re-e)starting device may want to find one or more resource
to make itself known with. directories to make itself known with.
The device may be pre-configured to exercise specific mechanisms for The device may be pre-configured to exercise specific mechanisms for
finding the resource directory: finding the resource directory:
o It may be configured with a specific IP address for the RD. That o It may be configured with a specific IP address for the RD. That
IP address may also be an anycast address, allowing the network to IP address may also be an anycast address, allowing the network to
forward RD requests to an RD that is topologically close; each forward RD requests to an RD that is topologically close; each
target network environment in which some of these preconfigured target network environment in which some of these preconfigured
nodes are to be brought up is then configured with a route for nodes are to be brought up is then configured with a route for
this anycast address that leads to an appropriate RD. (Instead of this anycast address that leads to an appropriate RD. (Instead of
skipping to change at page 14, line 24 skipping to change at page 15, line 27
suggests a number of candidates: suggests a number of candidates:
o In a 6LoWPAN, just assume the Edge Router (6LBR) can act as a o In a 6LoWPAN, just assume the Edge Router (6LBR) can act as a
resource directory (using the ABRO option to find that [RFC6775]). resource directory (using the ABRO option to find that [RFC6775]).
Confirmation can be obtained by sending a Unicast to Confirmation can be obtained by sending a Unicast to
"coap://[6LBR]/.well-known/core?rt=core.rd*". "coap://[6LBR]/.well-known/core?rt=core.rd*".
o In a network that supports multicast well, discovering the RD o In a network that supports multicast well, discovering the RD
using a multicast query for /.well-known/core as specified in CoRE using a multicast query for /.well-known/core as specified in CoRE
Link Format [RFC6690]: Sending a Multicast GET to Link Format [RFC6690]: Sending a Multicast GET to
"coap://[ff02::1]/.well-known/core?rt=core.rd*". RDs within the "coap://[MCD1]/.well-known/core?rt=core.rd*". RDs within the
multicast scope will answer the query. multicast scope will answer the query.
As some of the RD addresses obtained by the methods listed here are As some of the RD addresses obtained by the methods listed here are
just (more or less educated) guesses, endpoints MUST make use of any just (more or less educated) guesses, endpoints MUST make use of any
error messages to very strictly rate-limit requests to candidate IP error messages to very strictly rate-limit requests to candidate IP
addresses that don't work out. For example, an ICMP Destination addresses that don't work out. For example, an ICMP Destination
Unreachable message (and, in particular, the port unreachable code Unreachable message (and, in particular, the port unreachable code
for this message) may indicate the lack of a CoAP server on the for this message) may indicate the lack of a CoAP server on the
candidate host, or a CoAP error response code such as 4.05 "Method candidate host, or a CoAP error response code such as 4.05 "Method
Not Allowed" may indicate unwillingness of a CoAP server to act as a Not Allowed" may indicate unwillingness of a CoAP server to act as a
directory server. directory server.
If multiple candidate addresses are discovered, the device may pick
any of them initially, unless the discovery method indicates a more
precise selection scheme.
4.1. Resource Directory Address Option (RDAO) 4.1. Resource Directory Address Option (RDAO)
The Resource Directory Option (RDAO) using IPv6 neighbor Discovery The Resource Directory Address Option (RDAO) using IPv6 neighbor
(ND) carries information about the address of the Resource Directory Discovery (ND) carries information about the address of the Resource
(RD). This information is needed when endpoints cannot discover the Directory (RD). This information is needed when endpoints cannot
Resource Directory with link-local multicast address because the discover the Resource Directory with a link-local multicast address
endpoint and the RD are separated by a border Router (6LBR). In many because the endpoint and the RD are separated by a border Router
circumstances the availability of DHCP cannot be guaranteed either (6LBR). In many circumstances the availability of DHCP cannot be
during commissioning of the network. The presence and the use of the guaranteed either during commissioning of the network. The presence
RD is essential during commissioning. and the use of the RD is essential during commissioning.
It is possible to send multiple RDAO options in one message, It is possible to send multiple RDAO options in one message,
indicating as many resource directory addresses. indicating as many resource directory addresses.
The lifetime 0x0 means that the RD address is invalid and to be The lifetime 0x0 means that the RD address is invalid and to be
removed. removed.
The RDAO format is: The RDAO format is:
0 1 2 3 0 1 2 3
skipping to change at page 16, line 18 skipping to change at page 18, line 17
section. section.
All operations on the contents of the Resource Directory MUST be All operations on the contents of the Resource Directory MUST be
atomic and idempotent. atomic and idempotent.
A resource directory MAY make the information submitted to it A resource directory MAY make the information submitted to it
available to further directories, if it can ensure that a loop does available to further directories, if it can ensure that a loop does
not form. The protocol used between directories to ensure loop-free not form. The protocol used between directories to ensure loop-free
operation is outside the scope of this document. operation is outside the scope of this document.
5.1. Content Formats 5.1. Payload Content Formats
Resource Directory implementations using this specification MUST Resource Directory implementations using this specification MUST
support the application/link-format content format (ct=40). support the application/link-format content format (ct=40).
Resource Directories implementing this specification MAY support Resource Directories implementing this specification MAY support
additional content formats. additional content formats.
Any additional content format supported by a Resource Directory Any additional content format supported by a Resource Directory
implementing this specification MUST have an equivalent serialization implementing this specification MUST have an equivalent serialization
in the application/link-format content format. in the application/link-format content format.
skipping to change at page 16, line 46 skipping to change at page 18, line 45
RD discovery methods is described in Section 4. RD discovery methods is described in Section 4.
Discovery of the RD registration URI path is performed by sending Discovery of the RD registration URI path is performed by sending
either a multicast or unicast GET request to "/.well-known/core" and either a multicast or unicast GET request to "/.well-known/core" and
including a Resource Type (rt) parameter [RFC6690] with the value including a Resource Type (rt) parameter [RFC6690] with the value
"core.rd" in the query string. Likewise, a Resource Type parameter "core.rd" in the query string. Likewise, a Resource Type parameter
value of "core.rd-lookup*" is used to discover the URIs for RD Lookup value of "core.rd-lookup*" is used to discover the URIs for RD Lookup
operations, and "core.rd-group" is used to discover the URI path for operations, and "core.rd-group" is used to discover the URI path for
RD Group operations. Upon success, the response will contain a RD Group operations. Upon success, the response will contain a
payload with a link format entry for each RD function discovered, payload with a link format entry for each RD function discovered,
indicating the URI path of the RD function returned and the indicating the URI of the RD function returned and the corresponding
corresponding Resource Type. When performing multicast discovery, Resource Type. When performing multicast discovery, the multicast IP
the multicast IP address used will depend on the scope required and address used will depend on the scope required and the multicast
the multicast capabilities of the network. capabilities of the network.
A Resource Directory MAY provide hints about the content-formats it A Resource Directory MAY provide hints about the content-formats it
supports in the links it exposes or registers, using the "ct" link supports in the links it exposes or registers, using the "ct" link
attribute, as shown in the example below. Clients MAY use these attribute, as shown in the example below. Clients MAY use these
hints to select alternate content-formats for interaction with the hints to select alternate content-formats for interaction with the
Resource Directory. Resource Directory.
HTTP does not support multicast and consequently only unicast HTTP does not support multicast and consequently only unicast
discovery can be supported using HTTP. Links to Resource Directories discovery can be supported using HTTP. Links to Resource Directories
MAY be registered in other Resource Directories, and well-known entry MAY be registered in other Resource Directories. The well-known
points SHOULD be provided to enable the bootstrapping of unicast entry points SHOULD be provided to enable the bootstrapping of
discovery. unicast discovery.
An RD implementation of this specification MUST support query An implementation of this resource directory specification MUST
filtering for the rt parameter as defined in [RFC6690]. support query filtering for the rt parameter as defined in [RFC6690].
While the link targets in this discovery step are often expressed in
path-absolute form, this is not a requirement. Clients SHOULD
therefore accept URIs of all schemes they support, both in absolute
and relative forms, and not limit the set of discovered URIs to those
hosted at the address used for URI discovery.
The URI Discovery operation can yield multiple URIs of a given
resource type. The client can use any of the discovered addresses
initially.
The discovery request interface is specified as follows: The discovery request interface is specified as follows:
Interaction: EP -> RD Interaction: EP -> RD
Method: GET Method: GET
URI Template: /.well-known/core{?rt} URI Template: /.well-known/core{?rt}
URI Template Variables: URI Template Variables:
skipping to change at page 18, line 4 skipping to change at page 20, line 11
application/link-format+json, or application/link-format+cbor application/link-format+json, or application/link-format+cbor
payload containing one or more matching entries for the RD payload containing one or more matching entries for the RD
resource. resource.
Failure: 4.00 "Bad Request" or 400 "Bad Request" is returned in case Failure: 4.00 "Bad Request" or 400 "Bad Request" is returned in case
of a malformed request for a unicast request. of a malformed request for a unicast request.
Failure: No error response to a multicast request. Failure: No error response to a multicast request.
HTTP support : YES (Unicast only) HTTP support : YES (Unicast only)
The following example shows an endpoint discovering an RD using this The following example shows an endpoint discovering an RD using this
interface, thus learning that the directory resource is, in this interface, thus learning that the directory resource is, in this
example, at /rd, and that the content-format delivered by the server example, at /rd, and that the content-format delivered by the server
hosting the resource is application/link-format (ct=40). Note that hosting the resource is application/link-format (ct=40). Note that
it is up to the RD to choose its RD resource paths. it is up to the RD to choose its RD resource paths.
Req: GET coap://[ff02::1]/.well-known/core?rt=core.rd* Req: GET coap://[MCD1]/.well-known/core?rt=core.rd*
Res: 2.05 Content Res: 2.05 Content
</rd>;rt="core.rd";ct=40, </rd>;rt="core.rd";ct=40,
</rd-lookup/ep>;rt="core.rd-lookup-ep";ct=40, </rd-lookup/ep>;rt="core.rd-lookup-ep";ct=40,
</rd-lookup/res>;rt="core.rd-lookup-res";ct=40, </rd-lookup/res>;rt="core.rd-lookup-res";ct=40,
</rd-lookup/gp>;rt="core.rd-lookup-gp";ct=40, </rd-lookup/gp>;rt="core.rd-lookup-gp";ct=40,
</rd-group>;rt="core.rd-group";ct=40 </rd-group>;rt="core.rd-group";ct=40
Figure 6: Example discovery exchange Figure 6: Example discovery exchange
The following example shows the way of indicating that a client may The following example shows the way of indicating that a client may
request alternate content-formats. The Content-Format code attribute request alternate content-formats. The Content-Format code attribute
"ct" MAY include a space-separated sequence of Content-Format codes "ct" MAY include a space-separated sequence of Content-Format codes
as specified in Section 7.2.1 of [RFC7252], indicating that multiple as specified in Section 7.2.1 of [RFC7252], indicating that multiple
content-formats are available. The example below shows the required content-formats are available. The example below shows the required
Content-Format 40 (application/link-format) indicated as well as the Content-Format 40 (application/link-format) indicated as well as the
the CBOR and JSON representation of link format. The RD resource the CBOR and JSON representation of link format. The RD resource
paths /rd, /rd-lookup, and /rd-group are example values. paths /rd, /rd-lookup, and /rd-group are example values. The server
in this example also indicates that it is capable of providing
observation on resource lookups.
[ The RFC editor is asked to replace these and later occurrences of [ The RFC editor is asked to replace these and later occurrences of
TBD64 and TBD504 with the numeric ID values assigned by IANA to TBD64 and TBD504 with the numeric ID values assigned by IANA to
application/link-format+cbor and application/link-format+json, application/link-format+cbor and application/link-format+json,
respectively, as they are defined in I-D.ietf-core-links-json. ] respectively, as they are defined in I-D.ietf-core-links-json. ]
Req: GET coap://[ff02::1]/.well-known/core?rt=core.rd* Req: GET coap://[MCD1]/.well-known/core?rt=core.rd*
Res: 2.05 Content Res: 2.05 Content
</rd>;rt="core.rd";ct="40 65225", </rd>;rt="core.rd";ct="40 65225",
</rd-lookup/res>;rt="core.rd-lookup-res";ct="40 TBD64 TBD504", </rd-lookup/res>;rt="core.rd-lookup-res";ct="40 TBD64 TBD504";obs,
</rd-lookup/ep>;rt="core.rd-lookup-ep";ct="40 TBD64 TBD504", </rd-lookup/ep>;rt="core.rd-lookup-ep";ct="40 TBD64 TBD504",
</rd-lookup/gp>;rt="core.rd-lookup-gp";ct=40 TBD64 TBD504", </rd-lookup/gp>;rt="core.rd-lookup-gp";ct=40 TBD64 TBD504",
</rd-group>;rt="core.rd-group";ct="40 TBD64 TBD504" </rd-group>;rt="core.rd-group";ct="40 TBD64 TBD504"
From a management and maintenance perspective, it is necessary to
identify the components that constitute the server. The
identification refers to information about for example client-server
incompatibilities, supported features, required updates and other
aspects. The URI discovery address, a described in section 4 of
[RFC6690] can be used to find the identification.
It would typically be stored in an implementation information link
(as described in [I-D.bormann-t2trg-rel-impl]):
Req: GET /.well-known/core?rel=impl-info
Res: 2.05 Content
<http://software.example.com/shiny-resource-directory/1.0beta1>;
rel="impl-info"
Note that depending on the particular server's architecture, such a
link could be anchored at the server's root, at the discovery site
(as in this example) or at individual RD components. The latter is
to be expected when different applications are run on the same
server.
5.3. Registration 5.3. Registration
After discovering the location of an RD, an endpoint MAY register its After discovering the location of an RD, an endpoint MAY register its
resources using the registration interface. This interface accepts a resources using the registration interface. This interface accepts a
POST from an endpoint containing the list of resources to be added to POST from an endpoint containing the list of resources to be added to
the directory as the message payload in the CoRE Link Format the directory as the message payload in the CoRE Link Format
[RFC6690], JSON CoRE Link Format (application/link-format+json), or [RFC6690], JSON CoRE Link Format (application/link-format+json), or
CBOR CoRE Link Format (application/link-format+cbor) CBOR CoRE Link Format (application/link-format+cbor)
[I-D.ietf-core-links-json], along with query parameters indicating [I-D.ietf-core-links-json], along with query parameters indicating
the name of the endpoint, and optionally its domain and the lifetime the name of the endpoint, and optionally the domain and the lifetime
of the registration. It is expected that other specifications will of the registration. It is expected that other specifications will
define further parameters (see Section 9.3). The RD then creates a define further parameters (see Section 9.3). The RD then creates a
new registration resource in the RD and returns its location. An new registration resource in the RD and returns its location. An
endpoint MUST use that location when refreshing registrations using endpoint MUST use that location when refreshing registrations using
this interface. Registration resources in the RD are kept active for this interface. Registration resources in the RD are kept active for
the period indicated by the lifetime parameter. The endpoint is the period indicated by the lifetime parameter. The endpoint is
responsible for refreshing the registration resource within this responsible for refreshing the registration resource within this
period using either the registration or update interface. The period using either the registration or update interface. The
registration interface MUST be implemented to be idempotent, so that registration interface MUST be implemented to be idempotent, so that
registering twice with the same endpoint parameters ep and d does not registering twice with the same endpoint parameters ep and d does not
create multiple registration resources. A new registration resource create multiple registration resources. A new registration resource
may be created at any time to supersede an existing registration, may be created at any time to supersede an existing registration,
replacing the registration parameters and links. replacing the registration parameters and links.
An empty payload is considered a malformed request.
The posted link-format document can (and typically does) contain The posted link-format document can (and typically does) contain
relative references both in its link targets and in its anchors, or relative references both in its link targets and in its anchors, or
contain empty anchors. The RD server needs to resolve these contain empty anchors. The RD server needs to resolve these
references in order to faithfully represent them in lookups. The references in order to faithfully represent them in lookups. The
Base URI against which they are resolved is the context of the Base URI against which they are resolved is the context of the
registration, which is provided either explicitly in the "con" registration, which is provided either explicitly in the "con"
parameter or constructed implicitly from the requester's network parameter or constructed implicitly from the requester's network
address. When resolving relative target references, the server first address.
resolves the context of that link, and then interprets the target as
a reference relative to that context (see Appendix A.4). Documents in [RFC6690] Link Format SHOULD NOT contain links in which
resolving the target literal against the base URI gives a different
result than resolving it against the resolved anchor; this is to
avoid the ambiguities described in Appendix A.4. * Entries in which
there is no anchor attribute, * entries in which the target is an
absolute reference and * entries in which both the target and the
anchor start with a slash ("/")
never cause that kind of ambiguity.
The registration request interface is specified as follows: The registration request interface is specified as follows:
Interaction: EP -> RD Interaction: EP -> RD
Method: POST Method: POST
URI Template: {+rd}{?ep,d,lt,con,extra-attrs*} URI Template: {+rd}{?ep,d,lt,con,extra-attrs*}
URI Template Variables: URI Template Variables:
rd := RD registration URI (mandatory). This is the location of rd := RD registration URI (mandatory). This is the location of
the RD, as obtained from discovery. the RD, as obtained from discovery.
ep := Endpoint name (mostly mandatory). The endpoint name is an ep := Endpoint name (mostly mandatory). The endpoint name is an
identifier that MUST be unique within a domain. The maximum identifier that MUST be unique within a domain. The maximum
length of this parameter is 63 bytes. If the RD is configured length of this parameter is 63 bytes. If the RD is configured
to recognize the endpoint (eg. based on its security context), to recognize the endpoint (eg. based on its security context),
the endpoint can elide the endpoint name, and assign one based the endpoint can ignore the endpoint name, and assign one based
on the configuration. on a se of configuration parameter values.
d := Domain (optional). The domain to which this endpoint d := Domain (optional). The domain to which this endpoint
belongs. The maximum length of this parameter is 63 bytes. belongs. The maximum length of this parameter is 63 bytes.
When this parameter is elided, the RD MAY associate the When this parameter is not present, the RD MAY associate the
endpoint with a configured default domain. endpoint with a configured default domain or leave it empty.
lt := Lifetime (optional). Lifetime of the registration in lt := Lifetime (optional). Lifetime of the registration in
seconds. Range of 60-4294967295. If no lifetime is included seconds. Range of 60-4294967295. If no lifetime is included
in the initial registration, a default value of 86400 (24 in the initial registration, a default value of 86400 (24
hours) SHOULD be assumed. hours) SHOULD be assumed.
con := Context (optional). This parameter sets the Default Base con := Context (optional). This parameter sets the Default Base
URI under which the request's links are to be interpreted. The URI under which the request's links are to be interpreted. The
URI MUST NOT have a path component of its own, but MUST be specified URI MUST NOT have a path component of its own, but
suitable as a base URI to resolve any relative references given MUST be suitable as a base URI to resolve any relative
in the registration. The parameter is therefore of the shape references given in the registration. The parameter is
"scheme://authority" for HTTP and CoAP URIs. In the absence of therefore of the shape "scheme://authority" for HTTP and CoAP
this parameter the scheme of the protocol, source address and URIs. In the absence of this parameter the scheme of the
source port of the registration request are assumed. This protocol, source address and source port of the registration
parameter is mandatory when the directory is filled by a third request are assumed. This parameter is mandatory when the
party such as an commissioning tool. If the endpoint uses an directory is filled by a third party such as an commissioning
ephemeral port to register with, it MUST include the con tool. If the endpoint uses an ephemeral port to register with,
parameter in the registration to provide a valid network path. it MUST include the con parameter in the registration to
If the endpoint which is located behind a NAT gateway is provide a valid network path. If the endpoint which is located
registering with a Resource Directory which is on the network behind a NAT gateway is registering with a Resource Directory
service side of the NAT gateway, the endpoint MUST use a which is on the network service side of the NAT gateway, the
persistent port for the outgoing registration in order to endpoint MUST use a persistent port for the outgoing
provide the NAT gateway with a valid network address for registration in order to provide the NAT gateway with a valid
replies and incoming requests. network address for replies and incoming requests.
extra-attrs := Additional registration attributes (optional). extra-attrs := Additional registration attributes (optional).
The endpoint can pass any parameter registered at Section 9.3 The endpoint can pass any parameter registered at Section 9.3
to the directory. If the RD is aware of the parameter's to the directory. If the RD is aware of the parameter's
specified semantics, it processes it accordingly. Otherwise, specified semantics, it processes it accordingly. Otherwise,
it MUST store the unknown key and its value(s) as an endpoint it MUST store the unknown key and its value(s) as an endpoint
attribute for further lookup. attribute for further lookup.
Content-Format: application/link-format Content-Format: application/link-format
skipping to change at page 21, line 21 skipping to change at page 24, line 13
the payload. the payload.
Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed
request. request.
Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable". Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable".
Service could not perform the operation. Service could not perform the operation.
HTTP support: YES HTTP support: YES
If the registration fails with a Service Unavailable response and a
Max-Age option or Retry-After header, the client SHOULD retry the
operation after the time indicated. If the registration fails in
another way, including request timeouts, or if the Service
Unavailable error persists after several retries, or indicates a
longer time than the endpoint is willing to wait, it SHOULD pick
another registration URI from the "URI Discovery" step and if there
is only one or the list is exhausted, pick other choices from the
"Finding a Resource Directory" step. Care has to be taken to
consider the freshness of results obtained earlier, eg. of the result
of a "/.well-known/core" response, the lifetime of an RDAO option and
of DNS responses. Any rate limits and persistent errors from the
"Finding a Resource Directory" step must be considered for the whole
registration time, not only for a single operation.
The following example shows an endpoint with the name "node1" The following example shows an endpoint with the name "node1"
registering two resources to an RD using this interface. The registering two resources to an RD using this interface. The
location "/rd" is an example RD location discovered in a request location "/rd" is an example RD location discovered in a request
similar to Figure 6. similar to Figure 6.
Req: POST coap://rd.example.com/rd?ep=node1 Req: POST coap://rd.example.com/rd?ep=node1
Content-Format: 40 Content-Format: 40
Payload: Payload:
</sensors/temp>;ct=41;rt="temperature-c";if="sensor", </sensors/temp>;ct=41;rt="temperature-c";if="sensor";
anchor="coap://spurious.example.com:5683",
</sensors/light>;ct=41;rt="light-lux";if="sensor" </sensors/light>;ct=41;rt="light-lux";if="sensor"
Res: 2.01 Created Res: 2.01 Created
Location: /rd/4521 Location: /rd/4521
Figure 7: Example registration payload
A Resource Directory may optionally support HTTP. Here is an example A Resource Directory may optionally support HTTP. Here is an example
of almost the same registration operation above, when done using HTTP of almost the same registration operation above, when done using HTTP
and the JSON Link Format. and the JSON Link Format.
Req: POST /rd?ep=node1&con=http://[2001:db8:1::1] HTTP/1.1 Req: POST /rd?ep=node1&con=http://[2001:db8:1::1] HTTP/1.1
Host : example.com Host : example.com
Content-Type: application/link-format+json Content-Type: application/link-format+json
Payload: Payload:
[ [
{"href": "/sensors/temp", "ct": "41", "rt": "temperature-c", "if": "sensor"}, {"href": "/sensors/temp", "ct": "41", "rt": "temperature-c", "if": "sensor",
"anchor": "coap://spurious.example.com:5683"},
{"href": "/sensors/light", "ct": "41", "rt": "light-lux", "if": "sensor"} {"href": "/sensors/light", "ct": "41", "rt": "light-lux", "if": "sensor"}
] ]
Res: 201 Created Res: 201 Created
Location: /rd/4521 Location: /rd/4521
5.3.1. Simple Registration 5.3.1. Simple Registration
Not all endpoints hosting resources are expected to know how to Not all endpoints hosting resources are expected to know how to
upload links to a RD as described in Section 5.3. Instead, simple upload links to a RD as described in Section 5.3. Instead, simple
endpoints can implement the Simple Registration approach described in endpoints can implement the Simple Registration approach described in
this section. An RD implementing this specification MUST implement this section. An RD implementing this specification MUST implement
Simple Registration. However, there may be security reasons why this Simple Registration. However, there may be security reasons why this
form of directory discovery would be disabled. form of directory discovery would be disabled.
This approach requires that the endpoint makes available the hosted This approach requires that the endpoint makes available the hosted
skipping to change at page 22, line 15 skipping to change at page 25, line 29
Not all endpoints hosting resources are expected to know how to Not all endpoints hosting resources are expected to know how to
upload links to a RD as described in Section 5.3. Instead, simple upload links to a RD as described in Section 5.3. Instead, simple
endpoints can implement the Simple Registration approach described in endpoints can implement the Simple Registration approach described in
this section. An RD implementing this specification MUST implement this section. An RD implementing this specification MUST implement
Simple Registration. However, there may be security reasons why this Simple Registration. However, there may be security reasons why this
form of directory discovery would be disabled. form of directory discovery would be disabled.
This approach requires that the endpoint makes available the hosted This approach requires that the endpoint makes available the hosted
resources that it wants to be discovered, as links on its "/.well- resources that it wants to be discovered, as links on its "/.well-
known/core" interface as specified in [RFC6690]. known/core" interface as specified in [RFC6690]. The links in that
document are subject to the same limitations as the payload of a
registration (no relative target references when anchor is present).
The endpoint then finds one or more addresses of the directory server The endpoint then finds one or more addresses of the directory server
as described in Section 4. as described in Section 4.
An endpoint finally asks the directory server to probe it for An endpoint finally asks the selected directory server to probe it
resources and publish them as follows: for resources and publish them as follows:
It sends (and regularly refreshes with) a POST request to the The endpoint sends (and regularly refreshes with) a POST request to
"/.well-known/core" URI of the directory server of choice. The body the "/.well-known/core" URI of the directory server of choice. The
of the POST request is empty, which triggers the resource directory body of the POST request is empty, which triggers the resource
server to perform GET requests at the requesting server's default directory server to perform GET requests at the requesting server's
discovery URI to obtain the link-format payload to register. default discovery URI to obtain the link-format payload to register.
The endpoint includes the same registration parameters in the POST The endpoint includes the same registration parameters in the POST
request as it would per Section 5.3. The context of the registration request as it would per Section 5.3. The context of the registration
is taken from the requesting server's URI. is taken from the requesting server's URI.
The endpoints MUST be deleted after the expiration of their lifetime. The endpoints MUST be deleted after the expiration of their lifetime.
Additional operations cannot be executed because no registration Additional operations on the registration resource cannot be executed
location is returned. because no registration location is returned.
The following example shows an endpoint using Simple Registration, by The following example shows an endpoint using Simple Registration, by
simply sending an empty POST to a resource directory. simply sending an empty POST to a resource directory.
Req:(to RD server from [2001:db8:2::1]) Req:(to RD server from [2001:db8:2::1])
POST /.well-known/core?lt=6000&ep=node1 POST /.well-known/core?lt=6000&ep=node1
Content-Format: 40 Content-Format: 40
No payload No payload
Res: 2.04 Changed Res: 2.04 Changed
skipping to change at page 23, line 25 skipping to change at page 26, line 28
GET /.well-known/core GET /.well-known/core
Accept: 40 Accept: 40
Res: 2.05 Content Res: 2.05 Content
Payload: Payload:
</sen/temp> </sen/temp>
5.3.2. Third-party registration 5.3.2. Third-party registration
For some applications, even Simple Registration may be too taxing for For some applications, even Simple Registration may be too taxing for
certain very constrained devices, in particular if the security some very constrained devices, in particular if the security
requirements become too onerous. requirements become too onerous.
In a controlled environment (e.g. building control), the Resource In a controlled environment (e.g. building control), the Resource
Directory can be filled by a third device, called a commissioning Directory can be filled by a third device, called a commissioning
tool. The commissioning tool can fill the Resource Directory from a tool. The commissioning tool can fill the Resource Directory from a
database or other means. For that purpose the scheme, IP address and database or other means. For that purpose the scheme, IP address and
port of the registered device is indicated in the Context parameter port of the registered device is indicated in the Context parameter
of the registration described in Section 5.3. of the registration described in Section 5.3.
It should be noted that the value of the con parameter applies to all
the links of the registration and has consequences for the anchor
value of the individual links as exemplified in Appendix A. An
eventual (currently non-existing) con attribute of the link is not
affected by the value of con parameter in the registration.
5.4. Operations on the Registration Resource 5.4. Operations on the Registration Resource
After the initial registration, an endpoint should retain the After the initial registration, an endpoint should retain the
returned location of the Registration Resource for further returned location of the Registration Resource for further
operations, including refreshing the registration in order to extend operations, including refreshing the registration in order to extend
the lifetime and "keep-alive" the registration. When the lifetime of the lifetime and "keep-alive" the registration. When the lifetime of
the registration has expired, the RD SHOULD NOT respond to discovery the registration has expired, the RD SHOULD NOT respond to discovery
queries concerning this endpoint. The RD SHOULD continue to provide queries concerning this endpoint. The RD SHOULD continue to provide
access to the Registration Resource after a registration time-out access to the Registration Resource after a registration time-out
occurs in order to enable the registering endpoint to eventually occurs in order to enable the registering endpoint to eventually
refresh the registration. The RD MAY eventually remove the refresh the registration. The RD MAY eventually remove the
registration resource for the purpose of resource recovery and registration resource for the purpose of garbage collection and
garbage collection. If the Registration Resource is removed, the remove it from any group it belongs to. If the Registration Resource
endpoint will need to re-register. is removed, the endpoint will need to re-register.
The Registration Resource may also be used to inspect the The Registration Resource may also be used to inspect the
registration resource using GET, update the registration link registration resource using GET, update the registration, or cancel
contents, or cancel the registration using DELETE. the registration using DELETE.
These operations are described in this section. These operations are described in this section.
5.4.1. Registration Update 5.4.1. Registration Update
The update interface is used by an endpoint to refresh or update its The update interface is used by an endpoint to refresh or update its
registration with an RD. To use the interface, the endpoint sends a registration with an RD. To use the interface, the endpoint sends a
POST request to the registration resource returned in the Location POST request to the registration resource returned by the initial
header option in the response returned from the initial registration registration operation.
operation.
An update MAY update the lifetime- or the context- registration An update MAY update the lifetime- or the context- registration
parameters "lt", "con" as in Section 5.3. Parameters that are not parameters "lt", "con" as in Section 5.3. Parameters that are not
being changed SHOULD NOT be included in an update. Adding parameters being changed SHOULD NOT be included in an update. Adding parameters
that have not changed increases the size of the message but does not that have not changed increases the size of the message but does not
have any other implications. Parameters MUST be included as query have any other implications. Parameters MUST be included as query
parameters in an update operation as in Section 5.3. parameters in an update operation as in Section 5.3.
A registration update resets the timeout of the registration to the A registration update resets the timeout of the registration to the
(possibly updated) lifetime of the registration, independent of (possibly updated) lifetime of the registration, independent of
whether a "lt" parameter was given. whether a "lt" parameter was given.
If the context of the registration is changed in an update explicitly If the context of the registration is changed in an update explicitly
or implicitly, relative references submitted in the original or implicitly, relative references submitted in the original
registration or later updates are resolved anew against the new registration or later updates are resolved anew against the new
context (like in the original registration). context (like in the original registration).
This operation only describes the use of POST with an empty payload. The registration update operation only describes the use of POST with
As with modification of individual using iPATCH or PATCH as proposed an empty payload. Future standards might describe the semantics of
in Section 5.4.4, future standards might describe the semantics of
using content formats and payloads with the POST method to update the using content formats and payloads with the POST method to update the
links of a registration. links of a registration (see Section 5.4.4).
The update registration request interface is specified as follows: The update registration request interface is specified as follows:
Interaction: EP -> RD Interaction: EP -> RD
Method: POST Method: POST
URI Template: {+location}{?lt,con,extra-attrs*} URI Template: {+location}{?lt,con,extra-attrs*}
URI Template Variables: URI Template Variables:
location := This is the Location returned by the RD as a result location := This is the Location returned by the RD as a result
of a successful earlier registration. of a successful earlier registration.
lt := Lifetime (optional). Lifetime of the registration in lt := Lifetime (optional). Lifetime of the registration in
seconds. Range of 60-4294967295. If no lifetime is included, seconds. Range of 60-4294967295. If no lifetime is included,
the previous last lifetime set on a previous update or the the previous last lifetime set on a previous update or the
original registration (falling back to 86400) SHOULD be used. original registration (falling back to 86400) SHOULD be used.
skipping to change at page 25, line 42 skipping to change at page 28, line 49
request. request.
Failure: 4.04 "Not Found" or 404 "Not Found". Registration does not Failure: 4.04 "Not Found" or 404 "Not Found". Registration does not
exist (e.g. may have expired). exist (e.g. may have expired).
Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable". Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable".
Service could not perform the operation. Service could not perform the operation.
HTTP support: YES HTTP support: YES
If the registration update fails with a "Service Unavailable"
response and a Max-Age option or Retry-After header, the client
SHOULD retry the operation after the time indicated. If the
registration fails in another way, including request timeouts, or if
the time indicated excedes the remaining lifetime, the client SHOULD
attempt registration again.
The following example shows an endpoint updating its registration The following example shows an endpoint updating its registration
resource at an RD using this interface with the example location resource at an RD using this interface with the example location
value: /rd/4521. value: /rd/4521.
Req: POST /rd/4521 Req: POST /rd/4521
Res: 2.04 Changed Res: 2.04 Changed
The following example shows an endpoint updating its registration The following example shows an endpoint updating its registration
resource at an RD using this interface with the example location resource at an RD using this interface with the example location
value: /rd/4521. The initial registration by the client set the value: /rd/4521. The initial registration by the client set the
following values: following values:
o endpoint name (ep)=endpoint1 o endpoint name (ep)=endpoint1
o lifetime (lt)=500 o lifetime (lt)=500
o context (con)=coap://local-proxy-old.example.com:5683 o context (con)=coap://local-proxy-old.example.com:5683
o payload of Figure 7
The initial state of the Resource Directory is reflected in the The initial state of the Resource Directory is reflected in the
following request: following request:
Req: GET /rd-lookup/res?ep=endpoint1 Req: GET /rd-lookup/res?ep=endpoint1
Res: 2.01 Content Res: 2.01 Content
Payload: Payload:
</sensors/temp>;ct=41;rt="temperature";anchor="coap://local-proxy-old.example.com:5683", <coap://local-proxy-old.example.com:5683/sensors/temp>;ct=41;rt="temperature";
</sensors/light>;ct=41;rt="light-lux";if="sensor";anchor="coap://local-proxy-old.example.com:5683" anchor="coap://spurious.example.com:5683",
<coap://local-proxy-old.example.com:5683/sensors/light>;ct=41;rt="light-lux";
if="sensor";anchor="coap://local-proxy-old.example.com:5683"
The following example shows an EP changing the context to The following example shows an EP changing the context to
"coaps://new.example.com:5684": "coaps://new.example.com:5684":
Req: POST /rd/4521?con=coaps://new.example.com:5684 Req: POST /rd/4521?con=coaps://new.example.com:5684
Res: 2.04 Changed Res: 2.04 Changed
The consecutive query returns: The consecutive query returns:
Req: GET /rd-lookup/res?ep=endpoint1 Req: GET /rd-lookup/res?ep=endpoint1
Res: 2.01 Content Res: 2.01 Content
Payload: Payload:
</sensors/temp>;ct=41;rt="temperature";anchor="coaps://new.example.com:5684", <coaps://new.example.com:5684/sensors/temp>;ct=41;rt="temperature";
</sensors/light>;ct=41;rt="light-lux";if="sensor";anchor="coaps://new.example.com:5684", anchor="coap://spurious.example.com:5683",
<coaps://new.example.com:5684/sensors/light>;ct=41;rt="light-lux";if="sensor";
anchor="coaps://new.example.com:5684",
5.4.2. Registration Removal 5.4.2. Registration Removal
Although RD entries have soft state and will eventually timeout after Although RD entries have soft state and will eventually timeout after
their lifetime, an endpoint SHOULD explicitly remove its entry from their lifetime, an endpoint SHOULD explicitly remove its entry from
the RD if it knows it will no longer be available (for example on the RD if it knows it will no longer be available (for example on
shut-down). This is accomplished using a removal interface on the RD shut-down). This is accomplished using a removal interface on the RD
by performing a DELETE on the endpoint resource. by performing a DELETE on the endpoint resource.
Removed endpoints are implicitly removed from the groups to which Removed endpoints are implicitly removed from the groups to which
skipping to change at page 27, line 20 skipping to change at page 30, line 42
URI Template Variables: URI Template Variables:
location := This is the Location returned by the RD as a result location := This is the Location returned by the RD as a result
of a successful earlier registration. of a successful earlier registration.
The following responses codes are defined for this interface: The following responses codes are defined for this interface:
Success: 2.02 "Deleted" or 204 "No Content" upon successful deletion Success: 2.02 "Deleted" or 204 "No Content" upon successful deletion
Failure: 4.00 "Bad Request" or 400 "Bad request". Malformed Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed
request. request.
Failure: 4.04 "Not Found" or 404 "Not Found". Registration does not Failure: 4.04 "Not Found" or 404 "Not Found". Registration does not
exist (e.g. may have expired). exist (e.g. may have expired).
Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable". Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable".
Service could not perform the operation. Service could not perform the operation.
HTTP support: YES HTTP support: YES
The following examples shows successful removal of the endpoint from The following examples shows successful removal of the endpoint from
the RD with example location value /rd/4521. the RD with example location value /rd/4521.
Req: DELETE /rd/4521 Req: DELETE /rd/4521
Res: 2.02 Deleted Res: 2.02 Deleted
5.4.3. Read Endpoint Links 5.4.3. Read Endpoint Links
Some endpoints may wish to manage their links as a collection, and Some endpoints may wish to manage their links as a collection, and
skipping to change at page 28, line 18 skipping to change at page 31, line 41
URI Template Variables: URI Template Variables:
location := This is the Location returned by the RD as a result location := This is the Location returned by the RD as a result
of a successful earlier registration. of a successful earlier registration.
href,rel,rt,if,ct := link relations and attributes specified in href,rel,rt,if,ct := link relations and attributes specified in
the query in order to select particular links based on their the query in order to select particular links based on their
relations and attributes. "href" denotes the URI target of the relations and attributes. "href" denotes the URI target of the
link. See [RFC6690] Sec. 4.1 link. See [RFC6690] Sec. 4.1
The following responses codes are defined for this interface: The following response codes are defined for this interface:
Success: 2.05 "Content" or 200 "OK" upon success with an Success: 2.05 "Content" or 200 "OK" upon success with an
"application/link-format", "application/link-format+cbor", or "application/link-format", "application/link-format+cbor", or
"application/link-format+json" payload. "application/link-format+json" payload.
Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed
request. request.
Failure: 4.04 "Not Found" or 404 "Not Found". Registration does not Failure: 4.04 "Not Found" or 404 "Not Found". Registration does not
exist (e.g. may have expired). exist (e.g. may have expired).
Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable". Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable".
Service could not perform the operation. Service could not perform the operation.
HTTP support: YES HTTP support: YES
The following examples show successful read of the endpoint links The following examples show successful read of the endpoint links
from the RD, with example location value /rd/4521. from the RD, with example location value /rd/4521 and example
registration payload of Figure 7.
Req: GET /rd/4521 Req: GET /rd/4521
Res: 2.01 Content Res: 2.01 Content
Payload: Payload:
</sensors/temp>;ct=41;rt="temperature-c";if="sensor", </sensors/temp>;ct=41;rt="temperature-c";if="sensor";
anchor="coap://spurious.example.com:5683",
</sensors/light>;ct=41;rt="light-lux";if="sensor" </sensors/light>;ct=41;rt="light-lux";if="sensor"
5.4.4. Update Endpoint Links 5.4.4. Update Endpoint Links
An iPATCH (or PATCH) update [RFC8132] adds, removes or changes links An iPATCH (or PATCH) update [RFC8132] adds, removes or changes links
of a registration by including link update information in the payload of a registration by including link update information in the payload
of the update with a media type that still needs to be defined. of the update with a media type that still needs to be defined.
6. RD Groups 6. RD Groups
skipping to change at page 29, line 20 skipping to change at page 32, line 43
However unlike an endpoint entry, a group entry consists of a list of However unlike an endpoint entry, a group entry consists of a list of
endpoints and does not have a lifetime associated with it. In order endpoints and does not have a lifetime associated with it. In order
to make use of multicast requests with CoAP, a group MAY have a to make use of multicast requests with CoAP, a group MAY have a
multicast address associated with it. multicast address associated with it.
6.1. Register a Group 6.1. Register a Group
In order to create a group, a commissioning tool (CT) used to In order to create a group, a commissioning tool (CT) used to
configure groups, makes a request to the RD indicating the name of configure groups, makes a request to the RD indicating the name of
the group to create (or update), optionally the domain the group the group to create (or update), optionally the domain the group
belongs to, and optionally the multicast address of the group. The belongs to, and optionally the multicast address of the group. This
registration message is a list of links to registration resources of specification does not require that the endpoints belong to the same
the endpoints that belong to that group. domain as the group, but a Resource Directory implementation can
impose requirements on the domains of groups and endpoints depending
on its configuration.
The registration message is a list of links to registration resources
of the endpoints that belong to that group. The registration
resources MAY be located on different hosts than the group hosting
RD. In that case the endpoint link points to the registration
resource on the other RD. The commissioning tool SHOULD NOT attempt
to enter a foreign registration in a group unless it found it in the
group RD's lookup results, or has other reasons to assume that the
foreign registration will be accepted.
The commissioning tool SHOULD not send any target attributes with the The commissioning tool SHOULD not send any target attributes with the
links to the registration resources, and the resource directory links to the registration resources, and the resource directory
SHOULD ignore any attributes that are set. SHOULD reject registrations that contain links with unprocessable
attributes.
Configuration of the endpoints themselves is out of scope of this Configuration of the endpoints themselves is out of scope of this
specification. Such an interface for managing the group membership specification. Such an interface for managing the group membership
of an endpoint has been defined in [RFC7390]. of an endpoint has been defined in [RFC7390].
The registration request interface is specified as follows: The registration request interface is specified as follows:
Interaction: CT -> RD Interaction: CT -> RD
Method: POST Method: POST
skipping to change at page 29, line 50 skipping to change at page 33, line 36
URI Template Variables: URI Template Variables:
rd-group := RD Group URI (mandatory). This is the location of rd-group := RD Group URI (mandatory). This is the location of
the RD Group REST API. the RD Group REST API.
gp := Group Name (mandatory). The name of the group to be gp := Group Name (mandatory). The name of the group to be
created or replaced, unique within that domain. The maximum created or replaced, unique within that domain. The maximum
length of this parameter is 63 bytes. length of this parameter is 63 bytes.
d := Domain (optional). The domain to which this group belongs. d := Domain (optional). The domain to which this group belongs.
The maximum length of this parameter is 63 bytes. Optional. The maximum length of this parameter is 63 bytes. When this
When this parameter is elided, the RD MAY associate the parameter is not present, the RD MAY associate the group with a
endpoint with a configured default domain. configured default domain or leave it empty.
con := Context (optional). This parameter sets the scheme, con := Context (optional). This parameter sets the scheme,
address and port of the multicast address associated with the address and port of the multicast address associated with the
group. When con is used, scheme and host are mandatory and group. When con is used, scheme and host are mandatory and
port parameter is optional. port parameter is optional.
Content-Format: application/link-format Content-Format: application/link-format
Content-Format: application/link-format+json Content-Format: application/link-format+json
skipping to change at page 30, line 42 skipping to change at page 34, line 29
HTTP support: YES HTTP support: YES
The following example shows an EP registering a group with the name The following example shows an EP registering a group with the name
"lights" which has two endpoints. The RD group path /rd-group is an "lights" which has two endpoints. The RD group path /rd-group is an
example RD location discovered in a request similar to Figure 6. example RD location discovered in a request similar to Figure 6.
Req: POST coap://rd.example.com/rd-group?gp=lights Req: POST coap://rd.example.com/rd-group?gp=lights
&con=coap://[ff35:30:2001:db8::1] &con=coap://[ff35:30:2001:db8::1]
Content-Format: 40 Content-Format: 40
Payload: Payload:
</rd/4521>, <coap://other-rd/rd/4521>,
</rd/4522> </rd/4522>
Res: 2.01 Created Res: 2.01 Created
Location: /rd-group/12 Location: /rd-group/12
The href value is the path to the registration resource of the A relative href value denotes the path to the registration resource
Endpoint. of the Endpoint. When pointing to a registration resource on a
different RD, the href value is an absolute URI.
6.2. Group Removal 6.2. Group Removal
A group can be removed simply by sending a removal message to the A group can be removed simply by sending a removal message to the
location of the group registration resource which was returned when location of the group registration resource which was returned when
initially registering the group. Removing a group MUST NOT remove initially registering the group. Removing a group MUST NOT remove
the endpoints of the group from the RD. the endpoints of the group from the RD.
The removal request interface is specified as follows: The removal request interface is specified as follows:
skipping to change at page 32, line 33 skipping to change at page 36, line 20
| Group | core.rd-lookup-gp | Optional | | Group | core.rd-lookup-gp | Optional |
+-------------+--------------------+-----------+ +-------------+--------------------+-----------+
Table 1: Lookup Types Table 1: Lookup Types
7.1. Resource lookup 7.1. Resource lookup
Resource lookup results in links that are semantically equivalent to Resource lookup results in links that are semantically equivalent to
the links submitted to the RD if they were accessed on the endpoint the links submitted to the RD if they were accessed on the endpoint
itself. The links and link parameters returned are equal to the itself. The links and link parameters returned are equal to the
submitted ones except for anchor, which was resolved by the server submitted, except that the target and anchor references are fully
against the endpoint's context. resolved.
Links that did not have an anchor attribute are therefore returned Links that did not have an anchor attribute are therefore returned
with the (explicitly or implicitly set) context URI of the with the (explicitly or implicitly set) context URI of the
registration as the anchor. Links whose anchor was submitted as an registration as the anchor. Links whose href or anchor was submitted
absolute URI are returned as they were registered. The hrefs of as an absolute URI are returned with respective attributes
links can always be served as they were submitted; the server MAY unmodified.
return relative references in absolute form in to resource lookups,
but that results in needlessly verbose responses.
Above rules allow the client to interpret the response as links Above rules allow the client to interpret the response as links
without any further knowledge of what the RD does. The Resource without any further knowledge of what the RD does. The Resource
Directory MAY replace the contexts with a configured intermediate Directory MAY replace the contexts with a configured intermediate
proxy, e.g. in the case of an HTTP lookup interface for CoAP proxy, e.g. in the case of an HTTP lookup interface for CoAP
endpoints. endpoints.
7.2. Endpoint and group lookup 7.2. Endpoint and group lookup
Endpoint and group lookups result in links to registration resources Endpoint and group lookups result in links to registration resources
skipping to change at page 33, line 20 skipping to change at page 36, line 50
present), context (con) and lifetime (lt, if present). Additional present), context (con) and lifetime (lt, if present). Additional
endpoint attributes are added as link attributes to their endpoint endpoint attributes are added as link attributes to their endpoint
link unless their specification says otherwise. Group resources are link unless their specification says otherwise. Group resources are
annotated with their group names (gp), domain (d, if present) and annotated with their group names (gp), domain (d, if present) and
multicast address (con, if present). multicast address (con, if present).
While Endpoint Lookup does expose the registration resources, the RD While Endpoint Lookup does expose the registration resources, the RD
does not need to make them accessible to clients. Clients SHOULD NOT does not need to make them accessible to clients. Clients SHOULD NOT
attempt to dereference or manipulate them. attempt to dereference or manipulate them.
A Resource Directory can report endpoints or groups in lookup that
are not hosted at the same address. While the setup and management
of such a distributed system is out of scope for this document,
lookup clients MUST be prepared to see arbitrary URIs as registration
or group resources in the results.
For groups, a Resource Directory as specified here does not provide a
lookup mechanism for the resources that can be accessed on a group's
multicast address (ie. no lookup will return links like
"<coap://[ff35:30:2001:db8::1]/light>;..." for a group registered
with "con=coap://[ff35...]"). Such an additional lookup interface
could be specified in an extension document.
7.3. Lookup filtering 7.3. Lookup filtering
Using the Accept Option, the requester can control whether this list Using the Accept Option, the requester can control whether the
is returned in CoRE Link Format ("application/link-format", default) returned list is returned in CoRE Link Format ("application/link-
or its alternate content-formats ("application/link-format+json" or format", default) or its alternate content-formats ("application/
"application/link-format+cbor"). link-format+json" or "application/link-format+cbor").
The page and count parameters are used to obtain lookup results in The page and count parameters are used to obtain lookup results in
specified increments using pagination, where count specifies how many specified increments using pagination, where count specifies how many
links to return and page specifies which subset of links organized in links to return and page specifies which subset of links organized in
sequential pages, each containing 'count' links, starting with link sequential pages, each containing 'count' links, starting with link
zero and page zero. Thus, specifying count of 10 and page of 0 will zero and page zero. Thus, specifying count of 10 and page of 0 will
return the first 10 links in the result set (links 0-9). Count = 10 return the first 10 links in the result set (links 0-9). Count = 10
and page = 1 will return the next 'page' containing links 10-19, and and page = 1 will return the next 'page' containing links 10-19, and
so on. so on.
Multiple search criteria MAY be included in a lookup. All included Multiple search criteria MAY be included in a lookup. All included
criteria MUST match for a link to be returned. criteria MUST match for a link to be returned. The Resource
Directory MUST support matching with multiple search criteria.
A link matches a search criterion if it has an attribute of the same A link matches a search criterion if it has an attribute of the same
name and the same value, allowing for a trailing "*" wildcard name and the same value, allowing for a trailing "*" wildcard
operator as in Section 4.1 of [RFC6690]. Attributes that are defined operator as in Section 4.1 of [RFC6690]. Attributes that are defined
as "link-type" match if the search value matches any of their values as "link-type" match if the search value matches any of their values
(see Section 4.1 of [RFC6690]; eg. "?if=core.s" matches ";if="abc (see Section 4.1 of [RFC6690]; eg. "?if=core.s" matches ";if="abc
core.s";"). A link also matches a search criterion if the link that core.s";"). A link also matches a search criterion if the link that
would be produced for any of its containing entities would match the would be produced for any of its containing entities would match the
criterion: A search criterion matches an endpoint if it matches the criterion, or an entity contained in it would: A search criterion
endpoint itself or any of the groups it is contained in, and one on a matches an endpoint if it matches the endpoint itself, any of the
resource if it matches the resource, the resource's endpoint, or any groups it is contained in or any resource it contains. A search
of the endpoint's groups. criterion matches a resource if it matches the resource itself, the
resource's endpoint, or any of the endpoint's groups.
Note that "href" is also a valid search criterion and matches target Note that "href" is also a valid search criterion and matches target
references. Like all search criteria, on a resource lookup it can references. Like all search criteria, on a resource lookup it can
match the target reference of the resource link itself, but also the match the target reference of the resource link itself, but also the
registration resource of the endpoint that registered it, or any registration resource of the endpoint that registered it, or any
group resource that endpoint is contained in. group resource that endpoint is contained in.
Clients that are interested in a lookup result repeatedly or Clients that are interested in a lookup result repeatedly or
continuously can use mechanisms like ETag caching, resource continuously can use mechanisms like ETag caching, resource
observation ([RFC7641]), or any future mechanism that might allow observation ([RFC7641]), or any future mechanism that might allow
more efficient observations of collections. These are advertised, more efficient observations of collections. These are advertised,
detected and used according to their own specifications and can be detected and used according to their own specifications and can be
used with the lookup interface as with any other resource. used with the lookup interface as with any other resource.
When resource observation is used, every time the set of matching
links changes, or the content of a matching link changes, the RD
sends a notification with the matching link set. The notification
contains the successful current response to the given request,
especially with respect to representing zero matching links (see
"Success" item below).
The lookup interface is specified as follows: The lookup interface is specified as follows:
Interaction: Client -> RD Interaction: Client -> RD
Method: GET Method: GET
URI Template: {+type-lookup-location}{?page,count,search*} URI Template: {+type-lookup-location}{?page,count,search*}
URI Template Variables: URI Template Variables:
skipping to change at page 35, line 24 skipping to change at page 39, line 27
Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed Failure: 4.00 "Bad Request" or 400 "Bad Request". Malformed
request. request.
Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable". Failure: 5.03 "Service Unavailable" or 503 "Service Unavailable".
Service could not perform the operation. Service could not perform the operation.
HTTP support: YES HTTP support: YES
7.4. Lookup examples 7.4. Lookup examples
The examples in this section assume CoAP hosts with a default CoAP The examples in this section assume the existence of CoAP hosts with
port 61616. HTTP hosts are possible and do not change the nature of a default CoAP port 61616. HTTP hosts are possible and do not change
the examples. the nature of the examples.
The following example shows a client performing a resource lookup The following example shows a client performing a resource lookup
with the example resource look-up locations discovered in Figure 6: with the example resource look-up locations discovered in Figure 6:
Req: GET /rd-lookup/res?rt=temperature Req: GET /rd-lookup/res?rt=temperature
Res: 2.05 Content Res: 2.05 Content
</temp>;rt="temperature";anchor="coap://[2001:db8:3::123]:61616" <coap://[2001:db8:3::123]:61616/temp>;rt="temperature";anchor="coap://[2001:db8:3::123]:61616"
The same lookup using the CBOR Link Format media type: The same lookup using the CBOR Link Format media type:
Req: GET /rd-lookup/res?rt=temperature Req: GET /rd-lookup/res?rt=temperature
Accept: TBD64 Accept: TBD64
Res: 2.05 Content Res: 2.05 Content
Content-Format: TBD64 Content-Format: TBD64
Payload in Hex notation: Payload in Hex notation:
81A301652F74656D70096B74656D706572617475726503781E636F61703A2F2F5B323030 81A3017823636F61703A2F2F5B323030313A6462383A333A3A3132335D3A36313631362F
313A6462383A333A3A3132335D3A3631363136 74656D7003781E636F61703A2F2F5B323030313A6462383A333A3A3132335D3A36313631
36096B74656D7065726174757265
Decoded payload: Decoded payload:
[{1: "/temp", 9: "temperature", 3: "coap://[2001:db8:3::123]:61616"}] [{1: "coap://[2001:db8:3::123]:61616/temp", 9: "temperature",
3: "coap://[2001:db8:3::123]:61616"}]
A client that wants to be notified of new resources as they show up A client that wants to be notified of new resources as they show up
can use observation: can use observation:
Req: GET /rd-lookup/res?rt=light Req: GET /rd-lookup/res?rt=light
Observe: 0 Observe: 0
Res: 2.05 Content Res: 2.05 Content
Observe: 23 Observe: 23
Payload: empty Payload: empty
(at a later point in time) (at a later point in time)
Res: 2.05 Content Res: 2.05 Content
Observe: 24 Observe: 24
Payload: Payload:
</west>;rt="light";anchor="coap://[2001:db8:3::124]", <coap://[2001:db8:3::124]/west>;rt="light";
</south>;rt="light";anchor="coap://[2001:db8:3::124]", anchor="coap://[2001:db8:3::124]",
</east>;rt="light";anchor="coap://[2001:db8:3::124]" <coap://[2001:db8:3::124]/south>;rt="light";
anchor="coap://[2001:db8:3::124]",
<coap://[2001:db8:3::124]/east>;rt="light";
anchor="coap://[2001:db8:3::124]"
The following example shows a client performing an endpoint type The following example shows a client performing an endpoint type (et)
lookup: lookup with the value oic.d.sensor (which is currently a registered
rt value):
Req: GET /rd-lookup/ep?et=power-node Req: GET /rd-lookup/ep?et=oic.d.sensor
Res: 2.05 Content Res: 2.05 Content
</rd/1234>;con="coap://[2001:db8:3::127]:61616";ep="node5"; </rd/1234>;con="coap://[2001:db8:3::127]:61616";ep="node5";
et="power-node";ct="40";lt="600", et="oic.d.sensor";ct="40";lt="600",
</rd/4521>;con="coap://[2001:db8:3::129]:61616";ep="node7"; </rd/4521>;con="coap://[2001:db8:3::129]:61616";ep="node7";
et="power-node";ct="40";lt="600";d="floor-3" et="oic.d.sensor";ct="40";lt="600";d="floor-3"
The following example shows a client performing a group lookup for The following example shows a client performing a group lookup for
all groups: all groups:
Req: GET /rd-lookup/gp Req: GET /rd-lookup/gp
Res: 2.05 Content Res: 2.05 Content
</rd-group/1>;gp="lights1";d="example.com";con="coap://[ff35:30:2001:db8::1]", </rd-group/1>;gp="lights1";d="example.com";con="coap://[ff35:30:2001:db8::1]",
</rd-group/2>;gp="lights2";d="example.com";con="coap://[ff35:30:2001:db8::2]" </rd-group/2>;gp="lights2";d="example.com";con="coap://[ff35:30:2001:db8::2]"
The following example shows a client performing a lookup for all The following example shows a client performing a lookup for all
endpoints in a particular group: endpoints in a particular group, with one endpoint hosted by another
RD:
Req: GET /rd-lookup/ep?gp=lights1 Req: GET /rd-lookup/ep?gp=lights1
Res: 2.05 Content Res: 2.05 Content
</rd/abcd>;con="coap://[2001:db8:3::123]:61616";ep="node1";et="power-node";ct="40";lt="600", <coap://[other-rd]/rd/abcd>;con="coap://[2001:db8:3::123]:61616";
</rd/efgh>;con="coap://[2001:db8:3::124]:61616";ep="node2";et="power-node";ct="40";lt="600" anchor="coap://[other-rd]";ep="node1";et="oic.d.sensor";ct="40";lt="600",
</rd/efgh>;con="coap://[2001:db8:3::124]:61616";
ep="node2";et="oic.d.sensor";ct="40";lt="600"
The following example shows a client performing a lookup for all The following example shows a client performing a lookup for all
groups the endpoint "node1" belongs to: groups the endpoint "node1" belongs to:
Req: GET /rd-lookup/gp?ep=node1 Req: GET /rd-lookup/gp?ep=node1
Res: 2.05 Content Res: 2.05 Content
</rd-group/1>;gp="lights1" </rd-group/1>;gp="lights1"
The following example shows a client performing a paginated resource The following example shows a client performing a paginated resource
skipping to change at page 37, line 12 skipping to change at page 42, line 4
The following example shows a client performing a lookup for all The following example shows a client performing a lookup for all
groups the endpoint "node1" belongs to: groups the endpoint "node1" belongs to:
Req: GET /rd-lookup/gp?ep=node1 Req: GET /rd-lookup/gp?ep=node1
Res: 2.05 Content Res: 2.05 Content
</rd-group/1>;gp="lights1" </rd-group/1>;gp="lights1"
The following example shows a client performing a paginated resource The following example shows a client performing a paginated resource
lookup lookup
Req: GET /rd-lookup/res?page=0&count=5 Req: GET /rd-lookup/res?page=0&count=5
Res: 2.05 Content Res: 2.05 Content
</res/0>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", <coap://[2001:db8:3::123]:61616/res/0>;rt=sensor;ct=60;
</res/1>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", anchor="coap://[2001:db8:3::123]:61616",
</res/2>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", <coap://[2001:db8:3::123]:61616/res/1>;rt=sensor;ct=60;
</res/3>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", anchor="coap://[2001:db8:3::123]:61616",
</res/4>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616" <coap://[2001:db8:3::123]:61616/res/2>;rt=sensor;ct=60;
anchor="coap://[2001:db8:3::123]:61616",
<coap://[2001:db8:3::123]:61616/res/3>;rt=sensor;ct=60;
anchor="coap://[2001:db8:3::123]:61616",
<coap://[2001:db8:3::123]:61616/res/4>;rt=sensor;ct=60;
anchor="coap://[2001:db8:3::123]:61616"
Req: GET /rd-lookup/res?page=1&count=5 Req: GET /rd-lookup/res?page=1&count=5
Res: 2.05 Content Res: 2.05 Content
</res/5>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", <coap://[2001:db8:3::123]:61616/res/5>;rt=sensor;ct=60;
</res/6>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", anchor="coap://[2001:db8:3::123]:61616",
</res/7>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", <coap://[2001:db8:3::123]:61616/res/6>;rt=sensor;ct=60;
</res/8>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616", anchor="coap://[2001:db8:3::123]:61616",
</res/9>;rt=sensor;ct=60;anchor="coap://[2001:db8:3::123]:61616" <coap://[2001:db8:3::123]:61616/res/7>;rt=sensor;ct=60;
anchor="coap://[2001:db8:3::123]:61616",
<coap://[2001:db8:3::123]:61616/res/8>;rt=sensor;ct=60;
anchor="coap://[2001:db8:3::123]:61616",
<coap://[2001:db8:3::123]:61616/res/9>;rt=sensor;ct=60;
anchor="coap://[2001:db8:3::123]:61616"
The following example shows a client performing a lookup of all The following example shows a client performing a lookup of all
resources from endpoints of a given endpoint type. It assumes that resources from endpoints of all endpoints of a given endpoint type.
two endpoints (with endpoint names "sensor1" and "sensor2") have It assumes that two endpoints (with endpoint names "sensor1" and
previously registered with their respective addresses "sensor2") have previously registered with their respective addresses
"coap://sensor1.example.com" and "coap://sensor2.example.com", and "coap://sensor1.example.com" and "coap://sensor2.example.com", and
posted the very payload of the 6th request of section 5 of [RFC6690]. posted the very payload of the 6th request of section 5 of [RFC6690].
It demonstrates how the link targets stay unmodified, but the anchors It demonstrates how absolute link targets stay unmodified, while
get constructed by the resource directory: relative ones are resolved:
Req: GET /rd-lookup/res?et=sensor-node Req: GET /rd-lookup/res?et=oic.d.sensor
</sensors>;ct=40;title="Sensor Index"; <coap://sensor1.example.com/sensors>;ct=40;title="Sensor Index";
anchor="coap://sensor1.example.com", anchor="coap://sensor1.example.com",
</sensors/temp>;rt="temperature-c";if="sensor"; <coap://sensor1.example.com/sensors/temp>;rt="temperature-c";if="sensor";
anchor="coap://sensor1.example.com", anchor="coap://sensor1.example.com",
</sensors/light>;rt="light-lux";if="sensor"; <coap://sensor1.example.com/sensors/light>;rt="light-lux";if="sensor";
anchor="coap://sensor1.example.com", anchor="coap://sensor1.example.com",
<http://www.example.com/sensors/t123>;rel="describedby"; <http://www.example.com/sensors/t123>;rel="describedby";
anchor="coap://sensor1.example.com/sensors/temp", anchor="coap://sensor1.example.com/sensors/temp",
</t>;rel="alternate";anchor="coap://sensor1.example.com/sensors/temp", <coap://sensor1.example.com/t>;rel="alternate";
</sensors>;ct=40;title="Sensor Index"; anchor="coap://sensor1.example.com/sensors/temp",
anchor="coap://sensor2.example.com", <coap://sensor2.example.com/sensors>;ct=40;title="Sensor Index";
</sensors/temp>;rt="temperature-c";if="sensor"; anchor="coap://sensor2.example.com",
anchor="coap://sensor2.example.com", <coap://sensor2.example.com/sensors/temp>;rt="temperature-c";if="sensor";
</sensors/light>;rt="light-lux";if="sensor"; anchor="coap://sensor2.example.com",
anchor="coap://sensor2.example.com", <coap://sensor2.example.com/sensors/light>;rt="light-lux";if="sensor";
<http://www.example.com/sensors/t123>;rel="describedby"; anchor="coap://sensor2.example.com",
;anchor="coap://sensor2.example.com/sensors/temp", <http://www.example.com/sensors/t123>;rel="describedby";
</t>;rel="alternate";anchor="coap://sensor2.example.com/sensors/temp" anchor="coap://sensor2.example.com/sensors/temp",
<coap://sensor2.example.com/t>;rel="alternate";
anchor="coap://sensor2.example.com/sensors/temp"
8. Security Considerations 8. Security Considerations
The security considerations as described in Section 7 of [RFC5988] The security considerations as described in Section 7 of [RFC5988]
and Section 6 of [RFC6690] apply. The "/.well-known/core" resource and Section 6 of [RFC6690] apply. The "/.well-known/core" resource
may be protected e.g. using DTLS when hosted on a CoAP server as may be protected e.g. using DTLS when hosted on a CoAP server as
described in [RFC7252]. DTLS or TLS based security SHOULD be used on described in [RFC7252]. DTLS or TLS based security SHOULD be used on
all resource directory interfaces defined in this document. all resource directory interfaces defined in this document.
8.1. Endpoint Identification and Authentication 8.1. Endpoint Identification and Authentication
skipping to change at page 38, line 52 skipping to change at page 44, line 6
Every operation performed by an Endpoint or Client on a resource Every operation performed by an Endpoint or Client on a resource
directory SHOULD be mutually authenticated using Pre-Shared Key, Raw directory SHOULD be mutually authenticated using Pre-Shared Key, Raw
Public Key or Certificate based security. Public Key or Certificate based security.
Consider te following threat: two devices A and B are managed by a Consider te following threat: two devices A and B are managed by a
single server. Both devices have unique, per-device credentials for single server. Both devices have unique, per-device credentials for
use with DTLS to make sure that only parties with authorization to use with DTLS to make sure that only parties with authorization to
access A or B can do so. access A or B can do so.
Now, imagine that a malicious device A wants to sabotage the device Now, imagine that a malicious device A wants to sabotage the device
B. It uses its credentials during the TLS exchange. Then, it puts B. It uses its credentials during the DTLS exchange. Then, it puts
the endpoint name of device B. If the server does not check whether the endpoint name of device B. If the server does not check whether
the identifier provided in the DTLS handshake matches the identifier the identifier provided in the DTLS handshake matches the identifier
used at the CoAP layer then it may be inclined to use the endpoint used at the CoAP layer then it may be inclined to use the endpoint
name for looking up what information to provision to the malicious name for looking up what information to provision to the malicious
device. device.
Therfore, Endpoints MUST include the Endpoint identifier in the Therfore, Endpoints MUST include the Endpoint identifier in the
message, and this identifier MUST be checked by a resource directory message, and this identifier MUST be checked by a resource directory
to match the Endpoint identifier included in the Registration to match the Endpoint identifier included in the Registration
message. message.
skipping to change at page 40, line 25 skipping to change at page 45, line 28
o Resource Directory address Option (38) o Resource Directory address Option (38)
9.3. RD Parameter Registry 9.3. RD Parameter Registry
This specification defines a new sub-registry for registration and This specification defines a new sub-registry for registration and
lookup parameters called "RD Parameters" under "CoRE Parameters". lookup parameters called "RD Parameters" under "CoRE Parameters".
Although this specification defines a basic set of parameters, it is Although this specification defines a basic set of parameters, it is
expected that other standards that make use of this interface will expected that other standards that make use of this interface will
define new ones. define new ones.
Each entry in the registry must include * the human readable name of Each entry in the registry must include
the parameter, * the short name as used in query parameters or link
attributes, * indication of whether it can be passed as a query o the human readable name of the parameter,
parameter at registration of endpoints or groups, as a query
parameter in lookups, or be expressed as a link attribute, * validity o the short name as used in query parameters or link attributes,
requirements if any, and * a description.
o indication of whether it can be passed as a query parameter at
registration of endpoints or groups, as a query parameter in
lookups, or be expressed as a link attribute,
o validity requirements if any, and
o a description.
The query parameter MUST be both a valid URI query key [RFC3986] and The query parameter MUST be both a valid URI query key [RFC3986] and
a parmname as used in [RFC5988]. a parmname as used in [RFC5988].
The description must give details on which registrations they apply The description must give details on which registrations they apply
to (Endpoint, group registrations or both? Can they be updated?), to (Endpoint, group registrations or both? Can they be updated?),
and how they are to be processed in lookups. and how they are to be processed in lookups.
The mechanisms around new RD parameters should be designed in such a The mechanisms around new RD parameters should be designed in such a
way that they tolerate RD implementations that are unaware of the way that they tolerate RD implementations that are unaware of the
skipping to change at page 42, line 48 skipping to change at page 48, line 5
Section 9.3.1. Section 9.3.1.
o The registered values MUST conform to the ABNF reg-rel-type o The registered values MUST conform to the ABNF reg-rel-type
definition of [RFC6690] and MUST NOT be a URI. definition of [RFC6690] and MUST NOT be a URI.
o It is recommended to use the period "." character for o It is recommended to use the period "." character for
segmentation. segmentation.
The registry is initially empty. The registry is initially empty.
9.5. Multicast Address Registration
IANA has assigned the following multicast addresses for use by CoAP
nodes:
IPv4 - "all CoRE resource directories" address, from the "IPv4
Multicast Address Space Registry" equal to "All CoAP Nodes",
224.0.1.187. As the address is used for discovery that may span
beyond a single network, it has come from the Internetwork Control
Block (224.0.1.x, RFC 5771).
IPv6 - "all CoRE resource directories" address MCD1 (uggestions
FF0X::FE), from the "IPv6 Multicast Address Space Registry", in the
"Variable Scope Multicast Addresses" space (RFC 3307). Note that
there is a distinct multicast address for each scope that interested
CoAP nodes should listen to; CoAP needs the Link-Local and Site-Local
scopes only.
10. Examples 10. Examples
Two examples are presented: a Lighting Installation example in Two examples are presented: a Lighting Installation example in
Section 10.1 and a LWM2M example in Section 10.2. Section 10.1 and a LWM2M example in Section 10.2.
10.1. Lighting Installation 10.1. Lighting Installation
This example shows a simplified lighting installation which makes use This example shows a simplified lighting installation which makes use
of the Resource Directory (RD) with a CoAP interface to facilitate of the Resource Directory (RD) with a CoAP interface to facilitate
the installation and start up of the application code in the lights the installation and start up of the application code in the lights
skipping to change at page 45, line 5 skipping to change at page 50, line 26
| luminary1 | lm_R2-4-015_wndw | /light/right | light | | luminary1 | lm_R2-4-015_wndw | /light/right | light |
| luminary2 | lm_R2-4-015_door | /light/left | light | | luminary2 | lm_R2-4-015_door | /light/left | light |
| luminary2 | lm_R2-4-015_door | /light/middle | light | | luminary2 | lm_R2-4-015_door | /light/middle | light |
| luminary2 | lm_R2-4-015_door | /light/right | light | | luminary2 | lm_R2-4-015_door | /light/right | light |
| Presence | ps_R2-4-015_door | /ps | p-sensor | | Presence | ps_R2-4-015_door | /ps | p-sensor |
| sensor | | | | | sensor | | | |
+----------------+------------------+---------------+---------------+ +----------------+------------------+---------------+---------------+
Table 4: Resource Directory identifiers Table 4: Resource Directory identifiers
It is assumed that the CT knows of the RD's address, and has It is assumed that the CT knows the RD's address, and has performed
performed URI discovery on it that gave a response like the one in URI discovery on it that returned a response like the one in the
the Section 5.2 example. Section 5.2 example.
The CT inserts the endpoints of the luminaries and the sensor in the The CT inserts the endpoints of the luminaries and the sensor in the
RD using the Context parameter (con) to specify the interface RD using the Context parameter (con) to specify the interface
address: address:
Req: POST coap://[2001:db8:4::ff]/rd Req: POST coap://[2001:db8:4::ff]/rd
?ep=lm_R2-4-015_wndw&con=coap://[2001:db8:4::1]&d=R2-4-015 ?ep=lm_R2-4-015_wndw&con=coap://[2001:db8:4::1]&d=R2-4-015
Payload: Payload:
</light/left>;rt="light", </light/left>;rt="light",
</light/middle>;rt="light", </light/middle>;rt="light",
skipping to change at page 46, line 24 skipping to change at page 52, line 6
After the filling of the RD by the CT, the application in the After the filling of the RD by the CT, the application in the
luminaries can learn to which groups they belong, and enable their luminaries can learn to which groups they belong, and enable their
interface for the multicast address. interface for the multicast address.
The luminary, knowing its domain, queries the RD for the endpoint The luminary, knowing its domain, queries the RD for the endpoint
with rt=light and d=R2-4-015. The RD returns all endpoints in the with rt=light and d=R2-4-015. The RD returns all endpoints in the
domain. domain.
Req: GET coap://[2001:db8:4::ff]/rd-lookup/ep Req: GET coap://[2001:db8:4::ff]/rd-lookup/ep
?d=R2-4-015;rt=light ?d=R2-4-015&;rt=light
Res: 2.05 Content Res: 2.05 Content
</rd/4521>;con="coap://[2001:db8:4::1]", </rd/4521>;con="coap://[2001:db8:4::1]";
ep="lm_R2-4-015_wndw", ep="lm_R2-4-015_wndw",
</rd/4522>;con="coap://[2001:db8:4::2]", </rd/4522>;con="coap://[2001:db8:4::2]";
ep="lm_R2-4-015_door" ep="lm_R2-4-015_door"
Knowing its own IPv6 address, the luminary discovers its endpoint Knowing its own IPv6 address, the luminary discovers its endpoint
name. With the endpoint name the luminary queries the RD for all name. With the endpoint name the luminary queries the RD for all
groups to which the endpoint belongs. groups to which the endpoint belongs.
Req: GET coap://[2001:db8:4::ff]/rd-lookup/gp Req: GET coap://[2001:db8:4::ff]/rd-lookup/gp
?ep=lm_R2-4-015_wndw ?ep=lm_R2-4-015_wndw
Res: 2.05 Content Res: 2.05 Content
</rd-group/501>;gp="grp_R2-4-015";con="coap://[ff05::1]" </rd-group/501>;gp="grp_R2-4-015";con="coap://[ff05::1]"
From the context parameter value, the luminary learns the multicast From the context parameter value, the luminary learns the multicast
address of the multicast group. address of the multicast group.
Alternatively, the CT can communicate the multicast address directly Alternatively, the CT can communicate the multicast address directly
to the luminaries by using the "coap-group" resource specified in to the luminaries by using the "coap-group" resource specified in
[RFC7390]. [RFC7390].
Req: POST //[2001:db8:4::1]/coap-group Req: POST coap://[2001:db8:4::1]/coap-group
Content-Format: application/coap-group+json Content-Format: application/coap-group+json
{ "a": "[ff05::1]", Payload:
"n": "grp_R2-4-015"} { "a": "[ff05::1]", "n": "grp_R2-4-015"}
Res: 2.01 Created Res: 2.01 Created
Location-Path: /coap-group/1 Location-Path: /coap-group/1
Dependent on the situation, only the address, "a", or the name, "n", Dependent on the situation, only the address, "a", or the name, "n",
is specified in the coap-group resource. is specified in the coap-group resource.
10.2. OMA Lightweight M2M (LWM2M) Example 10.2. OMA Lightweight M2M (LWM2M) Example
This example shows how the OMA LWM2M specification makes use of This example shows how the OMA LWM2M specification makes use of
skipping to change at page 51, line 26 skipping to change at page 56, line 45
Oscar Novo, Srdjan Krco, Szymon Sasin, Kerry Lynn, Esko Dijk, Anders Oscar Novo, Srdjan Krco, Szymon Sasin, Kerry Lynn, Esko Dijk, Anders
Brandt, Matthieu Vial, Jim Schaad, Mohit Sethi, Hauke Petersen, Brandt, Matthieu Vial, Jim Schaad, Mohit Sethi, Hauke Petersen,
Hannes Tschofenig, Sampo Ukkola, Linyi Tian, and Jan Newmarch have Hannes Tschofenig, Sampo Ukkola, Linyi Tian, and Jan Newmarch have
provided helpful comments, discussions and ideas to improve and shape provided helpful comments, discussions and ideas to improve and shape
this document. Zach would also like to thank his colleagues from the this document. Zach would also like to thank his colleagues from the
EU FP7 SENSEI project, where many of the resource directory concepts EU FP7 SENSEI project, where many of the resource directory concepts
were originally developed. were originally developed.
12. Changelog 12. Changelog
changes from -12 to -13
o Added "all resource directory" nodes MC address
o Clarified observation behavior
o version identification
o example rt= and et= values
o domain from figure 2
o more explanatory text
o endpoints of a groups hosted by different RD
o resolve RFC6690-vs-8288 resolution ambiguities:
* require registered links not to be relative when using anchor
* return absolute URIs in resource lookup
changes from -11 to -12 changes from -11 to -12
o added Content Model section, including ER diagram o added Content Model section, including ER diagram
o removed domain lookup interface; domains are now plain attributes o removed domain lookup interface; domains are now plain attributes
of groups and endpoints of groups and endpoints
o updated chapter "Finding a Resource Directory"; now distinguishes o updated chapter "Finding a Resource Directory"; now distinguishes
configuration-provided, network-provided and heuristic sources configuration-provided, network-provided and heuristic sources
skipping to change at page 52, line 12 skipping to change at page 58, line 4
o lookup interface: search parameters work the same across all o lookup interface: search parameters work the same across all
entities entities
o removed all methods that modify links in an existing registration o removed all methods that modify links in an existing registration
(POST with payload, PATCH and iPATCH) (POST with payload, PATCH and iPATCH)
o removed plurality definition (was only needed for link o removed plurality definition (was only needed for link
modification) modification)
o enhanced IANA registry text o enhanced IANA registry text
o state that lookup resources can be observable
o More examples and improved text o More examples and improved text
changes from -09 to -10 changes from -09 to -10
o removed "ins" and "exp" link-format extensions. o removed "ins" and "exp" link-format extensions.
o removed all text concerning DNS-SD. o removed all text concerning DNS-SD.
o removed inconsistency in RDAO text. o removed inconsistency in RDAO text.
skipping to change at page 56, line 15 skipping to change at page 62, line 12
o Changed the lookup interface to accept endpoint and Domain as o Changed the lookup interface to accept endpoint and Domain as
query string parameters to control the scope of a lookup. query string parameters to control the scope of a lookup.
13. References 13. References
13.1. Normative References 13.1. Normative References
[I-D.ietf-core-links-json] [I-D.ietf-core-links-json]
Li, K., Rahman, A., and C. Bormann, "Representing Li, K., Rahman, A., and C. Bormann, "Representing
Constrained RESTful Environments (CoRE) Link Format in Constrained RESTful Environments (CoRE) Link Format in
JSON and CBOR", draft-ietf-core-links-json-09 (work in JSON and CBOR", draft-ietf-core-links-json-10 (work in
progress), July 2017. progress), February 2018.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, <https://www.rfc- DOI 10.17487/RFC2119, March 1997,
editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, Resource Identifier (URI): Generic Syntax", STD 66,
RFC 3986, DOI 10.17487/RFC3986, January 2005, RFC 3986, DOI 10.17487/RFC3986, January 2005,
<https://www.rfc-editor.org/info/rfc3986>. <https://www.rfc-editor.org/info/rfc3986>.
[RFC5988] Nottingham, M., "Web Linking", RFC 5988, [RFC5988] Nottingham, M., "Web Linking", RFC 5988,
DOI 10.17487/RFC5988, October 2010, <https://www.rfc- DOI 10.17487/RFC5988, October 2010,
editor.org/info/rfc5988>. <https://www.rfc-editor.org/info/rfc5988>.
[RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M., [RFC6570] Gregorio, J., Fielding, R., Hadley, M., Nottingham, M.,
and D. Orchard, "URI Template", RFC 6570, and D. Orchard, "URI Template", RFC 6570,
DOI 10.17487/RFC6570, March 2012, <https://www.rfc- DOI 10.17487/RFC6570, March 2012,
editor.org/info/rfc6570>. <https://www.rfc-editor.org/info/rfc6570>.
[RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link
Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, Format", RFC 6690, DOI 10.17487/RFC6690, August 2012,
<https://www.rfc-editor.org/info/rfc6690>. <https://www.rfc-editor.org/info/rfc6690>.
[RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service [RFC6763] Cheshire, S. and M. Krochmal, "DNS-Based Service
Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013, Discovery", RFC 6763, DOI 10.17487/RFC6763, February 2013,
<https://www.rfc-editor.org/info/rfc6763>. <https://www.rfc-editor.org/info/rfc6763>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
skipping to change at page 57, line 19 skipping to change at page 63, line 14
13.2. Informative References 13.2. Informative References
[ER] Chen, P., "The entity-relationship model---toward a [ER] Chen, P., "The entity-relationship model---toward a
unified view of data", ACM Transactions on Database unified view of data", ACM Transactions on Database
Systems Vol. 1, pp. 9-36, DOI 10.1145/320434.320440, March Systems Vol. 1, pp. 9-36, DOI 10.1145/320434.320440, March
1976. 1976.
[I-D.arkko-core-dev-urn] [I-D.arkko-core-dev-urn]
Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource Arkko, J., Jennings, C., and Z. Shelby, "Uniform Resource
Names for Device Identifiers", draft-arkko-core-dev-urn-04 Names for Device Identifiers", draft-arkko-core-dev-urn-05
(work in progress), July 2017. (work in progress), October 2017.
[I-D.nottingham-rfc5988bis] [I-D.bormann-t2trg-rel-impl]
Nottingham, M., "Web Linking", draft-nottingham- Bormann, C., "impl-info: A link relation type for
rfc5988bis-08 (work in progress), August 2017. disclosing implementation information", draft-bormann-
t2trg-rel-impl-00 (work in progress), January 2018.
[I-D.silverajan-core-coap-protocol-negotiation] [I-D.silverajan-core-coap-protocol-negotiation]
Silverajan, B. and M. Ocak, "CoAP Protocol Negotiation", Silverajan, B. and M. Ocak, "CoAP Protocol Negotiation",
draft-silverajan-core-coap-protocol-negotiation-07 (work draft-silverajan-core-coap-protocol-negotiation-07 (work
in progress), October 2017. in progress), October 2017.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, Transfer Protocol -- HTTP/1.1", RFC 2616,
DOI 10.17487/RFC2616, June 1999, <https://www.rfc- DOI 10.17487/RFC2616, June 1999,
editor.org/info/rfc2616>. <https://www.rfc-editor.org/info/rfc2616>.
[RFC6775] Shelby, Z., Ed., Chakrabarti, S., Nordmark, E., and C. [RFC6775] Shelby, Z., Ed., Chakrabarti, S., Nordmark, E., and C.
Bormann, "Neighbor Discovery Optimization for IPv6 over Bormann, "Neighbor Discovery Optimization for IPv6 over
Low-Power Wireless Personal Area Networks (6LoWPANs)", Low-Power Wireless Personal Area Networks (6LoWPANs)",
RFC 6775, DOI 10.17487/RFC6775, November 2012, RFC 6775, DOI 10.17487/RFC6775, November 2012,
<https://www.rfc-editor.org/info/rfc6775>. <https://www.rfc-editor.org/info/rfc6775>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
<https://www.rfc-editor.org/info/rfc7230>. <https://www.rfc-editor.org/info/rfc7230>.
[RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained
Application Protocol (CoAP)", RFC 7252, Application Protocol (CoAP)", RFC 7252,
DOI 10.17487/RFC7252, June 2014, <https://www.rfc- DOI 10.17487/RFC7252, June 2014,
editor.org/info/rfc7252>. <https://www.rfc-editor.org/info/rfc7252>.
[RFC7390] Rahman, A., Ed. and E. Dijk, Ed., "Group Communication for [RFC7390] Rahman, A., Ed. and E. Dijk, Ed., "Group Communication for
the Constrained Application Protocol (CoAP)", RFC 7390, the Constrained Application Protocol (CoAP)", RFC 7390,
DOI 10.17487/RFC7390, October 2014, <https://www.rfc- DOI 10.17487/RFC7390, October 2014,
editor.org/info/rfc7390>. <https://www.rfc-editor.org/info/rfc7390>.
[RFC7641] Hartke, K., "Observing Resources in the Constrained [RFC7641] Hartke, K., "Observing Resources in the Constrained
Application Protocol (CoAP)", RFC 7641, Application Protocol (CoAP)", RFC 7641,
DOI 10.17487/RFC7641, September 2015, <https://www.rfc- DOI 10.17487/RFC7641, September 2015,
editor.org/info/rfc7641>. <https://www.rfc-editor.org/info/rfc7641>.
[RFC8288] Nottingham, M., "Web Linking", RFC 8288,
DOI 10.17487/RFC8288, October 2017,
<https://www.rfc-editor.org/info/rfc8288>.
Appendix A. Web links and the Resource Directory Appendix A. Web links and the Resource Directory
Understanding the semantics of a link-format document and its URI Understanding the semantics of a link-format document and its URI
references is a journey through different documents ([RFC3986] references is a journey through different documents ([RFC3986]
defining URIs, [RFC6690] defining link-format documents based on defining URIs, [RFC6690] defining link-format documents based on
[RFC5988] which defines link headers, and [RFC7252] providing the [RFC8288] which defines link headers, and [RFC7252] providing the
transport). This appendix summarizes the mechanisms and semantics at transport). This appendix summarizes the mechanisms and semantics at
play from an entry in ".well-known/core" to a resource lookup. play from an entry in ".well-known/core" to a resource lookup.
This text is primarily aimed at people entering the field of This text is primarily aimed at people entering the field of
Constrained Restful Environments from applications that previously Constrained Restful Environments from applications that previously
did not use web mechanisms. did not use web mechanisms.
A.1. A simple example A.1. A simple example
Let's start this example with a very simple host, "2001:db8:f0::1". Let's start this example with a very simple host, "2001:db8:f0::1".
skipping to change at page 59, line 9 skipping to change at page 64, line 52
While the client - on the practical or implementation side - can just While the client - on the practical or implementation side - can just
go ahead and create a new request to "[2001:db8:f0::1]:5683" with go ahead and create a new request to "[2001:db8:f0::1]:5683" with
Uri-Path: "temp", the full resolution steps without any shortcuts Uri-Path: "temp", the full resolution steps without any shortcuts
are: are:
A.1.1. Resolving the URIs A.1.1. Resolving the URIs
The client parses the single returned record. The link's target The client parses the single returned record. The link's target
(sometimes called "href") is ""/temp"", which is a relative URI that (sometimes called "href") is ""/temp"", which is a relative URI that
needs resolving. The Base URI to resolve that against is, in absence needs resolving. As long as all involved links follow the
of an "anchor" parameter, the URI of the requested resource as restrictions set forth for this document (see Appendix A.4), the base
described in [RFC6690] Section 2.1. URI to resolve this against the requested URI.
The URI of the requested resource can be composed by following the The URI of the requested resource can be composed by following the
steps of [RFC7252] section 6.5 (with an addition at the end of 8.2) steps of [RFC7252] section 6.5 (with an addition at the end of 8.2)
into ""coap://[2001:db8:f0::1]/.well-known/core"". into ""coap://[2001:db8:f0::1]/.well-known/core"".
The record's target is resolved by replacing the path ""/.well-known/ The record's target is resolved by replacing the path ""/.well-known/
core"" from the Base URI (section 5.2 [RFC3986]) with the relative core"" from the Base URI (section 5.2 [RFC3986]) with the relative
target URI ""/temp"" into ""coap://[2001:db8:f0::1]/temp"". target URI ""/temp"" into ""coap://[2001:db8:f0::1]/temp"".
A.1.2. Interpreting attributes and relations A.1.2. Interpreting attributes and relations
skipping to change at page 60, line 9 skipping to change at page 65, line 45
A.2. A slightly more complex example A.2. A slightly more complex example
Omitting the "rt=temperature" filter, the discovery query would have Omitting the "rt=temperature" filter, the discovery query would have
given some more records in the payload: given some more records in the payload:
</temp>;rt=temperature;ct=0, </temp>;rt=temperature;ct=0,
</light>;rt=light-lux;ct=0, </light>;rt=light-lux;ct=0,
</t>;anchor="/sensors/temp";rel=alternate, </t>;anchor="/sensors/temp";rel=alternate,
<http://www.example.com/sensors/t123>;anchor="/sensors/temp"; <http://www.example.com/sensors/t123>;anchor="/sensors/temp";
rel=describedby, rel="describedby"
<t123.pdf>;rel=alternate;ct=65001;
anchor="http://www.example.com/sensors/t123"
Parsing the third record, the client encounters the "anchor" Parsing the third record, the client encounters the "anchor"
parameter. It is a URI relative to the document's Base URI and is parameter. It is a URI relative to the document's Base URI and is
thus resolved to ""coap://[2001:db8:f0::1]/sensors/temp"". That is thus resolved to ""coap://[2001:db8:f0::1]/sensors/temp"". That is
the context resource of the link, so the "rel" statement is not about the context resource of the link, so the "rel" statement is not about
the target and the document Base URI any more, but about the target the target and the document Base URI any more, but about the target
and that address. and that address.
Thus, the third record could be read as Thus, the third record could be read as
""coap://[2001:db8:f0::1]/sensors/temp" has an alternate ""coap://[2001:db8:f0::1]/sensors/temp" has an alternate
representation at "coap://[2001:db8:f0::1]/t"". representation at "coap://[2001:db8:f0::1]/t"".
The fourth record can be read as ""coap://[2001:db8:f0::1]/sensors/ The fourth record can be read as ""coap://[2001:db8:f0::1]/sensors/
temp" is described by "http://www.example.com/sensors/t123"" temp" is described by "http://www.example.com/sensors/t123"".
In the last example the anchor is absolute, where a ""t123.pdf"" is
resolved relative to ""http://www.example.com/sensors/t123"", which
gives a statement that ""http://www.example.com/sensors/t123/
t123.pdf" is an alternate representation to
""http://www.example.com/sensors/t123" of which the content type is
PDF".
A.3. Enter the Resource Directory A.3. Enter the Resource Directory
The resource directory tries to carry the semantics obtainable by The resource directory tries to carry the semantics obtainable by
classical CoAP discovery over to the resource lookup interface as classical CoAP discovery over to the resource lookup interface as
faithfully as possible. faithfully as possible.
For the following queries, we will assume that the simple host has For the following queries, we will assume that the simple host has
used Simple Registration to register at the resource directory that used Simple Registration to register at the resource directory that
was announced to it, sending this request from its UDP port was announced to it, sending this request from its UDP port
"[2001:db8:f0::1]:6553": "[2001:db8:f0::1]:6553":
POST coap://[2001:db8:f01::ff]/.well-known/core?ep-simple-host1 POST coap://[2001:db8:f01::ff]/.well-known/core?ep=simple-host1
The resource directory would have accepted the registration, and The resource directory would have accepted the registration, and
queried the simple host's ".well-known/core" by itself. As a result, queried the simple host's ".well-known/core" by itself. As a result,
the host is registered as an endpoint in the RD with the name the host is registered as an endpoint in the RD with the name
"simple-host1". The registration is active for 86400 seconds, and "simple-host1". The registration is active for 86400 seconds, and
the endpoint registration Base URI is ""coap://[2001:db8:f0::1]/"" the endpoint registration Base URI is ""coap://[2001:db8:f0::1]/""
because that is the address the registration was sent from (and no because that is the address the registration was sent from (and no
explicit "con=" was given). explicit "con=" was given).
If the client now queries the RD as it would previously have issued a If the client now queries the RD as it would previously have issued a
multicast request, it would go through the RD discovery steps by multicast request, it would go through the RD discovery steps by
fetching "coap://[2001:db8:f0::ff]/.well-known/core?rt=core.rd- fetching "coap://[2001:db8:f0::ff]/.well-known/core?rt=core.rd-
lookup-res", obtain "coap://[2001:db8:f0::ff]/rd-lookup/res" as the lookup-res", obtain "coap://[2001:db8:f0::ff]/rd-lookup/res" as the
resource lookup endpoint, and issue a request to resource lookup endpoint, and issue a request to
"coap://[2001:db8:f0::ff]/rd-lookup/res?rt=temperature" to receive "coap://[2001:db8:f0::ff]/rd-lookup/res?rt=temperature" to receive
the following data: the following data:
</temp>;rt=temperature;ct=0;anchor="coap://[2001:db8:f0::1]" <coap://[2001:db8:f0::1]/temp>;rt=temperature;ct=0;
anchor="coap://[2001:db8:f0::1]"
This is not _literally_ the same response that it would have received This is not _literally_ the same response that it would have received
from a multicast request, but it would contain the (almost) same from a multicast request, but it would contain the (almost) same
statement: statement:
'"coap://[2001:db8:f0::1]" is hosting the resource '"coap://[2001:db8:f0::1]" is hosting the resource
"coap://[2001:db8:f0::1]/temp", which is of the resource type "coap://[2001:db8:f0::1]/temp", which is of the resource type
"temperature" and can be accessed using the text/plain content "temperature" and can be accessed using the text/plain content
format.' format.'
(The difference is whether "/" or "/.well-known/core" hosts the (The difference is whether "/" or "/.well-known/core" hosts the
resources, which is subject of ongoing discussion about RFC6690). resources, which is subject of ongoing discussion about RFC6690).
To complete the examples, the client could also query all resources To complete the examples, the client could also query all resources
hosted at the endpoint with the known endpoint name "simple-host1". hosted at the endpoint with the known endpoint name "simple-host1".
A request to "coap://[2001:db8:f0::ff]/rd-lookup/res?ep=simple-host1" A request to "coap://[2001:db8:f0::ff]/rd-lookup/res?ep=simple-host1"
would return would return
</temp>;rt=temperature;ct=0;anchor="coap://[2001:db8:f0::1]", <coap://[2001:db8:f0::1]/temp>;rt=temperature;ct=0;
</light>;rt=light-lux;ct=0;anchor="coap://[2001:db8:f0::1]", anchor="coap://[2001:db8:f0::1]",
</t>;anchor="coap://[2001:db8:f0::1]/sensors/temp";rel=alternate, <coap://[2001:db8:f0::1]/light>;rt=light-lux;ct=0;
anchor="coap://[2001:db8:f0::1]",
<coap://[2001:db8:f0::1]/t>;
anchor="coap://[2001:db8:f0::1]/sensors/temp";rel=alternate,
<http://www.example.com/sensors/t123>; <http://www.example.com/sensors/t123>;
anchor="coap://[2001:db8:f0::1]/sensors/temp";rel=describedby, anchor="coap://[2001:db8:f0::1]/sensors/temp";rel="describedby"
<t123.pdf>;rel=alternate;ct=65001;
anchor="http://www.example.com/sensors/t123"
Note that the last link was not modified at all because its anchor All the target and anchor references are already in absolute form
was already an absolute reference. there, which don't need to be resolved any further.
Had the simple host registered with an explicit context (eg. Had the simple host registered with an explicit context (eg.
"?ep=simple-host1&con=coap+tcp://simple-host1.example.com"), that "?ep=simple-host1&con=coap+tcp://simple-host1.example.com"), that
context would have been used to resolve the relative anchor values context would have been used to resolve the relative anchor values
instead, giving instead, giving
</temp>;rt=temperature;ct=0;anchor="coap+tcp://simple-host1.example.com" <coap+tcp://simple-host1.example.com/temp>;rt=temperature;ct=0;
anchor="coap+tcp://simple-host1.example.com"
and analogous records. and analogous records.
A.4. A note on differences between link-format and Link headers A.4. A note on differences between link-format and Link headers
While link-format and Link headers look very similar and are based on While link-format and Link headers look very similar and are based on
the same model of typed links, there are some differences between the same model of typed links, there are some differences between
[RFC6690] and [RFC5988] that should be kept in mind when using or [RFC6690] and [RFC5988], which are dealt with differently:
implementing a Resource Directory:
o "Resolving the target against the anchor": [RFC6690] Section 2.1
states that the anchor of a link uses the Base URI against which
the term inside the angle brackets (the target) is resolved.
[RFC8288] Section B.2 describes that the anchor is immaterial to
the resolution of the target reference.
In the context of a Resource Directory, the authors decided not to
not let this become an issue by requiring that RFC6690 links be
serialized in a way that either rule set can be applied and give
the same results. Note that all examples of [RFC6690], [RFC8288]
and this document comply with that rule.
Applications that would prefer to transport references with a
relative target and an absolute anchor are advised to use a
different serialization of the links. [I-D.ietf-core-links-json]
might provide such formats.
o There is no percent encoding in link-format documents. o There is no percent encoding in link-format documents.
A link-format document is a UTF-8 encoded string of Unicode A link-format document is a UTF-8 encoded string of Unicode
characters and does not have percent encoding, while Link headers characters and does not have percent encoding, while Link headers
are practically ASCII strings that use percent encoding for non- are practically ASCII strings that use percent encoding for non-
ASCII characters, stating the encoding explictly when required. ASCII characters, stating the encoding explictly when required.
For example, while a Link header in a page about a Swedish city For example, while a Link header in a page about a Swedish city
might read might read
"Link: </temperature/Malm%C3%B6>;rel="live-environment-data"" "Link: </temperature/Malm%C3%B6>;rel="live-environment-data""
a link-format document from the same source might describe the a link-format document from the same source might describe the
link as link as
"</temperature/Malmoe>;rel="live-environment-data"" "</temperature/Malmoe>;rel="live-environment-data""
o In a link-format document, if the anchor attribute is present, the Parsers and producers of link-format and header data need to be
link target reference is resolved by using the the (resolved) aware of this difference.
anchor value as Base URI for that link, while in Link headers, it
is resolved against the URI of the requested document.
This is explicit in [RFC6690] section 2.1 for link-format, and
spelled out in section B.2 of [I-D.nottingham-rfc5988bis] , which
obsoletes the older [RFC5988]. [RFC6690] is based on [RFC5988]
and has not been updated with clarifications from
[I-D.nottingham-rfc5988bis].
Appendix B. Syntax examples for Protocol Negotiation Appendix B. Syntax examples for Protocol Negotiation
[ This appendix should not show up in a published version of this [ This appendix should not show up in a published version of this
document. ] document. ]
The protocol negotiation that is being worked on in The protocol negotiation that is being worked on in
[I-D.silverajan-core-coap-protocol-negotiation] makes use of the [I-D.silverajan-core-coap-protocol-negotiation] makes use of the
Resource Directory. Resource Directory.
Until that document is update to use the latest resource-directory Until that document is update to use the latest resource-directory
specification, here are some examples of protocol negotiation with specification, here are some examples of protocol negotiation with
the current Resource Directory: the current Resource Directory:
An endpoint could register as follows: An endpoint could register as follows from its address
"[2001:db8:f1::2]:5683":
Req: POST coap://rd.example.com/rd?ep=node1 Req: POST coap://rd.example.com/rd?ep=node1
&at=coap+tcp://[2001:db8:f1::2] &at=coap+tcp://[2001:db8:f1::2]
&at=coap://[2001:db8:f1::2]
Content-Format: 40 Content-Format: 40
Payload: Payload:
</temperature>;ct=0;rt="temperature";if="core.s" </temperature>;ct=0;rt="temperature";if="core.s"
Res: 2.01 Created Res: 2.01 Created
Location: /rd/1234 Location: /rd/1234
A UDP client would then query: An endpoint lookup would just reflect the registered attributes:
Req: GET /rd-lookup/res?rt=temperature Req: GET /rd-lookup/ep
Res: 2.05 Content Res: 2.05 Content
</temperature>;ct=0;rt="temperature";if="core.s"; </rd/1234>;ep="node1";con="coap://[2001:db8:f1::2]:5683";
anchor="coap://[2001:db8:f1::2]" at="coap+tcp://[2001:db8:f1::2]"
A UDP client would then see the following in a resource lookup:
Req: GET /rd-lookup/res?rt=temperature
Res: 2.05 Content
<coap://[2001:db8:f1::2]/temperature>;ct=0;rt="temperature";if="core.s";
anchor="coap://[2001:db8:f1::2]"
while a TCP capable client could say: while a TCP capable client could say:
Req: GET /rd-lookup/res?rt=temperature&tt=tcp Req: GET /rd-lookup/res?rt=temperature&tt=tcp
Res: 2.05 Content Res: 2.05 Content
</temperature>;ct=0;rt="temperature";if="core.s"; <coap+tcp://[2001:db8:f1::2]/temperature>;ct=0;rt="temperature";
anchor="coap+tcp://[2001:db8:f1::2]" if="core.s";anchor="coap+tcp://[2001:db8:f1::2]"
Authors' Addresses Authors' Addresses
Zach Shelby Zach Shelby
ARM ARM
150 Rose Orchard 150 Rose Orchard
San Jose 95134 San Jose 95134
USA USA
Phone: +1-408-203-9434 Phone: +1-408-203-9434
skipping to change at page 64, line 30 skipping to change at page 70, line 30
Email: cabo@tzi.org Email: cabo@tzi.org
Peter van der Stok Peter van der Stok
consultant consultant
Phone: +31-492474673 (Netherlands), +33-966015248 (France) Phone: +31-492474673 (Netherlands), +33-966015248 (France)
Email: consultancy@vanderstok.org Email: consultancy@vanderstok.org
URI: www.vanderstok.org URI: www.vanderstok.org
Christian Amsuess (editor) Christian Amsuess (editor)
Energy Harvesting Solutions
Hollandstr. 12/4 Hollandstr. 12/4
1020 1020
Austria Austria
Phone: +43-664-9790639 Phone: +43-664-9790639
Email: c.amsuess@energyharvesting.at Email: christian@amsuess.com
 End of changes. 147 change blocks. 
367 lines changed or deleted 571 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/