Network Working Group E. Ivov
Internet-Draft Atlassian
Intended status: Standards Track E. Rescorla
Expires: August 6, 2018 RTFM, Inc.
J. Uberti
P. Saint-Andre
February 2, 2018

Trickle ICE: Incremental Provisioning of Candidates for the Interactive Connectivity Establishment (ICE) Protocol


This document describes "Trickle ICE", an extension to the Interactive Connectivity Establishment (ICE) protocol that enables ICE agents to send and receive candidates incrementally rather than exchanging complete lists. With such incremental provisioning, ICE agents can begin connectivity checks while they are still gathering candidates and considerably shorten the time necessary for ICE processing to complete.

Status of This Memo

This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.

Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at

Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."

This Internet-Draft will expire on August 6, 2018.

Copyright Notice

Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents ( in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

Table of Contents

1. Introduction

The Interactive Connectivity Establishment (ICE) protocol [rfc5245bis] describes mechanisms for gathering candidates, prioritizing them, choosing default ones, exchanging them with a remote party, pairing them, and ordering the candidate pairs into check lists. Once all of these actions have been completed (and only then), the parties can begin a phase of connectivity checks and eventually select the pair of candidates that will be used in a media session or for a given media stream.

Although the sequence described above has the advantage of being relatively straightforward to implement and debug once deployed, it can also be rather lengthy. Candidate gathering often involves things like querying STUN servers and allocating relayed candidates at TURN servers. All of these actions can be delayed for a noticeable amount of time; although they can be run in parallel, they still need to respect the pacing requirements from [rfc5245bis], which is likely to delay them even further. Some or all of these actions also need be completed by the responder. Both agents would next perform connectivity checks and only then would they be ready to begin streaming media.

These factors can lead to relatively lengthy session establishment times and thus to a degraded user experience.

This document defines a supplementary mode of operation for ICE implementations, known as "Trickle ICE", in which candidates can be exchanged incrementally. This enables ICE agents to exchange candidates as soon as an ICE session has been initiated and a candidate has become available. Connectivity checks for a media stream can also start as soon as the first candidates for that stream become available.

Trickle ICE can reduce session establishment times in cases where connectivity is confirmed for the first exchanged candidates (e.g., where candidates for one of the agents are directly reachable from the second agent, such as candidates at a media relay). Even when this is not the case, performing candidate gathering for both agents and connectivity checks in parallel can considerably shorten ICE processing times.

It is worth noting that there is quite a bit of operational experience with the Trickle ICE technique, going back as far as 2005 (when the XMPP Jingle extension defined a "dribble mode" as specified in [XEP-0176]); this document incorporates feedback from those who have implemented and deployed the technique.

In addition to the basics of Trickle ICE, this document also describes how to discover support for Trickle ICE, how regular ICE processing needs to be modified when forming and updating check lists, and how Trickle ICE implementations interoperate with agents that only implement regular ICE processing as defined in [rfc5245bis].

This specification does not define the usage of Trickle ICE with any specific signaling protocol (however, see [I-D.ietf-mmusic-trickle-ice-sip] for usage with SIP [RFC3261] and [XEP-0176] for usage with XMPP [RFC6120]). Similarly, it does not define Trickle ICE in terms of the Session Description Protocol (SDP) [RFC4566] or the offer/answer model [RFC3264] because the technique can be and already is used in application protocols that are not tied to SDP or to offer/answer semantics. However, because SDP and the offer/answer model are familiar to most readers of this specification, some examples in this document use those particulars in order to explain the underlying concepts.

2. Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

This specification makes use of all terminology defined for Interactive Connectivity Establishment in [rfc5245bis]. In addition, it defines the following terms:

Full Trickle:
The typical mode of operation for Trickle ICE agents, in which the initial ICE description can include any number of candidates (even zero candidates) and does not need to include a full generation of candidates as in half trickle.
All of the candidates conveyed within an ICE session; these are the candidates that are associated with a specific local/remote ufrag pair (which will change on ICE restart, if any occurs).
Half Trickle:
A Trickle ICE mode of operation where the initiator gathers a full generation of candidates strictly before creating and conveying the initial ICE description. Once conveyed, this candidate information can be processed by regular ICE agents, which do not require support for this specification. It also allows Trickle ICE capable responders to still gather candidates and perform connectivity checks in a non-blocking way, thus roughly providing "half" the advantages of Trickle ICE. The mechanism is mostly meant for use in cases where the responder's support for Trickle ICE cannot be confirmed prior to conveying the initial ICE description.
ICE Description:
Any session-related (as opposed to candidate-related) attributes required to configure an ICE agent. These include but are not limited to the username fragment, password, and other attributes.
Trickled Candidates:
Candidates that a Trickle ICE agent conveys after conveying the initial ICE description or responding to the initial ICE description, but within the same ICE session. Trickled candidates can be conveyed in parallel with candidate gathering and connectivity checks.
The act of conveying trickled candidates.

3. Determining Support for Trickle ICE

To fully support Trickle ICE, applications SHOULD incorporate one of the following mechanisms to enable implementations to determine whether Trickle ICE is supported:

  1. Provide a capabilities discovery method so that agents can verify support of Trickle ICE prior to initiating a session (XMPP's Service Discovery is one such mechanism).
  2. Make support for Trickle ICE mandatory so that user agents can assume support.

If an application protocol does not provide a method of determining ahead of time whether Trickle ICE is supported, agents can make use of the half trickle procedure described in Section 14.

Prior to conveying the initial ICE description, agents using signaling protocols that support capabilities discovery can attempt to verify whether or not the remote party supports Trickle ICE. If an agent determines that the remote party does not support Trickle ICE, it MUST fall back to using regular ICE or abandon the entire session.

Even if a signaling protocol does not include a capabilities discovery method, a user agent can provide an indication within the ICE description that it supports Trickle ICE by communicating an ICE option of 'trickle'. This token MUST be provided either at the session level or, if at the media stream level, for every media stream (an agent MUST NOT specify Trickle ICE support for some media streams but not others). NOTE: The encoding of the 'trickle' ICE option, and the message(s) used to carry it to the peer, are protocol specific. The encoding for the Session Description Protocol (SDP) [RFC4566] is defined in [I-D.ietf-mmusic-trickle-ice-sip].

Dedicated discovery semantics and half trickle are needed only prior to session initiation. After a session is established and Trickle ICE support is confirmed for both parties, either agent can use full trickle for subsequent exchanges.

4. Conveying the Initial ICE Description

An initiator can start gathering candidates as soon as it has an indication that communication is imminent (e.g., a user interface cue or an explicit request to initiate a session). Unlike in regular ICE, in Trickle ICE implementations do not need to gather candidates in a blocking manner. Therefore, unless half trickle is being used, the user experience is improved if the initiator generates and transmits their initial ICE description as early as possible (thus enabling the remote party to start gathering and trickling candidates).

An initiator MAY include any mix of candidates when conveying the initial ICE description. This includes the possibility of conveying all the candidates the initiator plans to use (as in half trickle mode), conveying only a publicly-reachable IP address (e.g., a candidate at a media relay that is known to not be behind a firewall), or conveying no candidates at all (in which case the initiator can obtain the responder's initial candidate list sooner and the responder can begin candidate gathering more quickly).

Methods for calculating priorities and foundations, as well as determining redundancy of candidates, work just as with regular ICE (with the exception of pruning of duplicate peer reflexive candidates as described under Section 5.2).

5. Responder Procedures

When a responder receives the initial ICE description, it will first check if the ICE description or initiator indicates support for Trickle ICE as explained in Section 3. If this is not the case, the responder MUST process the initial ICE description according to regular ICE procedures [rfc5245bis] (or, if no ICE support is detected at all, according to relevant processing rules for the underlying signaling protocol, such as offer/answer processing rules [RFC3264]).

If support for Trickle ICE is confirmed, a responder will automatically assume support for regular ICE as well. Specifically, the rules from [rfc5245bis] would imply that ICE itself is not supported if the initial ICE description includes no candidates; however, such a conclusion is not warranted if the responder can confirm that the initiator supports Trickle ICE; in this case, fallback to non-ICE processing rules is not necessary.

If the initial ICE description indicates support for Trickle ICE, the responder will determine its role and start gathering and prioritizing candidates; while doing so, it will also respond by conveying its own ICE description, so that both the initiator and the responder can start forming check lists and begin connectivity checks.

5.1. Conveying the Initial Response

A responder can respond to the initial ICE description at any point while gathering candidates. Here again the ICE description MAY contain any set of candidates, including all candidates or no candidates. (The benefit of including no candidates is to convey the ICE description as quickly as possible, so that both parties can consider the overall session to be under active negotiation as soon as possible.)

As noted in Section 3, in application protocols that use SDP the responder's ICE description can indicate support for Trickle ICE by including a token of "trickle" in the ice-options attribute.

5.2. Forming Check Lists and Beginning Connectivity Checks

As soon as the agents have obtained local and remote candidates, both agents begin forming candidate pairs, computing candidate pair priorities, ordering candidate pairs, pruning duplicate pairs, and creating check lists according to regular ICE procedures [rfc5245bis].

According to those procedures, in order for candidate pairing to be possible and for duplicate candidates to be pruned, the candidates would need to be provided in the relevant ICE descriptions. By contrast, under Trickle ICE check lists can be empty until candidates are conveyed or received. Therefore Trickle ICE agents handle check lists and candidate pairing in a slightly different way than regular ICE agents: the agents still form the check lists, but they populate the check lists only after they actually have the candidate pairs. Every check list is initially placed in the Running state, even if there are not yet any candidate pairs in the check list.

A Trickle ICE agent initially considers all candidate pairs in all check lists to be frozen. It then inspects the first check list and attempts to unfreeze all candidate pairs it has received so far that belong to the first component on the first media stream (i.e., the first media stream that was reported to the ICE implementation from the using application). If that first component of the first media stream does not contain candidates for one or more of the currently known pair foundations, and if candidate pairs already exist for that foundation in one of the following components or media streams, then the agent unfreezes the first of those candidate pairs.

With regard to pruning of duplicate candidate pairs, a Trickle ICE agent SHOULD follow a policy of keeping the higher priority candidate unless it is peer reflexive.

6. Initiator Procedures

When processing the initial ICE description from a responder, the initiator follows regular ICE procedures to determine its role, after which it forms check lists (as described in Section 5.2) and begins connectivity checks.

7. Performing Connectivity Checks

For the most part, Trickle ICE agents perform connectivity checks following regular ICE procedures. However, the fact that gathering and communicating candidates is asynchronous in Trickle ICE imposes a number of changes as described in the following sections.

7.1. Scheduling Checks

The ICE specification [rfc5245bis], Section, specifies that an agent will terminate the timer for a triggered check in relation to a check list once the agent has exhausted all frozen pairs in the check list. This will not work with Trickle ICE, because more pairs will be added to the check list incrementally.

Therefore, a Trickle ICE agent SHOULD NOT terminate the timer until the state of the check list is Completed or Failed as specified herein (see Section 8.2).

7.2. Check List and Timer State Updates

The ICE specification [rfc5245bis], Section, requires that agents update check lists and timer states upon completing a connectivity check transaction. During such an update, regular ICE agents would set the state of a check list to Failed if both of the following two conditions are satisfied:

With Trickle ICE, the above situation would often occur when candidate gathering and trickling are still in progress, even though it is quite possible that future checks will succeed. For this reason, Trickle ICE agents add the following conditions to the above list:

When a check list is set to Failed as described above, regular ICE requires the agent to update all other check lists, placing one pair from each check list into the Waiting state and thereby effectively placing all remaining check lists into the Running state. However, under Trickle ICE other check lists might still be empty at this point (because candidates have not yet been received), and following only the rules from regular ICE would prevent the agent from forming those check lists (because the state of a check list depends on the state of the candidate pairs in that check list, but there might not yet by any candidate pairs in a given check list). In accordance with the ICE specification [rfc5245bis], Section, a Trickle ICE agent considers an empty check list to be in the Running state; in accordance with Section 8.1.1, when inserting a new candidate pair into an empty check list, the agent sets the pair to a state of Waiting.

8. Discovering and Conveying Additional Local Candidates

After candidate information has been conveyed, agents will most likely continue discovering new local candidates as STUN, TURN, and other non-host candidate gathering mechanisms begin to yield results. Whenever an agent discovers such a new candidate it will compute its priority, type, foundation and component ID according to regular ICE procedures.

The new candidate is then checked for redundancy against the existing list of local candidates. If its transport address and base match those of an existing candidate, it will be considered redundant and will be ignored. This would often happen for server reflexive candidates that match the host addresses they were obtained from (e.g., when the latter are public IPv4 addresses). Contrary to regular ICE, Trickle ICE agents will consider the new candidate redundant regardless of its priority.

Next the agent "trickles" the newly discovered candidate(s) to the remote agent. The actual delivery of the new candidates is handled by a signaling protocol such as SIP or XMPP. Trickle ICE imposes no restrictions on the way this is done (e.g., some applications may choose not to trickle updates for server reflexive candidates and instead rely on the discovery of peer reflexive ones).

When candidates are trickled, the signaling protocol MUST deliver each candidate to the receiving Trickle ICE implementation not more than once and in the same order it was conveyed. If the signaling protocol provides any candidate retransmissions, they need to be hidden from the ICE implementation.

  a=candidate:1 1 UDP 2130706431 2001:db8::1 5000 typ host ufrag 8hhY


Also, candidate trickling needs to be correlated to a specific ICE session, so that if there is an ICE restart, any delayed updates for a previous session can be recognized as such and ignored by the receiving party. For example, applications that choose to signal candidates via SDP may include a ufrag value in the corresponding a=candidate line such as:

Note: The signaling protocol needs to provide a mechanism for both parties to indicate and agree on the ICE session in force (as identified by the ufrag) so that they have a consistent view of which candidates are to be paired. This is especially important in the case of ICE restarts (see Section 13).

Once the candidate has been conveyed to the remote party, the agent checks if any remote candidates are currently known for this same stream and component. If not, the new candidate will simply be added to the list of local candidates.

Otherwise, if the agent has already learned of one or more remote candidates for this stream and component, it will begin pairing the new local candidates with them and adding the pairs to the existing check lists according to their priority.

Note: A Trickle ICE agent MUST NOT pair a local candidate until it has been trickled to the remote agent.

8.1. Pairing Newly Learned Candidates and Updating Check Lists

Forming candidate pairs works as described in the ICE specification [rfc5245bis]. However, actually adding the new pair to a check list happens according to the rules described below.

If the check list where the pair is to be added already contains the maximum number of candidate pairs (100 by default as per [rfc5245bis]), the new pair is discarded.

If the new pair's local candidate is server reflexive, the server reflexive candidate MUST be replaced by its base before adding the pair to the list.

Once this is done, the agent examines the check list looking for another pair that would be redundant with the new one. If such a pair exists and the type of its remote candidate is not peer reflexive, the pair with the higher priority is kept and the one with the lower priority is discarded. If, on the other hand, the type of the remote candidate in the pre-existing pair is peer reflexive, the agent MUST replace it with the newly formed pair (regardless of their respective priorities); this is done by setting the priority of the new candidate to the priority of the pre-existing candidate and then re-sorting the check list.

For all other pairs, including those with a server reflexive local candidate that were not found to be redundant, the rules specified in the following section apply.

8.1.1. Inserting a New Pair in a Check List

Consider the following tabular representation of all check lists in an agent (note that initially for one of the foundations, i.e., f5, there are no candidate pairs):

|                 |  f1  |  f2  |  f3  |  f4  |  f5  |
| m1 (Audio.RTP)  |  F   |  F   |  F   |      |      |
| m2 (Audio.RTCP) |  F   |  F   |  F   |  F   |      |
| m3 (Video.RTP)  |  F   |      |      |      |      |
| m4 (Video.RTCP) |  F   |      |      |      |      |


Figure 1: Example of Check List State

Each row in the table represents a component for a given media stream (e.g., m1 and m2 might be the RTP and RTCP components for audio). Each column represents one foundation. Each cell represents one candidate pair. In the foregoing table, "F" stands for "frozen"; in the tables below, "W" stands for "waiting" and "S" stands for "succeeded".

When an agent commences ICE processing, in accordance with Section of [rfc5245bis] it will unfreeze (i.e., place in the Waiting state) the topmost candidate pair in every column (i.e., the pair with the lowest component ID). This state is shown in the following table, with candidate pairs in the Waiting state marked by "W".

|                 |  f1  |  f2  |  f3  |  f4  |  f5  |
| m1 (Audio.RTP)  |  W   |  W   |  W   |      |      |
| m2 (Audio.RTCP) |  F   |  F   |  F   |  W   |      |
| m3 (Video.RTP)  |  F   |      |      |      |      |
| m4 (Video.RTCP) |  F   |      |      |      |      |


Figure 2: Initial Check List State

Then, as the checks proceed (see Section of [rfc5245bis]), for each pair that enters the Succeeded state (denoted here by "S"), the agent will unfreeze all pairs for all media streams with the same foundation (e.g., if the pair in column 1, row 1 succeeds then the agent will unfreeze the pair in column 1, rows 2, 3, and 4).

|                 |  f1  |  f2  |  f3  |  f4  |  f5  |
| m1 (Audio.RTP)  |  S   |  W   |  W   |      |      |
| m2 (Audio.RTCP) |  W   |  F   |  F   |  W   |      |
| m3 (Video.RTP)  |  W   |      |      |      |  W   |
| m4 (Video.RTCP) |  W   |      |      |      |  F   |


Figure 3: Check List State with Unfrozen Media Stream

Trickle ICE preserves all of these rules as they apply to what we might call "static" check list sets. This implies that if, for some reason, a Trickle agent were to begin connectivity checks with all of its pairs already present, the way that pair states change is indistinguishable from that of a regular ICE agent.

Of course, the major difference with Trickle ICE is that check list sets can be dynamically updated because candidates can arrive after connectivity checks have started. When this happens, an agent sets the state of the newly formed pair as described below.

Case 1: If the newly formed pair is the topmost pair in its column (i.e. the topmost pair among all the check lists for this foundation), set the state to Waiting (e.g., this would be the case if the newly formed pair were placed in column 5, row 1).

|                 |  f1  |  f2  |  f3  |  f4  |  f5  |
| m1 (Audio.RTP)  |  S   |  W   |  W   |      |  W   |
| m2 (Audio.RTCP) |  W   |  F   |  F   |  W   |      |
| m3 (Video.RTP)  |  W   |      |      |      |      |
| m4 (Video.RTCP) |  W   |      |      |      |      |


Figure 4: Check List State with Newly Formed Pair, Case 1

Case 2: If the pair immediately above the newly formed pair in its column is in the Succeeded state, set the state to Waiting (e.g., this would be the case if the pair in column 5, row 1 succeeded and the newly formed pair were placed in column 5, row 2);

|                 |  f1  |  f2  |  f3  |  f4  |  f5  |
| m1 (Audio.RTP)  |  S   |  W   |  W   |      |  S   |
| m2 (Audio.RTCP) |  W   |  F   |  F   |  W   |  W   |
| m3 (Video.RTP)  |  W   |      |      |      |      |
| m4 (Video.RTCP) |  W   |      |      |      |      |


Figure 5: Check List State with Newly Formed Pair, Case 2

Case 3: If there is at least one Succeeded pair in its column above the row of the newly formed pair, set the state to Waiting (e.g., this would be the case if the pair in column 5, row 1 succeeded and two newly formed pairs were placed in column 5, rows 3 and 4).

|                 |  f1  |  f2  |  f3  |  f4  |  f5  |
| m1 (Audio.RTP)  |  S   |  W   |  W   |      |  S   |
| m2 (Audio.RTCP) |  W   |  F   |  F   |  W   |  W   |
| m3 (Video.RTP)  |  W   |      |      |      |  W   |
| m4 (Video.RTCP) |  W   |      |      |      |  W   |


Figure 6: Check List State with Newly Formed Pair, Case 3

Case 4: In all other cases, set the state to Frozen.

8.2. Announcing End of Candidates

Once all candidate gathering is completed or expires for an ICE session associated with a specific media stream, the agent will generate an "end-of-candidates" indication for that session and convey it to the remote agent via the signaling channel. Although the exact form of the indication depends on the application protocol, the indication MUST specify the generation (ufrag/pwd combination) so that an agent can correlate the end-of-candidates indication with a particular ICE session. The indication can be conveyed in the following ways:

Conveying an end-of-candidates indication in a timely manner is important in order to avoid ambiguities and speed up the conclusion of ICE processing. In particular:

When conveying an end-of-candidates indication during trickling (rather than as a part of the initial ICE description or a response thereto), it is the responsibility of the using protocol to define methods for relating the indication to one or more specific media streams.

Receiving an end-of-candidates indication enables an agent to update check list states and, in case valid pairs do not exist for every component in every media stream, determine that ICE processing has failed. It also enables an agent to speed up the conclusion of ICE processing when a candidate pair has been validated but it involves the use of lower-preference transports such as TURN. In such situations, an implementation MAY choose to wait and see if higher-priority candidates are received; in this case the end-of-candidates indication provides a notification that such candidates are not forthcoming.

An agent MAY also choose to generate an end-of-candidates indication before candidate gathering has actually completed, if the agent determines that gathering has continued for more than an acceptable period of time. However, an agent MUST NOT convey any more candidates after it has conveyed an end-of-candidates indication.

When performing half trickle, an agent SHOULD convey an end-of-candidates indication together with its initial ICE description unless it is planning to potentially trickle additional candidates (e.g., in case the remote party turns out to support Trickle ICE).

After an agent conveys the end-of-candidates indication, it will update the state of the corresponding check list as explained in Section 7.2. Past that point, an agent MUST NOT trickle any new candidates within this ICE session. After an agent has received an end-of-candidates indication, it MUST also ignore any newly received candidates for that media stream or media session. Therefore, adding new candidates to the negotiation is possible only through an ICE restart (see Section 13).

This specification does not override regular ICE semantics for concluding ICE processing. Therefore, even if end-of-candidates indications are conveyed, an agent will still need to go through pair nomination. Also, if pairs have been nominated for components and media streams, ICE processing MAY still conclude even if end-of-candidates indications have not been received for all streams.

9. Receiving Additional Remote Candidates

At any time during ICE processing, a Trickle ICE agent might receive new candidates from the remote agent. When this happens and no local candidates are currently known for this same stream, the new remote candidates are added to the list of remote candidates.

Otherwise, the new candidates are used for forming candidate pairs with the pool of local candidates and they are added to the local check lists as described in Section 8.1.

Once the remote agent has completed candidate gathering, it will convey an end-of-candidates indication. Upon receiving such an indication, the local agent MUST update check list states as per Section 7.2. This might lead to some check lists being marked as Failed.

10. Receiving an End-Of-Candidates Indication

When an agent receives an end-of-candidates indication for a specific media stream, it will update the state of the relevant check list as per Section 7.2. If the check list is still in the Active state after the update, the agent will persist the fact that an end-of-candidates indication has been received and take it into account in future updates to the check list.

11. Trickle ICE and Peer Reflexive Candidates

Even though Trickle ICE does not explicitly modify the procedures for handling peer-reflexive candidates, use of Trickle ICE can have an impact on how they are processed. With Trickle ICE, it is possible that server reflexive candidates can be discovered as peer reflexive in cases where incoming connectivity checks are received from these candidates before the trickle updates that carry them.

While this would certainly increase the number of cases where ICE processing nominates and selects candidates discovered as peer-reflexive, it does not require any change in processing.

It is also likely that some applications would prefer not to trickle server reflexive candidates to entities that are known to be publicly accessible and where sending a direct STUN binding request is likely to reach the destination faster than the trickle update that travels through the signaling path.

12. Concluding ICE Processing

This specification does not directly modify the procedures for ending ICE processing described in Section 8 of [rfc5245bis], and Trickle ICE implementations follow the same rules.

13. Subsequent Exchanges

Before conveying an end-of-candidates indication, either agent MAY convey subsequent candidate information at any time allowed by the signaling protocol in use. When this happens, agents will use [rfc5245bis] semantics to determine whether or not the new candidate information require an ICE restart. If an ICE restart occurs, the agents can assume that Trickle ICE is still supported if support was determined previously, and thus can engage in Trickle ICE behavior as they would in an initial exchange of ICE descriptions where support was determined through a capabilities discovery method.

14. Unilateral Use of Trickle ICE (Half Trickle)

In half trickle mode, the initiator conveys the initial ICE description with a full generation of candidates. This ensures that the ICE description can be processed by a regular ICE responder and is mostly meant for use in cases where support for Trickle ICE cannot be confirmed prior to conveying the initial ICE description. The initial ICE description indicate support for Trickle ICE, which means the responder can respond with something less than a full generation of candidates and then trickle the rest. The initial ICE description for half trickle would typically contain an end-of-candidates indication, although this is not mandatory because if trickle support is confirmed then the initiator can choose to trickle additional candidates before it conveys an end-of-candidates indication.

The half trickle mechanism can be used in cases where there is no way for an agent to verify in advance whether a remote party supports Trickle ICE. Because the initial ICE description contain a full generation of candidates, it can thus be handled by a regular ICE agent, while still allowing a Trickle ICE agent to use the optimization defined in this specification. This prevents negotiation from failing in the former case while still giving roughly half the Trickle ICE benefits in the latter (hence the name of the mechanism).

Use of half trickle is only necessary during an initial exchange of ICE descriptions. After both parties have received an ICE description from their peer, they can each reliably determine Trickle ICE support and use it for all subsequent exchanges.

In some instances, using half trickle might bring more than just half the improvement in terms of user experience. This can happen when an agent starts gathering candidates upon user interface cues that the user will soon be initiating an interaction, such as activity on a keypad or the phone going off hook. This would mean that some or all of the candidate gathering could be completed before the agent actually needs to convey the candidate information. Because the responder will be able to trickle candidates, both agents will be able to start connectivity checks and complete ICE processing earlier than with regular ICE and potentially even as early as with full trickle.

However, such anticipation is not always possible. For example, a multipurpose user agent or a WebRTC web page where communication is a non-central feature (e.g., calling a support line in case of a problem with the main features) would not necessarily have a way of distinguishing between call intentions and other user activity. In such cases, using full trickle is most likely to result in an ideal user experience. Even so, using half trickle would be an improvement over regular ICE because it would result in a better experience for responders.

15. Requirements for Signaling Protocols

In order to fully enable the use of Trickle ICE, this specification defines the following requirements for signaling protocols.

16. Preserving Candidate Order while Trickling

One important aspect of regular ICE is that connectivity checks for a specific foundation and component are attempted simultaneously by both agents, so that any firewalls or NATs fronting the agents would whitelist both endpoints and allow all except for the first ("suicide") packets to go through. This is also important to unfreezing candidates at the right time. While not crucial, preserving this behavior in Trickle ICE is likely to improve ICE performance.

To achieve this, when trickling candidates, agents MUST respect the order in which the components and streams appear (implicitly or explicitly) as they have been negotiated by means of the relevant candidate information. Therefore candidates for a given component MUST NOT be conveyed prior to candidates for a component with a lower ID number within the same foundation. In addition, candidates MUST be paired, following the procedures in Section 8.1.1, in the same order they are conveyed.

  o=jdoe 2890844526 2890842807 IN IP6 2001:db8:a0b:12f0::1
  c=IN IP6 2001:db8:a0b:12f0::1
  t=0 0
  m=audio 5000 RTP/AVP 0
  a=rtpmap:0 PCMU/8000
  a=candidate:1 1 UDP 2130706431 2001:db8:a0b:12f0::1 5000 typ host
  a=candidate:1 2 UDP 2130706431 2001:db8:a0b:12f0::1 5001 typ host
  a=candidate:2 1 UDP 1694498815 2001:db8:a0b:12f0::3 5000 typ srflx
      raddr 2001:db8:a0b:12f0::1 rport 8998
  a=candidate:2 2 UDP 1694498815 2001:db8:a0b:12f0::3 5001 typ srflx
      raddr 2001:db8:a0b:12f0::1 rport 8998


For example, the following SDP description contains two components (RTP and RTCP) and two foundations (host and server reflexive):

Similar considerations apply at the level of media streams in addition to foundations; this is covered by the requirement to always start unfreezing candidates starting from the first media stream as described under Section 5.2.

17. Example Flow

As an example, a typical successful Trickle ICE exchange with a signaling protocol that follows the offer/answer model would look this way:

        Alice                                            Bob
          |                     Offer                     |
          |            Additional Candidates              |
          |                                               |
          |                     Answer                    |
          |            Additional Candidates              |
          |                                               |
          | Additional Candidates and Connectivity Checks |
          |                                               |
          |<=============== MEDIA FLOWS =================>|


Figure 7: Example

18. IANA Considerations

IANA is requested to register the following ICE option in the "ICE Options" sub-registry of the "Interactive Connectivity Establishment (ICE) registry", following the procedures defined in [RFC6336].

ICE Option:
Change control:
An ICE option of "trickle" indicates support for incremental communication of ICE candidates.

19. Security Considerations

This specification inherits most of its semantics from [rfc5245bis] and as a result all security considerations described there apply to Trickle ICE.

If the privacy implications of revealing host addresses on an endpoint device are a concern, agents can generate ICE descriptions that contain no candidates and then only trickle candidates that do not reveal host addresses (e.g., relayed candidates).

20. Acknowledgements

The authors would like to thank Bernard Aboba, Flemming Andreasen, Rajmohan Banavi, Taylor Brandstetter, Philipp Hancke, Christer Holmberg, Ari Keranen, Paul Kyzivat, Jonathan Lennox, Enrico Marocco, Pal Martinsen, Nils Ohlmeier, Thomas Stach, Peter Thatcher, Martin Thomson, Dale R. Worley, and Brandon Williams for their reviews and suggestions on improving this document. Thanks also to Ari Keranen and Peter Thatcher in their role as chairs, and Ben Campbell in his role as responsible Area Director.

21. References

21.1. Normative References

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997.
[rfc5245bis] Keranen, A., Holmberg, C. and J. Rosenberg, "Interactive Connectivity Establishment (ICE): A Protocol for Network Address Translator (NAT) Traversal", Internet-Draft draft-ietf-ice-rfc5245bis-17, February 2018.

21.2. Informative References

[I-D.ietf-mmusic-trickle-ice-sip] Ivov, E., Thomas, T., Marocco, E. and C. Holmberg, "A Session Initiation Protocol (SIP) usage for Trickle ICE", Internet-Draft draft-ietf-mmusic-trickle-ice-sip-12, December 2017.
[RFC1918] Rekhter, Y., Moskowitz, B., Karrenberg, D., de Groot, G. and E. Lear, "Address Allocation for Private Internets", BCP 5, RFC 1918, DOI 10.17487/RFC1918, February 1996.
[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M. and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, DOI 10.17487/RFC3261, June 2002.
[RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with Session Description Protocol (SDP)", RFC 3264, DOI 10.17487/RFC3264, June 2002.
[RFC4566] Handley, M., Jacobson, V. and C. Perkins, "SDP: Session Description Protocol", RFC 4566, DOI 10.17487/RFC4566, July 2006.
[RFC4787] Audet, F. and C. Jennings, "Network Address Translation (NAT) Behavioral Requirements for Unicast UDP", BCP 127, RFC 4787, DOI 10.17487/RFC4787, January 2007.
[RFC5389] Rosenberg, J., Mahy, R., Matthews, P. and D. Wing, "Session Traversal Utilities for NAT (STUN)", RFC 5389, DOI 10.17487/RFC5389, October 2008.
[RFC5766] Mahy, R., Matthews, P. and J. Rosenberg, "Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)", RFC 5766, DOI 10.17487/RFC5766, April 2010.
[RFC6120] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Core", RFC 6120, DOI 10.17487/RFC6120, March 2011.
[RFC6336] Westerlund, M. and C. Perkins, "IANA Registry for Interactive Connectivity Establishment (ICE) Options", RFC 6336, DOI 10.17487/RFC6336, July 2011.
[XEP-0030] Hildebrand, J., Millard, P., Eatmon, R. and P. Saint-Andre, "XEP-0030: Service Discovery", XEP XEP-0030, June 2008.
[XEP-0176] Beda, J., Ludwig, S., Saint-Andre, P., Hildebrand, J., Egan, S. and R. McQueen, "XEP-0176: Jingle ICE-UDP Transport Method", XEP XEP-0176, June 2009.

Appendix A. Interaction with Regular ICE

The ICE protocol was designed to be flexible enough to work in and adapt to as many network environments as possible. Despite that flexibility, ICE as specified in [rfc5245bis] does not by itself support trickle ICE. This section describes how trickling of candidates interacts with ICE.

[rfc5245bis] describes the conditions required to update check lists and timer states while an ICE agent is in the Running state. These conditions are verified upon transaction completion and one of them stipulates that:

This could be a problem and cause ICE processing to fail prematurely in a number of scenarios. Consider the following case:

  1. Alice and Bob are both located in different networks with Network Address Translation (NAT). Alice and Bob themselves have different address but both networks use the same private internet block (e.g., the "20-bit block" 172.16/12 specified in [RFC1918]).
  2. Alice conveys to Bob the candidate which also happens to correspond to an existing host on Bob's network.
  3. Bob creates a check list consisting solely of and starts checks.
  4. These checks reach the host at in Bob's network, which responds with an ICMP "port unreachable" error; per [rfc5245bis] Bob marks the transaction as Failed.

At this point the check list only contains Failed candidates and the valid list is empty. This causes the media stream and potentially all ICE processing to fail, even though if trickle agents could subsequently convey candidates that would cause previously empty check lists to become non-empty.

A similar race condition would occur if the initial ICE description from Alice contain only candidates that can be determined as unreachable from any of the candidates that Bob has gathered (e.g., this would be the case if Bob's candidates only contain IPv4 addresses and the first candidate that he receives from Alice is an IPv6 one).

Another potential problem could arise when a non-trickle ICE implementation initiates an interaction with a Trickle ICE implementation. Consider the following case:

  1. Alice's client has a non-Trickle ICE implementation.
  2. Bob's client has support for Trickle ICE.
  3. Alice and Bob are behind NATs with address-dependent filtering [RFC4787].
  4. Bob has two STUN servers but one of them is currently unreachable.

After Bob's agent receives Alice's initial ICE description it would immediately start connectivity checks. It would also start gathering candidates, which would take a long time because of the unreachable STUN server. By the time Bob's answer is ready and conveyed to Alice, Bob's connectivity checks may well have failed: until Alice gets Bob's answer, she won't be able to start connectivity checks and punch holes in her NAT. The NAT would hence be filtering Bob's checks as originating from an unknown endpoint.

Appendix B. Interaction with ICE Lite

The behavior of ICE lite agents that are capable of Trickle ICE does not require any particular rules other than those already defined in this specification and [rfc5245bis]. This section is hence provided only for informational purposes.

An ICE lite agent would generate candidate information as per [rfc5245bis] and would indicate support for Trickle ICE. Given that the candidate information will contain a full generation of candidates, it would also be accompanied by an end-of-candidates indication.

When performing full trickle, a full ICE implementation could conveying the initial ICE description or response thereto with no candidates. After receiving a response that identifies the remote agent as an ICE lite implementation, the initiator can choose to not trickle any additional candidates. The same is also true in the case when the ICE lite agent initiates the interaction and the full ICE agent is the responder. In these cases the connectivity checks would be enough for the ICE lite implementation to discover all potentially useful candidates as peer reflexive. The following example illustrates one such ICE session using SDP syntax:

        ICE Lite                                          Bob
           |   Offer (a=ice-lite a=ice-options:trickle)    |
           |                                               |no cand
           |         Answer (a=ice-options:trickle)        |trickling
           |              Connectivity Checks              |
  peer rflx|                                               |
 cand disco|                                               |
           |                                               |
           |<=============== MEDIA FLOWS =================>|


Figure 8: Example

In addition to reducing signaling traffic this approach also removes the need to discover STUN bindings or make TURN allocations, which may considerably lighten ICE processing.

Appendix C. Changes from Earlier Versions

Note to the RFC-Editor: please remove this section prior to publication as an RFC.

C.1. Changes from draft-ietf-ice-trickle-14

C.2. Changes from draft-ietf-ice-trickle-13

C.3. Changes from draft-ietf-ice-trickle-12

C.4. Changes from draft-ietf-ice-trickle-11

C.5. Changes from draft-ietf-ice-trickle-10

C.6. Changes from draft-ietf-ice-trickle-09

C.7. Changes from draft-ietf-ice-trickle-08

C.8. Changes from draft-ietf-ice-trickle-07

C.9. Changes from draft-ietf-ice-trickle-06

C.10. Changes from draft-ietf-ice-trickle-05

C.11. Changes from draft-ietf-ice-trickle-04

C.12. Changes from draft-ietf-ice-trickle-03

C.13. Changes from draft-ietf-ice-trickle-02

C.14. Changes from draft-ietf-ice-trickle-01

C.15. Changes from draft-ietf-ice-trickle-00

C.16. Changes from draft-mmusic-trickle-ice-02

C.17. Changes from draft-ivov-01 and draft-mmusic-00

C.18. Changes from draft-ivov-00

C.19. Changes from draft-rescorla-01

C.20. Changes from draft-rescorla-00

Authors' Addresses

Emil Ivov Atlassian 303 Colorado Street, #1600 Austin, TX 78701 USA Phone: +1-512-640-3000 EMail:
Eric Rescorla RTFM, Inc. 2064 Edgewood Drive Palo Alto, CA 94303 USA Phone: +1 650 678 2350 EMail:
Justin Uberti Google 747 6th St S Kirkland, WA 98033 USA Phone: +1 857 288 8888 EMail:
Peter Saint-Andre Mozilla Phone: +1 720 256 6756 EMail: URI: