idnits 2.17.1 draft-ietf-rtcweb-ip-handling-08.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 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 1 instance of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 3, 2018) is 2155 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Obsolete informational reference (is this intentional?): RFC 4941 (Obsoleted by RFC 8981) -- Obsolete informational reference (is this intentional?): RFC 5245 (Obsoleted by RFC 8445, RFC 8839) -- Obsolete informational reference (is this intentional?): RFC 5389 (Obsoleted by RFC 8489) -- Obsolete informational reference (is this intentional?): RFC 5766 (Obsoleted by RFC 8656) -- Obsolete informational reference (is this intentional?): RFC 7230 (Obsoleted by RFC 9110, RFC 9112) Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Uberti 3 Internet-Draft Google 4 Intended status: Standards Track G. Shieh 5 Expires: December 5, 2018 Facebook 6 June 3, 2018 8 WebRTC IP Address Handling Requirements 9 draft-ietf-rtcweb-ip-handling-08 11 Abstract 13 This document provides information and requirements for how IP 14 addresses should be handled by WebRTC implementations. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at https://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on December 5, 2018. 33 Copyright Notice 35 Copyright (c) 2018 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (https://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 52 3. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 2 53 4. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 54 5. Detailed Design . . . . . . . . . . . . . . . . . . . . . . . 4 55 5.1. Principles . . . . . . . . . . . . . . . . . . . . . . . 4 56 5.2. Modes and Recommendations . . . . . . . . . . . . . . . . 5 57 6. Implementation Guidance . . . . . . . . . . . . . . . . . . . 6 58 6.1. Ensuring Normal Routing . . . . . . . . . . . . . . . . . 6 59 6.2. Determining Host Candidates . . . . . . . . . . . . . . . 7 60 7. Application Guidance . . . . . . . . . . . . . . . . . . . . 7 61 8. Security Considerations . . . . . . . . . . . . . . . . . . . 7 62 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 63 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 8 64 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 65 11.1. Normative References . . . . . . . . . . . . . . . . . . 8 66 11.2. Informative References . . . . . . . . . . . . . . . . . 8 67 Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 9 68 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11 70 1. Introduction 72 One of WebRTC's key features is its support of peer-to-peer 73 connections. However, when establishing such a connection, which 74 involves connection attempts from various IP addresses, WebRTC may 75 allow a web application to learn additional information about the 76 user compared to an application that only uses the Hypertext Transfer 77 Protocol (HTTP) [RFC7230]. This may be problematic in certain cases. 78 This document summarizes the concerns, and makes recommendations on 79 how WebRTC implementations should best handle the tradeoff between 80 privacy and media performance. 82 2. Terminology 84 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 85 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 86 document are to be interpreted as described in [RFC2119]. 88 3. Problem Statement 90 In order to establish a peer-to-peer connection, WebRTC 91 implementations use Interactive Connectivity Establishment (ICE) 92 [RFC5245], which attempts to discover multiple IP addresses using 93 techniques such as Session Traversal Utilities for NAT (STUN) 94 [RFC5389] and Traversal Using Relays around NAT (TURN) [RFC5766], and 95 then checks the connectivity of each local-address-remote-address 96 pair in order to select the best one. The addresses that are 97 collected usually consist of an endpoint's private physical/virtual 98 addresses and its public Internet addresses. 100 These addresses are exposed upwards to the web application, so that 101 they can be communicated to the remote endpoint for its checks. This 102 allows the application to learn more about the local network 103 configuration than it would from a typical HTTP scenario, in which 104 the web server would only see a single public Internet address, i.e., 105 the address from which the HTTP request was sent. 107 The information revealed falls into three categories: 109 1. If the client is multihomed, additional public IP addresses for 110 the client can be learned. In particular, if the client tries to 111 hide its physical location through a Virtual Private Network 112 (VPN), and the VPN and local OS support routing over multiple 113 interfaces (a "split-tunnel" VPN), WebRTC will discover not only 114 the public address for the VPN, but also the ISP public address 115 over which the VPN is running. 117 2. If the client is behind a Network Address Translator (NAT), the 118 client's private IP addresses, often [RFC1918] addresses, can be 119 learned. 121 3. If the client is behind a proxy (a client-configured "classical 122 application proxy", as defined in [RFC1919], Section 3), but 123 direct access to the Internet is permitted, WebRTC's STUN checks 124 will bypass the proxy and reveal the public IP address of the 125 client. This concern also applies to the "enterprise TURN 126 server" scenario described in [RFC7478], Section 2.3.5.1, if, as 127 above, direct Internet access is permitted. However, when the 128 term "proxy" is used in this document, it is always in reference 129 to an [RFC1919] proxy server. 131 Of these three concerns, #1 is the most significant, because for some 132 users, the purpose of using a VPN is for anonymity. However, 133 different VPN users will have different needs, and some VPN users 134 (e.g., corporate VPN users) may in fact prefer WebRTC to send media 135 traffic directly, i.e., not through the VPN. 137 #2 is considered to be a less significant concern, given that the 138 local address values often contain minimal information (e.g., 139 192.168.0.2), or have built-in privacy protection (e.g., the 140 [RFC4941] IPv6 addresses recommended by 141 [I-D.ietf-rtcweb-transports]). 143 #3 is the least common concern, as proxy administrators can already 144 control this behavior through organizational firewall policy, and 145 generally, forcing WebRTC traffic through a proxy server will have 146 negative effects on both the proxy and on media quality. 148 Note also that these concerns predate WebRTC; Adobe Flash Player has 149 provided similar functionality since the introduction of RTMFP 150 [RFC7016] in 2008. 152 4. Goals 154 WebRTC's support of secure peer-to-peer connections facilitates 155 deployment of decentralized systems, which can have privacy benefits. 156 As a result, we want to avoid blunt solutions that disable WebRTC or 157 make it significantly harder to use. This document takes a more 158 nuanced approach, with the following goals: 160 o Provide a framework for understanding the problem so that controls 161 might be provided to make different tradeoffs regarding 162 performance and privacy concerns with WebRTC. 164 o Using that framework, define settings that enable peer-to-peer 165 communications, each with a different balance between performance 166 and privacy. 168 o Finally, provide recommendations for default settings that provide 169 reasonable performance without also exposing addressing 170 information in a way that might violate user expectations. 172 5. Detailed Design 174 5.1. Principles 176 The key principles for our framework are stated below: 178 1. By default, WebRTC traffic should follow typical IP routing, 179 i.e., WebRTC should use the same interface used for HTTP traffic, 180 and only the system's 'typical' public addresses (or those of an 181 enterprise TURN server, if present) should be visible to the 182 application. However, in the interest of optimal media quality, 183 it should be possible to enable WebRTC to make use of all network 184 interfaces to determine the ideal route. 186 2. By default, WebRTC should be able to negotiate direct peer-to- 187 peer connections between endpoints (i.e., without traversing a 188 NAT or relay server), by providing a minimal set of local IP 189 addresses to the application for use in the ICE process. This 190 ensures that applications that need true peer-to-peer routing for 191 bandwidth or latency reasons can operate successfully. However, 192 it should be possible to suppress these addresses (with the 193 resultant impact on direct connections) if desired. 195 3. By default, WebRTC traffic should not be sent through application 196 proxy servers, due to the media quality problems associated with 197 sending WebRTC traffic over TCP, which is almost always used when 198 communicating with such proxies, as well as proxy performance 199 issues that may result from proxying WebRTC's long-lived, high- 200 bandwidth connections. However, it should be possible to force 201 WebRTC to send its traffic through a configured proxy if desired. 203 5.2. Modes and Recommendations 205 Based on these ideas, we define four specific modes of WebRTC 206 behavior, reflecting different media quality/privacy tradeoffs: 208 Mode 1: Enumerate all addresses: WebRTC MUST use all network 209 interfaces to attempt communication with STUN servers, TURN 210 servers, or peers. This will converge on the best media 211 path, and is ideal when media performance is the highest 212 priority, but it discloses the most information. 214 Mode 2: Default route + associated local addresses: WebRTC MUST 215 follow the kernel routing table rules, which will typically 216 cause media packets to take the same route as the 217 application's HTTP traffic. If an application TURN server 218 is present, the preferred route MUST be through this TURN 219 server. Once an interface has been chosen, the private IPv4 220 and IPv6 addresses associated with this interface MUST be 221 discovered and provided to the application. This ensures 222 that direct connections can still be established in this 223 mode. 225 Mode 3: Default route only: This is the the same as Mode 2, except 226 that the associated private addresses MUST NOT be provided; 227 the only IP addresses gathered are those discovered via 228 mechanisms like STUN and TURN (on the default route). This 229 may cause traffic to hairpin through a NAT, fall back to an 230 application TURN server, or fail altogether, with resulting 231 quality implications. 233 Mode 4: Force proxy: This is the same as Mode 3, but when the 234 application's HTTP traffic is sent through an application 235 proxy, WebRTC media traffic MUST also be proxied. If the 236 proxy does not support UDP (as is the case for all HTTP and 237 most SOCKS [RFC1928] proxies), or the WebRTC implementation 238 does not support UDP proxying, the use of UDP will be 239 disabled, and TCP will be used to send and receive media 240 through the proxy. Use of TCP will result in reduced media 241 quality, in addition to any performance considerations 242 associated with sending all WebRTC media through the proxy 243 server. 245 Mode 1 MUST only be used when user consent has been provided. The 246 details of this consent are left to the implementation; one potential 247 mechanism is to tie this consent to getUserMedia consent. 248 Alternatively, implementations can provide a specific mechanism to 249 obtain user consent. 251 In cases where user consent has not been obtained, Mode 2 SHOULD be 252 used. 254 These defaults provide a reasonable tradeoff that permits trusted 255 WebRTC applications to achieve optimal network performance, but gives 256 applications without consent (e.g., 1-way streaming or data channel 257 applications) only the minimum information needed to achieve direct 258 connections, as defined in Mode 2. However, implementations MAY 259 choose stricter modes if desired, e.g., if a user indicates they want 260 all WebRTC traffic to follow the default route. 262 Note that the suggested defaults can still be used even for 263 organizations that want all external WebRTC traffic to traverse a 264 proxy or enterprise TURN server, simply by setting an organizational 265 firewall policy that allows WebRTC traffic to only leave through the 266 proxy or TURN server. This provides a way to ensure the proxy or 267 TURN server is used for any external traffic, but still allows direct 268 connections (and, in the proxy case, avoids the performance issues 269 associated with forcing media through said proxy) for intra- 270 organization traffic. 272 6. Implementation Guidance 274 This section provides guidance to WebRTC implementations on how to 275 implement the policies described above. 277 6.1. Ensuring Normal Routing 279 When trying to follow typical IP routing, the simplest approach is to 280 bind the sockets used for peer-to-peer connections to the wildcard 281 addresses (0.0.0.0 for IPv4, :: for IPv6), which allows the OS to 282 route WebRTC traffic the same way as it would HTTP traffic. STUN and 283 TURN will work as usual, and host candidates can still be determined 284 as mentioned below. 286 6.2. Determining Host Candidates 288 When binding to a wildcard address, some extra work is needed to 289 determine a suitable host candidate, which we define as the source 290 address that would be used for any packets sent to the web 291 application host (assuming that UDP and TCP get the same routing). 292 Use of the web application host as a destination ensures the right 293 source address is selected, regardless of where the application 294 resides (e.g., on an intranet). 296 First, the appropriate remote IPv4/IPv6 address is obtained by 297 resolving the host component of the web application URI [RFC3986]. 298 If the client is behind a proxy and cannot resolve these IPs via DNS, 299 the address of the proxy can be used instead. Or, if the web 300 application was loaded from a file:// URI [RFC8089], rather than over 301 the network, the implementation can fall back to a well-known DNS 302 name or IP address. 304 Once a suitable remote IP has been determined, the implementation can 305 create a UDP socket, bind it to the appropriate wildcard address, and 306 tell it to connect to the remote IP. Generally, this results in the 307 socket being assigned a local address based on the kernel routing 308 table, without sending any packets over the network. 310 Finally, the socket can be queried using getsockname() or the 311 equivalent to determine the appropriate host candidate. 313 7. Application Guidance 315 The recommendations mentioned in this document may cause certain 316 WebRTC applications to malfunction. In order to be robust in all 317 scenarios, the following guidelines are provided for applications: 319 o Applications SHOULD deploy a TURN server with support for both UDP 320 and TCP connections to the server. This ensures that connectivity 321 can still be established, even when Mode 3 or 4 are in use, 322 assuming the TURN server can be reached. 324 o Applications SHOULD detect when they don't have access to the full 325 set of ICE candidates by checking for the presence of host 326 candidates. If no host candidates are present, Mode 3 or 4 above 327 is in use; this knowledge can be useful for diagnostic purposes. 329 8. Security Considerations 331 This document is entirely devoted to security considerations. 333 9. IANA Considerations 335 This document requires no actions from IANA. 337 10. Acknowledgements 339 Several people provided input into this document, including Bernard 340 Aboba, Harald Alvestrand, Ted Hardie, Matthew Kaufmann, Eric 341 Rescorla, Adam Roach, and Martin Thomson. 343 11. References 345 11.1. Normative References 347 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 348 Requirement Levels", BCP 14, RFC 2119, 349 DOI 10.17487/RFC2119, March 1997, 350 . 352 11.2. Informative References 354 [I-D.ietf-rtcweb-transports] 355 Alvestrand, H., "Transports for WebRTC", draft-ietf- 356 rtcweb-transports-17 (work in progress), October 2016. 358 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 359 and E. Lear, "Address Allocation for Private Internets", 360 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 361 . 363 [RFC1919] Chatel, M., "Classical versus Transparent IP Proxies", 364 RFC 1919, DOI 10.17487/RFC1919, March 1996, 365 . 367 [RFC1928] Leech, M., Ganis, M., Lee, Y., Kuris, R., Koblas, D., and 368 L. Jones, "SOCKS Protocol Version 5", RFC 1928, 369 DOI 10.17487/RFC1928, March 1996, 370 . 372 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 373 Resource Identifier (URI): Generic Syntax", STD 66, 374 RFC 3986, DOI 10.17487/RFC3986, January 2005, 375 . 377 [RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy 378 Extensions for Stateless Address Autoconfiguration in 379 IPv6", RFC 4941, DOI 10.17487/RFC4941, September 2007, 380 . 382 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 383 (ICE): A Protocol for Network Address Translator (NAT) 384 Traversal for Offer/Answer Protocols", RFC 5245, 385 DOI 10.17487/RFC5245, April 2010, 386 . 388 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 389 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 390 DOI 10.17487/RFC5389, October 2008, 391 . 393 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 394 Relays around NAT (TURN): Relay Extensions to Session 395 Traversal Utilities for NAT (STUN)", RFC 5766, 396 DOI 10.17487/RFC5766, April 2010, 397 . 399 [RFC7016] Thornburgh, M., "Adobe's Secure Real-Time Media Flow 400 Protocol", RFC 7016, DOI 10.17487/RFC7016, November 2013, 401 . 403 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 404 Protocol (HTTP/1.1): Message Syntax and Routing", 405 RFC 7230, DOI 10.17487/RFC7230, June 2014, 406 . 408 [RFC7478] Holmberg, C., Hakansson, S., and G. Eriksson, "Web Real- 409 Time Communication Use Cases and Requirements", RFC 7478, 410 DOI 10.17487/RFC7478, March 2015, 411 . 413 [RFC8089] Kerwin, M., "The "file" URI Scheme", RFC 8089, 414 DOI 10.17487/RFC8089, February 2017, 415 . 417 Appendix A. Change log 419 Changes in draft -08: 421 o Discuss how enterprise TURN servers should be handled. 423 Changes in draft -07: 425 o Clarify consent guidance. 427 Changes in draft -06: 429 o Clarify recommendations. 431 o Split implementation guidance into two sections. 433 Changes in draft -05: 435 o Separated framework definition from implementation techniques. 437 o Removed RETURN references. 439 o Use origin when determining local IPs, rather than a well-known 440 IP. 442 Changes in draft -04: 444 o Rewording and cleanup in abstract, intro, and problem statement. 446 o Added 2119 boilerplate. 448 o Fixed weird reference spacing. 450 o Expanded acronyms on first use. 452 o Removed 8.8.8.8 mention. 454 o Removed mention of future browser considerations. 456 Changes in draft -03: 458 o Clarified when to use which modes. 460 o Added 2119 qualifiers to make normative statements. 462 o Defined 'proxy'. 464 o Mentioned split tunnels in problem statement. 466 Changes in draft -02: 468 o Recommendations -> Requirements 470 o Updated text regarding consent. 472 Changes in draft -01: 474 o Incorporated feedback from Adam Roach; changes to discussion of 475 cam/mic permission, as well as use of proxies, and various 476 editorial changes. 478 o Added several more references. 480 Changes in draft -00: 482 o Published as WG draft. 484 Authors' Addresses 486 Justin Uberti 487 Google 488 747 6th St S 489 Kirkland, WA 98033 490 USA 492 Email: justin@uberti.name 494 Guo-wei Shieh 495 Facebook 496 1101 Dexter Ave 497 Seattle, WA 98109 498 USA 500 Email: guoweis@facebook.com