idnits 2.17.1 draft-ietf-ice-trickle-02.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (June 6, 2016) is 2874 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-04 -- 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 (~~), 2 warnings (==), 3 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: December 8, 2016 RTFM, Inc. 6 J. Uberti 7 Google 8 P. Saint-Andre 9 Filament 10 June 6, 2016 12 Trickle ICE: Incremental Provisioning of Candidates for the Interactive 13 Connectivity Establishment (ICE) Protocol 14 draft-ietf-ice-trickle-02 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 December 8, 2016. 43 Copyright Notice 45 Copyright (c) 2016 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-01 . . . . . . . . . 21 93 C.2. Changes from draft-ietf-ice-trickle-00 . . . . . . . . . 21 94 C.3. Changes from draft-mmusic-trickle-ice-02 . . . . . . . . 22 95 C.4. Changes from draft-ivov-01 and draft-mmusic-00 . . . . . 22 96 C.5. Changes from draft-ivov-00 . . . . . . . . . . . . . . . 22 97 C.6. Changes from draft-rescorla-01 . . . . . . . . . . . . . 23 98 C.7. Changes from draft-rescorla-00 . . . . . . . . . . . . . 24 99 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 101 1. Introduction 103 The Interactive Connectivity Establishment (ICE) protocol 104 [rfc5245bis] describes mechanisms for gathering candidates, 105 prioritizing them, choosing default ones, exchanging them with the 106 remote party, pairing them, and ordering them into check lists. Once 107 all of these actions have been completed (and only then), the 108 participating agents can begin a phase of connectivity checks and 109 eventually select the pair of candidates that will be used in a media 110 session. 112 Although the sequence described above has the advantage of being 113 relatively straightforward to implement and debug once deployed, it 114 can also be rather lengthy. Candidate gathering often involves 115 things like querying STUN [RFC5389] servers, discovering UPnP 116 devices, and allocating relayed candidates at TURN [RFC5766] servers. 117 All of these actions can be delayed for a noticeable amount of time; 118 although they can be run in parallel, they still need to respect the 119 pacing requirements from [rfc5245bis], which is likely to delay them 120 even further. Some or all of these actions also need be completed by 121 the remote agent. Both agents would next perform connectivity checks 122 and only then would they be ready to begin streaming media. 124 These factors can lead to relatively lengthy session establishment 125 times and degraded user experience. 127 This document defines an alternative mode of operation for ICE 128 implementations, known as "Trickle ICE", in which candidates can be 129 exchanged incrementally. This enables ICE agents to exchange 130 candidates as soon as a session has been initiated. Connectivity 131 checks for a media stream can also start as soon as the first 132 candidates for that stream become available. 134 Trickle ICE can reduce session establishment times in cases where 135 connectivity is confirmed for the first exchanged candidates (e.g., 136 where the host candidates for one of the agents are directly 137 reachable from the second agent, such as host candidates at a media 138 relay). Even when this is not the case, running candidate gathering 139 for both agents and connectivity checks in parallel can considerably 140 shorten ICE processing times. 142 It is worth noting that there is quite a bit of operational 143 experience with the Trickle ICE technique, going back as far as 2005 144 (when the XMPP Jingle extension defined a "dribble mode" as specified 145 in [XEP-0176]); this document incorporates feedback from those who 146 have implemented and deployed the technique. 148 In addition to the basics of Trickle ICE, this document also 149 describes how to discover support for Trickle ICE, how regular ICE 150 processing needs to be modified when building and updating check 151 lists, and how Trickle ICE implementations interoperate with agents 152 that only implement so-called "Vanilla ICE" processing as defined in 153 [rfc5245bis]. 155 This specification does not define the usage of Trickle ICE with any 156 specific signalling protocol (however, see 157 [I-D.ietf-mmusic-trickle-ice-sip] for usage with SIP [RFC3261]). 158 Similarly, it does not define Trickle ICE in terms of the Session 159 Description Protocol (SDP) [RFC4566] or the offer/answer model 160 [RFC3264] because the technique can be and already is used in 161 application protocols that are not tied to SDP or to offer/answer 162 semantics. 164 2. Terminology 166 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 167 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 168 document are to be interpreted as described in [RFC2119]. 170 This specification makes use of all terminology defined for 171 Interactive Connectivity Establishment in [rfc5245bis]. 173 Vanilla ICE: The Interactive Connectivity Establishment protocol as 174 defined in [rfc5245bis]. 176 Candidate Harvester: A module used by an ICE agent to obtain local 177 candidates. Candidate gatherers use different mechanisms for 178 discovering local candidates. Some of them would typically make 179 use of protocols such as STUN or TURN. Others may also employ 180 techniques that are not referenced within [rfc5245bis] (e.g., UPnP 181 based port allocation or XMPP Jingle Relay Nodes [XEP-0278]). 183 Trickled Candidates: Candidates that a Trickle ICE agent sends after 184 an offer or answer but within the same context. Trickled 185 candidates can be sent in parallel with candidate gathering and 186 connectivity checks. 188 Trickling/Trickle (v.): The act of sending trickled candidates. 190 Half Trickle: A Trickle ICE mode of operation where the offerer 191 gathers its first generation of candidates strictly before 192 creating and sending the offer. Once sent, that offer can be 193 processed by Vanilla ICE agents and does not require support for 194 this specification. It also allows Trickle ICE capable answerers 195 to still gather candidates and perform connectivity checks in a 196 non-blocking way, thus roughly offering "half" the advantages of 197 Trickle ICE. The mechanism is mostly meant for use in cases where 198 support for trickle ICE cannot be confirmed prior to sending a 199 initial offer. 201 Full Trickle: The regular mode of operation for Trickle ICE agents, 202 in which an initial offer can include any number of candidates 203 (even zero candidates) and does not need to include the entire 204 first generation of candidates as in half trickle. 206 3. Determining Support for Trickle ICE 208 Application protocols that use Trickle ICE should do one of the 209 following: 211 o Provide a way for agents to verify support of Trickle ICE prior to 212 initiating a session (XMPP's Service Discovery [XEP-0030] is one 213 such mechanism). 215 o Make support for Trickle ICE mandatory so that user agents can 216 assume support. 218 Alternately, for cases where a protocol provides neither of the 219 foregoing methods, agents may rely on provisioning/configuration or 220 use the half trickle procedure described in Section 14. 222 Prior to sending an initial offer, agents using signaling protocols 223 that support capabilities discovery can attempt to verify whether or 224 not the remote party supports Trickle ICE. If an agent determines 225 that the remote party does not support Trickle ICE, it MUST fall back 226 to using Vanilla ICE or abandon the entire session. 228 In application protocols that use SDP, a user agent supporting 229 Trickle ICE MUST include a token of "trickle" in the ice-options 230 attribute every time it generates an offer or an answer. This 231 enables an agent that receives offers or answers to verify support by 232 checking for presence of the token. 234 Dedicated discovery semantics and half trickle are needed only prior 235 to session initiation (e.g., when sending the initial offer). After 236 a session is established and Trickle ICE support is confirmed for 237 both parties, either agent can use full trickle for subsequent 238 offers. 240 4. Sending the Initial Offer 242 An agent starts gathering candidates as soon as it has an indication 243 that communication is imminent (e.g., a user interface cue or an 244 explicit request to initiate a session). Contrary to Vanilla ICE, 245 implementations of Trickle ICE do not need to gather candidates in a 246 blocking manner. Therefore, unless half trickle is being used, 247 agents SHOULD generate and transmit their initial offer as early as 248 possible, in order to allow the remote party to start gathering and 249 trickling candidates. 251 Trickle ICE agents MAY include any set of candidates in an offer. 252 This includes the possibility of sending an offer that contains all 253 the candidates that the agent plans to use (as in half trickle mode), 254 sending an offer that contains only a publically-reachable IP address 255 (e.g., a host candidate at a media relay that is known to not be 256 behind a firewall), or sending an offer with no candidates at all (in 257 which case the offerer can receive the answerer's initial candidate 258 list sooner and the answerer can begin candidate gathering more 259 quickly). 261 For optimal performance, it is RECOMMENDED that the candidates in an 262 initial offer (if any) be host candidates only. This would allow 263 both agents to start gathering server reflexive, relayed, and other 264 non-host candidates simultaneously, and it would also enable them to 265 begin connectivity checks. 267 If the privacy implications of revealing host addresses on an 268 endpoint device are a concern, agents can generate an offer that 269 contains no candidates and then only trickle candidates that do not 270 reveal host addresses (e.g., relayed candidates). 272 Methods for calculating priorities and foundations, as well as 273 determining redundancy of candidates, work just as with vanilla ICE. 275 5. Receiving the Initial Offer 277 When an agent receives an initial offer, it will first check if the 278 offer or offerer indicates support for Trickle ICE as explained in 279 Section 3. If this is not the case, the agent MUST process the offer 280 according to Vanilla ICE procedures [rfc5245bis] or offer/answer 281 processing rules [RFC3264] if no ICE support is detected at all. 283 If support for Trickle ICE is confirmed, an agent will automatically 284 assume support for Vanilla ICE as well even if the support 285 verification procedure in [rfc5245bis] indicates otherwise. 286 Specifically, the rules from [rfc5245bis] would imply that ICE itself 287 is not supported if the initial offer includes no candidates in the 288 offer; however, such a conclusion is not warranted if the answerer 289 can confirm that the offerer supports Trickle ICE and thus fallback 290 to [RFC3264] is not necessary. 292 If the offer does indicate support for Trickle ICE, the agent will 293 determine its role, start gathering and prioritizing candidates and 294 while doing so it will also respond by sending its own answer, so 295 that both agents can start forming check lists and begin connectivity 296 checks. 298 5.1. Sending the Initial Answer 300 An agent can respond to an initial offer at any point while gathering 301 candidates. The answer can again contain any set of candidates, 302 including all candidates or no candidates. (The benefit of including 303 no candidates is to send the answer as quickly as possible, so that 304 both parties can consider the overall session to be under active 305 negotiation as soon as possible.) Unless the answering agent is 306 protecting host addresses for privacy reasons, it would typically 307 construct this initial answer including only host addresses, thus 308 enabling the remote party to also start forming check lists and 309 performing connectivity checks. 311 In application protocols that use SDP, the answer MUST indicate 312 support for Trickle ICE as described in Section 3. 314 5.2. Forming Check Lists and Beginning Connectivity Checks 316 After exchanging the offer and answer, and as soon as they have 317 obtained local and remote candidates, agents begin forming candidate 318 pairs, computing candidate pair priorities and ordering candidate 319 pairs, pruning duplicate pairs, and creating check lists according to 320 the Vanilla ICE procedures described in [rfc5245bis]. 322 According to those procedures, in order for candidate pairing to be 323 possible and for duplicate candidates to be pruned, the candidates 324 would need to be provided in both the offer and the answer. Under 325 Trickle ICE, check lists can be empty until candidate pairs are sent 326 or received. Therefore Trickle ICE agents handle check lists and 327 candidate pairing in a slightly different way: the agents still 328 create the check lists, but they only populate the check lists after 329 they actually have the candidate pairs. 331 Note: According to [rfc5245bis], "A check list with at least one 332 pair that is Waiting is called an active check list, and a check 333 list with all pairs Frozen is called a frozen check list." 334 Formally speaking an active check list does not have a state of 335 Active and a frozen check list does not have a state of Frozen, 336 because the only check list states are Running, Completed, and 337 Failed. 339 A Trickle ICE agent MUST initially consider all check lists to be 340 frozen. It then inspects the first check list and attempts to 341 unfreeze all candidates belonging to the first component on the first 342 media stream (i.e., the first media stream that was reported to the 343 ICE implementation from the using application). However, if this 344 check list is still empty, an agent delays further processing until 345 the check list is non-empty. 347 With regard to pruning of duplicate candidate pairs, a Trickle ICE 348 agent SHOULD follow a policy of "first one wins" and not re-apply the 349 pruning procedure if a higher-priority candidate pair is received 350 from the remote agent. 352 Respecting the order in which check lists have been reported to an 353 ICE implementation is crucial to the frozen candidates algorithm, so 354 that connectivity checks are performed simultaneously by both agents. 356 6. Receiving the Initial Answer 358 When receiving an answer, agents follow Vanilla ICE procedures to 359 determine their role, after which they form check lists (as described 360 in Section 5.2) and begin connectivity checks. 362 7. Performing Connectivity Checks 364 For the most part, Trickle ICE agents perform connectivity checks 365 following Vanilla ICE procedures. However, the asynchronous nature 366 of gathering and communicating candidates in Trickle ICE impose a 367 number of changes described as described in the following sections. 369 7.1. Scheduling Checks 371 The ICE specification [rfc5245bis], Section 5.8, requires that agents 372 terminate the timer for a triggered check in relation to an active 373 check list once the agent has exhausted all frozen pairs in check 374 list. This will not work with Trickle ICE, because more pairs will 375 be added to the check list incrementally. 377 Therefore, a Trickle ICE agent SHOULD NOT terminate the timer until 378 the state of the check list is Completed or Failed as specified 379 herein (see Section 8.2). 381 7.2. Check List and Timer State Updates 383 The ICE specification [rfc5245bis], Section 7.1.3.3, requires that 384 agents update check lists and timer states upon completing a 385 connectivity check transaction. During such an update, Vanilla ICE 386 agents would set the state of a check list to Failed if both of the 387 following two conditions are satisfied: 389 o all of the pairs in the check list are either in the Failed or 390 Succeeded state; and 392 o there is not a pair in the valid list for each component of the 393 media stream. 395 With Trickle ICE, the above situation would often occur when 396 candidate gathering and trickling are still in progress, even though 397 it is quite possible that future checks will succeed. For this 398 reason, Trickle ICE agents add the following conditions to the above 399 list: 401 o all candidate gatherers have completed and the agent is not 402 expecting to discover any new local candidates; 404 o the remote agent has sent an end-of-candidates indication for that 405 check list as described in Section 8.2. 407 Vanilla ICE requires that agents then update all other check lists, 408 placing one pair from each of them into the Waiting state, 409 effectively unfreezing all remaining check lists. However, under 410 Trickle ICE other check lists might still be empty at that point. 411 Therefore a Trickle ICE agent SHOULD monitor whether a check list is 412 active or frozen independently of the state of the candidate pairs 413 that the check list contains. A Trickle ICE agent SHOULD consider a 414 check list to be active either when unfreezing the first candidate 415 pair in the check list or when there is no candidate pair in the 416 check list (i.e., when the check list is empty). 418 8. Discovering and Sending Additional Local Candidates 420 After an offer or an answer has been sent, agents will most likely 421 continue discovering new local candidates as STUN, TURN, and other 422 non-host candidate gathering mechanisms begin to yield results. 423 Whenever an agent discovers such a new candidate it will compute its 424 priority, type, foundation and component ID according to normal 425 Vanilla ICE procedures. 427 The new candidate is then checked for redundancy against the existing 428 list of local candidates. If its transport address and base match 429 those of an existing candidate, it will be considered redundant and 430 will be ignored. This would often happen for server reflexive 431 candidates that match the host addresses they were obtained from 432 (e.g., when the latter are public IPv4 addresses). Contrary to 433 Vanilla ICE, Trickle ICE agents will consider the new candidate 434 redundant regardless of its priority. 436 Next the agent sends (i.e., trickles) the newly discovered 437 candidate(s) to the remote agent. The actual delivery of the new 438 candidates are specified by using protocols such as SIP or XMPP. 439 Trickle ICE imposes no restrictions on the way this is done or 440 whether it is done at all. For example, some applications may choose 441 not to send trickle updates for server reflexive candidates and rely 442 on the discovery of peer reflexive ones instead. 444 When trickle updates are sent, each candidate MUST be delivered to 445 the receiving Trickle ICE implementation not more than once and in 446 the same order that they were sent. In other words, if there are any 447 candidate retransmissions, they must be hidden from the ICE 448 implementation. 450 Also, candidate trickling needs to be correlated to a specific ICE 451 negotiation session, so that if there is an ICE restart, any delayed 452 updates for a previous session can be recognized as such and ignored 453 by the receiving party. 455 One important aspect of Vanilla ICE is that connectivity checks for a 456 specific foundation and component are attempted simultaneously by 457 both agents, so that any firewalls or NATs fronting the agents would 458 whitelist both endpoints and allow all except for the first 459 ("suicide") packets to go through. This is also crucial to 460 unfreezing candidates in the right time. 462 In order to preserve this feature in Trickle ICE, when trickling 463 candidates agents MUST respect the order of the components as they 464 appear (implicitly or explicitly) in the offer/answer descriptions. 465 Therefore a candidate for a specific component MUST NOT be sent prior 466 to candidates for other components within the same foundation. 468 For example, the following SDP description contains two components 469 (RTP and RTCP) and two foundations (host and server reflexive): 471 v=0 472 o=jdoe 2890844526 2890842807 IN IP6 2001:db8:a0b:12f0::1 473 s= 474 c=IN IP4 2001:db8:a0b:12f0::1 475 t=0 0 476 a=ice-pwd:asd88fgpdd777uzjYhagZg 477 a=ice-ufrag:8hhY 478 m=audio 5000 RTP/AVP 0 479 a=rtpmap:0 PCMU/8000 480 a=candidate:1 1 UDP 2130706431 2001:db8:a0b:12f0::1 5000 typ host 481 a=candidate:1 2 UDP 2130706431 2001:db8:a0b:12f0::1 5001 typ host 482 a=candidate:2 1 UDP 1694498815 2001:db8:a0b:12f0::3 5000 typ srflx 483 raddr 2001:db8:a0b:12f0::1 rport 8998 484 a=candidate:2 2 UDP 1694498815 2001:db8:a0b:12f0::3 5001 typ srflx 485 raddr 2001:db8:a0b:12f0::1 rport 8998 487 For this description the RTCP host candidate MUST NOT be sent prior 488 to the RTP host candidate. Similarly the RTP server reflexive 489 candidate MUST be sent together with or prior to the RTCP server 490 reflexive candidate. 492 Note that the order restriction only applies among candidates that 493 belong to the same foundation. 495 It is also equally important to preserve this order across media 496 streams, which is covered by the requirement to always start 497 unfreezing candidates starting from the first media stream as 498 described under Section 5.2. 500 Once the candidate has been sent to the remote party, the agent 501 checks if any remote candidates are currently known for this same 502 stream. If not, the new candidate will simply be added to the list 503 of local candidates. 505 Otherwise, if the agent has already learned of one or more remote 506 candidates for this stream and component, it will begin pairing the 507 new local candidates with them and adding the pairs to the existing 508 check lists according to their priority. 510 8.1. Pairing Newly Learned Candidates and Updating Check Lists 512 Forming candidate pairs works the way it is described by the ICE 513 specification [rfc5245bis]. However, actually adding the new pair to 514 a check list happens according to the rules described below. 516 If the check list where the pair is to be added already contains the 517 maximum number of candidate pairs (100 by default as per 518 [rfc5245bis]), the new pair is discarded. 520 If the new pair's local candidate is server reflexive, the server 521 reflexive candidate MUST be replaced by its base before adding the 522 pair to the list. Once this is done, the agent examines the check 523 list looking for another pair that would be redundant with the new 524 one. If such a pair exists, the newly formed pair is ignored. 526 For all other pairs, including those with a server reflexive local 527 candidate that were not found to be redundant: 529 o if this check list is frozen then the new pair will be assigned a 530 state of Frozen. 532 o else if the check list is active and it is either empty or 533 contains only candidates in the Succeeded and Failed states, then 534 the new pair's state is set to Waiting. 536 o else if the check list is non-empty and active, then the state of 537 the new pair will be set to 539 Frozen: if there is at least one pair in the check list whose 540 foundation matches the one in the new pair and whose state is 541 neither Succeeded nor Failed (eventually the new pair will get 542 unfrozen after the ongoing check for the existing pair 543 concludes); 545 Waiting: if the list contains no pairs with the same foundation 546 as the new one, or, in case such pairs exist but they are all 547 in either the Succeeded or Failed states. 549 8.2. Announcing End of Candidates 551 Once all candidate gathering is completed or expires for a specific 552 media stream, the agents will generate an "end-of-candidates" 553 indication for that stream and send it to the remote agent via the 554 signalling channel. The exact form of the indication depends on the 555 application protocol. The indication can be sent in the following 556 ways: 558 o As part of an offer (which would typically be the case with half 559 trickle initial offers) 561 o Along with the last candidate an agent can send for a stream 562 o As a standalone notification (e.g., after STUN Binding requests or 563 TURN Allocate requests to a server timeout and the agent has no 564 other active gatherers) 566 A controlled Trickle ICE agent SHOULD send end-of-candidates 567 indications after gathering for a media stream has completed, unless 568 ICE processing terminates before the agent has had a chance to do so. 569 Sending the indication is necessary in order to avoid ambiguities and 570 speed up the conclusion of ICE processing. On the other hand, a 571 controlling agent MAY conclude ICE processing prior to sending end- 572 of-candidates indications for all streams. This would typically be 573 the case with aggressive nomination. However, it is RECOMMENDED that 574 controlling agents do send such indications whenever possible for the 575 sake of consistency and to keep middle boxes and controlled agents 576 up-to-date on the state of ICE processing. 578 When sending an end-of-candidate indication during trickling (rather 579 than as a part of an offer or an answer), it is the responsibility of 580 the using protocol to define methods for relating the indication to 581 one or more specific media streams. 583 Receiving an end-of-candidates indication enables an agent to update 584 check list states and, in case valid pairs do not exist for every 585 component in every media stream, determine that ICE processing has 586 failed. It also enables agents to speed up the conclusion of ICE 587 processing when a candidate pair has been validated but it involves 588 the use of lower-preference transports such as TURN. In such 589 situations, an implementations may choose to wait and see if higher- 590 priority candidates are received; in this case the end-of-candidates 591 indication provides a notificaiton that such candidates are not 592 forthcoming. 594 An agent MAY also choose to generate an end-of-candidates indication 595 before candidate gathering has actually completed, if the agent 596 determines that gathering has continued for more than an acceptable 597 period of time. However, an agent MUST NOT send any more candidates 598 after it has send an end-of-candidates indication. 600 When performing half trickle, an agent SHOULD send an end-of- 601 candidates indication together with its initial offer unless it is 602 planning to potentially send additional candidates (e.g., in case the 603 remote party turns out to support Trickle ICE). 605 When an end-of-candidates indication is sent as part of an offer or 606 an answer, it can be considered to apply to the session as a whole, 607 which is equivalent to having it apply to all media streams. 609 After an agent sends the end-of-candidates indication, it will update 610 the state of the corresponding check list as explained in 611 Section 7.2. Past that point, an agent MUST NOT send any new 612 candidates within this ICE session. After an agent has received an 613 end-of-candidates indication, it MUST also ignore any newly received 614 candidates for that media stream or media session. Therefore, adding 615 new candidates to the negotiation is possible only through an ICE 616 restart. 618 This specification does not override Vanilla ICE semantics for 619 concluding ICE processing. Therefore even if end-of-candidates 620 indications are sent agents will still have to go through pair 621 nomination. Also, if pairs have been nominated for components and 622 media streams, ICE processing will still conclude even if end-of- 623 candidate indications have not been received for all streams. 625 9. Receiving Additional Remote Candidates 627 At any point of ICE processing, a Trickle ICE agent may receive new 628 candidates from the remote agent. When this happens and no local 629 candidates are currently known for this same stream, the new remote 630 candidates are simply added to the list of remote candidates. 632 Otherwise, the new candidates are used for forming candidate pairs 633 with the pool of local candidates and they are added to the local 634 check lists as described in Section 8.1. 636 Once the remote agent has completed candidate gathering, it will send 637 an end-of-candidates indication. Upon receiving such an indication, 638 the local agent MUST update check list states as per Section 7.2. 639 This may lead to some check lists being marked as Failed. 641 10. Receiving an End-Of-Candidates Notification 643 When an agent receives an end-of-candidates indication for a specific 644 check list, it will update the state of the check list as per 645 Section 7.2. If the check list is still active state after the 646 update, the agent will persist the the fact that an end-of-candidates 647 indication has been received and take it into account in future 648 updates to the check list. 650 11. Trickle ICE and Peer Reflexive Candidates 652 Even though Trickle ICE does not explicitly modify the procedures for 653 handling peer reflexive candidates, their processing could be 654 impacted in implementations. With Trickle ICE, it is possible that 655 server reflexive candidates can be discovered as peer reflexive in 656 cases where incoming connectivity checks are received from these 657 candidates before the trickle updates that carry them. 659 While this would certainly increase the number of cases where ICE 660 processing nominates and selects candidates discovered as peer- 661 reflexive, it does not require any change in processing. 663 It is also likely that some applications would prefer not to trickle 664 server reflexive candidates to entities that are known to be publicly 665 accessible and where sending a direct STUN binding request is likely 666 to reach the destination faster than the trickle update that travels 667 through the signalling path. 669 12. Concluding ICE Processing 671 This specification does not directly modify the procedures ending ICE 672 processing described in Section 8 of [rfc5245bis], and Trickle ICE 673 implementations will follow the same rules. 675 13. Subsequent Offer/Answer Exchanges 677 Either agent MAY generate a subsequent offer at any time allowed by 678 [RFC3264]. When this happens agents will use [rfc5245bis] semantics 679 to determine whether or not the new offer requires an ICE restart. 680 If this is the case then agents would perform Trickle ICE as they 681 would in an initial offer/answer exchange. 683 The only differences between an ICE restart and a brand new media 684 session are that: 686 o during the restart, media can continue to be sent to the 687 previously validated pair. 689 o both agents are already aware whether or not their peer supports 690 Trickle ICE, and there is no longer need for performing half 691 trickle or confirming support with other mechanisms. 693 14. Unilateral Use of Trickle ICE (Half Trickle) 695 In half trickle mode, the offerer sends a regular, Vanilla ICE offer, 696 with a complete set of candidates. This ensures that the offer can 697 be processed by a Vanilla ICE answerer and is mostly meant for use in 698 cases where support for Trickle ICE cannot be confirmed prior to 699 sending an initial offer. The initial offer indicates support for 700 Trickle ICE, so that the answerer can respond with an incomplete set 701 of candidates and continue trickling the rest. Half trickle offers 702 typically contain an end-of-candidates indication, although this is 703 not mandatory because if trickle support is confirmed then the 704 offerer can choose to trickle additional candidates before it sends 705 an end-of-candidates indication. 707 The half trickle mechanism can be used in cases where there is no way 708 for an agent to verify in advance whether a remote party supports 709 Trickle ICE. Because the initial offer contains a full set of 710 candidates, it can thus be handled by a regular Vanilla ICE agent, 711 while still allowing a Trickle ICE agent to use the optimization 712 defined in this specification. This prevents negotiation from 713 failing in the former case while still giving roughly half the 714 Trickle ICE benefits in the latter (hence the name of the mechanism). 716 Use of half trickle is only necessary during an initial offer/answer 717 exchange. After both parties have received a session description 718 from their peer, they can each reliably determine Trickle ICE support 719 and use it for all subsequent offer/answer exchanges. 721 In some instances, using half trickle might bring more than just half 722 the improvement in terms of user experience. This can happen when an 723 agent starts gathering candidates upon user interface cues that the 724 user will soon be initiating an offer, such as activity on a keypad 725 or the phone going off hook. This would mean that some or all of the 726 candidate gathering could be completed before the agent actually 727 needs to send the offer. Because the answerer will be able to 728 trickle candidates, both agents will be able to start connectivity 729 checks and complete ICE processing earlier than with Vanilla ICE and 730 potentially even as early as with full trickle. 732 However, such anticipation is not always possible. For example, a 733 multipurpose user agent or a WebRTC web page where communication is a 734 non-central feature (e.g., calling a support line in case of a 735 problem with the main features) would not necessarily have a way of 736 distinguishing between call intentions and other user activity. In 737 such cases, using full trickle is most likely to result in an ideal 738 user experience. Even so, using half trickle would be an improvement 739 over vanilla ICE because it would result in a better experience for 740 answerers. 742 15. Example Flow 744 A typical successful Trickle ICE exchange with an Offer/Answer 745 protocol would look this way: 747 Alice Bob 748 | Offer | 749 |---------------------------------------------->| 750 | Additional Candidates | 751 |---------------------------------------------->| 752 | | 753 | Answer | 754 |<----------------------------------------------| 755 | Additional Candidates | 756 |<----------------------------------------------| 757 | | 758 | Additional Candidates and Connectivity Checks | 759 |<--------------------------------------------->| 760 | | 761 |<=============== MEDIA FLOWS =================>| 763 Figure 1: Example 765 16. IANA Considerations 767 This specification requests no actions from IANA. 769 17. Security Considerations 771 This specification inherits most of its semantics from [rfc5245bis] 772 and as a result all security considerations described there remain 773 the same. 775 18. Acknowledgements 777 The authors would like to thank Bernard Aboba, Flemming Andreasen, 778 Rajmohan Banavi, Christer Holmberg, Jonathan Lennox, Enrico Marocco, 779 Pal Martinsen, Martin Thomson, Dale R. Worley, and Brandon Williams 780 for their reviews and suggestions on improving this document. 782 19. References 784 19.1. Normative References 786 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 787 Requirement Levels", BCP 14, RFC 2119, March 1997. 789 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 790 with Session Description Protocol (SDP)", RFC 3264, June 791 2002. 793 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 794 Description Protocol", RFC 4566, July 2006. 796 [rfc5245bis] 797 Keranen, A. and J. Rosenberg, "Interactive Connectivity 798 Establishment (ICE): A Protocol for Network Address 799 Translator (NAT) Traversal", draft-ietf-ice-rfc5245bis-00 800 (work in progress), October 2015. 802 19.2. Informative References 804 [I-D.ietf-mmusic-trickle-ice-sip] 805 Ivov, E., Thomas, T., Marocco, E., and C. Holmberg, "A 806 Session Initiation Protocol (SIP) usage for Trickle ICE", 807 draft-ietf-mmusic-trickle-ice-sip-04 (work in progress), 808 May 2016. 810 [I-D.keranen-mmusic-ice-address-selection] 811 Keraenen, A. and J. Arkko, "Update on Candidate Address 812 Selection for Interactive Connectivity Establishment 813 (ICE)", draft-keranen-mmusic-ice-address-selection-01 814 (work in progress), July 2012. 816 [RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G., 817 and E. Lear, "Address Allocation for Private Internets", 818 BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996, 819 . 821 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 822 A., Peterson, J., Sparks, R., Handley, M., and E. 823 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 824 June 2002. 826 [RFC4787] Audet, F., Ed. and C. Jennings, "Network Address 827 Translation (NAT) Behavioral Requirements for Unicast 828 UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 829 2007, . 831 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 832 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 833 DOI 10.17487/RFC5389, October 2008, 834 . 836 [RFC5766] Mahy, R., Matthews, P., and J. Rosenberg, "Traversal Using 837 Relays around NAT (TURN): Relay Extensions to Session 838 Traversal Utilities for NAT (STUN)", RFC 5766, April 2010. 840 [XEP-0030] 841 Hildebrand, J., Millard, P., Eatmon, R., and P. Saint- 842 Andre, "XEP-0030: Service Discovery", XEP XEP-0030, June 843 2008. 845 [XEP-0176] 846 Beda, J., Ludwig, S., Saint-Andre, P., Hildebrand, J., 847 Egan, S., and R. McQueen, "XEP-0176: Jingle ICE-UDP 848 Transport Method", XEP XEP-0176, June 2009. 850 [XEP-0278] 851 Camargo, T., "XEP-0278: Jingle Relay Nodes", XEP XEP-0278, 852 June 2011. 854 Appendix A. Interaction with ICE 856 The ICE protocol was designed to be flexible enough to work in and 857 adapt to as many network environments as possible. Despite that 858 flexibility, ICE as specified in [rfc5245bis] does not by itself 859 support trickle ICE. This section describes how trickling of 860 candidates interacts with ICE. 862 [rfc5245bis] describes the conditions required to update check lists 863 and timer states while an ICE agent is in the Running state. These 864 conditions are verified upon transaction completion and one of them 865 stipulates that: 867 If there is not a pair in the valid list for each component of the 868 media stream, the state of the check list is set to Failed. 870 This could be a problem and cause ICE processing to fail prematurely 871 in a number of scenarios. Consider the following case: 873 1. Alice and Bob are both located in different networks with Network 874 Address Translation (NAT). Alice and Bob themselves have 875 different address but both networks use the same [RFC1918] block. 877 2. Alice sends Bob the candidate 2001:db8:a0b:12f0::10 which also 878 happens to correspond to an existing host on Bob's network. 880 3. Bob creates a check list consisting solely of 881 2001:db8:a0b:12f0::10 and starts checks. 883 4. These checks reach the host at 2001:db8:a0b:12f0::10 in Bob's 884 network, which responds with an ICMP "port unreachable" error and 885 per [rfc5245bis] Bob marks the transaction as Failed. 887 At this point the check list only contains Failed candidates and the 888 valid list is empty. This causes the media stream and potentially 889 all ICE processing to Fail. 891 A similar race condition would occur if the initial offer from Alice 892 only contains candidates that can be determined as unreachable (per 893 [I-D.keranen-mmusic-ice-address-selection]) from any of the 894 candidates that Bob has gathered. This would be the case if Bob's 895 candidates only contain IPv4 addresses and the first candidate that 896 he receives from Alice is an IPv6 one. 898 Another potential problem could arise when a non-trickle ICE 899 implementation sends an offer to a trickle one. Consider the 900 following case: 902 1. Alice's client has a non-Trickle ICE implementation 904 2. Bob's client has support for Trickle ICE. 906 3. Alice and Bob are behind NATs with address-dependent filtering 907 [RFC4787]. 909 4. Bob has two STUN servers but one of them is currently unreachable 911 After Bob's agent receives Alice's offer it would immediately start 912 connectivity checks. It would also start gathering candidates, which 913 would take a long time because of the unreachable STUN server. By 914 the time Bob's answer is ready and sent to Alice, Bob's connectivity 915 checks may well have failed: until Alice gets Bob's answer, she won't 916 be able to start connectivity checks and punch holes in her NAT. The 917 NAT would hence be filtering Bob's checks as originating from an 918 unknown endpoint. 920 Appendix B. Interaction with ICE Lite 922 The behavior of ICE lite agents that are capable of Trickle ICE does 923 not require any particular rules other than those already defined in 924 this specification and [rfc5245bis]. This section is hence provided 925 only for informational purposes. 927 Such an agent would generate offers or answers as per [rfc5245bis]. 928 Both its offers and answers will indicate support for Trickle ICE. 929 Given that they will contain a complete set of candidates (the 930 agent's host candidates), these offers and answers would also be 931 accompanied with an end-of-candidates indication. 933 When performing full trickle, a full ICE implementation could send an 934 offer or an answer with no candidates. After receiving an answer 935 that identifies the remote agent as an ICE lite implementation, the 936 offerer may choose to not send any additional candidates. The same 937 is also true in the case when the ICE lite agent is making the offer 938 and the full ICE one is answering. In these cases the connectivity 939 checks would be enough for the ICE lite implementation to discover 940 all potentially useful candidates as peer reflexive. The following 941 example illustrates one such ICE session using SDP syntax: 943 ICE Lite Bob 944 Agent 945 | Offer (a=ice-lite a=ice-options:trickle) | 946 |---------------------------------------------->| 947 | |no cand 948 | Answer (a=ice-options:trickle) |trickling 949 |<----------------------------------------------| 950 | Connectivity Checks | 951 |<--------------------------------------------->| 952 peer rflx| | 953 cand disco| | 954 | | 955 |<=============== MEDIA FLOWS =================>| 957 Figure 2: Example 959 In addition to reducing signaling traffic this approach also removes 960 the need to discover STUN bindings, or to make TURN or UPnP 961 allocations, which may considerably lighten ICE processing. 963 Appendix C. Changes from Earlier Versions 965 Note to the RFC-Editor: please remove this section prior to 966 publication as an RFC. 968 C.1. Changes from draft-ietf-ice-trickle-01 970 o Changed examples to use IPv6. 972 C.2. Changes from draft-ietf-ice-trickle-00 974 o Removed dependency on SDP (which is to be provided in a separate 975 specification). 977 o Clarified text about the fact that a check list can be empty if no 978 candidates have been sent or received yet. 980 o Clarified wording about check list states so as not to define new 981 states for "Active" and "Frozen" because those states are not 982 defined for check lists (only for candidate pairs) in ICE core. 984 o Removed open issues list because it was out of date. 986 o Completed a thorough copy edit. 988 C.3. Changes from draft-mmusic-trickle-ice-02 990 o Addressed feedback from Rajmohan Banavi and Brandon Williams. 992 o Clarified text about determining support and about how to proceed 993 if it can be determined that the answering agent does not support 994 Trickle ICE. 996 o Clarified text about check list and timer updates. 998 o Clarified when it is appropriate to use half trickle or to send no 999 candidates in an offer or answer. 1001 o Updated the list of open issues. 1003 C.4. Changes from draft-ivov-01 and draft-mmusic-00 1005 o Added a requirement to trickle candidates by order of components 1006 to avoid deadlocks in the unfreezing algorithm. 1008 o Added an informative note on peer-reflexive candidates explaining 1009 that nothing changes for them semantically but they do become a 1010 more likely occurrence for Trickle ICE. 1012 o Limit the number of pairs to 100 to comply with 5245. 1014 o Added clarifications on the non-importance of how newly discovered 1015 candidates are trickled/sent to the remote party or if this is 1016 done at all. 1018 o Added transport expectations for trickled candidates as per Dale 1019 Worley's recommendation. 1021 C.5. Changes from draft-ivov-00 1023 o Specified that end-of-candidates is a media level attribute which 1024 can of course appear as session level, which is equivalent to 1025 having it appear in all m-lines. Also made end-of-candidates 1026 optional for cases such as aggressive nomination for controlled 1027 agents. 1029 o Added an example for ICE lite and Trickle ICE to illustrate how, 1030 when talking to an ICE lite agent doesn't need to send or even 1031 discover any candidates. 1033 o Added an example for ICE lite and Trickle ICE to illustrate how, 1034 when talking to an ICE lite agent doesn't need to send or even 1035 discover any candidates. 1037 o Added wording that explicitly states ICE lite agents have to be 1038 prepared to receive no candidates over signalling and that they 1039 should not freak out if this happens. (Closed the corresponding 1040 open issue). 1042 o It is now mandatory to use MID when trickling candidates and using 1043 m-line indexes is no longer allowed. 1045 o Replaced use of 0.0.0.0 to IP6 :: in order to avoid potential 1046 issues with RFC2543 SDP libraries that interpret 0.0.0.0 as an on- 1047 hold operation. Also changed the port number here from 1 to 9 1048 since it already has a more appropriate meaning. (Port change 1049 suggested by Jonathan Lennox). 1051 o Closed the Open Issue about use about what to do with cands 1052 received after end-of-cands. Solution: ignore, do an ICE restart 1053 if you want to add something. 1055 o Added more terminology, including trickling, trickled candidates, 1056 half trickle, full trickle, 1058 o Added a reference to the SIP usage for Trickle ICE as requested at 1059 the Boston interim. 1061 C.6. Changes from draft-rescorla-01 1063 o Brought back explicit use of Offer/Answer. There are no more 1064 attempts to try to do this in an O/A independent way. Also 1065 removed the use of ICE Descriptions. 1067 o Added SDP specification for trickled candidates, the trickle 1068 option and 0.0.0.0 addresses in m-lines, and end-of-candidates. 1070 o Support and Discovery. Changed that section to be less abstract. 1071 As discussed in IETF85, the draft now says implementations and 1072 usages need to either determine support in advance and directly 1073 use trickle, or do half trickle. Removed suggestion about use of 1074 discovery in SIP or about letting implementing protocols do what 1075 they want. 1077 o Defined Half Trickle. Added a section that says how it works. 1078 Mentioned that it only needs to happen in the first o/a (not 1079 necessary in updates), and added Jonathan's comment about how it 1080 could, in some cases, offer more than half the improvement if you 1081 can pre-gather part or all of your candidates before the user 1082 actually presses the call button. 1084 o Added a short section about subsequent offer/answer exchanges. 1086 o Added a short section about interactions with ICE Lite 1087 implementations. 1089 o Added two new entries to the open issues section. 1091 C.7. Changes from draft-rescorla-00 1093 o Relaxed requirements about verifying support following a 1094 discussion on MMUSIC. 1096 o Introduced ICE descriptions in order to remove ambiguous use of 1097 3264 language and inappropriate references to offers and answers. 1099 o Removed inappropriate assumption of adoption by RTCWEB pointed out 1100 by Martin Thomson. 1102 Authors' Addresses 1104 Emil Ivov 1105 Jitsi 1106 Strasbourg 67000 1107 France 1109 Phone: +33 6 72 81 15 55 1110 Email: emcho@jitsi.org 1112 Eric Rescorla 1113 RTFM, Inc. 1114 2064 Edgewood Drive 1115 Palo Alto, CA 94303 1116 USA 1118 Phone: +1 650 678 2350 1119 Email: ekr@rtfm.com 1120 Justin Uberti 1121 Google 1122 747 6th St S 1123 Kirkland, WA 98033 1124 USA 1126 Phone: +1 857 288 8888 1127 Email: justin@uberti.name 1129 Peter Saint-Andre 1130 Filament 1132 Email: peter@filament.com 1133 URI: https://filament.com/