idnits 2.17.1 draft-ietf-rtcweb-ip-handling-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 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 (February 11, 2018) is 2259 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: August 15, 2018 Facebook 6 February 11, 2018 8 WebRTC IP Address Handling Requirements 9 draft-ietf-rtcweb-ip-handling-05 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 August 15, 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 7. Application Guidance . . . . . . . . . . . . . . . . . . . . 7 59 8. Security Considerations . . . . . . . . . . . . . . . . . . . 7 60 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 61 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 7 62 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 63 11.1. Normative References . . . . . . . . . . . . . . . . . . 7 64 11.2. Informative References . . . . . . . . . . . . . . . . . 7 65 Appendix A. Change log . . . . . . . . . . . . . . . . . . . . . 9 66 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 68 1. Introduction 70 One of WebRTC's key features is its support of peer-to-peer 71 connections. However, when establishing such a connection, which 72 involves connection attempts from various IP addresses, WebRTC may 73 allow a web application to learn additional information about the 74 user compared to an application that only uses the Hypertext Transfer 75 Protocol (HTTP) [RFC7230]. This may be problematic in certain cases. 76 This document summarizes the concerns, and makes recommendations on 77 how WebRTC implementations should best handle the tradeoff between 78 privacy and media performance. 80 2. Terminology 82 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 83 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 84 document are to be interpreted as described in [RFC2119]. 86 3. Problem Statement 88 In order to establish a peer-to-peer connection, WebRTC 89 implementations use Interactive Connectivity Establishment (ICE) 90 [RFC5245], which attempts to discover multiple IP addresses using 91 techniques such as Session Traversal Utilities for NAT (STUN) 92 [RFC5389] and Traversal Using Relays around NAT (TURN) [RFC5766], and 93 then checks the connectivity of each local-address-remote-address 94 pair in order to select the best one. The addresses that are 95 collected usually consist of an endpoint's private physical/virtual 96 addresses and its public Internet addresses. 98 These addresses are exposed upwards to the web application, so that 99 they can be communicated to the remote endpoint for its checks. This 100 allows the application to learn more about the local network 101 configuration than it would from a typical HTTP scenario, in which 102 the web server would only see a single public Internet address, i.e., 103 the address from which the HTTP request was sent. 105 The information revealed falls into three categories: 107 1. If the client is multihomed, additional public IP addresses for 108 the client can be learned. In particular, if the client tries to 109 hide its physical location through a Virtual Private Network 110 (VPN), and the VPN and local OS support routing over multiple 111 interfaces (a "split-tunnel" VPN), WebRTC will discover not only 112 the public address for the VPN, but also the ISP public address 113 over which the VPN is running. 115 2. If the client is behind a Network Address Translator (NAT), the 116 client's private IP addresses, often [RFC1918] addresses, can be 117 learned. 119 3. If the client is behind a proxy (a client-configured "classical 120 application proxy", as defined in [RFC1919], Section 3), but 121 direct access to the Internet is also supported, WebRTC's STUN 122 checks will bypass the proxy and reveal the public IP address of 123 the client. 125 Of these three concerns, #1 is the most significant, because for some 126 users, the purpose of using a VPN is for anonymity. However, 127 different VPN users will have different needs, and some VPN users 128 (e.g., corporate VPN users) may in fact prefer WebRTC to send media 129 traffic directly, i.e., not through the VPN. 131 #2 is considered to be a less significant concern, given that the 132 local address values often contain minimal information (e.g., 133 192.168.0.2), or have built-in privacy protection (e.g., the 134 [RFC4941] IPv6 addresses recommended by 135 [I-D.ietf-rtcweb-transports]). 137 #3 is the least common concern, as proxy administrators can already 138 control this behavior through organizational firewall policy, and 139 generally, forcing WebRTC traffic through a proxy server will have 140 negative effects on both the proxy and on media quality. 142 Note also that these concerns predate WebRTC; Adobe Flash Player has 143 provided similar functionality since the introduction of RTMFP 144 [RFC7016] in 2008. 146 4. Goals 148 WebRTC's support of secure peer-to-peer connections facilitates 149 deployment of decentralized systems, which can have privacy benefits. 150 As a result, we want to avoid blunt solutions that disable WebRTC or 151 make it significantly harder to use. This document takes a more 152 nuanced approach, with the following goals: 154 o Provide a framework for understanding the problem so that controls 155 might be provided to make different tradeoffs regarding 156 performance and privacy concerns with WebRTC. 158 o Using that framework, define settings that enable peer-to-peer 159 communications, each with a different balance between performance 160 and privacy. 162 o Finally, provide recommendations for default settings that provide 163 reasonable performance without also exposing addressing 164 information in a way that might violate user expectations. 166 5. Detailed Design 168 5.1. Principles 170 The key principles for our framework are stated below: 172 1. By default, WebRTC traffic should follow typical IP routing, 173 i.e., WebRTC should use the same interface used for HTTP traffic, 174 and only the system's 'typical' public addresses should be 175 visible to the application. However, in the interest of optimal 176 media quality, it should be possible to enable WebRTC to make use 177 of all network interfaces to determine the ideal route. 179 2. By default, WebRTC should be able to negotiate direct peer-to- 180 peer connections between endpoints (i.e., without traversing a 181 NAT or relay server), by providing a minimal set of local IP 182 addresses to the application for use in the ICE process. This 183 ensures that applications that need true peer-to-peer routing for 184 bandwidth or latency reasons can operate successfully. However, 185 it should be possible to suppress these addresses (with the 186 resultant impact on direct connections) if desired. 188 3. By default, WebRTC traffic should not be sent through proxy 189 servers, due to the media quality problems associated with 190 sending WebRTC traffic over TCP, which is almost always used when 191 communicating with proxies, as well as proxy performance issues 192 that may result from proxying WebRTC's long-lived, high-bandwidth 193 connections. However, it should be possible to force WebRTC to 194 send its traffic through a configured proxy if desired. 196 5.2. Modes and Recommendations 198 Based on these ideas, we define four specific modes of WebRTC 199 behavior, reflecting different media quality/privacy tradeoffs: 201 Mode 1: Enumerate all addresses: WebRTC MUST use all network 202 interfaces to attempt communication with STUN servers, TURN 203 servers, or peers. This will converge on the best media 204 path, and is ideal when media performance is the highest 205 priority, but it discloses the most information. 207 Mode 2: Default route + associated local addresses: WebRTC MUST 208 follow the kernel routing table rules, which will typically 209 cause media packets to take the same route as the 210 application's HTTP traffic. In addition, the private IPv4 211 and IPv6 addresses associated with the kernel-chosen 212 interface MUST be discovered and provided to the 213 application. This ensures that direct connections can still 214 be established in this mode. 216 Mode 3: Default route only: This is the the same as Mode 2, except 217 that the associated private addressses MUST NOT be provided; 218 the only IP addresses gathered are those discovered via 219 mechanisms like STUN and TURN (on the default route). This 220 may cause traffic to hairpin through a NAT, fall back to an 221 application TURN server, or fail altogether, with resulting 222 quality implications. 224 Mode 4: Force proxy: This is the same as Mode 3, but all WebRTC 225 media traffic is forced through a proxy, if one is 226 configured. If the proxy does not support UDP (as is the 227 case for all HTTP and most SOCKS [RFC1928] proxies), or the 228 WebRTC implementation does not support UDP proxying, the use 229 of UDP will be disabled, and TCP will be used to send and 230 receive media through the proxy. Use of TCP will result in 231 reduced media quality, in addition to any performance 232 considerations associated with sending all WebRTC media 233 through the proxy server. 235 The recommended defaults are as follows: 237 Mode 1 MUST only be used when user consent has been provided; this 238 allows trusted WebRTC applications to achieve optimal network 239 performance, but significanly limites the network information exposed 240 to arbitrary web pages. The details of this consent are left to the 241 implementation; one potential mechanism is to tie this consent to 242 getUserMedia consent. 244 In cases where user consent has not been obtained, Mode 2 SHOULD be 245 used. This allows applications to still achieve direct connections 246 in many cases, even without consent (e.g., streaming or data channel 247 applications). However, implementations MAY choose a stricter 248 default policy in certain circumstances. 250 Note that these defaults can still be used even for organizations 251 that want all external WebRTC traffic to traverse a proxy, simply by 252 setting an organizational firewall policy that allows WebRTC traffic 253 to only leave through the proxy. This provides a way to ensure the 254 proxy is used for any external traffic, but avoids the performance 255 issues of Mode 4 (where all media is forced through said proxy) for 256 intra-organization traffic. 258 6. Implementation Guidance 260 This section provides guidance to WebRTC implementations on how to 261 implement the policies described above. 263 When trying to follow typical IP routing, the simplest approach is to 264 bind the sockets used for p2p connections to the wildcard addresses 265 (0.0.0.0 for IPv4, :: for IPv6), which allows the OS to route WebRTC 266 traffic the same way as it would HTTP traffic. STUN and TURN will 267 work as usual, and host candidates can be determined as mentioned 268 below. 270 In order to discover the correct local IP addresses, implementations 271 can use the common trick of binding sockets to the wildcard 272 addresses, connect()ing those sockets to the IPv4/IPv6 addresses of 273 the web application (obtained by resolving the host component of its 274 URI [RFC3986]) and then reading the bound local addresses via 275 getsockname(). This requires no data exchange; it simply provides a 276 mechanism for applications to retrieve the desired information from 277 the kernel routing table. 279 Use of the web application IPs ensures the right local IPs are 280 selected, regardless of where the application is hosted (e.g., on an 281 intranet). If the client is behind a proxy and cannot resolve the 282 IPs via DNS, the IPv4/v6 addresses of the proxy can be used instead. 283 If the web application was loaded from a file:// URI [RFC8089], the 284 implementation can fall back to a well-known DNS name or IP address. 286 7. Application Guidance 288 The recommendations mentioned in this document may cause certain 289 WebRTC applications to malfunction. In order to be robust in all 290 scenarios, the following guidelines are provided for applications: 292 o Applications SHOULD deploy a TURN server with support for both UDP 293 and TCP connections to the server. This ensures that connectivity 294 can still be established, even when Mode 3 or 4 are in use, 295 assuming the TURN server can be reached. 297 o Applications SHOULD detect when they don't have access to the full 298 set of ICE candidates by checking for the presence of host 299 candidates. If no host candidates are present, Mode 3 or 4 above 300 is in use; this knowledge can be useful for diagnostic purposes. 302 8. Security Considerations 304 This document is entirely devoted to security considerations. 306 9. IANA Considerations 308 This document requires no actions from IANA. 310 10. Acknowledgements 312 Several people provided input into this document, including Bernard 313 Aboba, Harald Alvestrand, Ted Hardie, Matthew Kaufmann, Eric 314 Rescorla, Adam Roach, and Martin Thomson. 316 11. References 318 11.1. Normative References 320 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 321 Requirement Levels", BCP 14, RFC 2119, 322 DOI 10.17487/RFC2119, March 1997, 323 . 325 11.2. Informative References 327 [I-D.ietf-rtcweb-transports] 328 Alvestrand, H., "Transports for WebRTC", draft-ietf- 329 rtcweb-transports-17 (work in progress), October 2016. 331 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 332 and E. Lear, "Address Allocation for Private Internets", 333 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 334 . 336 [RFC1919] Chatel, M., "Classical versus Transparent IP Proxies", 337 RFC 1919, DOI 10.17487/RFC1919, March 1996, 338 . 340 [RFC1928] Leech, M., Ganis, M., Lee, Y., Kuris, R., Koblas, D., and 341 L. Jones, "SOCKS Protocol Version 5", RFC 1928, 342 DOI 10.17487/RFC1928, March 1996, 343 . 345 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 346 Resource Identifier (URI): Generic Syntax", STD 66, 347 RFC 3986, DOI 10.17487/RFC3986, January 2005, 348 . 350 [RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy 351 Extensions for Stateless Address Autoconfiguration in 352 IPv6", RFC 4941, DOI 10.17487/RFC4941, September 2007, 353 . 355 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 356 (ICE): A Protocol for Network Address Translator (NAT) 357 Traversal for Offer/Answer Protocols", RFC 5245, 358 DOI 10.17487/RFC5245, April 2010, 359 . 361 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 362 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 363 DOI 10.17487/RFC5389, October 2008, 364 . 366 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 367 Relays around NAT (TURN): Relay Extensions to Session 368 Traversal Utilities for NAT (STUN)", RFC 5766, 369 DOI 10.17487/RFC5766, April 2010, 370 . 372 [RFC7016] Thornburgh, M., "Adobe's Secure Real-Time Media Flow 373 Protocol", RFC 7016, DOI 10.17487/RFC7016, November 2013, 374 . 376 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 377 Protocol (HTTP/1.1): Message Syntax and Routing", 378 RFC 7230, DOI 10.17487/RFC7230, June 2014, 379 . 381 [RFC8089] Kerwin, M., "The "file" URI Scheme", RFC 8089, 382 DOI 10.17487/RFC8089, February 2017, 383 . 385 Appendix A. Change log 387 Changes in draft -05: 389 o Separated framework definition from implementation techniques. 391 o Removed RETURN references. 393 o Use origin when determining local IPs, rather than a well-known 394 IP. 396 Changes in draft -04: 398 o Rewording and cleanup in abstract, intro, and problem statement. 400 o Added 2119 boilerplate. 402 o Fixed weird reference spacing. 404 o Expanded acronyms on first use. 406 o Removed 8.8.8.8 mention. 408 o Removed mention of future browser considerations. 410 Changes in draft -03: 412 o Clarified when to use which modes. 414 o Added 2119 qualifiers to make normative statements. 416 o Defined 'proxy'. 418 o Mentioned split tunnels in problem statement. 420 Changes in draft -02: 422 o Recommendations -> Requirements 423 o Updated text regarding consent. 425 Changes in draft -01: 427 o Incorporated feedback from Adam Roach; changes to discussion of 428 cam/mic permission, as well as use of proxies, and various 429 editorial changes. 431 o Added several more references. 433 Changes in draft -00: 435 o Published as WG draft. 437 Authors' Addresses 439 Justin Uberti 440 Google 441 747 6th St S 442 Kirkland, WA 98033 443 USA 445 Email: justin@uberti.name 447 Guo-wei Shieh 448 Facebook 449 1101 Dexter Ave 450 Seattle, WA 98109 451 USA 453 Email: guoweis@facebook.com