idnits 2.17.1 draft-ietf-ice-trickle-01.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 9 instances 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. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 10, 2015) is 3060 days in the past. Is this intentional? 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 normative reference: RFC 4566 (Obsoleted by RFC 8866) == Outdated reference: A later version (-18) exists of draft-ietf-mmusic-trickle-ice-sip-03 -- Obsolete informational reference (is this intentional?): RFC 5389 (Obsoleted by RFC 8489) -- Obsolete informational reference (is this intentional?): RFC 5766 (Obsoleted by RFC 8656) Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group E. Ivov 3 Internet-Draft Jitsi 4 Intended status: Standards Track E. Rescorla 5 Expires: June 12, 2016 RTFM, Inc. 6 J. Uberti 7 Google 8 P. Saint-Andre 9 &yet 10 December 10, 2015 12 Trickle ICE: Incremental Provisioning of Candidates for the Interactive 13 Connectivity Establishment (ICE) Protocol 14 draft-ietf-ice-trickle-01 16 Abstract 18 This document describes an extension to the Interactive Connectivity 19 Establishment (ICE) protocol that enables ICE agents to send and 20 receive candidates incrementally rather than exchanging complete 21 lists. With such incremental provisioning, ICE agents can begin 22 connectivity checks while they are still gathering candidates and 23 considerably shorten the time necessary for ICE processing to 24 complete. This mechanism is called "trickle ICE". 26 Status of This Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on June 12, 2016. 43 Copyright Notice 45 Copyright (c) 2015 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 61 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 62 3. Determining Support for Trickle ICE . . . . . . . . . . . . . 5 63 4. Sending the Initial Offer . . . . . . . . . . . . . . . . . . 6 64 5. Receiving the Initial Offer . . . . . . . . . . . . . . . . . 6 65 5.1. Sending the Initial Answer . . . . . . . . . . . . . . . 7 66 5.2. Forming Check Lists and Beginning Connectivity 67 Checks . . . . . . . . . . . . . . . . . . . . . . . . . 7 68 6. Receiving the Initial Answer . . . . . . . . . . . . . . . . 8 69 7. Performing Connectivity Checks . . . . . . . . . . . . . . . 8 70 7.1. Scheduling Checks . . . . . . . . . . . . . . . . . . . . 8 71 7.2. Check List and Timer State Updates . . . . . . . . . . . 9 72 8. Discovering and Sending Additional Local Candidates . . . . . 9 73 8.1. Pairing Newly Learned Candidates and Updating 74 Check Lists . . . . . . . . . . . . . . . . . . . . . . . 11 75 8.2. Announcing End of Candidates . . . . . . . . . . . . . . 12 76 9. Receiving Additional Remote Candidates . . . . . . . . . . . 14 77 10. Receiving an End-Of-Candidates Notification . . . . . . . . . 14 78 11. Trickle ICE and Peer Reflexive Candidates . . . . . . . . . . 14 79 12. Concluding ICE Processing . . . . . . . . . . . . . . . . . . 15 80 13. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 15 81 14. Unilateral Use of Trickle ICE (Half Trickle) . . . . . . . . 15 82 15. Example Flow . . . . . . . . . . . . . . . . . . . . . . . . 16 83 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 84 17. Security Considerations . . . . . . . . . . . . . . . . . . . 17 85 18. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 17 86 19. References . . . . . . . . . . . . . . . . . . . . . . . . . 17 87 19.1. Normative References . . . . . . . . . . . . . . . . . . 17 88 19.2. Informative References . . . . . . . . . . . . . . . . . 18 89 Appendix A. Interaction with ICE . . . . . . . . . . . . . . . . 19 90 Appendix B. Interaction with ICE Lite . . . . . . . . . . . . . 20 91 Appendix C. Changes from Earlier Versions . . . . . . . . . . . 21 92 C.1. Changes from draft-ietf-ice-trickle-00 . . . . . . . . . 21 93 C.2. Changes from draft-mmusic-trickle-ice-02 . . . . . . . . 22 94 C.3. Changes from draft-ivov-01 and draft-mmusic-00 . . . . . 22 95 C.4. Changes from draft-ivov-00 . . . . . . . . . . . . . . . 22 96 C.5. Changes from draft-rescorla-01 . . . . . . . . . . . . . 23 97 C.6. Changes from draft-rescorla-00 . . . . . . . . . . . . . 24 98 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 100 1. Introduction 102 The Interactive Connectivity Establishment (ICE) protocol 103 [rfc5245bis] describes mechanisms for gathering candidates, 104 prioritizing them, choosing default ones, exchanging them with the 105 remote party, pairing them, and ordering them into check lists. Once 106 all of these actions have been completed (and only then), the 107 participating agents can begin a phase of connectivity checks and 108 eventually select the pair of candidates that will be used in a media 109 session. 111 Although the sequence described above has the advantage of being 112 relatively straightforward to implement and debug once deployed, it 113 can also be rather lengthy. Candidate gathering often involves 114 things like querying STUN [RFC5389] servers, discovering UPnP 115 devices, and allocating relayed candidates at TURN [RFC5766] servers. 116 All of these actions can be delayed for a noticeable amount of time; 117 although they can be run in parallel, they still need to respect the 118 pacing requirements from [rfc5245bis], which is likely to delay them 119 even further. Some or all of these actions also need be completed by 120 the remote agent. Both agents would next perform connectivity checks 121 and only then would they be ready to begin streaming media. 123 These factors can lead to relatively lengthy session establishment 124 times and degraded user experience. 126 This document defines an alternative mode of operation for ICE 127 implementations, known as "Trickle ICE", in which candidates can be 128 exchanged incrementally. This enables ICE agents to exchange 129 candidates as soon as a session has been initiated. Connectivity 130 checks for a media stream can also start as soon as the first 131 candidates for that stream become available. 133 Trickle ICE can reduce session establishment times in cases where 134 connectivity is confirmed for the first exchanged candidates (e.g., 135 where the host candidates for one of the agents are directly 136 reachable from the second agent, such as host candidates at a media 137 relay). Even when this is not the case, running candidate gathering 138 for both agents and connectivity checks in parallel can considerably 139 shorten ICE processing times. 141 It is worth noting that there is quite a bit of operational 142 experience with the Trickle ICE technique, going back as far as 2005 143 (when the XMPP Jingle extension defined a "dribble mode" as specified 144 in [XEP-0176]); this document incorporates feedback from those who 145 have implemented and deployed the technique. 147 In addition to the basics of Trickle ICE, this document also 148 describes how to discover support for Trickle ICE, how regular ICE 149 processing needs to be modified when building and updating check 150 lists, and how Trickle ICE implementations interoperate with agents 151 that only implement so-called "Vanilla ICE" processing as defined in 152 [rfc5245bis]. 154 This specification does not define the usage of Trickle ICE with any 155 specific signalling protocol (however, see 156 [I-D.ietf-mmusic-trickle-ice-sip] for usage with SIP [RFC3261]). 157 Similarly, it does not define Trickle ICE in terms of the Session 158 Description Protocol (SDP) [RFC4566] or the offer/answer model 159 [RFC3264] because the technique can be and already is used in 160 application protocols that are not tied to SDP or to offer/answer 161 semantics. 163 2. Terminology 165 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 166 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 167 document are to be interpreted as described in [RFC2119]. 169 This specification makes use of all terminology defined for 170 Interactive Connectivity Establishment in [rfc5245bis]. 172 Vanilla ICE: The Interactive Connectivity Establishment protocol as 173 defined in [rfc5245bis]. 175 Candidate Harvester: A module used by an ICE agent to obtain local 176 candidates. Candidate gatherers use different mechanisms for 177 discovering local candidates. Some of them would typically make 178 use of protocols such as STUN or TURN. Others may also employ 179 techniques that are not referenced within [rfc5245bis] (e.g., UPnP 180 based port allocation or XMPP Jingle Relay Nodes [XEP-0278]). 182 Trickled Candidates: Candidates that a Trickle ICE agent sends after 183 an offer or answer but within the same context. Trickled 184 candidates can be sent in parallel with candidate gathering and 185 connectivity checks. 187 Trickling/Trickle (v.): The act of sending trickled candidates. 189 Half Trickle: A Trickle ICE mode of operation where the offerer 190 gathers its first generation of candidates strictly before 191 creating and sending the offer. Once sent, that offer can be 192 processed by Vanilla ICE agents and does not require support for 193 this specification. It also allows Trickle ICE capable answerers 194 to still gather candidates and perform connectivity checks in a 195 non-blocking way, thus roughly offering "half" the advantages of 196 Trickle ICE. The mechanism is mostly meant for use in cases where 197 support for trickle ICE cannot be confirmed prior to sending a 198 initial offer. 200 Full Trickle: The regular mode of operation for Trickle ICE agents, 201 in which an initial offer can include any number of candidates 202 (even zero candidates) and does not need to include the entire 203 first generation of candidates as in half trickle. 205 3. Determining Support for Trickle ICE 207 Application protocols that use Trickle ICE should do one of the 208 following: 210 o Provide a way for agents to verify support of Trickle ICE prior to 211 initiating a session (XMPP's Service Discovery [XEP-0030] is one 212 such mechanism). 214 o Make support for Trickle ICE mandatory so that user agents can 215 assume support. 217 Alternately, for cases where a protocol provides neither of the 218 foregoing methods, agents may rely on provisioning/configuration or 219 use the half trickle procedure described in Section 14. 221 Prior to sending an initial offer, agents using signaling protocols 222 that support capabilities discovery can attempt to verify whether or 223 not the remote party supports Trickle ICE. If an agent determines 224 that the remote party does not support Trickle ICE, it MUST fall back 225 to using Vanilla ICE or abandon the entire session. 227 In application protocols that use SDP, a user agent supporting 228 Trickle ICE MUST include a token of "trickle" in the ice-options 229 attribute every time it generates an offer or an answer. This 230 enables an agent that receives offers or answers to verify support by 231 checking for presence of the token. 233 Dedicated discovery semantics and half trickle are needed only prior 234 to session initiation (e.g., when sending the initial offer). After 235 a session is established and Trickle ICE support is confirmed for 236 both parties, either agent can use full trickle for subsequent 237 offers. 239 4. Sending the Initial Offer 241 An agent starts gathering candidates as soon as it has an indication 242 that communication is imminent (e.g., a user interface cue or an 243 explicit request to initiate a session). Contrary to Vanilla ICE, 244 implementations of Trickle ICE do not need to gather candidates in a 245 blocking manner. Therefore, unless half trickle is being used, 246 agents SHOULD generate and transmit their initial offer as early as 247 possible, in order to allow the remote party to start gathering and 248 trickling candidates. 250 Trickle ICE agents MAY include any set of candidates in an offer. 251 This includes the possibility of sending an offer that contains all 252 the candidates that the agent plans to use (as in half trickle mode), 253 sending an offer that contains only a publically-reachable IP address 254 (e.g., a host candidate at a media relay that is known to not be 255 behind a firewall), or sending an offer with no candidates at all (in 256 which case the offerer can receive the answerer's initial candidate 257 list sooner and the answerer can begin candidate gathering more 258 quickly). 260 For optimal performance, it is RECOMMENDED that the candidates in an 261 initial offer (if any) be host candidates only. This would allow 262 both agents to start gathering server reflexive, relayed, and other 263 non-host candidates simultaneously, and it would also enable them to 264 begin connectivity checks. 266 If the privacy implications of revealing host addresses on an 267 endpoint device are a concern, agents can generate an offer that 268 contains no candidates and then only trickle candidates that do not 269 reveal host addresses (e.g., relayed candidates). 271 Methods for calculating priorities and foundations, as well as 272 determining redundancy of candidates, work just as with vanilla ICE. 274 5. Receiving the Initial Offer 276 When an agent receives an initial offer, it will first check if the 277 offer or offerer indicates support for Trickle ICE as explained in 278 Section 3. If this is not the case, the agent MUST process the offer 279 according to Vanilla ICE procedures [rfc5245bis] or offer/answer 280 processing rules [RFC3264] if no ICE support is detected at all. 282 If support for Trickle ICE is confirmed, an agent will automatically 283 assume support for Vanilla ICE as well even if the support 284 verification procedure in [rfc5245bis] indicates otherwise. 285 Specifically, the rules from [rfc5245bis] would imply that ICE itself 286 is not supported if the initial offer includes no candidates in the 287 offer; however, such a conclusion is not warranted if the answerer 288 can confirm that the offerer supports Trickle ICE and thus fallback 289 to [RFC3264] is not necessary. 291 If the offer does indicate support for Trickle ICE, the agent will 292 determine its role, start gathering and prioritizing candidates and 293 while doing so it will also respond by sending its own answer, so 294 that both agents can start forming check lists and begin connectivity 295 checks. 297 5.1. Sending the Initial Answer 299 An agent can respond to an initial offer at any point while gathering 300 candidates. The answer can again contain any set of candidates, 301 including all candidates or no candidates. (The benefit of including 302 no candidates is to send the answer as quickly as possible, so that 303 both parties can consider the overall session to be under active 304 negotiation as soon as possible.) Unless the answering agent is 305 protecting host addresses for privacy reasons, it would typically 306 construct this initial answer including only host addresses, thus 307 enabling the remote party to also start forming check lists and 308 performing connectivity checks. 310 In application protocols that use SDP, the answer MUST indicate 311 support for Trickle ICE as described in Section 3. 313 5.2. Forming Check Lists and Beginning Connectivity Checks 315 After exchanging the offer and answer, and as soon as they have 316 obtained local and remote candidates, agents begin forming candidate 317 pairs, computing candidate pair priorities and ordering candidate 318 pairs, pruning duplicate pairs, and creating check lists according to 319 the Vanilla ICE procedures described in [rfc5245bis]. 321 According to those procedures, in order for candidate pairing to be 322 possible and for duplicate candidates to be pruned, the candidates 323 would need to be provided in both the offer and the answer. Under 324 Trickle ICE, check lists can be empty until candidate pairs are sent 325 or received. Therefore Trickle ICE agents handle check lists and 326 candidate pairing in a slightly different way: the agents still 327 create the check lists, but they only populate the check lists after 328 they actually have the candidate pairs. 330 Note: According to [rfc5245bis], "A check list with at least one 331 pair that is Waiting is called an active check list, and a check 332 list with all pairs Frozen is called a frozen check list." 333 Formally speaking an active check list does not have a state of 334 Active and a frozen check list does not have a state of Frozen, 335 because the only check list states are Running, Completed, and 336 Failed. 338 A Trickle ICE agent MUST initially consider all check lists to be 339 frozen. It then inspects the first check list and attempts to 340 unfreeze all candidates belonging to the first component on the first 341 media stream (i.e., the first media stream that was reported to the 342 ICE implementation from the using application). However, if this 343 check list is still empty, an agent delays further processing until 344 the check list is non-empty. 346 With regard to pruning of duplicate candidate pairs, a Trickle ICE 347 agent SHOULD follow a policy of "first one wins" and not re-apply the 348 pruning procedure if a higher-priority candidate pair is received 349 from the remote agent. 351 Respecting the order in which check lists have been reported to an 352 ICE implementation is crucial to the frozen candidates algorithm, so 353 that connectivity checks are performed simultaneously by both agents. 355 6. Receiving the Initial Answer 357 When receiving an answer, agents follow Vanilla ICE procedures to 358 determine their role, after which they form check lists (as described 359 in Section 5.2) and begin connectivity checks. 361 7. Performing Connectivity Checks 363 For the most part, Trickle ICE agents perform connectivity checks 364 following Vanilla ICE procedures. However, the asynchronous nature 365 of gathering and communicating candidates in Trickle ICE impose a 366 number of changes described as described in the following sections. 368 7.1. Scheduling Checks 370 The ICE specification [rfc5245bis], Section 5.8, requires that agents 371 terminate the timer for a triggered check in relation to an active 372 check list once the agent has exhausted all frozen pairs in check 373 list. This will not work with Trickle ICE, because more pairs will 374 be added to the check list incrementally. 376 Therefore, a Trickle ICE agent SHOULD NOT terminate the timer until 377 the state of the check list is Completed or Failed as specified 378 herein (see Section 8.2). 380 7.2. Check List and Timer State Updates 382 The ICE specification [rfc5245bis], Section 7.1.3.3, requires that 383 agents update check lists and timer states upon completing a 384 connectivity check transaction. During such an update, Vanilla ICE 385 agents would set the state of a check list to Failed if both of the 386 following two conditions are satisfied: 388 o all of the pairs in the check list are either in the Failed or 389 Succeeded state; and 391 o there is not a pair in the valid list for each component of the 392 media stream. 394 With Trickle ICE, the above situation would often occur when 395 candidate gathering and trickling are still in progress, even though 396 it is quite possible that future checks will succeed. For this 397 reason, Trickle ICE agents add the following conditions to the above 398 list: 400 o all candidate gatherers have completed and the agent is not 401 expecting to discover any new local candidates; 403 o the remote agent has sent an end-of-candidates indication for that 404 check list as described in Section 8.2. 406 Vanilla ICE requires that agents then update all other check lists, 407 placing one pair from each of them into the Waiting state, 408 effectively unfreezing all remaining check lists. However, under 409 Trickle ICE other check lists might still be empty at that point. 410 Therefore a Trickle ICE agent SHOULD monitor whether a check list is 411 active or frozen independently of the state of the candidate pairs 412 that the check list contains. A Trickle ICE agent SHOULD consider a 413 check list to be active either when unfreezing the first candidate 414 pair in the check list or when there is no candidate pair in the 415 check list (i.e., when the check list is empty). 417 8. Discovering and Sending Additional Local Candidates 419 After an offer or an answer has been sent, agents will most likely 420 continue discovering new local candidates as STUN, TURN, and other 421 non-host candidate gathering mechanisms begin to yield results. 422 Whenever an agent discovers such a new candidate it will compute its 423 priority, type, foundation and component ID according to normal 424 Vanilla ICE procedures. 426 The new candidate is then checked for redundancy against the existing 427 list of local candidates. If its transport address and base match 428 those of an existing candidate, it will be considered redundant and 429 will be ignored. This would often happen for server reflexive 430 candidates that match the host addresses they were obtained from 431 (e.g., when the latter are public IPv4 addresses). Contrary to 432 Vanilla ICE, Trickle ICE agents will consider the new candidate 433 redundant regardless of its priority. 435 Next the agent sends (i.e., trickles) the newly discovered 436 candidate(s) to the remote agent. The actual delivery of the new 437 candidates are specified by using protocols such as SIP or XMPP. 438 Trickle ICE imposes no restrictions on the way this is done or 439 whether it is done at all. For example, some applications may choose 440 not to send trickle updates for server reflexive candidates and rely 441 on the discovery of peer reflexive ones instead. 443 When trickle updates are sent, each candidate MUST be delivered to 444 the receiving Trickle ICE implementation not more than once and in 445 the same order that they were sent. In other words, if there are any 446 candidate retransmissions, they must be hidden from the ICE 447 implementation. 449 Also, candidate trickling needs to be correlated to a specific ICE 450 negotiation session, so that if there is an ICE restart, any delayed 451 updates for a previous session can be recognized as such and ignored 452 by the receiving party. 454 One important aspect of Vanilla ICE is that connectivity checks for a 455 specific foundation and component are attempted simultaneously by 456 both agents, so that any firewalls or NATs fronting the agents would 457 whitelist both endpoints and allow all except for the first 458 ("suicide") packets to go through. This is also crucial to 459 unfreezing candidates in the right time. 461 In order to preserve this feature in Trickle ICE, when trickling 462 candidates agents MUST respect the order of the components as they 463 appear (implicitly or explicitly) in the offer/answer descriptions. 464 Therefore a candidate for a specific component MUST NOT be sent prior 465 to candidates for other components within the same foundation. 467 For example, the following SDP description contains two components 468 (RTP and RTCP) and two foundations (host and server reflexive): 470 v=0 471 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 472 s= 473 c=IN IP4 10.0.1.1 474 t=0 0 475 a=ice-pwd:asd88fgpdd777uzjYhagZg 476 a=ice-ufrag:8hhY 477 m=audio 5000 RTP/AVP 0 478 a=rtpmap:0 PCMU/8000 479 a=candidate:1 1 UDP 2130706431 10.0.1.1 5000 typ host 480 a=candidate:1 2 UDP 2130706431 10.0.1.1 5001 typ host 481 a=candidate:2 1 UDP 1694498815 192.0.2.3 5000 typ srflx 482 raddr 10.0.1.1 rport 8998 483 a=candidate:2 2 UDP 1694498815 192.0.2.3 5001 typ srflx 484 raddr 10.0.1.1 rport 8998 486 For this description the RTCP host candidate MUST NOT be sent prior 487 to the RTP host candidate. Similarly the RTP server reflexive 488 candidate MUST be sent together with or prior to the RTCP server 489 reflexive candidate. 491 Note that the order restriction only applies among candidates that 492 belong to the same foundation. 494 It is also equally important to preserve this order across media 495 streams, which is covered by the requirement to always start 496 unfreezing candidates starting from the first media stream as 497 described under Section 5.2. 499 Once the candidate has been sent to the remote party, the agent 500 checks if any remote candidates are currently known for this same 501 stream. If not, the new candidate will simply be added to the list 502 of local candidates. 504 Otherwise, if the agent has already learned of one or more remote 505 candidates for this stream and component, it will begin pairing the 506 new local candidates with them and adding the pairs to the existing 507 check lists according to their priority. 509 8.1. Pairing Newly Learned Candidates and Updating Check Lists 511 Forming candidate pairs works the way it is described by the ICE 512 specification [rfc5245bis]. However, actually adding the new pair to 513 a check list happens according to the rules described below. 515 If the check list where the pair is to be added already contains the 516 maximum number of candidate pairs (100 by default as per 517 [rfc5245bis]), the new pair is discarded. 519 If the new pair's local candidate is server reflexive, the server 520 reflexive candidate MUST be replaced by its base before adding the 521 pair to the list. Once this is done, the agent examines the check 522 list looking for another pair that would be redundant with the new 523 one. If such a pair exists, the newly formed pair is ignored. 525 For all other pairs, including those with a server reflexive local 526 candidate that were not found to be redundant: 528 o if this check list is frozen then the new pair will be assigned a 529 state of Frozen. 531 o else if the check list is active and it is either empty or 532 contains only candidates in the Succeeded and Failed states, then 533 the new pair's state is set to Waiting. 535 o else if the check list is non-empty and active, then the state of 536 the new pair will be set to 538 Frozen: if there is at least one pair in the check list whose 539 foundation matches the one in the new pair and whose state is 540 neither Succeeded nor Failed (eventually the new pair will get 541 unfrozen after the ongoing check for the existing pair 542 concludes); 544 Waiting: if the list contains no pairs with the same foundation 545 as the new one, or, in case such pairs exist but they are all 546 in either the Succeeded or Failed states. 548 8.2. Announcing End of Candidates 550 Once all candidate gathering is completed or expires for a specific 551 media stream, the agents will generate an "end-of-candidates" 552 indication for that stream and send it to the remote agent via the 553 signalling channel. The exact form of the indication depends on the 554 application protocol. The indication can be sent in the following 555 ways: 557 o As part of an offer (which would typically be the case with half 558 trickle initial offers) 560 o Along with the last candidate an agent can send for a stream 561 o As a standalone notification (e.g., after STUN Binding requests or 562 TURN Allocate requests to a server timeout and the agent has no 563 other active gatherers) 565 A controlled Trickle ICE agent SHOULD send end-of-candidates 566 indications after gathering for a media stream has completed, unless 567 ICE processing terminates before the agent has had a chance to do so. 568 Sending the indication is necessary in order to avoid ambiguities and 569 speed up the conclusion of ICE processing. On the other hand, a 570 controlling agent MAY conclude ICE processing prior to sending end- 571 of-candidates indications for all streams. This would typically be 572 the case with aggressive nomination. However, it is RECOMMENDED that 573 controlling agents do send such indications whenever possible for the 574 sake of consistency and to keep middle boxes and controlled agents 575 up-to-date on the state of ICE processing. 577 When sending an end-of-candidate indication during trickling (rather 578 than as a part of an offer or an answer), it is the responsibility of 579 the using protocol to define methods for relating the indication to 580 one or more specific media streams. 582 Receiving an end-of-candidates indication enables an agent to update 583 check list states and, in case valid pairs do not exist for every 584 component in every media stream, determine that ICE processing has 585 failed. It also enables agents to speed up the conclusion of ICE 586 processing when a candidate pair has been validated but it involves 587 the use of lower-preference transports such as TURN. In such 588 situations, an implementations may choose to wait and see if higher- 589 priority candidates are received; in this case the end-of-candidates 590 indication provides a notificaiton that such candidates are not 591 forthcoming. 593 An agent MAY also choose to generate an end-of-candidates indication 594 before candidate gathering has actually completed, if the agent 595 determines that gathering has continued for more than an acceptable 596 period of time. However, an agent MUST NOT send any more candidates 597 after it has send an end-of-candidates indication. 599 When performing half trickle, an agent SHOULD send an end-of- 600 candidates indication together with its initial offer unless it is 601 planning to potentially send additional candidates (e.g., in case the 602 remote party turns out to support Trickle ICE). 604 When an end-of-candidates indication is sent as part of an offer or 605 an answer, it can be considered to apply to the session as a whole, 606 which is equivalent to having it apply to all media streams. 608 After an agent sends the end-of-candidates indication, it will update 609 the state of the corresponding check list as explained in 610 Section 7.2. Past that point, an agent MUST NOT send any new 611 candidates within this ICE session. After an agent has received an 612 end-of-candidates indication, it MUST also ignore any newly received 613 candidates for that media stream or media session. Therefore, adding 614 new candidates to the negotiation is possible only through an ICE 615 restart. 617 This specification does not override Vanilla ICE semantics for 618 concluding ICE processing. Therefore even if end-of-candidates 619 indications are sent agents will still have to go through pair 620 nomination. Also, if pairs have been nominated for components and 621 media streams, ICE processing will still conclude even if end-of- 622 candidate indications have not been received for all streams. 624 9. Receiving Additional Remote Candidates 626 At any point of ICE processing, a Trickle ICE agent may receive new 627 candidates from the remote agent. When this happens and no local 628 candidates are currently known for this same stream, the new remote 629 candidates are simply added to the list of remote candidates. 631 Otherwise, the new candidates are used for forming candidate pairs 632 with the pool of local candidates and they are added to the local 633 check lists as described in Section 8.1. 635 Once the remote agent has completed candidate gathering, it will send 636 an end-of-candidates indication. Upon receiving such an indication, 637 the local agent MUST update check list states as per Section 7.2. 638 This may lead to some check lists being marked as Failed. 640 10. Receiving an End-Of-Candidates Notification 642 When an agent receives an end-of-candidates indication for a specific 643 check list, it will update the state of the check list as per 644 Section 7.2. If the check list is still active state after the 645 update, the agent will persist the the fact that an end-of-candidates 646 indication has been received and take it into account in future 647 updates to the check list. 649 11. Trickle ICE and Peer Reflexive Candidates 651 Even though Trickle ICE does not explicitly modify the procedures for 652 handling peer reflexive candidates, their processing could be 653 impacted in implementations. With Trickle ICE, it is possible that 654 server reflexive candidates can be discovered as peer reflexive in 655 cases where incoming connectivity checks are received from these 656 candidates before the trickle updates that carry them. 658 While this would certainly increase the number of cases where ICE 659 processing nominates and selects candidates discovered as peer- 660 reflexive, it does not require any change in processing. 662 It is also likely that some applications would prefer not to trickle 663 server reflexive candidates to entities that are known to be publicly 664 accessible and where sending a direct STUN binding request is likely 665 to reach the destination faster than the trickle update that travels 666 through the signalling path. 668 12. Concluding ICE Processing 670 This specification does not directly modify the procedures ending ICE 671 processing described in Section 8 of [rfc5245bis], and Trickle ICE 672 implementations will follow the same rules. 674 13. Subsequent Offer/Answer Exchanges 676 Either agent MAY generate a subsequent offer at any time allowed by 677 [RFC3264]. When this happens agents will use [rfc5245bis] semantics 678 to determine whether or not the new offer requires an ICE restart. 679 If this is the case then agents would perform Trickle ICE as they 680 would in an initial offer/answer exchange. 682 The only differences between an ICE restart and a brand new media 683 session are that: 685 o during the restart, media can continue to be sent to the 686 previously validated pair. 688 o both agents are already aware whether or not their peer supports 689 Trickle ICE, and there is no longer need for performing half 690 trickle or confirming support with other mechanisms. 692 14. Unilateral Use of Trickle ICE (Half Trickle) 694 In half trickle mode, the offerer sends a regular, Vanilla ICE offer, 695 with a complete set of candidates. This ensures that the offer can 696 be processed by a Vanilla ICE answerer and is mostly meant for use in 697 cases where support for Trickle ICE cannot be confirmed prior to 698 sending an initial offer. The initial offer indicates support for 699 Trickle ICE, so that the answerer can respond with an incomplete set 700 of candidates and continue trickling the rest. Half trickle offers 701 typically contain an end-of-candidates indication, although this is 702 not mandatory because if trickle support is confirmed then the 703 offerer can choose to trickle additional candidates before it sends 704 an end-of-candidates indication. 706 The half trickle mechanism can be used in cases where there is no way 707 for an agent to verify in advance whether a remote party supports 708 Trickle ICE. Because the initial offer contains a full set of 709 candidates, it can thus be handled by a regular Vanilla ICE agent, 710 while still allowing a Trickle ICE agent to use the optimization 711 defined in this specification. This prevents negotiation from 712 failing in the former case while still giving roughly half the 713 Trickle ICE benefits in the latter (hence the name of the mechanism). 715 Use of half trickle is only necessary during an initial offer/answer 716 exchange. After both parties have received a session description 717 from their peer, they can each reliably determine Trickle ICE support 718 and use it for all subsequent offer/answer exchanges. 720 In some instances, using half trickle might bring more than just half 721 the improvement in terms of user experience. This can happen when an 722 agent starts gathering candidates upon user interface cues that the 723 user will soon be initiating an offer, such as activity on a keypad 724 or the phone going off hook. This would mean that some or all of the 725 candidate gathering could be completed before the agent actually 726 needs to send the offer. Because the answerer will be able to 727 trickle candidates, both agents will be able to start connectivity 728 checks and complete ICE processing earlier than with Vanilla ICE and 729 potentially even as early as with full trickle. 731 However, such anticipation is not always possible. For example, a 732 multipurpose user agent or a WebRTC web page where communication is a 733 non-central feature (e.g., calling a support line in case of a 734 problem with the main features) would not necessarily have a way of 735 distinguishing between call intentions and other user activity. In 736 such cases, using full trickle is most likely to result in an ideal 737 user experience. Even so, using half trickle would be an improvement 738 over vanilla ICE because it would result in a better experience for 739 answerers. 741 15. Example Flow 743 A typical successful Trickle ICE exchange with an Offer/Answer 744 protocol would look this way: 746 Alice Bob 747 | Offer | 748 |---------------------------------------------->| 749 | Additional Candidates | 750 |---------------------------------------------->| 751 | | 752 | Answer | 753 |<----------------------------------------------| 754 | Additional Candidates | 755 |<----------------------------------------------| 756 | | 757 | Additional Candidates and Connectivity Checks | 758 |<--------------------------------------------->| 759 | | 760 |<=============== MEDIA FLOWS =================>| 762 Figure 1: Example 764 16. IANA Considerations 766 This specification requests no actions from IANA. 768 17. Security Considerations 770 This specification inherits most of its semantics from [rfc5245bis] 771 and as a result all security considerations described there remain 772 the same. 774 18. Acknowledgements 776 The authors would like to thank Bernard Aboba, Flemming Andreasen, 777 Rajmohan Banavi, Christer Holmberg, Jonathan Lennox, Enrico Marocco, 778 Pal Martinsen, Martin Thomson, Dale R. Worley, and Brandon Williams 779 for their reviews and suggestions on improving this document. 781 19. References 783 19.1. Normative References 785 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 786 Requirement Levels", BCP 14, RFC 2119, March 1997. 788 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 789 with Session Description Protocol (SDP)", RFC 3264, June 790 2002. 792 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 793 Description Protocol", RFC 4566, July 2006. 795 [rfc5245bis] 796 Keranen, A. and J. Rosenberg, "Interactive Connectivity 797 Establishment (ICE): A Protocol for Network Address 798 Translator (NAT) Traversal", draft-ietf-ice-rfc5245bis-00 799 (work in progress), October 2015. 801 19.2. Informative References 803 [I-D.ietf-mmusic-trickle-ice-sip] 804 Ivov, E., Thomas, T., Marocco, E., and C. Holmberg, "A 805 Session Initiation Protocol (SIP) usage for Trickle ICE", 806 draft-ietf-mmusic-trickle-ice-sip-03 (work in progress), 807 October 2015. 809 [I-D.keranen-mmusic-ice-address-selection] 810 Keraenen, A. and J. Arkko, "Update on Candidate Address 811 Selection for Interactive Connectivity Establishment 812 (ICE)", draft-keranen-mmusic-ice-address-selection-01 813 (work in progress), July 2012. 815 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 816 and E. Lear, "Address Allocation for Private Internets", 817 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 818 . 820 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 821 A., Peterson, J., Sparks, R., Handley, M., and E. 822 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 823 June 2002. 825 [RFC4787] Audet, F., Ed. and C. Jennings, "Network Address 826 Translation (NAT) Behavioral Requirements for Unicast 827 UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 828 2007, . 830 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 831 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 832 DOI 10.17487/RFC5389, October 2008, 833 . 835 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 836 Relays around NAT (TURN): Relay Extensions to Session 837 Traversal Utilities for NAT (STUN)", RFC 5766, April 2010. 839 [XEP-0030] 840 Hildebrand, J., Millard, P., Eatmon, R., and P. Saint- 841 Andre, "XEP-0030: Service Discovery", XEP XEP-0030, June 842 2008. 844 [XEP-0176] 845 Beda, J., Ludwig, S., Saint-Andre, P., Hildebrand, J., 846 Egan, S., and R. McQueen, "XEP-0176: Jingle ICE-UDP 847 Transport Method", XEP XEP-0176, June 2009. 849 [XEP-0278] 850 Camargo, T., "XEP-0278: Jingle Relay Nodes", XEP XEP-0278, 851 June 2011. 853 Appendix A. Interaction with ICE 855 The ICE protocol was designed to be flexible enough to work in and 856 adapt to as many network environments as possible. Despite that 857 flexibility, ICE as specified in [rfc5245bis] does not by itself 858 support trickle ICE. This section describes how trickling of 859 candidates interacts with ICE. 861 [rfc5245bis] describes the conditions required to update check lists 862 and timer states while an ICE agent is in the Running state. These 863 conditions are verified upon transaction completion and one of them 864 stipulates that: 866 If there is not a pair in the valid list for each component of the 867 media stream, the state of the check list is set to Failed. 869 This could be a problem and cause ICE processing to fail prematurely 870 in a number of scenarios. Consider the following case: 872 1. Alice and Bob are both located in different networks with Network 873 Address Translation (NAT). Alice and Bob themselves have 874 different address but both networks use the same [RFC1918] block. 876 2. Alice sends Bob the candidate 10.0.0.10 which also happens to 877 correspond to an existing host on Bob's network. 879 3. Bob creates a check list consisting solely of 10.0.0.10 and 880 starts checks. 882 4. These checks reach the host at 10.0.0.10 in Bob's network, which 883 responds with an ICMP "port unreachable" error and per 884 [rfc5245bis] Bob marks the transaction as Failed. 886 At this point the check list only contains Failed candidates and the 887 valid list is empty. This causes the media stream and potentially 888 all ICE processing to Fail. 890 A similar race condition would occur if the initial offer from Alice 891 only contains candidates that can be determined as unreachable (per 892 [I-D.keranen-mmusic-ice-address-selection]) from any of the 893 candidates that Bob has gathered. This would be the case if Bob's 894 candidates only contain IPv4 addresses and the first candidate that 895 he receives from Alice is an IPv6 one. 897 Another potential problem could arise when a non-trickle ICE 898 implementation sends an offer to a trickle one. Consider the 899 following case: 901 1. Alice's client has a non-Trickle ICE implementation 903 2. Bob's client has support for Trickle ICE. 905 3. Alice and Bob are behind NATs with address-dependent filtering 906 [RFC4787]. 908 4. Bob has two STUN servers but one of them is currently unreachable 910 After Bob's agent receives Alice's offer it would immediately start 911 connectivity checks. It would also start gathering candidates, which 912 would take a long time because of the unreachable STUN server. By 913 the time Bob's answer is ready and sent to Alice, Bob's connectivity 914 checks may well have failed: until Alice gets Bob's answer, she won't 915 be able to start connectivity checks and punch holes in her NAT. The 916 NAT would hence be filtering Bob's checks as originating from an 917 unknown endpoint. 919 Appendix B. Interaction with ICE Lite 921 The behavior of ICE lite agents that are capable of Trickle ICE does 922 not require any particular rules other than those already defined in 923 this specification and [rfc5245bis]. This section is hence provided 924 only for informational purposes. 926 Such an agent would generate offers or answers as per [rfc5245bis]. 927 Both its offers and answers will indicate support for Trickle ICE. 928 Given that they will contain a complete set of candidates (the 929 agent's host candidates), these offers and answers would also be 930 accompanied with an end-of-candidates indication. 932 When performing full trickle, a full ICE implementation could send an 933 offer or an answer with no candidates. After receiving an answer 934 that identifies the remote agent as an ICE lite implementation, the 935 offerer may choose to not send any additional candidates. The same 936 is also true in the case when the ICE lite agent is making the offer 937 and the full ICE one is answering. In these cases the connectivity 938 checks would be enough for the ICE lite implementation to discover 939 all potentially useful candidates as peer reflexive. The following 940 example illustrates one such ICE session using SDP syntax: 942 ICE Lite Bob 943 Agent 944 | Offer (a=ice-lite a=ice-options:trickle) | 945 |---------------------------------------------->| 946 | |no cand 947 | Answer (a=ice-options:trickle) |trickling 948 |<----------------------------------------------| 949 | Connectivity Checks | 950 |<--------------------------------------------->| 951 peer rflx| | 952 cand disco| | 953 | | 954 |<=============== MEDIA FLOWS =================>| 956 Figure 2: Example 958 In addition to reducing signaling traffic this approach also removes 959 the need to discover STUN bindings, or to make TURN or UPnP 960 allocations, which may considerably lighten ICE processing. 962 Appendix C. Changes from Earlier Versions 964 Note to the RFC-Editor: please remove this section prior to 965 publication as an RFC. 967 C.1. Changes from draft-ietf-ice-trickle-00 969 o Removed dependency on SDP (which is to be provided in a separate 970 specification). 972 o Clarified text about the fact that a check list can be empty if no 973 candidates have been sent or received yet. 975 o Clarified wording about check list states so as not to define new 976 states for "Active" and "Frozen" because those states are not 977 defined for check lists (only for candidate pairs) in ICE core. 979 o Removed open issues list because it was out of date. 981 o Completed a thorough copy edit. 983 C.2. Changes from draft-mmusic-trickle-ice-02 985 o Addressed feedback from Rajmohan Banavi and Brandon Williams. 987 o Clarified text about determining support and about how to proceed 988 if it can be determined that the answering agent does not support 989 Trickle ICE. 991 o Clarified text about check list and timer updates. 993 o Clarified when it is appropriate to use half trickle or to send no 994 candidates in an offer or answer. 996 o Updated the list of open issues. 998 C.3. Changes from draft-ivov-01 and draft-mmusic-00 1000 o Added a requirement to trickle candidates by order of components 1001 to avoid deadlocks in the unfreezing algorithm. 1003 o Added an informative note on peer-reflexive candidates explaining 1004 that nothing changes for them semantically but they do become a 1005 more likely occurrence for Trickle ICE. 1007 o Limit the number of pairs to 100 to comply with 5245. 1009 o Added clarifications on the non-importance of how newly discovered 1010 candidates are trickled/sent to the remote party or if this is 1011 done at all. 1013 o Added transport expectations for trickled candidates as per Dale 1014 Worley's recommendation. 1016 C.4. Changes from draft-ivov-00 1018 o Specified that end-of-candidates is a media level attribute which 1019 can of course appear as session level, which is equivalent to 1020 having it appear in all m-lines. Also made end-of-candidates 1021 optional for cases such as aggressive nomination for controlled 1022 agents. 1024 o Added an example for ICE lite and Trickle ICE to illustrate how, 1025 when talking to an ICE lite agent doesn't need to send or even 1026 discover any candidates. 1028 o Added an example for ICE lite and Trickle ICE to illustrate how, 1029 when talking to an ICE lite agent doesn't need to send or even 1030 discover any candidates. 1032 o Added wording that explicitly states ICE lite agents have to be 1033 prepared to receive no candidates over signalling and that they 1034 should not freak out if this happens. (Closed the corresponding 1035 open issue). 1037 o It is now mandatory to use MID when trickling candidates and using 1038 m-line indexes is no longer allowed. 1040 o Replaced use of 0.0.0.0 to IP6 :: in order to avoid potential 1041 issues with RFC2543 SDP libraries that interpret 0.0.0.0 as an on- 1042 hold operation. Also changed the port number here from 1 to 9 1043 since it already has a more appropriate meaning. (Port change 1044 suggested by Jonathan Lennox). 1046 o Closed the Open Issue about use about what to do with cands 1047 received after end-of-cands. Solution: ignore, do an ICE restart 1048 if you want to add something. 1050 o Added more terminology, including trickling, trickled candidates, 1051 half trickle, full trickle, 1053 o Added a reference to the SIP usage for Trickle ICE as requested at 1054 the Boston interim. 1056 C.5. Changes from draft-rescorla-01 1058 o Brought back explicit use of Offer/Answer. There are no more 1059 attempts to try to do this in an O/A independent way. Also 1060 removed the use of ICE Descriptions. 1062 o Added SDP specification for trickled candidates, the trickle 1063 option and 0.0.0.0 addresses in m-lines, and end-of-candidates. 1065 o Support and Discovery. Changed that section to be less abstract. 1066 As discussed in IETF85, the draft now says implementations and 1067 usages need to either determine support in advance and directly 1068 use trickle, or do half trickle. Removed suggestion about use of 1069 discovery in SIP or about letting implementing protocols do what 1070 they want. 1072 o Defined Half Trickle. Added a section that says how it works. 1073 Mentioned that it only needs to happen in the first o/a (not 1074 necessary in updates), and added Jonathan's comment about how it 1075 could, in some cases, offer more than half the improvement if you 1076 can pre-gather part or all of your candidates before the user 1077 actually presses the call button. 1079 o Added a short section about subsequent offer/answer exchanges. 1081 o Added a short section about interactions with ICE Lite 1082 implementations. 1084 o Added two new entries to the open issues section. 1086 C.6. Changes from draft-rescorla-00 1088 o Relaxed requirements about verifying support following a 1089 discussion on MMUSIC. 1091 o Introduced ICE descriptions in order to remove ambiguous use of 1092 3264 language and inappropriate references to offers and answers. 1094 o Removed inappropriate assumption of adoption by RTCWEB pointed out 1095 by Martin Thomson. 1097 Authors' Addresses 1099 Emil Ivov 1100 Jitsi 1101 Strasbourg 67000 1102 France 1104 Phone: +33 6 72 81 15 55 1105 Email: emcho@jitsi.org 1107 Eric Rescorla 1108 RTFM, Inc. 1109 2064 Edgewood Drive 1110 Palo Alto, CA 94303 1111 USA 1113 Phone: +1 650 678 2350 1114 Email: ekr@rtfm.com 1115 Justin Uberti 1116 Google 1117 747 6th St S 1118 Kirkland, WA 98033 1119 USA 1121 Phone: +1 857 288 8888 1122 Email: justin@uberti.name 1124 Peter Saint-Andre 1125 &yet 1127 Email: peter@andyet.com 1128 URI: https://andyet.com/