
Hirsalantie 11 02420 Jorvas Finland christer.holmberg@ericsson.com
747 6th St W 98033 Kirkland USA justin@uberti.name
Transport ICE Working Group ICE PAC Candidate During the process of creating a peer-to-peer connection, ICE agents can encounter situations where they have no candidate pairs to check, and, as a result, conclude that ICE processing has failed. However, because additional candidate pairs can be discovered during ICE processing, declaring failure at this point may be premature. This document discusses when these situations can occur and proposes a way to avoid premature failure.
describes a protocol, Interactive Connectivity Establishment (ICE), for Network Address Translator (NAT) traversal for UDP-based communication. Typically, when using ICE, ICE agents will exchange candidate addresses, form a list of candidate pairs, and then test each candidate pair to see if connectivity can be established. If the test for a given pair fails, it is marked accordingly, and if all pairs have failed, the overall ICE process is considered to have failed. During the process of connectivity checks, additional candidates may be created as a result of successful inbound checks from the peer agent. Such candidates are referred to as peer-reflexive candidates, and once discovered, will be used to form new candidate pairs which will be tested like any other. However, there is an inherent race condition here; if, before learning about any peer-reflexive candidates, an agent runs out of candidate pairs to check, either because it has none, or it considers them all to have failed, it will prematurely declare failure and terminate ICE processing. This race condition can occur in many common situations. This specification updates , by simply requiring that an agent wait a minimum amount of time before declaring ICE failure, even if there are no candidate pairs to check, or if all candidate pairs have failed. This delay provides enough time for the discovery of peer-reflexive candidates, which may eventually lead to ICE processing completing successfully.
It is entirely legal for an ICE agent to provide zero candidates of its own. If the agent somehow knows that the peer agent is directly reachable, gathering local candidates is unnecessary and will only cause delays; the peer agent can discover the appropriate local candidate via connectivity checks. However, following the procedures from strictly will result in immediate ICE failure, since the checklist at the peer agent will be empty.
Even if the ICE agent provides candidates, they may be discarded by the peer agent if it does not know what to do with them. For example, candidates may use an address family that the peer agent does not support, (e.g., a host candidate with an IPv6 address in a NAT64 scenario), or may not be usable for some other reason (e.g., a candidate that contains a FQDN that fails to resolve). In these scenarios, when the candidates are discarded, the checklist at the peer agent will once again be empty, leading to immediate ICE failure.
In order to avoid the problem raised by this document, the ICE agent needs to wait enough time to allow peer-reflexive candidates to be discovered. Accordingly, when full ICE implementations begin their ICE processing, as described in , Section 6.1, the agent MUST set a timer, and its duration SHOULD be equal to the agent's connectivity check transaction timeout. This timeout value is chosen to roughly coincide with the maximum possible duration of ICE connectivity checks from the peer agent, which, if successful, could create peer-reflexive candidates. Because the agent doesn't know the exact number of candidate pairs and pacing interval in use by the peer agent, this timeout value is simply a guess, albeit an educated one. Regardless, for this particular problem, the desired benefits will be realized as long as the agent waits some reasonable amount of time. While the timer is running, if a checklist has no pairs left to check, i.e., there are no pairs that are not in the failed state, the agent MUST not conclude that ICE processing has failed, and MUST wait for the timer to elapse before doing so. One consequence of this behavior is that in cases where ICE should fail, e.g., where both sides provide candidates with unresolvable FQDNs ICE will no longer fail immediately, and only fail when the aforementioned timer expires. However, because most ICE scenarios require an extended period of time to determine failure, the fact that some specific scenarios no longer fail fast should have minimal application impact, if any.
The security considerations for ICE are defined in . This specification only recommends ICE agents to wait for a certain time of period before they declare ICE failure, and does not introduce new security considerations.
This specification makes no requests to IANA.