-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdraft-ietf-ice-trickle-01.xml
1413 lines (1404 loc) · 61.8 KB
/
draft-ietf-ice-trickle-01.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
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<rfc category='std' ipr='trust200902'
docName='draft-ietf-ice-trickle-01'>
<?rfc toc='yes' ?>
<?rfc symrefs='yes' ?>
<?rfc sortrefs='yes'?>
<?rfc iprnotified='no' ?>
<?rfc strict='yes' ?>
<?rfc compact='yes' ?>
<front>
<title abbrev='Trickle ICE'>
Trickle ICE: Incremental Provisioning of Candidates for the
Interactive Connectivity Establishment (ICE) Protocol
</title>
<author initials='E.' surname='Ivov'
fullname='Emil Ivov'>
<organization abbrev='Jitsi'>Jitsi</organization>
<address>
<postal>
<street></street>
<city>Strasbourg</city>
<code>67000</code>
<country>France</country>
</postal>
<phone>+33 6 72 81 15 55</phone>
<email>[email protected]</email>
</address>
</author>
<author fullname="Eric Rescorla" initials="E.K." surname="Rescorla">
<organization>RTFM, Inc.</organization>
<address>
<postal>
<street>2064 Edgewood Drive</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94303</code>
<country>USA</country>
</postal>
<phone>+1 650 678 2350</phone>
<email>[email protected]</email>
</address>
</author>
<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>
<phone>+1 857 288 8888</phone>
<email>[email protected]</email>
</address>
</author>
<author initials="P." surname="Saint-Andre" fullname="Peter Saint-Andre">
<organization>&yet</organization>
<address>
<email>[email protected]</email>
<uri>https://andyet.com/</uri>
</address>
</author>
<date />
<abstract>
<t>
This document describes an extension to the Interactive
Connectivity Establishment (ICE) protocol that enables ICE agents
to send and receive candidates incrementally rather than
exchanging complete lists. With such incremental provisioning,
ICE agents can begin connectivity checks while they are still
gathering candidates and considerably shorten the time necessary
for ICE processing to complete. This mechanism is called "trickle
ICE".
</t>
</abstract>
</front>
<middle>
<section title='Introduction'>
<t>
The Interactive Connectivity Establishment (ICE) protocol
<xref target="rfc5245bis"/> describes mechanisms for gathering
candidates, prioritizing them, choosing default ones, exchanging
them with the remote party, pairing them, and ordering them into
check lists. Once all of these actions have been completed (and only
then), the participating agents can begin a phase of connectivity
checks and eventually select the pair of candidates that will be
used in a media session.
</t>
<t>
Although the sequence described above has the advantage of being
relatively straightforward to implement and debug once deployed,
it can also be rather lengthy.
Candidate gathering often involves things like querying
<xref target="RFC5389">STUN</xref> servers, discovering UPnP
devices, and allocating relayed candidates at
<xref target="RFC5766">TURN</xref> servers. All of these actions can
be delayed for a noticeable amount of time; although they can be
run in parallel, they still need to respect the pacing
requirements from <xref target="rfc5245bis"/>, which is likely to
delay them even further. Some or all of these actions also
need be completed by the remote agent. Both agents would
next perform connectivity checks and only then would they be
ready to begin streaming media.
</t>
<t>
These factors can lead to relatively lengthy session
establishment times and degraded user experience.
</t>
<t>
This document defines an alternative mode of
operation for ICE implementations, known as "Trickle ICE",
in which candidates can be exchanged incrementally. This enables
ICE agents to exchange candidates as soon as a
session has been initiated. Connectivity checks for a media
stream can also start as soon as the first candidates for that
stream become available.
</t>
<t>
Trickle ICE can reduce session establishment times in cases
where connectivity is confirmed for the first exchanged
candidates (e.g., where the host candidates for one of the agents
are directly reachable from the second agent, such as host
candidates at a media relay). Even when this is
not the case, running candidate gathering for both agents and
connectivity checks in parallel can considerably
shorten ICE processing times.
</t>
<t>
It is worth noting that there is quite a bit of operational
experience with the Trickle ICE technique, going back as far as
2005 (when the XMPP Jingle extension defined a "dribble mode" as
specified in <xref target="XEP-0176"/>); this document incorporates
feedback from those who have implemented and deployed the technique.
</t>
<t>
In addition to the basics of Trickle ICE, this document also
describes how to discover support for Trickle ICE,
how regular ICE processing needs to be modified when
building and updating check lists, and how Trickle ICE
implementations interoperate with agents that only
implement so-called "Vanilla ICE" processing as defined in
<xref target="rfc5245bis"/>.
</t>
<t>
This specification does not define the usage of Trickle ICE with any
specific signalling protocol (however, see
<xref target="I-D.ietf-mmusic-trickle-ice-sip"/> for usage with SIP
<xref target='RFC3261'/>).
Similarly, it does not define Trickle ICE in
terms of the Session Description Protocol (SDP) <xref target='RFC4566'/>
or the offer/answer model <xref target='RFC3264'/> because
the technique can be and already is used in application protocols
that are not tied to SDP or to offer/answer semantics.
</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"/>.
</t>
<t>
This specification makes use of all terminology defined
for Interactive Connectivity Establishment in
<xref target="rfc5245bis"/>.
</t>
<t>
<list style="hanging">
<t hangText="Vanilla ICE:">
The Interactive Connectivity Establishment protocol as
defined in <xref target="rfc5245bis"/>.
</t>
<t hangText="Candidate Harvester:">
A module used by an ICE agent to obtain local candidates.
Candidate gatherers use different mechanisms for
discovering local candidates. Some of them would typically
make use of protocols such as STUN or TURN. Others may also
employ techniques that are not referenced within
<xref target="rfc5245bis"/> (e.g., UPnP based port allocation
or XMPP Jingle Relay Nodes <xref target="XEP-0278"/>).
</t>
<t hangText="Trickled Candidates:">
Candidates that a Trickle ICE agent sends after an offer
or answer but within the same context.
Trickled candidates can be sent in parallel with candidate
gathering and connectivity checks.
</t>
<t hangText="Trickling/Trickle (v.):">
The act of sending trickled candidates.
</t>
<t hangText="Half Trickle:">
A Trickle ICE mode of operation where the offerer gathers
its first generation of candidates strictly before creating
and sending the offer. Once sent, that offer can be
processed by Vanilla ICE agents and does not require support
for this specification. It also allows Trickle ICE capable
answerers to still gather candidates and perform
connectivity checks in a non-blocking way, thus roughly
offering "half" the advantages of Trickle ICE. The mechanism
is mostly meant for use in cases where support for trickle
ICE cannot be confirmed prior to sending a initial offer.
</t>
<t hangText="Full Trickle:">
The regular mode of operation for Trickle ICE agents, in which
an initial offer can include any number of candidates (even
zero candidates) and does not need to include the entire
first generation of candidates as in half trickle.
</t>
</list>
</t>
</section>
<section title='Determining Support for Trickle ICE' anchor="disco">
<t>
Application protocols that use Trickle ICE should do one of
the following:
</t>
<t>
<list style='symbols'>
<t>
Provide a way for agents to verify support of Trickle ICE
prior to initiating a session (XMPP's
<xref target="XEP-0030">Service Discovery</xref> is
one such mechanism).
</t>
<t>
Make support for Trickle ICE mandatory so that user agents
can assume support.
</t>
</list>
</t>
<t>
Alternately, for cases where a protocol provides neither of the
foregoing methods, agents may rely on provisioning/configuration or
use the half trickle procedure described in
<xref target="half-trickle"/>.
</t>
<t>
Prior to sending an initial offer, agents using signaling protocols
that support capabilities discovery can attempt to verify whether or
not the remote party supports Trickle ICE. If an agent determines
that the remote party does not support Trickle ICE, it MUST fall back
to using Vanilla ICE or abandon the entire session.
</t>
<t>
In application protocols that use SDP, a user agent supporting
Trickle ICE MUST include a token of "trickle" in the
ice-options attribute every time it generates an offer or an answer.
This enables an agent that receives offers or answers to verify
support by checking for presence of the token.
</t>
<t>
Dedicated discovery semantics and half trickle are needed
only prior to session initiation (e.g.,
when sending the initial offer). After a session is established
and Trickle ICE support is confirmed for both parties, either
agent can use full trickle for subsequent offers.
</t>
</section>
<section title='Sending the Initial Offer' anchor="initial-offer">
<t>
An agent starts gathering candidates as soon as it has an
indication that communication is imminent (e.g., a user interface
cue or an explicit request to initiate a session). Contrary to
Vanilla ICE, implementations of Trickle ICE do not need to
gather candidates in a blocking manner. Therefore, unless half
trickle is being used, agents SHOULD generate and transmit their
initial offer as early as possible, in order to allow the remote
party to start gathering and trickling candidates.
</t>
<t>
Trickle ICE agents MAY include any set of candidates in an
offer. This includes the possibility of sending an offer that
contains all the candidates that the agent plans to use
(as in half trickle mode), sending an offer that contains only a
publically-reachable IP address (e.g., a host candidate at a media
relay that is known to not be behind a firewall), or sending an offer
with no candidates at all (in which case the offerer can receive the
answerer's initial candidate list sooner and the answerer can begin
candidate gathering more quickly).
</t>
<t>
For optimal performance, it is RECOMMENDED that the candidates in
an initial offer (if any) be host candidates only. This would allow
both agents to start gathering server reflexive, relayed, and other
non-host candidates simultaneously, and it would also enable them to
begin connectivity checks.
</t>
<t>
If the privacy implications of revealing host addresses on an
endpoint device are a
concern, agents can generate an offer that contains no
candidates and then only trickle candidates that do not reveal
host addresses (e.g., relayed candidates).
</t>
<t>
Methods for calculating priorities and foundations, as well as
determining redundancy of candidates, work just as with vanilla
ICE.
</t>
</section>
<section title='Receiving the Initial Offer' >
<t>
When an agent receives an initial offer, it will first check if
the offer or offerer indicates support for Trickle ICE as explained in
<xref target="disco"/>. If this is not the case, the agent MUST
process the offer according to Vanilla ICE procedures
<xref target="rfc5245bis"/> or offer/answer processing rules
<xref target="RFC3264"/> if no ICE support is detected at all.
</t>
<t>
If support for Trickle ICE is
confirmed, an agent will automatically assume support for
Vanilla ICE as well even if the support verification procedure
in <xref target="rfc5245bis"/> indicates otherwise. Specifically,
the rules from <xref target="rfc5245bis"/> would imply that ICE
itself is not supported if the initial offer includes no candidates
in the offer; however, such a conclusion is not warranted if the
answerer can confirm that the offerer supports Trickle ICE and
thus fallback to <xref target="RFC3264"/> is not necessary.
</t>
<t>
If the offer does indicate support for Trickle ICE, the agent
will determine its role, start gathering and prioritizing
candidates and while doing so it will also respond by sending
its own answer, so that both agents can start forming check
lists and begin connectivity checks.
</t>
<section title="Sending the Initial Answer">
<t>
An agent can respond to an initial offer at any point while
gathering candidates. The answer can again contain any set of
candidates, including all candidates or no candidates. (The
benefit of including no candidates is to send the answer as
quickly as possible, so that both parties can consider the
overall session to be under active negotiation as soon as
possible.) Unless the answering agent is
protecting host addresses for privacy reasons, it would
typically construct this initial answer including only host
addresses, thus enabling the remote party to also start forming
check lists and performing connectivity checks.
</t>
<t>
In application protocols that use SDP,
the answer MUST indicate support for Trickle ICE as described
in <xref target="disco"/>.
</t>
</section>
<section title="Forming Check Lists and Beginning Connectivity
Checks" anchor="check.lists">
<t>
After exchanging the offer and answer, and as soon as they have
obtained local and remote candidates, agents begin
forming candidate pairs, computing candidate pair priorities
and ordering candidate pairs, pruning duplicate pairs, and
creating check lists according to the Vanilla ICE procedures
described in <xref target="rfc5245bis"/>.
</t>
<t>
According to those procedures, in order for candidate pairing
to be possible and for duplicate candidates to be pruned, the
candidates would need to be provided in both the offer and the
answer. Under Trickle ICE, check lists can be empty until
candidate pairs are sent or received. Therefore Trickle ICE agents
handle check lists and candidate pairing in a slightly different
way: the agents still create the check lists, but they only
populate the check lists after they actually have the candidate
pairs.
</t>
<t>
<list style='empty'>
<t>
Note: According to <xref target="rfc5245bis"/>, "A check list with at
least one pair that is Waiting is called an active check list,
and a check list with all pairs Frozen is called a frozen check list."
Formally speaking an active check list does not have a state of Active
and a frozen check list does not have a state of Frozen, because the
only check list states are Running, Completed, and Failed.
</t>
</list>
</t>
<t>
A Trickle ICE agent MUST initially consider all check lists to be
frozen. It then inspects the first check list and
attempts to unfreeze all candidates belonging to the first
component on the first media stream (i.e., the first media
stream that was reported to the ICE implementation from the
using application). However, if this check list is still empty,
an agent delays further processing until the check list is
non-empty.
</t>
<t>
With regard to pruning of duplicate candidate pairs, a Trickle ICE
agent SHOULD follow a policy of "first one wins" and not re-apply
the pruning procedure if a higher-priority candidate pair is
received from the remote agent.
</t>
<t>
Respecting the order in which check lists have been reported to an
ICE implementation is crucial to the frozen candidates
algorithm, so that connectivity
checks are performed simultaneously by both agents.
</t>
</section>
</section>
<section title="Receiving the Initial Answer">
<t>
When receiving an answer, agents follow Vanilla ICE
procedures to determine their role, after which they
form check lists (as described in <xref target="check.lists"/>)
and begin connectivity checks.
</t>
</section>
<section title='Performing Connectivity Checks' >
<t>
For the most part, Trickle ICE agents perform connectivity
checks following Vanilla ICE procedures. However, the
asynchronous nature of gathering and communicating candidates
in Trickle ICE impose a number of changes described as
described in the following sections.
</t>
<section title="Scheduling Checks" anchor="scheduling-checks">
<t>
The ICE specification <xref target='rfc5245bis'/>, Section 5.8,
requires that agents terminate the timer for a triggered
check in relation to an active check list once the agent
has exhausted all frozen pairs in check list. This will
not work with Trickle ICE, because more pairs will be
added to the check list incrementally.
</t>
<t>
Therefore, a Trickle ICE agent SHOULD NOT terminate the timer
until the state of the check list is Completed or Failed as
specified herein (see <xref target='end-of-candidates'/>).
</t>
</section>
<section title="Check List and Timer State Updates"
anchor="state-updates">
<t>
The ICE specification <xref target='rfc5245bis'/>, Section 7.1.3.3,
requires that agents update check lists and timer states upon
completing a connectivity check transaction. During such an
update, Vanilla ICE agents would set the state of a check list
to Failed if both of the following two conditions are satisfied:
</t>
<t>
<list style="symbols">
<t>
all of the pairs in the check list are either in the
Failed or Succeeded state; and
</t>
<t>
there is not a pair in the valid list for each component
of the media stream.
</t>
</list>
</t>
<t>
With Trickle ICE, the above situation would often occur when
candidate gathering and trickling are still in progress, even
though it is quite possible that future checks will succeed. For
this reason, Trickle ICE agents add the following conditions to
the above list:
</t>
<t>
<list style="symbols">
<t>
all candidate gatherers have completed and the agent
is not expecting to discover any new local candidates;
</t>
<t>
the remote agent has sent an end-of-candidates indication
for that check list as described in
<xref target="end-of-candidates"/>.
</t>
</list>
</t>
<t>
Vanilla ICE requires that agents then update all other check
lists, placing one pair from each of them into the Waiting
state, effectively unfreezing all remaining check lists. However,
under Trickle ICE other check lists might still be empty at
that point. Therefore a Trickle ICE agent SHOULD monitor whether
a check list is active or frozen independently of the state of the
candidate pairs that the check list contains. A Trickle ICE agent
SHOULD consider a check list to be active either when unfreezing
the first candidate pair in the check list or when there is no
candidate pair in the check list (i.e., when the check list is
empty).
</t>
</section>
</section>
<section title='Discovering and Sending Additional Local Candidates'
anchor="send-trickling">
<t>
After an offer or an answer has been sent, agents will most
likely continue discovering new local candidates as STUN, TURN,
and other non-host candidate gathering mechanisms begin to
yield results. Whenever an agent discovers such a new candidate
it will compute its priority, type, foundation and component ID
according to normal Vanilla ICE procedures.
</t>
<t>
The new candidate is then checked for redundancy against the
existing list of local candidates. If its transport address and
base match those of an existing candidate, it will be considered
redundant and will be ignored. This would often happen for
server reflexive candidates that match the host addresses they
were obtained from (e.g., when the latter are public IPv4
addresses). Contrary to Vanilla ICE, Trickle ICE agents will
consider the new candidate redundant regardless of its priority.
</t>
<t>
Next the agent sends (i.e., trickles) the newly discovered
candidate(s) to the remote agent. The actual delivery of the new
candidates are specified by using protocols such as SIP or XMPP.
Trickle ICE imposes no restrictions on the way this is done or
whether it is done at all. For example, some applications may
choose not to send trickle updates for server reflexive
candidates and rely on the discovery of peer reflexive ones
instead.
</t>
<t>
When trickle updates are sent, each candidate MUST be
delivered to the receiving Trickle ICE implementation not more
than once and in the same order that they were sent. In other
words, if there are any candidate retransmissions, they must
be hidden from the ICE implementation.
</t>
<t>
Also, candidate trickling needs to be correlated to a specific
ICE negotiation session, so that if there is an ICE restart, any
delayed updates for a previous session can be recognized as such
and ignored by the receiving party.
</t>
<t>
One important aspect of Vanilla ICE is that connectivity checks
for a specific foundation and component are attempted
simultaneously by both agents, so that any firewalls or NATs
fronting the agents would whitelist both endpoints and allow
all except for the first ("suicide") packets to go through. This
is also crucial to unfreezing candidates in the right time.
</t>
<t>
In order to preserve this feature in Trickle ICE, when trickling
candidates agents MUST respect the order of the components as
they appear (implicitly or explicitly) in the offer/answer
descriptions. Therefore a candidate for a specific component
MUST NOT be sent prior to candidates for other components within
the same foundation.
</t>
<t>
For example, the following SDP description contains two
components (RTP and RTCP) and two foundations (host and
server reflexive):
<figure>
<artwork>
<![CDATA[
v=0
o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1
s=
c=IN IP4 10.0.1.1
t=0 0
a=ice-pwd:asd88fgpdd777uzjYhagZg
a=ice-ufrag:8hhY
m=audio 5000 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=candidate:1 1 UDP 2130706431 10.0.1.1 5000 typ host
a=candidate:1 2 UDP 2130706431 10.0.1.1 5001 typ host
a=candidate:2 1 UDP 1694498815 192.0.2.3 5000 typ srflx
raddr 10.0.1.1 rport 8998
a=candidate:2 2 UDP 1694498815 192.0.2.3 5001 typ srflx
raddr 10.0.1.1 rport 8998
]]>
</artwork>
</figure>
For this description the RTCP host candidate MUST NOT be sent
prior to the RTP host candidate. Similarly the RTP server
reflexive candidate MUST be sent together with or prior to the
RTCP server reflexive candidate.
</t>
<t>
Note that the order restriction only applies among candidates
that belong to the same foundation.
</t>
<t>
It is also equally important to preserve this order across media
streams, which is covered by the requirement to always start
unfreezing candidates starting from the first media stream
as described under <xref target="check.lists"/>.
</t>
<t>
Once the candidate has been sent to the remote party, the agent
checks if any remote candidates are currently known for this
same stream. If not, the new candidate will
simply be added to the list of local candidates.
</t>
<t>
Otherwise, if the agent has already learned of one or more
remote candidates for this stream and component, it will begin
pairing the new local candidates with them and adding the pairs
to the existing check lists according to their priority.
</t>
<section title='Pairing Newly Learned Candidates and Updating
Check Lists' anchor="cand-pairing">
<t>
Forming candidate pairs works the way it is described by
the ICE specification <xref target='rfc5245bis'/>.
However, actually adding the new pair to
a check list happens according to the rules
described below.
</t>
<t>
If the check list where the pair is to be added already
contains the maximum number of candidate pairs (100 by default
as per <xref target="rfc5245bis"/>), the new pair is discarded.
</t>
<t>
If the new pair's local candidate is server reflexive, the
server reflexive candidate MUST be replaced by its base before
adding the pair to the list. Once this is done, the agent
examines the check list looking for another pair that would be
redundant with the new one. If such a pair exists, the newly
formed pair is ignored.
</t>
<t>
For all other pairs, including those with a server reflexive
local candidate that were not found to be redundant:
<list style="symbols">
<t>
if this check list is frozen then the new pair will
be assigned a state of Frozen.
</t>
<t>
else if the check list is active and it is either empty or
contains only candidates in the Succeeded and Failed
states, then the new pair's state is set to Waiting.
</t>
<t>
else if the check list is non-empty and active, then the
state of the new pair will be set to
<list style="hanging">
<t hangText="Frozen: ">
if there is at least one pair in the check list whose
foundation matches the one in the new pair and whose
state is neither Succeeded nor Failed (eventually the
new pair will get unfrozen after the ongoing
check for the existing pair concludes);
</t>
<t hangText="Waiting: ">
if the list contains no pairs with the same foundation
as the new one, or, in case such pairs exist but they
are all in either the Succeeded or Failed states.
</t>
</list>
</t>
</list>
</t>
</section>
<section title='Announcing End of Candidates'
anchor="end-of-candidates">
<t>
Once all candidate gathering is completed or expires for a
specific media stream, the agents will generate an
"end-of-candidates" indication for that stream and send it to
the remote agent via the signalling channel. The exact form of
the indication depends on the application protocol. The
indication can be sent in the following ways:
<list style='symbols'>
<t>As part of an offer (which would typically be the case with
half trickle initial offers)</t>
<t>Along with the last candidate an agent can send for a stream</t>
<t>As a standalone notification (e.g., after STUN Binding requests
or TURN Allocate requests to a server timeout and the agent has
no other active gatherers)</t>
</list>
</t>
<t>
A controlled Trickle ICE agent SHOULD send
end-of-candidates indications after gathering for a media stream
has completed, unless ICE processing terminates before the agent has
had a chance to do so. Sending the indication is necessary in
order to avoid ambiguities and speed up the conclusion of ICE
processing. On the other hand, a
controlling agent MAY
conclude ICE processing prior to sending end-of-candidates
indications for all streams. This would typically be the case
with aggressive nomination. However, it is RECOMMENDED that
controlling agents do send such indications whenever possible
for the sake of consistency and to keep middle boxes and
controlled agents up-to-date on the state of ICE processing.
</t>
<t>
When sending an end-of-candidate indication during trickling
(rather than as a part of an offer or an answer),
it is the responsibility of the
using protocol to define methods for relating the
indication to one or more specific media streams.
</t>
<t>
Receiving an end-of-candidates indication enables an agent to
update check list states and, in case valid pairs do not exist
for every component in every media stream, determine that ICE
processing has failed. It also enables agents to speed up the
conclusion of ICE processing when a candidate pair has been validated
but it involves the use of lower-preference transports such as
TURN. In such situations, an implementations may choose to wait
and see if higher-priority candidates are received; in this case
the end-of-candidates indication provides a notificaiton that such
candidates are not forthcoming.
</t>
<t>
An agent MAY also choose to generate an end-of-candidates
indication before candidate gathering has actually completed, if the
agent determines that gathering has continued for more than an
acceptable period of time. However, an agent MUST NOT send any
more candidates after it has send an end-of-candidates
indication.
</t>
<t>
When performing half trickle, an agent SHOULD send an
end-of-candidates indication together with its initial offer unless
it is planning to potentially send additional candidates (e.g., in
case the remote party turns out to support Trickle ICE).
</t>
<t>
When an end-of-candidates indication is sent as part of an offer or
an answer, it can be considered to apply to the session as a whole,
which is equivalent to having it apply to all media streams.
</t>
<t>
After an agent sends the end-of-candidates indication, it will
update the state of the corresponding check list as explained
in <xref target="state-updates"/>. Past that point, an
agent MUST NOT send any new candidates within this ICE session.
After an agent has received an end-of-candidates indication, it
MUST also ignore any newly received candidates for that media
stream or media session. Therefore, adding new candidates to the
negotiation is possible only through an ICE restart.
</t>
<t>
This specification does not
override Vanilla ICE semantics for concluding ICE processing.
Therefore even if end-of-candidates indications are sent
agents will still have to go through pair nomination. Also, if
pairs have been nominated for components and media streams, ICE
processing will still conclude even if end-of-candidate
indications have not been received for all streams.
</t>
</section>
</section>
<section title='Receiving Additional Remote Candidates'
anchor="recv-trickling">
<t>
At any point of ICE processing, a Trickle ICE agent may receive
new candidates from the remote agent. When this happens and no
local candidates are currently known for this same stream, the
new remote candidates are simply added to the list of remote
candidates.
</t>
<t>
Otherwise, the new candidates are used for forming candidate
pairs with the pool of local candidates and they are added to
the local check lists as described in
<xref target="cand-pairing"/>.
</t>
<t>
Once the remote agent has completed candidate gathering, it
will send an end-of-candidates indication. Upon receiving such an
indication, the local agent MUST update check list states as per
<xref target="state-updates"/>. This may lead to some check
lists being marked as Failed.
</t>
</section>
<section title='Receiving an End-Of-Candidates Notification'
anchor="end-of-candidates.recv">
<t>
When an agent receives an end-of-candidates indication
for a specific check list, it will update the state of the
check list as per
<xref target="state-updates"/>. If the check list is still
active state after the update, the agent will persist the
the fact that an end-of-candidates indication has been
received and take it into account in future updates
to the check list.
</t>
</section>
<section title="Trickle ICE and Peer Reflexive Candidates">
<t>
Even though Trickle ICE does not explicitly modify the
procedures for handling peer reflexive candidates, their
processing could be impacted in implementations. With Trickle
ICE, it is possible that server reflexive candidates can be
discovered as peer reflexive in cases where incoming
connectivity checks are received from these candidates before
the trickle updates that carry them.
</t>
<t>
While this would certainly increase the number of cases where
ICE processing nominates and selects candidates discovered as
peer-reflexive, it does not require any change in processing.
</t>
<t>
It is also likely that some applications would prefer not to
trickle server reflexive candidates to entities that are known
to be publicly accessible and where sending a direct STUN
binding request is likely to reach the destination faster than
the trickle update that travels through the signalling path.
</t>
</section>
<section title='Concluding ICE Processing'
anchor="concluding.ice">
<t>
This specification does not directly modify the procedures
ending ICE processing described in Section 8 of
<xref target="rfc5245bis"/>, and Trickle ICE implementations will
follow the same rules.
</t>
<t>
</t>
</section>
<section title='Subsequent Offer/Answer Exchanges'
anchor="subsequent.oa">
<t>
Either agent MAY generate a subsequent offer at any time allowed
by <xref target="RFC3264"/>. When this happens agents will use
<xref target="rfc5245bis"/> semantics to determine whether or not
the new offer requires an ICE restart. If this is the case then
agents would perform Trickle ICE as they would in an initial
offer/answer exchange.
</t>
<t>
The only differences between an ICE restart and a brand new
media session are that:
</t>
<t>
<list style='symbols'>
<t>
during the restart, media can continue to be sent to the
previously validated pair.
</t>
<t>
both agents are already aware whether or not their peer
supports Trickle ICE, and there is no longer need for
performing half trickle or confirming support with other
mechanisms.
</t>
</list>
</t>
</section>
<section title='Unilateral Use of Trickle ICE (Half Trickle)'
anchor="half-trickle">
<t>
In half trickle mode, the offerer sends a regular, Vanilla ICE
offer, with a complete set of candidates. This ensures that the
offer can be processed by a Vanilla ICE answerer and is mostly
meant for use in cases where support for Trickle ICE cannot be
confirmed prior to sending an initial offer. The initial offer
indicates support for Trickle ICE, so that the answerer can
respond with an incomplete set of candidates and continue
trickling the rest. Half trickle offers typically contain an
end-of-candidates indication, although this is not mandatory
because if trickle support is confirmed then the offerer can
choose to trickle additional candidates before it sends an
end-of-candidates indication.
</t>
<t>
The half trickle mechanism can be used in cases where there is
no way for an agent to verify in advance whether a remote
party supports Trickle ICE. Because the initial offer contains
a full set of candidates, it can thus be handled by a regular
Vanilla ICE agent, while still allowing a Trickle ICE agent to use
the optimization defined in this specification. This prevents
negotiation from failing in the former case while still giving
roughly half the Trickle ICE benefits in the latter (hence the
name of the mechanism).
</t>
<t>
Use of half trickle is only necessary during an initial
offer/answer exchange. After both parties have received a
session description from their peer, they can each reliably
determine Trickle ICE support and use it for all subsequent
offer/answer exchanges.
</t>
<t>
In some instances, using half trickle might bring more than
just half the improvement in terms of user experience. This
can happen when an agent starts gathering candidates upon user
interface cues that the user will soon be initiating an offer,
such as activity on a keypad or the phone going off hook. This
would mean that some or all of the candidate
gathering could be completed before the agent actually
needs to send the offer. Because the answerer will be able
to trickle candidates, both agents will be able to start
connectivity checks and complete ICE processing earlier than
with Vanilla ICE and potentially even as early as with full
trickle.
</t>
<t>
However, such anticipation is not always possible. For
example, a multipurpose user agent or a WebRTC web page where
communication is a non-central feature (e.g., calling a support
line in case of a problem with the main features) would not
necessarily have a way of distinguishing between call
intentions and other user activity. In such cases, using full
trickle is most likely to result in an ideal user experience.
Even so, using half trickle would be an improvement over vanilla
ICE because it would result in a better experience for answerers.
</t>
</section>
<section title='Example Flow'>
<t>
A typical successful Trickle ICE exchange with an Offer/Answer
protocol would look this way:
</t>
<figure title="Example " anchor="fig-example">
<artwork>
<![CDATA[
Alice Bob
| Offer |
|---------------------------------------------->|
| Additional Candidates |
|---------------------------------------------->|
| |
| Answer |
|<----------------------------------------------|
| Additional Candidates |
|<----------------------------------------------|
| |
| Additional Candidates and Connectivity Checks |
|<--------------------------------------------->|
| |
|<=============== MEDIA FLOWS =================>|
]]>
</artwork>
</figure>
</section>
<section title='IANA Considerations'>
<t>This specification requests no actions from IANA.</t>
</section>
<section title='Security Considerations'>
<t>
This specification inherits most of its semantics from
<xref target="rfc5245bis"/> and as a result all security
considerations described there remain the same.
</t>
</section>
<section title='Acknowledgements'>
<t>
The authors would like to thank Bernard Aboba,
Flemming Andreasen, Rajmohan Banavi, Christer Holmberg,
Jonathan Lennox, Enrico Marocco, Pal Martinsen,
Martin Thomson, Dale R. Worley, and Brandon Williams
for their reviews and suggestions on improving this document.
</t>
</section>
</middle>
<back>
<references title='Normative References'>
<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.3264"?>
<?rfc include="reference.RFC.4566"?>
<reference anchor='rfc5245bis'>
<front>
<title>Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal</title>
<author initials='A' surname='Keranen' fullname='Ari Keranen'>
<organization />
</author>
<author initials='J' surname='Rosenberg' fullname='Jonathan Rosenberg'>
<organization />
</author>
<date month='October' day='19' year='2015' />
<abstract><t>This document describes a protocol for Network Address Translator (NAT) traversal for UDP-based multimedia. This protocol is called Interactive Connectivity Establishment (ICE). ICE makes use of the Session Traversal Utilities for NAT (STUN) protocol and its extension, Traversal Using Relay NAT (TURN). This document obsoletes RFC 5245.</t></abstract>
</front>
<seriesInfo name='Internet-Draft' value='draft-ietf-ice-rfc5245bis-00' />
<format type='TXT'
target='http://www.ietf.org/internet-drafts/draft-ietf-ice-rfc5245bis-00.txt' />
</reference>
</references>
<references title='Informative References'>
<?rfc include="reference.RFC.1918"?>
<?rfc include="reference.RFC.3261"?>
<?rfc include="reference.RFC.4787"?>
<?rfc include="reference.RFC.5389"?>
<?rfc include="reference.RFC.5766"?>
<?rfc include="reference.I-D.keranen-mmusic-ice-address-selection"?>
<?rfc include="reference.I-D.ietf-mmusic-trickle-ice-sip"?>
<reference anchor="XEP-0176">
<front>