idnits 2.17.1 draft-silverajan-core-coap-alternative-transports-06.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 : ---------------------------------------------------------------------------- ** There are 2 instances of too long lines in the document, the longest one being 3 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 283 has weird spacing: '...ntifier ide...' -- The document date (July 21, 2014) is 3560 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'I-D.ietf-core-groupcomm' is defined on line 567, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 596, but no explicit reference was found in the text == Unused Reference: 'RFC6455' is defined on line 614, but no explicit reference was found in the text == Unused Reference: 'RFC6568' is defined on line 617, but no explicit reference was found in the text == Unused Reference: 'RFC6733' is defined on line 621, but no explicit reference was found in the text == Outdated reference: A later version (-06) exists of draft-ietf-appsawg-uri-scheme-reg-01 == Outdated reference: A later version (-06) exists of draft-becker-core-coap-sms-gprs-04 == Outdated reference: A later version (-27) exists of draft-bormann-coap-misc-26 == Outdated reference: A later version (-17) exists of draft-ietf-6lo-btle-02 == Outdated reference: A later version (-25) exists of draft-ietf-core-groupcomm-20 == Outdated reference: A later version (-16) exists of draft-ietf-core-observe-14 == Outdated reference: A later version (-10) exists of draft-jimenez-p2psip-coap-reload-04 == Outdated reference: A later version (-07) exists of draft-savolainen-core-coap-websockets-02 -- Obsolete informational reference (is this intentional?): RFC 2818 (Obsoleted by RFC 9110) Summary: 1 error (**), 0 flaws (~~), 15 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CoRE Working Group B. Silverajan 3 Internet-Draft Tampere University of Technology 4 Intended status: Informational T. Savolainen 5 Expires: January 22, 2015 Nokia 6 July 21, 2014 8 CoAP Communication with Alternative Transports 9 draft-silverajan-core-coap-alternative-transports-06 11 Abstract 13 CoAP has been standardised as an application level REST-based 14 protocol. A single CoAP message is typically encapsulated and 15 transmitted using UDP or DTLS as transports. These transports are 16 optimal solutions for CoAP use in IP-based constrained environments 17 and nodes. However compelling motivation exists for understanding 18 how CoAP can operate with other transports, such as the need for M2M 19 communication using non-IP networks, improved transport level end-to- 20 end reliability and security, NAT and firewall traversal issues, and 21 mechanisms possibly incurring a lower overhead to CoAP/HTTP 22 translation gateways. This draft examines the requirements for 23 conveying CoAP messages to end points over such alternative 24 transports. It also provides a new URI format for representing CoAP 25 resources over alternative transports. 27 Status of This Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at http://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on January 22, 2015. 44 Copyright Notice 46 Copyright (c) 2014 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 62 2. Usage Cases . . . . . . . . . . . . . . . . . . . . . . . . . 3 63 2.1. Use of SMS . . . . . . . . . . . . . . . . . . . . . . . 4 64 2.2. Use of WebSockets . . . . . . . . . . . . . . . . . . . . 4 65 2.3. Use of P2P Overlays . . . . . . . . . . . . . . . . . . . 4 66 2.4. Use of TCP . . . . . . . . . . . . . . . . . . . . . . . 4 67 2.5. Others . . . . . . . . . . . . . . . . . . . . . . . . . 5 68 3. Node Types based on Transport Availability . . . . . . . . . 5 69 4. CoAP Alternative Transport URI . . . . . . . . . . . . . . . 6 70 4.1. Design Considerations . . . . . . . . . . . . . . . . . . 7 71 4.2. URI format . . . . . . . . . . . . . . . . . . . . . . . 8 72 5. Alternative Transport Analysis and Properties . . . . . . . . 9 73 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 11 75 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 12 76 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 77 9.1. Normative References . . . . . . . . . . . . . . . . . . 12 78 9.2. Informative References . . . . . . . . . . . . . . . . . 12 79 Appendix A. Expressing transport in the URI in other ways . . . 14 80 A.1. Transport information as part of the URI authority . . . 14 81 A.1.1. Usage of DNS records . . . . . . . . . . . . . . . . 15 82 A.2. Making CoAP Resources Available over Multiple Transports 15 83 A.3. Transport as part of a 'service:' URL scheme . . . . . . 17 84 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 86 1. Introduction 88 The Constrained Application Protocol (CoAP) [RFC7252] has been 89 standardised by the CoRE WG as a lightweight, HTTP-like protocol 90 providing a request/response model that constrained nodes can use to 91 communicate with other nodes, be those servers, proxies, gateways, 92 less constrained nodes, or other constrained nodes. 94 As the Internet continues taking shape by integrating new kinds of 95 networks, services and devices, the need for a consistent, 96 lightweight method for resource representation, retrieval and 97 manipulation becomes evident. Owing to its simplicity and low 98 overhead, CoAP is a highly suitable protocol for this purpose. 99 However, the CoAP endpoint can reside in a non-IP network, be 100 separated from its peer by NATs and firewalls or simply has no 101 possibility to communicate over UDP. Consequently in addition to 102 UDP, alternative transport channels for conveying CoAP messages could 103 be considered. 105 Extending CoAP over alternative transports allows implementations to 106 have a significantly larger relevance in constrained as well as non- 107 constrained networked environments. It leads to better code 108 optimisation in constrained nodes and broader implementation reuse 109 across new transport channels. As opposed to implementing new 110 resource retrieval mechanisms, an application in an end-node can 111 continue relying on using CoAP's REST-based resource retrieval and 112 manipulation for this purpose, while changes in end point 113 identification and the transport protocol can be addressed by a 114 transport-specific messaging sublayer. This simplifies development 115 and memory requirements. Resource representations are also visible 116 in an end-to-end manner for any CoAP client. The processing and 117 computational overhead for conveying CoAP Requests and Responses from 118 one underlying transport to another, would be less than that of an 119 application-level gateway performing protocol translation of 120 individual messages between CoAP and another resource retrieval 121 protocol such as HTTP. 123 This document first provides scenarios where usage of CoAP over 124 alternative transports is either currently underway, or may prove 125 advantageous in the future. A simple transport type classification 126 for CoAP-capable nodes is provided next. Then a new URI format is 127 described through which a CoAP resource representation can be 128 formulated that expresses transport identification in addition to 129 endpoint information and resource paths. Following that, a 130 discussion of the various transport properties which influence how 131 CoAP Requests and Responses are mapped to transport level payloads, 132 is presented. 134 This document however, does not touch on application QoS 135 requirements, user policies or network adaptation, nor does it 136 advocate replacing the current practice of UDP-based CoAP 137 communication. 139 2. Usage Cases 141 Apart from UDP and DTLS, CoAP usage is being specified for the 142 following environments as of this writing: 144 2.1. Use of SMS 146 CoAP Request and Response messages can be sent via SMS between CoAP 147 end-points in a cellular network [I-D.becker-core-coap-sms-gprs]. A 148 CoAP Request message can also be sent via SMS from a CoAP client to a 149 sleeping CoAP Server as a wake-up mechanism and trigger communication 150 via IP. The Open Mobile Alliance (OMA) specifies both UDP and SMS as 151 transports for M2M communication in cellular networks. The OMA 152 Lightweight M2M protocol being drafted uses CoAP, and as transports, 153 specifies both UDP binding as well as Short Message Service (SMS) 154 bindings [OMALWM2M] for the same reason. 156 2.2. Use of WebSockets 158 The WebSocket protocol is being proposed as a transport channel 159 between WebSocket enabled CoAP end-points on the Internet 160 [I-D.savolainen-core-coap-websockets]. This is particularly useful 161 as a means for web browsers, especially in smart devices, to allow 162 embedded client side scripts to create new WebSocket connections to 163 various WebSocket-enabled servers, through which CoAP Request and 164 Response messages can be exchanged. This also allows a browser 165 containing an embedded CoAP server to behave as a WebSocket client by 166 opening a connection to a WebSocket enabled CoAP Mirror Server 167 [I-D.vial-core-mirror-server] to register and update its resources. 169 2.3. Use of P2P Overlays 171 [I-D.jimenez-p2psip-coap-reload] specifices how CoAP nodes can use a 172 peer-to-peer overlay network called RELOAD, as a resource caching 173 facility for storing wireless sensor data. When a CoAP node 174 registers its resources with a RELOAD Proxy Node (PN), the node 175 computes a hash value from the CoAP URI and stores it as a structure 176 together with the PN's Node ID as well as the resources. Resource 177 retrieval by CoAP nodes is accomplished by computing the hash key 178 over the Request URI,opening a connection to the overlay and using 179 its message routing system to contact the CoAP server via its PN. 181 2.4. Use of TCP 183 Using TCP to facilitate the traversal of CoAP Request and Response 184 messages [I-D.bormann-core-coap-tcp], allows easier communication 185 between CoAP clients and servers separated by firewalls and NATs. 186 This also allows CoAP messages to be transported over push 187 notification services from a notification server to a client app on a 188 smartphone, that may previously have subscribed to receive change 189 notifications of CoAP resource representations, possibly by using 190 CoAP Observe-functionality [I-D.ietf-core-observe]. 192 2.5. Others 194 CoAP could in addition be extended atop other transport channels, 195 such as: 197 1. The transportation of CoAP messages in Delay-Tolerant Networks 198 [RFC4838], using the Bundle Protocol [RFC5050] for reaching 199 sensors in extremely challenging environments such as acoustic, 200 underwater and deep space networks. 202 2. Any type of non-IP networks supporting constrained nodes and low- 203 energy sensors, such as Bluetooth and Bluetooth Low Energy 204 (either through L2CAP or with GATT) [BTCorev4.1], ZigBee, Z-Wave, 205 1-Wire, DASH7 and so on. 207 3. Instant Messaging and Social Networking channels, such as Jabber 208 and Twitter. 210 3. Node Types based on Transport Availability 212 The term "alternative transport" in this document thus far has been 213 used to refer to any non-UDP and non-DTLS transport that can convey 214 CoAP messages in its payload. A node however, may in fact possess 215 the capability to utilise CoAP over multiple transport channels at 216 its disposal, simultaneously or otherwise, at any point in time to 217 communicate with a CoAP end-point. Such communication can obviously 218 take place over UDP and DTLS as well. Inevitably, if two CoAP 219 endpoints reside in distinctly separate networks with orthogonal 220 transports, a CoAP proxy node is needed between the two networks so 221 that CoAP Requests and Responses can be exchanged properly. 223 In [RFC7228], Tables 1, 3 and 4 introduced classification schemes for 224 devices, in terms of their resource constraints, energy limitations 225 and communication power. For this document, in addition to these 226 capabilities, it seems useful to additionally identify devices based 227 on their transport capabilities. 229 +-------+----------------------------+ 230 | Name | Transport Availability | 231 +-------+----------------------------+ 232 | T0 | Single transport | 233 | | | 234 | T1 | Multiple transports, with | 235 | | one or more active at any | 236 | | point in time | 237 | | | 238 | T2 | Multiple active transports| 239 +-------+----------------------------+ 241 Table 1: Classes of Available Transports 243 Nodes falling under Type T0 possess the capability of exactly 1 type 244 of transport channel for CoAP, at all times. These include both 245 active and sleepy nodes, which may choose to perform duty cycling for 246 power saving. 248 Type T1 nodes possess multiple different transports, and can retrieve 249 or expose CoAP resources over any or all of these transports. 250 However, not all transports are constantly active and certain 251 transport channels and interfaces could be kept in a mostly-off state 252 for energy-efficiency, such as when using CoAP over SMS (refer to 253 section 2.1) 255 Type T2 nodes possess more than 1 transport, and multiple transports 256 are simultaneously active at all times. CoAP proxy nodes which allow 257 CoAP endpoints from disparate transports to communicate with each 258 other, are a good example of this. 260 4. CoAP Alternative Transport URI 262 Based on the usage scenarios as well as the transport classes 263 presented in the preceding sections, this section discusses the 264 formulation of a new URI for representing CoAP resources over 265 alternative transports. 267 CoAP is logically divided into 2 sublayers, whereby a request/ 268 response layer is responsible for the protocol functionality of 269 exchanging request and response messages, while the messaging layer 270 is bound to UDP. These 2 sublayers are tightly coupled, both being 271 responsible for properly encoding the header and body of the CoAP 272 message. The CoAP URI is used by both logical sublayers. For a URI 273 that is expressed generically as 275 URI = scheme ":" "//" authority path-abempty ["?"query ] 276 a simple example CoAP URI, "coap://server.example.com/sensors/ 277 temperature" is interpreted as follows: 279 coap :// server.example.com /sensors/temperature 280 \___/ \______ ________/ \______ _________/ 281 | \/ \/ 282 protocol endpoint parameterised 283 identifier identifier resource 284 identifier 286 Figure 1: The CoAP URI format 288 The resource path is explicitly expressed, and the endpoint 289 identifier, which contains the host address at the network-level is 290 also directly bound to the scheme name containing the application- 291 level protocol identifier. The choice of a specific transport for a 292 scheme, however, cannot be embedded with a URI, but is defined by 293 convention or standardisation of the protocol using the scheme. As 294 examples, [RFC5092] defines the 'imap' scheme for the IMAP protocol 295 over TCP, while [RFC2818] requires that the 'https' protocol 296 identifier be used to differentiate using HTTP over TLS instead of 297 TCP. 299 4.1. Design Considerations 301 Several ways of formulating a URI which express an alternative 302 transport binding to CoAP, can be envisioned. When such a URI is 303 provided from an end-application to its CoAP implementation, the URI 304 component containing transport-specific information can be checked to 305 allow CoAP to use the appropriate transport for a target endpoint 306 identifier. 308 The following design considerations influence the formulation of a 309 new URI expressing CoAP resources over alternative transports: 311 1. A CoAP Transport URI can be supplied as a Proxy-Uri option by a 312 CoAP end-point to a CoAP forward proxy. This allows 313 communication with a CoAP end-point residing in a network using a 314 different transport. Section 6.4 of [RFC7252] provides an 315 algorithm for parsing a received URI to obtain the request's 316 options. Also, the generic syntax for a URI is described in 317 [RFC3986]. By ensuring conformance to RFC3986, the need for 318 custom URI parsers as well as resolution algorithms can be 319 obviated. In particular, a URI format needs to be described in 320 which each URI component clearly meets the syntax and percent- 321 encoding rules described. 323 2. Request messages sent to a CoAP endpoint using a CoAP Transport 324 URI may be responded to with a relative URI reference, for 325 example, of the form "../../path/to/resource". In such cases, 326 the requesting endpoint needs to resolve the relative reference 327 against the original CoAP Transport URI to then obtain a new 328 target URI to which a request can be sent to, to obtain a 329 resource representation. [RFC3986] provides an algorithm to 330 establish how relative references can be resolved against a base 331 URI to obtain a target URI. Given this algorithm, a URI format 332 needs to be described in which relative reference resolution does 333 not result in a target URI that loses its transport-specific 334 information 336 3. The host component of current CoAP URIs can either be an IPv4 337 address, an IPv6 address or a resolvable hostname. While the 338 usage of DNS can sometimes be useful for distinguishing transport 339 information (see section 4.3.1), accessing DNS over some 340 alternative transport environments may be challenging. 341 Therefore, a URI format needs to be described which is able to 342 represent a resource without heavy reliance on a naming 343 infrastructure, such as DNS. 345 4.2. URI format 347 To meet the design considerations previously discussed, the transport 348 information is expressed as part of the URI scheme component. This 349 is performed by minting new schemes for alternative transports using 350 the form "coap+", where the name of the transport is 351 clearly and unambiguously described. Each scheme name formed in this 352 manner is used to differentiate the use of CoAP over an alternative 353 transport instead of the use of CoAP over UDP or DTLS. The endpoint 354 identifier, path and query components together with each scheme name 355 would be used to uniquely identify each resource. 357 Examples of such URIs are: 359 o coap+tcp://[2001:db8::1]:5683/sensors/temperature for using CoAP 360 over TCP 362 o coap+sms://0015105550101/sensors/temperature for using CoAP over 363 SMS or USSD with the endpoint identifier being a telephone 364 subscriber number 366 o coap+ws://www.example.com/sensors/temperature for using CoAP over 367 WebSockets 369 A URI of this format to distinguish transport types is simple to 370 understand and not dissimilar to the CoAP URI format. As the usage 371 of each alternative transport results in an entirely new scheme, IANA 372 intervention is required for the registration of each scheme name. 373 The registration process follows the guidelines stipulated in 374 [I-D.ietf-appsawg-uri-scheme-reg], particularly where permanent URI 375 scheme registration is concerned. 377 It is also entirely possible for each new scheme to specify its own 378 rules for how resource and transport endpoint information can be 379 presented. However, the URIs and resource representations arising 380 from their usage should meet the URI design considerations and 381 guidelines mentioned in this document. In addition, each new 382 transport being defined should take into consideration the various 383 transport-level properties that can have an impact on how CoAP 384 messages are conveyed as payload. This is elaborated on in the next 385 section. 387 5. Alternative Transport Analysis and Properties 389 In this section the various characteristics of alternative transports 390 for successfully supporting various kinds of functionality for CoAP 391 are considered. CoAP factors lossiness, unreliability, small packet 392 sizes and connection statelessness into its protocol logic. General 393 transport differences and their impact on carrying CoAP messages here 394 are discussed. Note that Properties 1, 2, and 3 are related. 396 Property 1: Uniqueness of an end-point identifier. 398 Transport protocols providing non-unique end-point IDs for nodes may 399 only convey a subset of the CoAP functionality. Such nodes may only 400 serve as CoAP servers that announce data at specific intervals to a 401 pre-specified end point, or to a shared medium. 403 Property 2: Unidirectional or bidirectional CoAP communication 404 support. 406 This refers to the ability of the CoAP end-point to use a single 407 transport channel for both request and response messages. Depending 408 on the scenario, having a unidirectional transport layer would mean 409 the CoAP end-point might utilise it only for outgoing data or 410 incoming data. Should both functionalities be needed, 2 411 unidirectional transport channels would be necessary. 413 Property 3: 1:N communication support. 415 This refers to the ability of the transport protocol to support 416 broadcast and multicast communication. CoAP's request/response 417 behaviour depends on unicast messaging. Group communication in CoAP 418 is bound to using multicasting. Therefore a protocol such as TCP 419 would be ill-suited for group communications using multicast. 420 Anycast support, where a message is sent to a well defined 421 destination address to which several nodes belong, on the other hand, 422 is supported by TCP. 424 Property 4: Transport-level reliability. 426 This refers to the ability of the transport protocol to provide a 427 guarantee of reliability against packet loss, ensuring ordered packet 428 delivery and having error control. When CoAP Request and Response 429 messages are delivered over such transports, the CoAP implementations 430 elide certain fields in the packet header. As an example, if the 431 usage of a connection-oriented transport renders it unnecessary to 432 specify the various CoAP message types, the Type field can be elided. 433 For some connection-oriented transports, such as WebSockets, the 434 version of CoAP being used can be negotiated during the opening 435 transfer. Consequently, the Version field in CoAP packets can also 436 be elided. 438 Property 5: Message encoding. 440 While parts of the CoAP payload are human readable or are transmitted 441 in XML, JSON or SenML format, CoAP is essentially a low overhead 442 binary protocol. Efficient transmission of such packets would 443 therefore be met with a transport offering binary encoding support, 444 although techniques exist in allowing binary payloads to be 445 transferred over text-based transport protocols such as base-64 446 encoding. A fuller discussion about performing CoAP message encoding 447 for SMS can be found in Appendix A.5 of [I-D.bormann-coap-misc] 449 Property 6: Network byte order. 451 CoAP, as well as transports based on the IP stack use a Big Endian 452 byte order for transmitting packets over the air or wire, while 453 transports based on Bluetooth and Zigbee prefer Little Endian byte 454 ordering for packet fields and transmission. Any CoAP implementation 455 that potentially uses multiple transports has to ensure correct byte 456 ordering for the transport used. 458 Property 7: MTU correlation with CoAP PDU size. 460 Section 4.6 of [RFC7252] discusses the avoidance of IP fragmentation 461 by ensuring CoAP message fit into a single UDP datagram. End-points 462 on constrained networks using 6LoWPAN may use blockwise transfers to 463 accommodate even smaller packet sizes to avoid fragmentation. The 464 MTU sizes for Bluetooth Low Energy as well as Classic Bluetooth are 465 provided in Section 2.4 of [I-D.ietf-6lo-btle]. Transport MTU 466 correlation with CoAP messages helps ensure minimal to no 467 fragmentation at the transport layer. On the other hand, allowing a 468 CoAP message to be delivered using a delay-tolerant transport service 469 such as the Bundle Protocol [RFC5050] would imply that the CoAP 470 message may be fragmented (or reconstituted) along various nodes in 471 the DTN as various sized bundles and bundle fragments. 473 Property 8: Framing 475 When using CoAP over a streaming transport protocol such as TCP, as 476 opposed to datagram based protocols, care must be observed in 477 preserving message boundaries. Commonly applied techniques at the 478 transport level include the use of delimiting characters for this 479 purpose as well as message framing and length prefixing. 481 Property 9: Transport latency. 483 A confirmable CoAP request would be retransmitted by a CoAP end-point 484 if a response is not obtained within a certain time. A CoAP end- 485 point registering to a Resource Directory uses a POST message that 486 could include a lifetime value. A sleepy end-point similarly uses a 487 lifetime value to indicate the freshness of the data to a CoAP Mirror 488 Server. Care needs to be exercised to ensure the latency of the 489 transport being used to carry CoAP messages is small enough not to 490 interfere with these values for the proper operation of these 491 functionalities. 493 Property 10: Connection Management. 495 A CoAP endpoint using a connection-oriented transport should be 496 responsible for proper connection establishment prior to sending a 497 CoAP Request message. Both communicating endpoints may monitor the 498 connection health during the Data Transfer phase. Finally, once data 499 transfer is complete, at least one end point should perform 500 connection teardown gracefully. 502 6. IANA Considerations 504 This memo includes no request to IANA. 506 7. Security Considerations 508 While no new security risks are envisaged simply from the 509 introduction of support for alternative transports, end-applications 510 and CoAP implementations should take note if certain transports 511 require privacy trade-offs that may arise if identifiers such as MAC 512 addresses or phone numbers are made public in addition to FQDNs. 514 8. Acknowledgements 516 Feedback, ideas and ongoing discussions with Klaus Hartke, Martin 517 Thomson, Mark Nottingham, Dave Thaler, Graham Klyne, Carsten Bormann, 518 Markus Becker and Golnaz Karbaschi provided useful insights and ideas 519 for this work. 521 9. References 523 9.1. Normative References 525 [I-D.ietf-appsawg-uri-scheme-reg] 526 Thaler, D., Hansen, T., Hardie, T., and L. Masinter, 527 "Guidelines and Registration Procedures for New URI 528 Schemes", draft-ietf-appsawg-uri-scheme-reg-01 (work in 529 progress), July 2014. 531 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 532 Resource Identifier (URI): Generic Syntax", STD 66, RFC 533 3986, January 2005. 535 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 536 Constrained-Node Networks", RFC 7228, May 2014. 538 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 539 Application Protocol (CoAP)", RFC 7252, June 2014. 541 9.2. Informative References 543 [BTCorev4.1] 544 BLUETOOTH Special Interest Group, "BLUETOOTH Specification 545 Version 4.1", December 2013. 547 [I-D.becker-core-coap-sms-gprs] 548 Becker, M., Li, K., Poetsch, T., and K. Kuladinithi, 549 "Transport of CoAP over SMS", draft-becker-core-coap-sms- 550 gprs-04 (work in progress), August 2013. 552 [I-D.bormann-coap-misc] 553 Bormann, C. and K. Hartke, "Miscellaneous additions to 554 CoAP", draft-bormann-coap-misc-26 (work in progress), 555 December 2013. 557 [I-D.bormann-core-coap-tcp] 558 Bormann, C., "A TCP transport for CoAP", draft-bormann- 559 core-coap-tcp-01 (work in progress), July 2014. 561 [I-D.ietf-6lo-btle] 562 Nieminen, J., Savolainen, T., Isomaki, M., Patil, B., 563 Shelby, Z., and C. Gomez, "Transmission of IPv6 Packets 564 over BLUETOOTH(R) Low Energy", draft-ietf-6lo-btle-02 565 (work in progress), June 2014. 567 [I-D.ietf-core-groupcomm] 568 Rahman, A. and E. Dijk, "Group Communication for CoAP", 569 draft-ietf-core-groupcomm-20 (work in progress), July 570 2014. 572 [I-D.ietf-core-observe] 573 Hartke, K., "Observing Resources in CoAP", draft-ietf- 574 core-observe-14 (work in progress), June 2014. 576 [I-D.jimenez-p2psip-coap-reload] 577 Jimenez, J., Lopez-Vega, J., Maenpaa, J., and G. 578 Camarillo, "A Constrained Application Protocol (CoAP) 579 Usage for REsource LOcation And Discovery (RELOAD)", 580 draft-jimenez-p2psip-coap-reload-04 (work in progress), 581 July 2014. 583 [I-D.savolainen-core-coap-websockets] 584 Savolainen, T., Hartke, K., and B. Silverajan, "CoAP over 585 WebSockets", draft-savolainen-core-coap-websockets-02 586 (work in progress), April 2014. 588 [I-D.vial-core-mirror-server] 589 Vial, M., "CoRE Mirror Server", draft-vial-core-mirror- 590 server-01 (work in progress), April 2013. 592 [OMALWM2M] 593 Open Mobile Alliance (OMA), "Lightweight Machine to 594 Machine Technical Specification", 2013. 596 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 597 Requirement Levels", BCP 14, RFC 2119, March 1997. 599 [RFC2609] Guttman, E., Perkins, C., and J. Kempf, "Service Templates 600 and Service: Schemes", RFC 2609, June 1999. 602 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 604 [RFC4838] Cerf, V., Burleigh, S., Hooke, A., Torgerson, L., Durst, 605 R., Scott, K., Fall, K., and H. Weiss, "Delay-Tolerant 606 Networking Architecture", RFC 4838, April 2007. 608 [RFC5050] Scott, K. and S. Burleigh, "Bundle Protocol 609 Specification", RFC 5050, November 2007. 611 [RFC5092] Melnikov, A. and C. Newman, "IMAP URL Scheme", RFC 5092, 612 November 2007. 614 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 615 6455, December 2011. 617 [RFC6568] Kim, E., Kaspar, D., and JP. Vasseur, "Design and 618 Application Spaces for IPv6 over Low-Power Wireless 619 Personal Area Networks (6LoWPANs)", RFC 6568, April 2012. 621 [RFC6733] Fajardo, V., Arkko, J., Loughney, J., and G. Zorn, 622 "Diameter Base Protocol", RFC 6733, October 2012. 624 [WWWArchv1] 625 http://www.w3.org/TR/webarch/#uri-aliases, "Architecture 626 of the World Wide Web, Volume One", December 2004. 628 Appendix A. Expressing transport in the URI in other ways 630 Other means of indicating the transport as a distinguishable 631 component within the CoAP URI are possible, but have been deemed 632 unsuitable by not meeting the design considerations listed, or are 633 incompatible with existing practices outlined in [RFC7252]. They are 634 however, retained in this section for historical documentation and 635 completeness. 637 A.1. Transport information as part of the URI authority 639 A single URI scheme, "coap-at" can be introduced, as part of an 640 absolute URI which expresses the transport information within the 641 authority component. One approach is to structure the component with 642 a transport prefix to the endpoint identifier and a delimiter, such 643 as "-endpoint_identifier". 645 Examples of resulting URIs are: 647 o coap-at://tcp-server.example.com/sensors/temperature 649 o coap-at://sms-0015105550101/sensors/temperature 651 An implementation note here is that some generic URI parsers will 652 fail when encountering a URI such as "coap-at://tcp- 653 [2001:db8::1]/sensors/temperature". Consequently, an equivalent, but 654 parseable URI from the ip6.arpa domain needs to be formulated 655 instead. For [2001:db8::1] using TCP, this would result in the 656 following URL: 658 coap-at://tcp-1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0 659 .1.0.0.2.ip6.arpa:5683/sensors/temperature 661 Usage of an IPv4-mapped IPv6 address such as [::ffff.192.100.0.1] can 662 similarly be expressed with a URI from the ip6.arpa domain. 664 This URI format allows the usage of a single scheme to represent 665 multiple types of transport end-points. Consequently, it requires 666 consistency in ensuring how various transport-specific endpoints are 667 identified, as a single URI format is used. Attention must be paid 668 towards the syntax rules and encoding for the URI host component. 669 Additionally, against a base URI of the form "coap-at://tcp- 670 server.example.com/sensors/temperature", resolving a relative 671 reference, such as "//example.net/sensors/temperature" would result 672 in the target URI "coap-at://example.net/sensors/temperature", in 673 which transport information is lost. 675 A.1.1. Usage of DNS records 677 DNS names can be used instead of IPv6 address literals to mitigate 678 lengthy URLs referring to the ip6.arpa domain, if usage of DNS is 679 possible. 681 DNS SRV records can also be employed to formulate a URL such as: 683 coap-at://srv-_coap._tcp.example.com/sensors/temperature 685 in which the "srv" prefix is used to indicate that a DNS SRV lookup 686 should be used for _coap._tcp.example.com, where usage of CoAP over 687 TCP is specified for example.com, and is eventually resolved to a 688 numerical IPv4 or IPv6 address. 690 A.2. Making CoAP Resources Available over Multiple Transports 692 The CoAP URI used thus far is as follows: 694 URI = scheme ":" hier-part [ "?" query ] 695 hier-part = "//" authority path-abempty 697 A new URI format could be introduced, that does not possess an 698 "authority" component, and instead defining "hier-part" to instead 699 use another component, "path-rootless", as specified by RFC3986 700 [RFC3986]. The partial ABNF format of this URI would then be: 702 URI = scheme ":" hier-part [ "?" query ] 703 hier-part = path-rootless 704 path-rootless = segment-nz *( "/" segment ) 706 The full syntax of "path-rootless" is described in [RFC3986]. A 707 generic URI defined this way would conform to the syntax of 708 [RFC3986], while the path component can be treated as an opaque 709 string to indicate transport types, endpoints as well as paths to 710 CoAP resources. A single scheme can similarly be used. 712 A constrained node that is capable of communicating over several 713 types of transports (such as UDP, TCP and SMS) would be able to 714 convey a single CoAP resource over multiple transports. This is also 715 beneficial for nodes performing caching and proxying from one type of 716 transport to another. 718 Requesting and retrieving the same CoAP resource representation over 719 multiple transports could be rendered possible by prefixing the 720 transport type and endpoint identifier information to the CoAP URI. 721 This would result in the following example representation: 723 coap-at:tcp://example.com?coap://example.com/sensors/temperature 724 \_______ ______/ \________________ __________________/ 725 \/ \/ 726 Transport-specific CoAP Resource 727 Prefix 729 Figure 2: Prefixing a CoAP URI with TCP transport 731 Such a representation would result in the URI being decomposed into 732 its constituent components, with the CoAP resource residing within 733 the query component as follows: 735 Scheme: coap-at 737 Path: tcp://example.com 739 Query: coap://example.com/sensors/temperature 741 The same CoAP resource, if requested over a WebSocket transport, 742 would result the following URI: 744 coap-at:ws://example.com/endpoint?coap://example.com/sensors/temperature 745 \___________ __________/ \_______________ ___________________/ 746 \/ \/ 747 Transport-specific CoAP Resource 748 Prefix 750 Figure 3: Prefixing a CoAP URI with WebSocket transport 752 While the transport prefix changes, the CoAP resource representation 753 remains the same in the query component: 755 Scheme: coap-at 757 Path: ws://example.com/endpoint 759 Query: coap://example.com/sensors/temperature 761 The URI format described here overcomes URI aliasing [WWWArchv1] when 762 multiple transports are used, by ensuring each CoAP resource 763 representation remains the same, but is prefixed with different 764 transports. However, against a base URI of this format, resolving 765 relative references of the form "//example.net/sensors/temperature" 766 and "/sensor2/temperature" would again result in target URIs which 767 lose transport-specific information. 769 Implementation note: While square brackets are disallowed within the 770 path component, the '[' and ']' characters needed to enclose a 771 literal IPv6 address can be percent-encoded into their respective 772 equivalents. The ':' character does not need to be percent-encoded. 773 This results in a significantly simpler URI string compared to 774 section 2.2, particularly for compressed IPv6 addresses. 775 Additionally, the URI format can be used to specify other similar 776 address families and formats, such as Bluetooth addresses 777 [BTCorev4.1]. 779 A.3. Transport as part of a 'service:' URL scheme 781 The "service:" URL scheme name was introduced in [RFC2609] and forms 782 the basis of service description used primarily by the Service 783 Location Protocol. An abstract service type URI would have the form 785 "service::" 787 where refers to a service type name that can be 788 associated with a variety of protocols, while the 789 then providing the specific details of the protocol used, authority 790 and other URI components. 792 Adopting the "service:" URL scheme to describe CoAP usage over 793 alternative transports would be rather trivial. To use a previous 794 example, a CoAP service to discover a Resource Directory and its base 795 RD resource using TCP would take the form 797 service:coap:tcp://host.example.com/.well-known/core?rt=core-rd 799 The syntax of the "service:" URL scheme differs from the generic URI 800 syntax and therefore such a representation should be treated as an 801 opaque URI as Section 2.1 of [RFC2609] recommends. 803 Authors' Addresses 805 Bilhanan Silverajan 806 Tampere University of Technology 807 Korkeakoulunkatu 10 808 FI-33720 Tampere 809 Finland 811 Email: bilhanan.silverajan@tut.fi 813 Teemu Savolainen 814 Nokia 815 Hermiankatu 12 D 816 FI-33720 Tampere 817 Finland 819 Email: teemu.savolainen@nokia.com