idnits 2.17.1 draft-silverajan-core-coap-alternative-transports-05.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 (June 27, 2014) is 3585 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'I-D.ietf-core-groupcomm' is defined on line 575, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 604, but no explicit reference was found in the text == Unused Reference: 'RFC6455' is defined on line 622, but no explicit reference was found in the text == Unused Reference: 'RFC6568' is defined on line 625, but no explicit reference was found in the text == Unused Reference: 'RFC6733' is defined on line 629, but no explicit reference was found in the text == Outdated reference: A later version (-06) exists of draft-ietf-appsawg-uri-scheme-reg-00 == 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 (-01) exists of draft-bormann-core-coap-tcp-00 == 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-19 == Outdated reference: A later version (-16) exists of draft-ietf-core-observe-13 == Outdated reference: A later version (-10) exists of draft-jimenez-p2psip-coap-reload-03 == 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 (~~), 16 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: December 29, 2014 Nokia 6 June 27, 2014 8 CoAP Communication with Alternative Transports 9 draft-silverajan-core-coap-alternative-transports-05 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 December 29, 2014. 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 . . . . . . . . . . . . . . . . . . . . . 12 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 12 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 16 83 A.3. Transport as part of a 'service:' URL scheme . . . . . . 18 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 Note: The specific delimiting character which serves to separate the 370 "coap" prefix from the transport information, is still to be decided 371 upon, and depends on progress within the Applications Area Working 372 Group on URI scheme registration procedures in 373 [I-D.ietf-appsawg-uri-scheme-reg]. Also, expressing target address 374 formats other than IPv6 literal addresses with '[' and ']' characters 375 within this URI format, such as Bluetooth, is as yet unresolved. 377 A URI of this format to distinguish transport types is simple to 378 understand and not dissimilar to the CoAP URI format. As the usage 379 of each alternative transport results in an entirely new scheme, IANA 380 intervention is required for the registration of each scheme name. 381 The registration process follows the guidelines stipulated in 382 [I-D.ietf-appsawg-uri-scheme-reg], particularly where permanent URI 383 scheme registration is concerned. 385 It is also entirely possible for each new scheme to specify its own 386 rules for how resource and transport endpoint information can be 387 presented. However, the URIs and resource representations arising 388 from their usage should meet the URI design considerations and 389 guidelines mentioned in this document. In addition, each new 390 transport being defined should take into consideration the various 391 transport-level properties that can have an impact on how CoAP 392 messages are conveyed as payload. This is elaborated on in the next 393 section. 395 5. Alternative Transport Analysis and Properties 397 In this section the various characteristics of alternative transports 398 for successfully supporting various kinds of functionality for CoAP 399 are considered. CoAP factors lossiness, unreliability, small packet 400 sizes and connection statelessness into its protocol logic. General 401 transport differences and their impact on carrying CoAP messages here 402 are discussed. Note that Properties 1, 2, and 3 are related. 404 Property 1: Uniqueness of an end-point identifier. 406 Transport protocols providing non-unique end-point IDs for nodes may 407 only convey a subset of the CoAP functionality. Such nodes may only 408 serve as CoAP servers that announce data at specific intervals to a 409 pre-specified end point, or to a shared medium. 411 Property 2: Unidirectional or bidirectional CoAP communication 412 support. 414 This refers to the ability of the CoAP end-point to use a single 415 transport channel for both request and response messages. Depending 416 on the scenario, having a unidirectional transport layer would mean 417 the CoAP end-point might utilise it only for outgoing data or 418 incoming data. Should both functionalities be needed, 2 419 unidirectional transport channels would be necessary. 421 Property 3: 1:N communication support. 423 This refers to the ability of the transport protocol to support 424 broadcast and multicast communication. CoAP's request/response 425 behaviour depends on unicast messaging. Group communication in CoAP 426 is bound to using multicasting. Therefore a protocol such as TCP 427 would be ill-suited for group communications using multicast. 428 Anycast support, where a message is sent to a well defined 429 destination address to which several nodes belong, on the other hand, 430 is supported by TCP. 432 Property 4: Transport-level reliability. 434 This refers to the ability of the transport protocol to provide a 435 guarantee of reliability against packet loss, ensuring ordered packet 436 delivery and having error control. When CoAP Request and Response 437 messages are delivered over such transports, the CoAP implementations 438 elide certain fields in the packet header. As an example, if the 439 usage of a connection-oriented transport renders it unnecessary to 440 specify the various CoAP message types, the Type field can be elided. 441 For some connection-oriented transports, such as WebSockets, the 442 version of CoAP being used can be negotiated during the opening 443 transfer. Consequently, the Version field in CoAP packets can also 444 be elided. 446 Property 5: Message encoding. 448 While parts of the CoAP payload are human readable or are transmitted 449 in XML, JSON or SenML format, CoAP is essentially a low overhead 450 binary protocol. Efficient transmission of such packets would 451 therefore be met with a transport offering binary encoding support, 452 although techniques exist in allowing binary payloads to be 453 transferred over text-based transport protocols such as base-64 454 encoding. A fuller discussion about performing CoAP message encoding 455 for SMS can be found in Appendix A.5 of [I-D.bormann-coap-misc] 457 Property 6: Network byte order. 459 CoAP, as well as transports based on the IP stack use a Big Endian 460 byte order for transmitting packets over the air or wire, while 461 transports based on Bluetooth and Zigbee prefer Little Endian byte 462 ordering for packet fields and transmission. Any CoAP implementation 463 that potentially uses multiple transports has to ensure correct byte 464 ordering for the transport used. 466 Property 7: MTU correlation with CoAP PDU size. 468 Section 4.6 of [RFC7252] discusses the avoidance of IP fragmentation 469 by ensuring CoAP message fit into a single UDP datagram. End-points 470 on constrained networks using 6LoWPAN may use blockwise transfers to 471 accommodate even smaller packet sizes to avoid fragmentation. The 472 MTU sizes for Bluetooth Low Energy as well as Classic Bluetooth are 473 provided in Section 2.4 of [I-D.ietf-6lo-btle]. Transport MTU 474 correlation with CoAP messages helps ensure minimal to no 475 fragmentation at the transport layer. On the other hand, allowing a 476 CoAP message to be delivered using a delay-tolerant transport service 477 such as the Bundle Protocol [RFC5050] would imply that the CoAP 478 message may be fragmented (or reconstituted) along various nodes in 479 the DTN as various sized bundles and bundle fragments. 481 Property 8: Framing 483 When using CoAP over a streaming transport protocol such as TCP, as 484 opposed to datagram based protocols, care must be observed in 485 preserving message boundaries. Commonly applied techniques at the 486 transport level include the use of delimiting characters for this 487 purpose as well as message framing and length prefixing. 489 Property 9: Transport latency. 491 A confirmable CoAP request would be retransmitted by a CoAP end-point 492 if a response is not obtained within a certain time. A CoAP end- 493 point registering to a Resource Directory uses a POST message that 494 could include a lifetime value. A sleepy end-point similarly uses a 495 lifetime value to indicate the freshness of the data to a CoAP Mirror 496 Server. Care needs to be exercised to ensure the latency of the 497 transport being used to carry CoAP messages is small enough not to 498 interfere with these values for the proper operation of these 499 functionalities. 501 Property 10: Connection Management. 503 A CoAP endpoint using a connection-oriented transport should be 504 responsible for proper connection establishment prior to sending a 505 CoAP Request message. Both communicating endpoints may monitor the 506 connection health during the Data Transfer phase. Finally, once data 507 transfer is complete, at least one end point should perform 508 connection teardown gracefully. 510 6. IANA Considerations 512 This memo includes no request to IANA. 514 7. Security Considerations 516 While no new security risks are envisaged simply from the 517 introduction of support for alternative transports, end-applications 518 and CoAP implementations should take note if certain transports 519 require privacy trade-offs that may arise if identifiers such as MAC 520 addresses or phone numbers are made public in addition to FQDNs. 522 8. Acknowledgements 524 Feedback, ideas and ongoing discussions with Klaus Hartke, Martin 525 Thomson, Mark Nottingham, Dave Thaler, Graham Klyne, Carsten Bormann, 526 Markus Becker and Golnaz Karbaschi provided useful insights and ideas 527 for this work. 529 9. References 531 9.1. Normative References 533 [I-D.ietf-appsawg-uri-scheme-reg] 534 Thaler, D., Hansen, T., Hardie, T., and L. Masinter, 535 "Guidelines and Registration Procedures for New URI 536 Schemes", draft-ietf-appsawg-uri-scheme-reg-00 (work in 537 progress), March 2014. 539 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 540 Resource Identifier (URI): Generic Syntax", STD 66, RFC 541 3986, January 2005. 543 [RFC7228] Bormann, C., Ersue, M., and A. Keranen, "Terminology for 544 Constrained-Node Networks", RFC 7228, May 2014. 546 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 547 Application Protocol (CoAP)", RFC 7252, June 2014. 549 9.2. Informative References 551 [BTCorev4.1] 552 BLUETOOTH Special Interest Group, "BLUETOOTH Specification 553 Version 4.1", December 2013. 555 [I-D.becker-core-coap-sms-gprs] 556 Becker, M., Li, K., Poetsch, T., and K. Kuladinithi, 557 "Transport of CoAP over SMS", draft-becker-core-coap-sms- 558 gprs-04 (work in progress), August 2013. 560 [I-D.bormann-coap-misc] 561 Bormann, C. and K. Hartke, "Miscellaneous additions to 562 CoAP", draft-bormann-coap-misc-26 (work in progress), 563 December 2013. 565 [I-D.bormann-core-coap-tcp] 566 Bormann, C., "A TCP transport for CoAP", draft-bormann- 567 core-coap-tcp-00 (work in progress), July 2013. 569 [I-D.ietf-6lo-btle] 570 Nieminen, J., Savolainen, T., Isomaki, M., Patil, B., 571 Shelby, Z., and C. Gomez, "Transmission of IPv6 Packets 572 over BLUETOOTH(R) Low Energy", draft-ietf-6lo-btle-02 573 (work in progress), June 2014. 575 [I-D.ietf-core-groupcomm] 576 Rahman, A. and E. Dijk, "Group Communication for CoAP", 577 draft-ietf-core-groupcomm-19 (work in progress), June 578 2014. 580 [I-D.ietf-core-observe] 581 Hartke, K., "Observing Resources in CoAP", draft-ietf- 582 core-observe-13 (work in progress), April 2014. 584 [I-D.jimenez-p2psip-coap-reload] 585 Jimenez, J., Lopez-Vega, J., Maenpaa, J., and G. 586 Camarillo, "A Constrained Application Protocol (CoAP) 587 Usage for REsource LOcation And Discovery (RELOAD)", 588 draft-jimenez-p2psip-coap-reload-03 (work in progress), 589 February 2013. 591 [I-D.savolainen-core-coap-websockets] 592 Savolainen, T., Hartke, K., and B. Silverajan, "CoAP over 593 WebSockets", draft-savolainen-core-coap-websockets-02 594 (work in progress), April 2014. 596 [I-D.vial-core-mirror-server] 597 Vial, M., "CoRE Mirror Server", draft-vial-core-mirror- 598 server-01 (work in progress), April 2013. 600 [OMALWM2M] 601 Open Mobile Alliance (OMA), "Lightweight Machine to 602 Machine Technical Specification", 2013. 604 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 605 Requirement Levels", BCP 14, RFC 2119, March 1997. 607 [RFC2609] Guttman, E., Perkins, C., and J. Kempf, "Service Templates 608 and Service: Schemes", RFC 2609, June 1999. 610 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 612 [RFC4838] Cerf, V., Burleigh, S., Hooke, A., Torgerson, L., Durst, 613 R., Scott, K., Fall, K., and H. Weiss, "Delay-Tolerant 614 Networking Architecture", RFC 4838, April 2007. 616 [RFC5050] Scott, K. and S. Burleigh, "Bundle Protocol 617 Specification", RFC 5050, November 2007. 619 [RFC5092] Melnikov, A. and C. Newman, "IMAP URL Scheme", RFC 5092, 620 November 2007. 622 [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 623 6455, December 2011. 625 [RFC6568] Kim, E., Kaspar, D., and JP. Vasseur, "Design and 626 Application Spaces for IPv6 over Low-Power Wireless 627 Personal Area Networks (6LoWPANs)", RFC 6568, April 2012. 629 [RFC6733] Fajardo, V., Arkko, J., Loughney, J., and G. Zorn, 630 "Diameter Base Protocol", RFC 6733, October 2012. 632 [WWWArchv1] 633 http://www.w3.org/TR/webarch/#uri-aliases, "Architecture 634 of the World Wide Web, Volume One", December 2004. 636 Appendix A. Expressing transport in the URI in other ways 638 Other means of indicating the transport as a distinguishable 639 component within the CoAP URI are possible, but have been deemed 640 unsuitable by not meeting the design considerations listed, or are 641 incompatible with existing practices outlined in [RFC7252]. They are 642 however, retained in this section for historical documentation and 643 completeness. 645 A.1. Transport information as part of the URI authority 647 A single URI scheme, "coap-at" can be introduced, as part of an 648 absolute URI which expresses the transport information within the 649 authority component. One approach is to structure the component with 650 a transport prefix to the endpoint identifier and a delimiter, such 651 as "-endpoint_identifier". 653 Examples of resulting URIs are: 655 o coap-at://tcp-server.example.com/sensors/temperature 657 o coap-at://sms-0015105550101/sensors/temperature 659 An implementation note here is that some generic URI parsers will 660 fail when encountering a URI such as "coap-at://tcp- 661 [2001:db8::1]/sensors/temperature". Consequently, an equivalent, but 662 parseable URI from the ip6.arpa domain needs to be formulated 663 instead. For [2001:db8::1] using TCP, this would result in the 664 following URL: 666 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 667 .1.0.0.2.ip6.arpa:5683/sensors/temperature 669 Usage of an IPv4-mapped IPv6 address such as [::ffff.192.100.0.1] can 670 similarly be expressed with a URI from the ip6.arpa domain. 672 This URI format allows the usage of a single scheme to represent 673 multiple types of transport end-points. Consequently, it requires 674 consistency in ensuring how various transport-specific endpoints are 675 identified, as a single URI format is used. Attention must be paid 676 towards the syntax rules and encoding for the URI host component. 677 Additionally, against a base URI of the form "coap-at://tcp- 678 server.example.com/sensors/temperature", resolving a relative 679 reference, such as "//example.net/sensors/temperature" would result 680 in the target URI "coap-at://example.net/sensors/temperature", in 681 which transport information is lost. 683 A.1.1. Usage of DNS records 685 DNS names can be used instead of IPv6 address literals to mitigate 686 lengthy URLs referring to the ip6.arpa domain, if usage of DNS is 687 possible. 689 DNS SRV records can also be employed to formulate a URL such as: 691 coap-at://srv-_coap._tcp.example.com/sensors/temperature 693 in which the "srv" prefix is used to indicate that a DNS SRV lookup 694 should be used for _coap._tcp.example.com, where usage of CoAP over 695 TCP is specified for example.com, and is eventually resolved to a 696 numerical IPv4 or IPv6 address. 698 A.2. Making CoAP Resources Available over Multiple Transports 700 The CoAP URI used thus far is as follows: 702 URI = scheme ":" hier-part [ "?" query ] 703 hier-part = "//" authority path-abempty 705 A new URI format could be introduced, that does not possess an 706 "authority" component, and instead defining "hier-part" to instead 707 use another component, "path-rootless", as specified by RFC3986 708 [RFC3986]. The partial ABNF format of this URI would then be: 710 URI = scheme ":" hier-part [ "?" query ] 711 hier-part = path-rootless 712 path-rootless = segment-nz *( "/" segment ) 714 The full syntax of "path-rootless" is described in [RFC3986]. A 715 generic URI defined this way would conform to the syntax of 716 [RFC3986], while the path component can be treated as an opaque 717 string to indicate transport types, endpoints as well as paths to 718 CoAP resources. A single scheme can similarly be used. 720 A constrained node that is capable of communicating over several 721 types of transports (such as UDP, TCP and SMS) would be able to 722 convey a single CoAP resource over multiple transports. This is also 723 beneficial for nodes performing caching and proxying from one type of 724 transport to another. 726 Requesting and retrieving the same CoAP resource representation over 727 multiple transports could be rendered possible by prefixing the 728 transport type and endpoint identifier information to the CoAP URI. 729 This would result in the following example representation: 731 coap-at:tcp://example.com?coap://example.com/sensors/temperature 732 \_______ ______/ \________________ __________________/ 733 \/ \/ 734 Transport-specific CoAP Resource 735 Prefix 737 Figure 2: Prefixing a CoAP URI with TCP transport 739 Such a representation would result in the URI being decomposed into 740 its constituent components, with the CoAP resource residing within 741 the query component as follows: 743 Scheme: coap-at 745 Path: tcp://example.com 747 Query: coap://example.com/sensors/temperature 749 The same CoAP resource, if requested over a WebSocket transport, 750 would result the following URI: 752 coap-at:ws://example.com/endpoint?coap://example.com/sensors/temperature 753 \___________ __________/ \_______________ ___________________/ 754 \/ \/ 755 Transport-specific CoAP Resource 756 Prefix 758 Figure 3: Prefixing a CoAP URI with WebSocket transport 760 While the transport prefix changes, the CoAP resource representation 761 remains the same in the query component: 763 Scheme: coap-at 765 Path: ws://example.com/endpoint 767 Query: coap://example.com/sensors/temperature 769 The URI format described here overcomes URI aliasing [WWWArchv1] when 770 multiple transports are used, by ensuring each CoAP resource 771 representation remains the same, but is prefixed with different 772 transports. However, against a base URI of this format, resolving 773 relative references of the form "//example.net/sensors/temperature" 774 and "/sensor2/temperature" would again result in target URIs which 775 lose transport-specific information. 777 Implementation note: While square brackets are disallowed within the 778 path component, the '[' and ']' characters needed to enclose a 779 literal IPv6 address can be percent-encoded into their respective 780 equivalents. The ':' character does not need to be percent-encoded. 781 This results in a significantly simpler URI string compared to 782 section 2.2, particularly for compressed IPv6 addresses. 784 Additionally, the URI format can be used to specify other similar 785 address families and formats, such as Bluetooth addresses 786 [BTCorev4.1]. 788 A.3. Transport as part of a 'service:' URL scheme 790 The "service:" URL scheme name was introduced in [RFC2609] and forms 791 the basis of service description used primarily by the Service 792 Location Protocol. An abstract service type URI would have the form 794 "service::" 796 where refers to a service type name that can be 797 associated with a variety of protocols, while the 798 then providing the specific details of the protocol used, authority 799 and other URI components. 801 Adopting the "service:" URL scheme to describe CoAP usage over 802 alternative transports would be rather trivial. To use a previous 803 example, a CoAP service to discover a Resource Directory and its base 804 RD resource using TCP would take the form 806 service:coap:tcp://host.example.com/.well-known/core?rt=core-rd 808 The syntax of the "service:" URL scheme differs from the generic URI 809 syntax and therefore such a representation should be treated as an 810 opaque URI as Section 2.1 of [RFC2609] recommends. 812 Authors' Addresses 814 Bilhanan Silverajan 815 Tampere University of Technology 816 Korkeakoulunkatu 10 817 FI-33720 Tampere 818 Finland 820 Email: bilhanan.silverajan@tut.fi 822 Teemu Savolainen 823 Nokia 824 Hermiankatu 12 D 825 FI-33720 Tampere 826 Finland 828 Email: teemu.savolainen@nokia.com