/
draft-ietf-rtcweb-ip-handling.xml
445 lines (383 loc) · 19.4 KB
/
draft-ietf-rtcweb-ip-handling.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<?rfc toc="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc compact="yes" ?>
<?rfc sortrefs="yes" ?>
<?rfc colonspace="yes" ?>
<?rfc rfcedstyle="no" ?>
<?rfc tocdepth="4"?>
<rfc category="std" docName="draft-ietf-rtcweb-ip-handling-08"
ipr="trust200902">
<front>
<title abbrev="WebRTC IP Handling">WebRTC IP Address Handling
Requirements</title>
<author fullname="Justin Uberti" initials="J." surname="Uberti">
<organization>Google</organization>
<address>
<postal>
<street>747 6th St S</street>
<city>Kirkland</city>
<region>WA</region>
<code>98033</code>
<country>USA</country>
</postal>
<email>justin@uberti.name</email>
</address>
</author>
<author fullname="Guo-wei Shieh" initials="G." surname="Shieh">
<organization>Facebook</organization>
<address>
<postal>
<street>1101 Dexter Ave</street>
<city>Seattle</city>
<region>WA</region>
<code>98109</code>
<country>USA</country>
</postal>
<email>guoweis@facebook.com</email>
</address>
</author>
<date day="3" month="June" year="2018" />
<area>RAI</area>
<abstract>
<t>This document provides information and requirements for how IP
addresses should be handled by WebRTC implementations.</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>One of WebRTC's key features is its support of peer-to-peer
connections. However, when establishing such a connection,
which involves connection attempts from various IP addresses,
WebRTC may allow a web application to learn additional information about
the user compared to an application that only uses the
Hypertext Transfer Protocol (HTTP)
<xref target="RFC7230" />. This may be problematic in certain cases.
This document summarizes the concerns, and makes
recommendations on how WebRTC implementations should best handle the
tradeoff between privacy and media performance.</t>
</section>
<section title="Terminology">
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in
<xref target="RFC2119"></xref>.</t>
</section>
<section title="Problem Statement">
<t>In order to establish a peer-to-peer connection, WebRTC implementations
use Interactive Connectivity Establishment (ICE)
<xref target="RFC5245" />, which attempts to discover
multiple IP addresses using techniques such as
Session Traversal Utilities for NAT (STUN) <xref target="RFC5389" /> and
Traversal Using Relays around NAT (TURN) <xref target="RFC5766" />,
and then checks the connectivity of each
local-address-remote-address pair in order to select the best one.
The addresses that are collected usually consist of
an endpoint's private physical/virtual addresses and its public Internet
addresses.</t>
<t>These addresses are exposed upwards to the web application, so that
they can be communicated to the remote endpoint for its checks.
This allows the
application to learn more about the local network configuration than it
would from a typical HTTP scenario, in which the web server would only
see a single public Internet address, i.e., the address from which the
HTTP request was sent.</t>
<t>The information revealed falls into three categories:
<list style="numbers">
<t>If the client is multihomed, additional public IP addresses for the
client can be learned. In particular,
if the client tries to hide its physical location through a Virtual
Private Network (VPN), and the VPN and local OS support routing over
multiple interfaces (a "split-tunnel" VPN), WebRTC will discover
not only the public address for the VPN, but also the ISP public address
over which the VPN is running.</t>
<t>If the client is behind a Network Address Translator (NAT), the
client's private IP addresses, often
<xref target="RFC1918" /> addresses, can be learned.</t>
<t>If the client is behind a proxy (a client-configured "classical
application proxy", as defined in
<xref target="RFC1919" />, Section 3), but direct access to the
Internet is permitted, WebRTC's STUN
checks will bypass the proxy and reveal the
public IP address of the client. This concern
also applies to the "enterprise TURN server" scenario described in
<xref target="RFC7478" />, Section 2.3.5.1, if, as above, direct
Internet access is permitted. However, when the term "proxy"
is used in this document, it is always in reference to an
<xref target="RFC1919" /> proxy server.
</t>
</list></t>
<t>Of these three concerns, #1 is the most significant, because for
some users, the purpose of using a VPN is for anonymity. However,
different VPN users will have different needs, and some VPN users (e.g.,
corporate VPN users) may in fact prefer WebRTC to send media traffic
directly, i.e., not through the VPN.</t>
<t>#2 is considered to be a less significant concern, given that the
local address values often contain minimal information (e.g.,
192.168.0.2), or have built-in privacy protection (e.g., the
<xref target="RFC4941" /> IPv6 addresses recommended
by <xref target="I-D.ietf-rtcweb-transports"/>).</t>
<t>#3 is the least common concern, as proxy administrators can already
control this behavior through organizational firewall policy, and
generally, forcing WebRTC traffic through a proxy server will have
negative effects on both the proxy and on media quality.</t>
<t>Note also that these concerns predate WebRTC; Adobe Flash Player has
provided similar functionality since the introduction of RTMFP
<xref target="RFC7016" /> in 2008.</t>
</section>
<section title="Goals">
<t>WebRTC's support of secure peer-to-peer connections
facilitates deployment of decentralized systems, which can have privacy
benefits. As a result, we want to avoid blunt solutions that disable
WebRTC or make it significantly harder to use. This document
takes a more nuanced approach, with the following goals:
<list style="symbols">
<t>Provide a framework for understanding the problem so that controls
might be provided to make different tradeoffs regarding performance
and privacy concerns with WebRTC.</t>
<t>Using that framework, define settings that enable peer-to-peer
communications, each with a different balance between performance and
privacy.</t>
<t>Finally, provide recommendations for default settings that provide
reasonable performance without also exposing addressing information
in a way that might violate user expectations.</t>
</list></t>
</section>
<section title="Detailed Design">
<section title="Principles">
<t>The key principles for our framework are stated below:
<list style="numbers">
<t>By default, WebRTC traffic should follow typical IP routing, i.e.,
WebRTC should use the same interface used for HTTP traffic, and only
the system's 'typical' public addresses (or those of an enterprise
TURN server, if present) should be visible to the application.
However, in the interest of optimal media quality,
it should be possible to enable WebRTC to make use of all
network interfaces to determine the ideal route.
</t>
<t>By default, WebRTC should be able to negotiate direct peer-to-peer
connections between endpoints (i.e., without traversing a
NAT or relay server), by providing a minimal set of local IP
addresses to the application for use in the ICE process.
This ensures that applications that need true
peer-to-peer routing for bandwidth or latency reasons can operate
successfully.
However, it should be possible to suppress these addresses (with the
resultant impact on direct connections) if desired.
</t>
<t>By default, WebRTC traffic should not be sent through
proxy servers, due to the media quality problems
associated with sending WebRTC traffic over TCP, which is almost
always used when communicating with such proxies, as well as
proxy performance issues that may result from proxying WebRTC's
long-lived, high-bandwidth connections. However, it should be possible
to force WebRTC to send its traffic through a configured proxy if
desired.
</t>
</list></t>
</section>
<section title="Modes and Recommendations">
<t>Based on these ideas, we define four specific modes of WebRTC
behavior, reflecting different media quality/privacy tradeoffs:
<list style="format Mode %d:">
<t>Enumerate all addresses: WebRTC MUST use all network interfaces
to attempt communication with STUN
servers, TURN servers, or peers. This will converge on the best media
path, and is ideal when media performance is the highest priority, but
it discloses the most information.</t>
<t>Default route + associated local addresses: WebRTC MUST follow the
kernel routing table rules, which will typically cause media packets to
take the same route as the application's HTTP traffic. If an
application TURN server is present, the preferred route MUST
be through this TURN server. Once an interface has been chosen,
the private IPv4 and IPv6 addresses associated with this
interface MUST be discovered and provided to the
application. This ensures that direct connections can still be
established in this mode.</t>
<t>Default route only: This is the the same as Mode 2, except that the
associated private addresses MUST NOT be provided; the only IP
addresses gathered are those discovered via mechanisms like STUN and
TURN (on the default route). This may cause traffic
to hairpin through a NAT, fall back to an application TURN server, or
fail altogether, with resulting quality implications.</t>
<t>Force proxy: This is the same as Mode 3, but when the application's
HTTP traffic is sent through a proxy, WebRTC media
traffic MUST also be proxied.
If the proxy does not support UDP (as is the case for all HTTP and
most SOCKS <xref target="RFC1928" /> proxies), or the WebRTC
implementation does
not support UDP proxying, the use of UDP will be disabled, and TCP will
be used to send and receive media through the proxy. Use of TCP will
result in reduced media quality, in addition to any performance
considerations associated with sending all WebRTC media through the
proxy server.</t>
</list></t>
<t>Mode 1 MUST only be used when user consent has been provided.
The details of this
consent are left to the implementation; one potential mechanism is to tie
this consent to getUserMedia consent. Alternatively, implementations can
provide a specific mechanism to obtain user consent.</t>
<t>In cases where user consent has not been obtained, Mode 2 SHOULD be
used.</t>
<t>These defaults provide a reasonable tradeoff that permits trusted
WebRTC applications to achieve optimal network performance, but gives
applications without consent (e.g., 1-way streaming or
data channel applications) only the minimum information needed to
achieve direct connections, as defined in Mode 2. However,
implementations MAY choose stricter modes if desired, e.g., if a user
indicates they want all WebRTC traffic to follow the default route.
</t>
<t>Note that the suggested defaults can still be used even for
organizations that want all
external WebRTC traffic to traverse a proxy or enterprise TURN server,
simply by setting an organizational firewall policy that allows
WebRTC traffic to only leave through the proxy or TURN server.
This provides a way to ensure the proxy or TURN server is used for any
external traffic, but still allows direct connections (and, in the
proxy case, avoids the performance issues associated with forcing
media through said proxy) for intra-organization traffic.</t>
</section>
</section>
<section title="Implementation Guidance">
<t>This section provides guidance to WebRTC implementations on how to
implement the policies described above.</t>
<section title="Ensuring Normal Routing">
<t>When trying to follow typical IP routing, the simplest approach is to
bind the sockets used for peer-to-peer connections to the wildcard
addresses (0.0.0.0 for IPv4, :: for IPv6), which allows the OS to
route WebRTC traffic the same way as it would HTTP traffic. STUN and
TURN will work as usual, and host candidates can still be determined
as mentioned below.
</t>
</section>
<section title="Determining Host Candidates">
<t>When binding to a wildcard address, some extra work is needed to
determine a suitable host candidate, which we define as the
source address that would be used for any packets sent to the
web application host (assuming that UDP and TCP get the same
routing). Use of the web application host as a destination ensures the
right source address is selected, regardless of where the application
resides (e.g., on an intranet).
</t>
<t>First, the appropriate remote IPv4/IPv6 address is obtained by
resolving the host component of the web application
URI <xref target="RFC3986"/>. If the client is behind a proxy and cannot
resolve these IPs via DNS, the address of the proxy can be used instead.
Or, if the web application was loaded from a file://
URI <xref target="RFC8089"/>, rather than over the network, the
implementation can fall back to a well-known DNS name or IP address.
</t>
<t>Once a suitable remote IP has been determined, the implementation
can create a UDP socket, bind it to the appropriate wildcard address,
and tell it to connect to the remote IP. Generally, this results in
the socket being assigned a local address based on the kernel routing
table, without sending any packets over the network.</t>
<t>Finally, the socket can be queried using getsockname() or the
equivalent to determine the appropriate host candidate.</t>
</section>
</section>
<section title="Application Guidance">
<t>The recommendations mentioned in this document may cause certain
WebRTC applications to malfunction. In order to be robust in all
scenarios, the following guidelines are provided for applications:
<list style="symbols">
<t>Applications SHOULD deploy a TURN server with support for both UDP
and TCP connections to the server. This ensures that connectivity can
still be established, even when Mode 3 or 4 are in use, assuming the
TURN server can be reached.</t>
<t>Applications SHOULD detect when they don't have access to the full
set of ICE candidates by checking for the presence of host candidates.
If no host candidates are present, Mode 3 or 4 above is in use; this
knowledge can be useful for diagnostic purposes.</t>
</list></t>
</section>
<section title="Security Considerations">
<t>This document is entirely devoted to security considerations.</t>
</section>
<section title="IANA Considerations">
<t>This document requires no actions from IANA.</t>
</section>
<section title="Acknowledgements">
<t>Several people provided input into this document, including Bernard
Aboba, Harald Alvestrand, Ted Hardie, Matthew Kaufmann, Eric Rescorla,
Adam Roach, and Martin Thomson.</t>
</section>
</middle>
<back>
<references title="Normative References">
<?rfc include='reference.RFC.2119.xml'?>
</references>
<references title="Informative References">
<?rfc include='reference.RFC.1918.xml'?>
<?rfc include='reference.RFC.1919.xml'?>
<?rfc include='reference.RFC.1928.xml'?>
<?rfc include='reference.RFC.3986.xml'?>
<?rfc include='reference.RFC.4941.xml'?>
<?rfc include='reference.RFC.5245.xml'?>
<?rfc include='reference.RFC.5389.xml'?>
<?rfc include='reference.RFC.5766.xml'?>
<?rfc include='reference.RFC.7016.xml'?>
<?rfc include='reference.RFC.7230.xml'?>
<?rfc include='reference.RFC.7478.xml'?>
<?rfc include='reference.RFC.8089.xml'?>
<?rfc include='reference.I-D.ietf-rtcweb-transports'?>
</references>
<section title="Change log">
<t>Changes in draft -08:
<list style="symbols">
<t>Discuss how enterprise TURN servers should be handled.</t>
</list></t>
<t>Changes in draft -07:
<list style="symbols">
<t>Clarify consent guidance.</t>
</list></t>
<t>Changes in draft -06:
<list style="symbols">
<t>Clarify recommendations.</t>
<t>Split implementation guidance into two sections.</t>
</list></t>
<t>Changes in draft -05:
<list style="symbols">
<t>Separated framework definition from implementation techniques.</t>
<t>Removed RETURN references.</t>
<t>Use origin when determining local IPs, rather than a well-known IP.</t>
</list></t>
<t>Changes in draft -04:
<list style="symbols">
<t>Rewording and cleanup in abstract, intro, and problem statement.</t>
<t>Added 2119 boilerplate.</t>
<t>Fixed weird reference spacing.</t>
<t>Expanded acronyms on first use.</t>
<t>Removed 8.8.8.8 mention.</t>
<t>Removed mention of future browser considerations.</t>
</list></t>
<t>Changes in draft -03:
<list style="symbols">
<t>Clarified when to use which modes.</t>
<t>Added 2119 qualifiers to make normative statements.</t>
<t>Defined 'proxy'.</t>
<t>Mentioned split tunnels in problem statement.</t>
</list></t>
<t>Changes in draft -02:
<list style="symbols">
<t>Recommendations -> Requirements</t>
<t>Updated text regarding consent.</t>
</list></t>
<t>Changes in draft -01:
<list style="symbols">
<t>Incorporated feedback from Adam Roach; changes to discussion of
cam/mic permission, as well as use of proxies, and various editorial
changes.</t>
<t>Added several more references.</t>
</list></t>
<t>Changes in draft -00:
<list style="symbols">
<t>Published as WG draft.</t>
</list></t>
</section>
</back>
</rfc>