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 a full ICE implementation begins its ICE processing, as described in
RFC 8445,
Section 6.1, it
MUST set a timer, henceforth known as the "PAC timer" (Patiently Awaiting Connectivity), to ensure that ICE will run for a minimum amount of time before determining failure.
Specifically, the ICE agent will start its timer once it believes ICE connectivity checks are starting. This occurs when the agent has sent the values needed to perform connectivity checks (e.g., the Username Fragment and Password denoted in
RFC 8445,
Section 5.3) and has received some indication that the remote side is ready to start connectivity checks, typically via receipt of the values mentioned above. Note that the agent will start the timer even if it has not sent or received any ICE candidates.
The
RECOMMENDED duration for the PAC timer is equal to the agent's connectivity check transaction timeout, including all retransmissions. When using default values for retransmission timeout (RTO) and Rc, this amounts to 39.5 seconds, as explained in
RFC 5389,
Section 7.2.1. This timeout value is chosen to roughly coincide with the maximum possible duration of ICE connectivity checks from the remote peer, which, if successful, could create peer-reflexive candidates. Because the ICE agent doesn't know the exact number of candidate pairs and pacing interval in use by the remote side, 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, and, as usual, the application is in the best position to determine what is reasonable for its scenario.
While the timer is still running, the ICE agent
MUST NOT update a checklist state from Running to Failed, even if there are no pairs left in the checklist to check. As a result, the ICE agent will not remove any data streams or set the state of the ICE session to Failed as long as the timer is running.
When the timer period eventually elapses, the ICE agent
MUST resume typical ICE processing, including setting the state of any checklists to Failed if they have no pairs left to check and handling any consequences as indicated in
RFC 8445,
Section 8.1.2. Naturally, if there are no such checklists, no action is necessary.
One consequence of this behavior is that in cases where ICE should fail, e.g., where both sides provide candidates with unsupported address families, ICE will no longer fail immediately -- it will only fail when the PAC 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 quickly should have minimal application impact, if any.
Note also that the PAC timer is potentially relevant to the ICE nomination procedure described in
RFC 8445,
Section 8.1.1. That specification does not define a minimum duration for ICE processing prior to nomination of a candidate pair, but in order to select the best candidate pair, ICE needs to run for enough time in order to allow peer-reflexive candidates to be discovered and checked, as noted above. Accordingly, the controlling ICE agent
SHOULD wait a sufficient amount of time before nominating candidate pairs, and it
MAY use the PAC timer to do so. As always, the controlling ICE agent retains full discretion and
MAY decide, based on its own criteria, to nominate pairs prior to the PAC timer period elapsing.