-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdraft-ietf-ice-pac.xml
299 lines (290 loc) · 13.9 KB
/
draft-ietf-ice-pac.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
<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC0822 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC0822 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC8445 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8445.xml">
]>
<?rfc toc="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="yes" ?>
<?rfc sortrefs="no" ?>
<?rfc strict="yes" ?>
<rfc ipr="trust200902" category="std" docName="draft-ietf-ice-pac-latest" obsoletes="" updates="8445" submissionType="IETF" xml:lang="en">
<front>
<title abbrev="ICE PAC">
Interactive Connectivity Establishment Patiently Awaiting Connectivity (ICE PAC)
</title>
<author initials="C.H." surname="Holmberg" fullname="Christer Holmberg">
<organization>Ericsson</organization>
<address>
<postal>
<street>Hirsalantie 11</street>
<code>02420</code>
<city>Jorvas</city>
<country>Finland</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author initials="J." surname="Uberti" fullname="Justin Uberti">
<organization>Google</organization>
<address>
<postal>
<street>747 6th St W</street>
<code>98033</code>
<city>Kirkland</city>
<country>USA</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<date year="2019"/>
<area>Transport</area>
<workgroup>ICE Working Group</workgroup>
<keyword>ICE</keyword>
<keyword>PAC</keyword>
<keyword>Candidate</keyword>
<abstract>
<t>
During the process of establishing peer-to-peer connectivity,
ICE agents can encounter situations where they have
no candidate pairs to check, and, as a result, conclude that
ICE processing has failed. However, because additional
candidate pairs can be discovered during ICE processing,
declaring failure at this point may be premature. This
document discusses when these situations can occur and
proposes a way to avoid premature failure. This document
updates RFC 8445.
</t>
</abstract>
</front>
<middle>
<section title="Introduction" toc="default">
<t>
<xref target="RFC8445"></xref> describes a protocol, Interactive Connectivity Establishment (ICE),
for Network Address Translator (NAT) traversal for UDP-based communication.
</t>
<t>
When using ICE, endpoints will typically exchange ICE candidates,
form a list of candidate pairs, and then test each candidate pair to see
if connectivity can be established. If the test for a given pair fails,
it is marked accordingly, and if all pairs have failed, the overall
ICE process typically is considered to have failed.
</t>
<t>
During the process of connectivity checks, additional candidates may
be created as a result of successful inbound checks from the remote
peer. Such candidates are referred to as peer-reflexive candidates,
and once discovered, will be used to form new candidate pairs which will
be tested like any other. However, there is an inherent race condition
here; if, before learning about any peer-reflexive candidates, an
endpoint runs out of candidate pairs to check, either because it has
none, or it considers them all to have failed, it will prematurely
declare failure and terminate ICE processing. This race condition can
occur in many common situations.
</t>
<t>
This specification updates <xref target="RFC8445"></xref>, by simply
requiring that an ICE agent wait a minimum amount of time before
declaring ICE failure, even if there are no candidate pairs to check,
or if all candidate pairs have failed. This delay provides enough time
for the discovery of peer-reflexive candidates, which may eventually
lead to ICE processing completing successfully.
</t>
</section>
<section title="Conventions">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref>
when, and only when, they appear in all capitals, as shown here.
</t>
</section>
<section title="Relevant Scenarios">
<t>
As noted above, the core problem this specification attempts to
address is the situation where even after local gathering and remote
candidate signaling has completed, the ICE agent immediately ends up
with no valid pairs and no candidate pairs left to check, resulting in
a premature ICE failure. This failure is premature because not
enough time has elapsed to allow for discovery of peer-reflexive
candidates from inbound connectivity checks; if discovered, these
candidates are very likely to result in a valid pair.
</t>
<t>
In most ICE scenarios, the lengthy timeouts for connectivity check transactions,
typically tens of seconds, will prevent this problem from occurring. However, there
are certain specific cases where this problem will frequently occur.
</t>
<section title="No Candidates From Peer">
<t>
It is entirely legal for an ICE agent to provide zero candidates of
its own. If the agent somehow knows that the remote endpoint is
directly reachable, gathering local candidates is unnecessary and
will only cause delays; the peer agent can discover the
appropriate local candidate via connectivity checks.
</t>
<t>
However, following the procedures from
<xref target="RFC8445"></xref> strictly will result in immediate
ICE failure, since the checklist at the peer agent will be
empty.
</t>
</section>
<section title="All Candidates Discarded">
<t>
Even if the ICE agent provides candidates, they may be discarded
by the peer agent if it does not know what to do with them.
For example, candidates may use an address family that the peer
agent does not support, (e.g., a host candidate with an IPv6
address in a NAT64 scenario), or may not be usable for some other
reason.
</t>
<t>
In these scenarios, when the candidates are discarded, the
checklist at the peer agent will once again be empty, leading
to immediate ICE failure.
</t>
</section>
<section title="Immediate Candidate Pair Failure">
<t>
Section 7.2.5.2 of <xref target="RFC8445"></xref> describes several
situations in which a candidate pair will be considered to have
failed, well before the connectivity check transaction timeout.
</t>
<t>
As a result, even if the ICE agent provides usable candidates,
the pairs created by the peer agent may fail immediately when
checked, e.g., a check to a non-routable address that receives an
immediate ICMP error.
</t>
<t>
In this situation, the checklist at the peer agent may contain
only failed pairs, resulting in immediate ICE failure.
</t>
</section>
</section>
<section title="Update to RFC 8445">
<t>
In order to avoid the problem raised by this document, the ICE agent
needs to wait enough time to allow peer-reflexive candidates to be
discovered. Accordingly, when a full ICE implementation begins its
ICE processing, as described in <xref target="RFC8445" />, Section
6.1, it MUST set a timer, henceforth known as the PAC timer, to
ensure ICE will run for a minimum amount of time before determining
failure.
</t>
<t>
Specifically, the ICE agent will start its timer once it believes
ICE connectivity checks are starting. This occurs when the agent has
sent the values needed to perform connectivity checks
(e.g., the Username Fragment and Password denoted in
<xref target="RFC8445" />, Section 5.3)
and has received some indication that the remote side is
ready to start connectivity checks, typically via receipt of the values
mentioned above. Note that the agent will start the timer even if it
has not sent or received any ICE candidates.
</t>
<t>
The RECOMMENDED duration for the timer is equal to the agent's
connectivity check transaction timeout, including all retransmissions.
This timeout value is chosen to roughly coincide with the maximum
possible duration of ICE connectivity checks from the remote peer,
which, if successful, could create peer-reflexive candidates. Because
the ICE agent doesn't know the exact number of candidate pairs and pacing
interval in use by the remote side, this timeout value is simply a
guess, albeit an educated one. Regardless, for this particular problem,
the desired benefits will be realized as long as the agent waits
some reasonable amount of time, and, as usual, the application is in
the best position to determine what is reasonable for its scenario.
</t>
<t>
While the timer is running, the ICE agent MUST NOT set the state of
a checklist to Failed, even if the checklist has no pairs left to check.
As a result, the ICE agent will not remove any data streams or set the
state of the ICE session to Failed as long as the timer is running.
</t>
<t>
When the timer eventually elapses, the ICE agent MUST resume typical
ICE processing, including setting any checklists containing only Failed
pairs to the Failed state, as usual, and handling any consequences as
indicated in <xref target="RFC8445" />, Section 8.1.2. Naturally, if
there are no such checklists, no action is necessary.
</t>
<t>
One consequence of this behavior is that in cases where ICE should fail,
e.g., where both sides provide candidates with unsupported address families,
ICE will no longer fail immediately, and only fail when the
PAC timer expires. However, because most ICE scenarios
require an extended period of time to determine failure, the
fact that some specific scenarios no longer fail fast should have
minimal application impact, if any.
</t>
<t>
Note also that the PAC timer is potentially relevant to the ICE nomination
procedure described in <xref target="RFC8445" />, Section 8.1.1. That
specification does not define a minimum duration for ICE processing
prior to nomination of a candidate pair, but in order to select the
best candidate pair, ICE needs to run for enough time in order to allow
peer-reflexive candidates to be discovered and checked, as noted above.
Accordingly, the controlling ICE agent SHOULD wait a sufficient amount
of time before nominating candidate pairs, and it MAY use the PAC timer
to do so. As always, the controlling ICE agent retains
full discretion, and MAY decide, based on its own criteria, to nominate
pairs prior to the timer elapsing.
</t>
</section>
<section title="Update to RFC XXXX">
<t>
[RFC EDITOR NOTE: Please replace RFC XXXX with the RFC number of
draft-ietf-ice-trickle once it has been published.]
</t>
<t>
Trickle ICE <xref target="I-D.ietf-ice-trickle" />
considers a similar problem, namely whether an ICE agent should allow
a checklist to enter the Failed state if more candidates might
still be provided by the remote peer. The solution, specified in
<xref target="I-D.ietf-ice-trickle" />, Section 8, is to
wait until an end-of-candidates indication has been received
before determining ICE failure.
</t>
<t>
However, for the same reasons described above,
the ICE agent may discover peer-reflexive candidates after it has
received the end-of-candidates indication, and so the solution
proposed by this document MUST still be used even when
the ICE agent is using Trickle ICE.
</t>
<t>
Note also that sending an end-of-candidates indication is only a
SHOULD-strength requirement, which means that ICE agents will need
to implement an backup mechanism to decide when all candidates
have been received, typically a timer. Accordingly, ICE agents
MAY use the PAC timer to also serve as an end-of-candidates fallback.
</t>
</section>
<section anchor="section.sec" title="Security Considerations">
<t>
The security considerations for ICE are defined in <xref target="RFC8445" pageno="false" format="default"/>.
This specification only recommends that ICE agents wait for a certain time of period before they declare
ICE failure, and does not introduce new security considerations.
</t>
</section>
<section anchor="section.iana" title="IANA considerations">
<t>
This specification makes no requests to IANA.
</t>
</section>
<section anchor="sec-acks" title="Acknowledgements" toc="default">
</section>
</middle>
<back>
<references title="Normative References">
<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.8174"?>
<?rfc include="reference.RFC.8445"?>
<?rfc include='reference.I-D.ietf-ice-trickle'?>
</references>
</back>
</rfc>