idnits 2.17.1 draft-hartke-t2trg-data-hub-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 2, 2018) is 2247 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Outdated reference: A later version (-09) exists of draft-hartke-t2trg-coral-04 == Outdated reference: A later version (-14) exists of draft-ietf-core-coap-pubsub-03 == Outdated reference: A later version (-28) exists of draft-ietf-core-resource-directory-13 Summary: 0 errors (**), 0 flaws (~~), 4 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Thing-to-Thing Research Group K. Hartke 3 Internet-Draft Universitaet Bremen TZI 4 Intended status: Experimental March 2, 2018 5 Expires: September 3, 2018 7 Thing-to-Thing Data Hub 8 draft-hartke-t2trg-data-hub-01 10 Abstract 12 The Thing-to-Thing Data Hub is a RESTful, hypermedia-driven Web 13 application that can be used in Thing-to-Thing communication to share 14 data items such as thing descriptions, configurations, resource 15 descriptions, or firmware updates at a central location. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at https://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on September 3, 2018. 34 Copyright Notice 36 Copyright (c) 2018 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (https://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.1. Requirements Notation . . . . . . . . . . . . . . . . . . 3 53 2. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 4 54 3. Interaction Model . . . . . . . . . . . . . . . . . . . . . . 5 55 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 56 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 57 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 58 6.1. Normative References . . . . . . . . . . . . . . . . . . 7 59 6.2. Informative References . . . . . . . . . . . . . . . . . 7 60 Appendix A. Related Work . . . . . . . . . . . . . . . . . . . . 8 61 A.1. CoAP Publish-Subscribe . . . . . . . . . . . . . . . . . 8 62 A.2. CoRE Resource Directory . . . . . . . . . . . . . . . . . 9 63 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 11 65 1. Introduction 67 In Thing-to-Thing communication, there is often a need to share data 68 items of common interest at a central location. For example, the 69 CoRE Resource Directory [I-D.ietf-core-resource-directory] aggregates 70 descriptions of resources held on other servers, which enables things 71 to easily discover these resources. Similarly, a W3C Web-of-Things 72 Thing Description Repository [WOT] stores semantic metadata of things 73 as well as functional descriptions of their interfaces, making this 74 data available to Web dashboards, commissioning tools and other 75 things. 77 As more and more thing-to-thing applications are implemented, it 78 becomes increasingly important to be able to share not only resource 79 and thing descriptions but also many other kinds of data, such as 80 default configurations for new devices, service locations, firmware 81 updates, or certificate revocation lists. The existing resource 82 directories and thing description repositories are not a good fit for 83 these kinds of data, as they're specialized to their use case and 84 don't accept other kinds of data. And defining a new specialized 85 application for each use case is not practical in the long term. 87 This document defines a simple "data hub" application, a RESTful Web 88 application with a hypermedia API that is suitable for constrained 89 environments and that generalizes the concept of a central repository 90 for sharing any kinds of data. A data hub enables clients to share 91 data items in any format and provides means for creating, reading, 92 observing, updating, deleting and finding data items at a data hub 93 server. 95 Data hubs are intended to be used primarily with CoAP [RFC7252]. 97 Features: 99 o General 101 The data hub generalizes the concept of a directory or repository 102 to data items to any Internet media type. This means applications 103 using the data hub aren't stuck forever with the same media types 104 or limited to resource descriptions and thing descriptions. 106 o Searchable 108 Clients can retrieve a subset of data items from a data hub based 109 on item metadata. 111 o Observable 113 Data items published to a data hub are exposed as resources. As 114 such, they can be observed for changes [RFC7641]. This allows 115 clients to stay informed of information that other clients update 116 over time. As a result, the data hub functions similar to a CoAP 117 Publish-Subscribe Broker [I-D.ietf-core-coap-pubsub], although 118 this isn't its primary use case. 120 o Evolvable 122 The key differentiator of the data hub compared to CoRE Resource 123 Directory and CoAP Publish-Subscribe Broker is the evolvability -- 124 the ability to respond effectively to the need for changes without 125 negatively impacting existing and new clients. Data hubs enable 126 fine-grained evolvability by driving all interactions by machine- 127 readable hypermedia elements. Features can be added, changed or 128 removed in a safe, backwards-compatible way simply by updating the 129 data hub representation to expose appropriate links and forms. 131 1.1. Requirements Notation 133 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 134 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 135 "OPTIONAL" in this document are to be interpreted as described in 136 [RFC2119]. 138 2. Data Model 140 The data model consists of two elements: the _data hub_ and a number 141 of shared _data items_ (Figure 1). 143 ___ 144 Data Hub / \ 145 \___/ 146 | ___ 147 |________/ \ Data Item 148 | item \___/ 149 | ___ 150 |________/ \ Data Item 151 | item \___/ 152 | . 153 | . 154 | . 155 | ___ 156 |________/ \ Data Item 157 item \___/ 159 Figure 1: A Data Hub with a Number of Shared Data Items 161 Data Hub 163 A data hub resource is a collection of shared data items. 165 Data hub representations MUST be formatted in the "application/ 166 coral+cbor" or "text/coral" media type [I-D.hartke-t2trg-coral]. 167 They primarily consist of links to the data items using the "item" 168 link relation type [RFC6573]. To reduce the number of round- 169 trips, they MAY also embed (complete or partial) representations 170 of data items. Forms contained in the representation enable 171 interactions with the hub and data items, as described in the 172 following section. The representations MAY additionally contain 173 other links and forms that are not described in this document, 174 such as a link with the "alternate" link relation type that 175 references an alternate representation of the data hub resource. 177 For a start, a data hub is defined to have a depth of only one 178 level; i.e., all data item resources are organized directly under 179 the top-level data hub resource. This could be extended to 180 multiple levels in a future revision of this document. 182 Data Item 184 A data item is a member of the collection. 186 Data item representations MAY be formatted in any media type. 187 However, a data hub instance MAY restrict the media types it 188 accepts for publication. The form in the data hub representation 189 for creating data items MUST list the acceptable media types in 190 this case using form fields with name . 192 The representations of data items MAY link back to a data hub 193 resource using the "collection" link relation type [RFC6573]. 195 3. Interaction Model 197 The interaction model consists of eight possible interactions with a 198 data hub: discovering and reading the data hub, and creating, 199 reading, observing, updating, deleting, and finding shared data items 200 in the data hub. 202 Discovering a Data Hub 204 For a start, this revision of the document assumes that clients 205 are pre-configured with a link to a data hub. 207 Reading a Data Hub 209 A client can retrieve a representation of a data hub by following 210 the pre-configured link. The representation of the data hub 211 includes links to (and, optionally, representations of) the data 212 items in the data hub. The data hub representation also includes 213 forms for creating, updating, deleting, and finding data items. 215 Creating an Item 217 The representation of a data hub MAY contain a form with the 218 form relation type. Submitting this 219 form with a representation in one of the acceptable media types 220 creates a new data item in the data hub. The acceptable media 221 types are indicated by form fields. 223 Data hubs implementing this specification MUST offer the POST 224 method [RFC7252] in this form. 226 Reading an Item 228 A client can retrieve a representation of a data item by following 229 a link with the 230 link relation type in the data hub representation. 232 Observing an Item 233 A client can observe a data item by following a link with the 234 link relation type 235 in the data hub representation and observing the target resource 236 as specified in RFC 7641 [RFC7641]. 238 Updating an Item 240 For each data item in a data hub, the representation of the data 241 hub MAY include a nested form with the 242 form relation type. Submitting this form updates the data item in 243 the data hub to the submitted representation. 245 Data hubs implementing this specification MUST offer the PUT 246 method [RFC7252] in this form. 248 Deleting an Item 250 For each data item in a data hub, the representation of the data 251 hub MAY include a nested form with the 252 form relation type. Submitting this form deletes the data item 253 from the data hub. 255 Data hubs implementing this specification MUST offer the DELETE 256 method [RFC7252] in this form. 258 Searching for Items 260 The representation of a data hub MAY contain a form with the 261 form relation type. This form can be 262 used to find data items in the data hub. Submitting this form 263 with a search query returns the subset of data items that match 264 the query. 266 Data hubs implementing this specification MUST offer the FETCH 267 method [RFC8132] in this form. 269 4. Security Considerations 271 TODO. 273 5. IANA Considerations 275 This document includes no request to IANA. 277 6. References 279 6.1. Normative References 281 [I-D.hartke-t2trg-coral] 282 Hartke, K., "The Constrained RESTful Application Language 283 (CoRAL)", draft-hartke-t2trg-coral-04 (work in progress), 284 October 2017. 286 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 287 Requirement Levels", BCP 14, RFC 2119, 288 DOI 10.17487/RFC2119, March 1997, 289 . 291 [RFC6573] Amundsen, M., "The Item and Collection Link Relations", 292 RFC 6573, DOI 10.17487/RFC6573, April 2012, 293 . 295 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 296 Application Protocol (CoAP)", RFC 7252, 297 DOI 10.17487/RFC7252, June 2014, 298 . 300 [RFC7641] Hartke, K., "Observing Resources in the Constrained 301 Application Protocol (CoAP)", RFC 7641, 302 DOI 10.17487/RFC7641, September 2015, 303 . 305 [RFC8132] van der Stok, P., Bormann, C., and A. Sehgal, "PATCH and 306 FETCH Methods for the Constrained Application Protocol 307 (CoAP)", RFC 8132, DOI 10.17487/RFC8132, April 2017, 308 . 310 6.2. Informative References 312 [I-D.ietf-core-coap-pubsub] 313 Koster, M., Keranen, A., and J. Jimenez, "Publish- 314 Subscribe Broker for the Constrained Application Protocol 315 (CoAP)", draft-ietf-core-coap-pubsub-03 (work in 316 progress), February 2018. 318 [I-D.ietf-core-resource-directory] 319 Shelby, Z., Koster, M., Bormann, C., Stok, P., and C. 320 Amsuess, "CoRE Resource Directory", draft-ietf-core- 321 resource-directory-13 (work in progress), March 2018. 323 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 324 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 325 . 327 [WOT] Kovatsch, M., Ed. and D. Peintner, Ed., "WoT Current 328 Practices", February 2018, . 331 Appendix A. Related Work 333 The data hub is an instance of the well-known collection pattern. As 334 such, it might be used in places where a more specialized instance of 335 the collection pattern is currently used, such as the CoAP Publish- 336 Subscribe Broker [I-D.ietf-core-coap-pubsub] or the CoRE Resource 337 Directory [I-D.ietf-core-resource-directory]. This section shows how 338 these two applications might be implemented with a data hub (without 339 trying to replicate all of their features in detail). 341 A.1. CoAP Publish-Subscribe 343 CoAP Publish-Subscribe [I-D.ietf-core-coap-pubsub] provides means for 344 resource-constrained sensor and actuator nodes to publish and receive 345 data without having to be available at the same time. The basic 346 operation involves clients called "publishers" updating "topic" 347 resources at a server called the "broker" and clients called 348 "subscribers" observing these resources (Figure 2). 350 ____________ ____________ ____________ 351 | |--------->| | | | 352 | Publisher |<---------| Broker | | Subscriber | 353 | (Client) | | (Server) |<---------| (Client) | 354 |____________| |____________|--------->|____________| 356 Figure 2: CoAP Publish-Subscribe 358 A broker might be implemented as a data hub by creating the topics as 359 resources on the data hub server and linking to these from the data 360 hub resource (Figure 3). Hypermedia controls in the data hub 361 representation enable publishers to create, update, and delete topics 362 as well as subscribers to read or observe these topics. 364 +----------------------------+ 365 | ___ | 366 | / \ Data Hub | 367 | \___/ | 368 | | ___ | 369 | |________/ \ Topic A | 370 | | item \___/ | 371 | | ___ | 372 | |________/ \ Topic B | 373 | | item \___/ | 374 | | ___ | 375 | |________/ \ Topic C | 376 | item \___/ | 377 | | 378 +----------------------------+ 380 Figure 3: A Data Hub Acting as a Publish-Subscribe Broker 382 +-------------+--------------------------+ 383 | Interaction | Mapped to | 384 +-------------+--------------------------+ 385 | DISCOVERY | Discovering a Data Hub / | 386 | | Reading a Data Hub / | 387 | | Searching for Items | 388 | CREATE | Creating an Item | 389 | PUBLISH | Updating an Item | 390 | SUBSCRIBE | Observing an Item | 391 | UNSUBSCRIBE | Observing an Item | 392 | READ | Reading an Item | 393 | REMOVE | Deleting an Item | 394 +-------------+--------------------------+ 396 Table 1: Mapping of Pub/Sub Interactions to Data Hub 398 A.2. CoRE Resource Directory 400 A CoRE Resource Directory [I-D.ietf-core-resource-directory] hosts 401 descriptions of resources held on other servers, allowing lookups to 402 be performed for those descriptions. The descriptions are encoded as 403 links in CoRE Link Format [RFC6690] annotated with a variety of link 404 attributes providing the type of and hints about the linked 405 resources. 407 +---------------------------------+ 408 | ___ | 409 | / \ Data Hub | 410 | \___/ | 411 | | ___ | 412 | |________/ \ Data Item in | +------------------+ 413 | | item \___/ Link Format | | ___ | 414 | | |_________________|____|__/ \ Resource | 415 | | | hosts | | \___/ | 416 | | | | | ___ | 417 | | |_________________|____|__/ \ Resource | 418 | | hosts | | \___/ | 419 | | | | | 420 | | ___ | +------------------+ 421 | |________/ \ Data Item in | +------------------+ 422 | item \___/ Link Format | | ___ | 423 | |_________________|____|__/ \ Resource | 424 | hosts | | \___/ | 425 | | | | 426 +---------------------------------+ +------------------+ 428 Figure 4: A Data Hub Storing Link Format Items 430 A data hub might be used to store these resource descriptions. Each 431 resource description becomes a data item in the data hub (Figure 4). 432 A specialized interface for querying the cumulative set of stored 433 links might be provided separately. 435 +-----------------------+------------------------+ 436 | Interaction | Mapped to | 437 +-----------------------+------------------------+ 438 | Discovery | Discovering a Data Hub | 439 | Registration | Creating an Item | 440 | Registration Update | - | 441 | Registration Removal | Deleting an Item | 442 | Read Endpoint Links | Reading an Item | 443 | Update Endpoint Links | Updating an Item | 444 +-----------------------+------------------------+ 446 Table 2: Mapping of Resource Directory Interactions to Data Hub 448 Author's Address 450 Klaus Hartke 451 Universitaet Bremen TZI 452 Postfach 330440 453 Bremen D-28359 454 Germany 456 Phone: +49-421-218-63905 457 Email: hartke@tzi.org