MMUSIC J. Rosenberg Internet-Draft Cisco Systems Expires: April9,26, 2007 October6,23, 2006 Interactive Connectivity Establishment (ICE): A Methodology for Network Address Translator (NAT) Traversal for Offer/Answer Protocolsdraft-ietf-mmusic-ice-11draft-ietf-mmusic-ice-12 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. 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." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on April9,26, 2007. Copyright Notice Copyright (C) The Internet Society (2006). Abstract This document describes a protocol for Network Address Translator (NAT) traversal for multimedia session signaling protocols based on the offer/answer model, such as the Session Initiation Protocol (SIP). This protocol is called Interactive Connectivity Establishment (ICE). ICE makes use of the Simple Traversal Underneath NAT (STUN) protocol, applying its binding discovery and relay usages, in addition to defining a new usage for checking connectivity between peers. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . .45 2. Overview of ICE . . . . . . . . . . . . . . . . . . . . . . .45 2.1. Gathering Candidate Addresses . . . . . . . . . . . . . .67 2.2. Connectivity Checks . . . . . . . . . . . . . . . . . . .89 2.3. Sorting Candidates . . . . . . . . . . . . . . . . . . . . 10 2.4. Frozen Candidates . . . . . . . . . . . . . . . . . . . .1011 2.5. Security for Checks . . . . . . . . . . . . . . . . . . . 113. Terminology2.6. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . 11 2.7. Passive-Only Agents . . .11 4. Sending the Initial Offer. . . . . . . . . . . . . . . . 12 3. Terminology . .13 4.1. Gathering Candidates. . . . . . . . . . . . . . . . . . .13 4.2. Prioritizing Candidates. . . . 13 4. Choosing a Mode . . . . . . . . . . . . .16 4.3. Choosing In-Use Candidates. . . . . . . . . . 15 5. Sending the Initial Offer . . . . . .18 4.4. Encoding the SDP. . . . . . . . . . . . 15 5.1. Gathering Candidates . . . . . . . . .18 5. Receiving the Initial Offer. . . . . . . . . . 16 5.2. Prioritizing Candidates . . . . . . .20 5.1. Verifying ICE Support. . . . . . . . . . 18 5.3. Choosing In-Use Candidates . . . . . . . .20 5.2. Gathering Candidates. . . . . . . . 20 5.4. Encoding the SDP . . . . . . . . . . .20 5.3. Prioritizing Candidates. . . . . . . . . . 20 6. Receiving the Initial Offer . . . . . . .21 5.4. Choosing In Use Candidates. . . . . . . . . . 22 6.1. Verifying ICE Support . . . . . .21 5.5. Encoding the SDP. . . . . . . . . . . . 22 6.2. Determining Role . . . . . . . . .21 5.6. Forming the Check Lists. . . . . . . . . . . . 23 6.3. Gathering Candidates . . . . .21 5.7. Performing Periodic Checks. . . . . . . . . . . . . . 23 6.4. Prioritizing Candidates . .23 6. Receipt of the Initial Answer. . . . . . . . . . . . . . . 23 6.5. Choosing In Use Candidates .24 6.1. Verifying ICE Support. . . . . . . . . . . . . . . 23 6.6. Encoding the SDP . . .24 6.2. Forming the Check List. . . . . . . . . . . . . . . . . .24 6.3. Performing Periodic Checks23 6.7. Forming the Check Lists . . . . . . . . . . . . . . . .24 7. Connectivity Checks. 23 6.8. Performing Periodic Checks . . . . . . . . . . . . . . . . 26 7. Receipt of the Initial Answer . . . .24 7.1. Applicability. . . . . . . . . . . . 27 7.1. Verifying ICE Support . . . . . . . . . .24 7.2. Client Discovery of Server. . . . . . . . 27 7.2. Determining Role . . . . . . . .25 7.3. Server Determination of Usage. . . . . . . . . . . . . 27 7.3. Forming the Check List .25 7.4. New Requests or Indications. . . . . . . . . . . . . . .25 7.5. New Attributes. . 27 7.4. Performing Periodic Checks . . . . . . . . . . . . . . . . 27 8. Connectivity Checks . . . .25 7.6. New Error Response Codes. . . . . . . . . . . . . . . . .25 7.7.27 8.1. Client Procedures . . . . . . . . . . . . . . . . . . . .25 7.7.1.28 8.1.1. Sending the Request . . . . . . . . . . . . . . . . .25 7.7.2.28 8.1.2. Processing the Response . . . . . . . . . . . . . . .26 7.8.29 8.2. Server Procedures . . . . . . . . . . . . . . . . . . . .27 7.9. Security Considerations for Connectivity Check30 9. Concluding ICE . . . . . .29 8. Completing the ICE Checks. . . . . . . . . . . . . . . . . .29 9.32 10. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . .30 9.1.33 10.1. Generating the Offer . . . . . . . . . . . . . . . . . . .30 9.2.33 10.2. Receiving the Offer and Generating an Answer . . . . . . .31 9.3.34 10.3. Updating the Check and Valid Lists . . . . . . . . . . . .32 10.35 11. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . .33 11.37 12. Media Handling . . . . . . . . . . . . . . . . . . . . . . . .34 11.1.38 12.1. Sending Media . . . . . . . . . . . . . . . . . . . . . .34 11.2.38 12.2. Receiving Media . . . . . . . . . . . . . . . . . . . . .35 12.39 13. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . .35 12.1.39 13.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . .35 12.2.39 13.2. Interactions with Forking . . . . . . . . . . . . . . . .37 12.3.40 13.3. Interactions with Preconditions . . . . . . . . . . . . .37 12.4.41 13.4. Interactions with Third Party Call Control . . . . . . . .38 13.41 14. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . .38 14.42 15. Example . . . . . . . . . . . . . . . . . . . . . . . . . . .40 15.44 16. Security Considerations . . . . . . . . . . . . . . . . . . .46 15.1.49 16.1. Attacks on Connectivity Checks . . . . . . . . . . . . . .46 15.2.49 16.2. Attacks on Address Gathering . . . . . . . . . . . . . . .49 15.3.52 16.3. Attacks on the Offer/Answer Exchanges . . . . . . . . . .49 15.4.52 16.4. Insider Attacks . . . . . . . . . . . . . . . . . . . . .50 15.4.1.52 16.4.1. The Voice Hammer Attack . . . . . . . . . . . . . . .50 15.4.2.53 16.4.2. STUN Amplification Attack . . . . . . . . . . . . . .50 16. IANA Considerations .53 17. Definition of Connectivity Check Usage . . . . . . . . . . . . 54 17.1. Applicability . . . . . . . .51 16.1. candidate Attribute. . . . . . . . . . . . . . 54 17.2. Client Discovery of Server . . . . .51 16.2. remote-candidates Attribute. . . . . . . . . . . 54 17.3. Server Determination of Usage . . . .51 16.3. ice-pwd Attribute. . . . . . . . . . 54 17.4. New Requests or Indications . . . . . . . . . .52 16.4. ice-ufrag Attribute. . . . . 54 17.5. New Attributes . . . . . . . . . . . . . .52 17. IAB Considerations. . . . . . . . 54 17.6. New Error Response Codes . . . . . . . . . . . . . .53 17.1. Problem Definition. . . 55 17.7. Client Procedures . . . . . . . . . . . . . . . . .53 17.2. Exit Strategy. . . 55 17.8. Server Procedures . . . . . . . . . . . . . . . . . . .53 17.3. Brittleness Introduced by ICE. 55 17.9. Security Considerations for Connectivity Check . . . . . . 55 18. IANA Considerations . . . . . . .54 17.4. Requirements for a Long Term Solution. . . . . . . . . .55 17.5. Issues with Existing NAPT Boxes. . . . 55 18.1. SDP Attributes . . . . . . . . .55 18. Acknowledgements. . . . . . . . . . . . . 55 18.1.1. candidate Attribute . . . . . . . . . .56 19. References. . . . . . . 55 18.1.2. remote-candidates Attribute . . . . . . . . . . . . . 56 18.1.3. ice-passive Attribute . . . . . .56 19.1. Normative References. . . . . . . . . . 56 18.1.4. ice-pwd Attribute . . . . . . . . .56 19.2. Informative References. . . . . . . . . 57 18.1.5. ice-ufrag Attribute . . . . . . . . .57 Appendix A. Design Motivations. . . . . . . . 57 18.2. STUN Attributes . . . . . . . . .58 A.1. Applicability to Gateways and Servers. . . . . . . . . .59 A.2. Pacing of STUN Transactions. . 58 19. IAB Considerations . . . . . . . . . . . . .60 A.3. Candidates with Multiple Bases. . . . . . . . . 58 19.1. Problem Definition . . . . .61 A.4. Purpose of the Translation. . . . . . . . . . . . . . . 58 19.2. Exit Strategy .63 A.5. Importance of the STUN Username. . . . . . . . . . . . .63 A.6. The Candidate Pair Sequence Number Formula. . . . . . . .64 A.7. The Frozen State59 19.3. Brittleness Introduced by ICE . . . . . . . . . . . . . . 59 19.4. Requirements for a Long Term Solution . . . . . . .65 A.8. The remote-candidates attribute. . . 60 19.5. Issues with Existing NAPT Boxes . . . . . . . . . .65 A.9. Why are Keepalives Needed?. . . 60 20. Acknowledgements . . . . . . . . . . . . .66 A.10. Why Prefer Peer Reflexive Candidates?. . . . . . . . . .67 A.11. Why Can't Offerers Send Media When a Pair Validates61 21. References . . .67 Author's Address. . . . . . . . . . . . . . . . . . . . . . . 61 21.1. Normative References . .69 Intellectual Property and Copyright Statements. . . . . . . . . .70 1. Introduction RFC 3264 [4] defines a two-phase exchange of Session Description Protocol (SDP) messages [10] for the purposes. . . . . . . 61 21.2. Informative References . . . . . . . . . . . . . . . . . . 62 Appendix A. Passive-Only ICE . . . . . . . . . . . . . . . . . . 64 Appendix B. Design Motivations . . . . . . . . . . . . . . . . . 66 B.1. Pacing ofestablishmentSTUN Transactions . . . . . . . . . . . . . . . 66 B.2. Candidates with Multiple Bases . . . . . . . . . . . . . . 67 B.3. Purpose ofmultimedia sessions. This offer/answer mechanism is used by protocols such astheSession Initiation Protocol (SIP) [3]. Protocols using offer/answer are difficult to operate through Network Address Translators (NAT). Because their purpose is to establish a flowTranslation . . . . . . . . . . . . . . . . 69 B.4. Importance ofmedia packets, they tend to carry IP addresses within their messages, which is known to be problematic through NAT [14].the STUN Username . . . . . . . . . . . . . 69 B.5. Theprotocols also seekCandidate Pair Sequence Number Formula . . . . . . . . 70 B.6. The Frozen State . . . . . . . . . . . . . . . . . . . . . 71 B.7. The remote-candidates attribute . . . . . . . . . . . . . 71 B.8. Why are Keepalives Needed? . . . . . . . . . . . . . . . . 72 B.9. Why Prefer Peer Reflexive Candidates? . . . . . . . . . . 73 B.10. Why Send an Updated Offer? . . . . . . . . . . . . . . . . 73 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 74 Intellectual Property and Copyright Statements . . . . . . . . . . 75 1. Introduction RFC 3264 [4] defines a two-phase exchange of Session Description Protocol (SDP) messages [10] for the purposes of establishment of multimedia sessions. This offer/answer mechanism is used by protocols such as the Session Initiation Protocol (SIP) [3]. Protocols using offer/answer are difficult to operate through Network Address Translators (NAT). Because their purpose is to establish a flow of media packets, they tend to carry IP addresses within their messages, which is known to be problematic through NAT [14]. The protocols also seek to create a media flow directly between participants, so that there is no application layer intermediary between them. This is done to reduce media latency, decrease packet loss, and reduce the operational costs of deploying the application. However, this is difficult to accomplish through NAT. A full treatment of the reasons for this is beyond the scope of this specification. Numerous solutions have been proposed for allowing these protocols to operate through NAT. These include Application Layer Gateways (ALGs), the Middlebox Control Protocol [15], Simple Traversal Underneath NAT (STUN) [13] and its revision [11], the STUN Relay Usage [12], and Realm Specific IP [17] [18] along with session description extensions needed to make them work, such as the Session Description Protocol (SDP) [10] attribute for the Real Time Control Protocol (RTCP) [2]. Unfortunately, these techniques all have pros and cons which make each one optimal in some network topologies, but a poor choice in others. The result is that administrators and implementors are making assumptions about the topologies of the networks in which their solutions will be deployed. This introduces complexity and brittleness into the system. What is needed is a single solution which is flexible enough to work well in all situations. This specification provides that solution for media streams established by signaling protocols based on the offer-answer model. It is called Interactive Connectivity Establishment, or ICE. ICE makes use of STUN and its relay extension, commonly called TURN, but uses them in a specific methodology which avoids many of the pitfalls of using any one alone. 2. Overview of ICE In a typical ICE deployment, we have two endpoints (known as agents in RFC 3264 terminology) which want to communicate. They are able to communicate indirectly via some signaling system such as SIP, by which they can perform an offer/answer exchange of SDP [4] messages. Note that ICE is not intended for NAT traversal for SIP, which is assumed to be provided via some other mechanism [31]. At the beginning of the ICE process, the agents are ignorant of their own topologies. In particular, they might or might not be behind a NAT (or multiple tiers of NATs). ICE allows the agents to discover enough information about their topologies to find a path or paths by which they can communicate. Figure Figure 1 shows a typical environment for ICE deployment. The two endpoints are labelled L and R (for left and right, which helps visualize call flows). Both L and R are behind NATs -- though as mentioned before, they don't know that. The type of NAT and its properties are also unknown. Agents L and R are capable of engaging in an offer/answer exchange by which they can exchange SDP messages, whose purpose is to set up a media session between L and R. Typically, this exchange will occur through a SIP server. In addition to the agents, a SIP server and NATs, ICE is typically used in concert with STUN servers in the network. Each agent can have its own STUN server, or they can be the same. +-------+ | SIP | +-------+ | Srvr | +-------+ | STUN | | | | STUN | | Srvr | +-------+ | Srvr | | | / \ | | +-------+ / \ +-------+ / \ / \ / \ / \ / <- Signalling -> \ / \ / \ +--------+ +--------+ | NAT | | NAT | +--------+ +--------+ / \ / \ / \ +-------+ +-------+ | Agent | | Agent | | L | | R | | | | | +-------+ +-------+ Figure 1 The basic idea behind ICE is as follows: each agent has a variety of candidate transport addresses it could use to communicate with the other agent. These might include: o It's directly attached network interface (or interfaces in the case of a multihomed machine o A translated address on the public side of a NAT (a "server reflexive" address) o The address of a media relay the agent is using. Potentially, any of L's candidate transport addresses can be used to communicate with any of R's transport addresses. In practice, however, many combinations will not work. For instance, if L and R are both behind NATs then their directly interface addresses are unlikely to be able to communicate directly (this is why ICE is needed, after all!). The purpose of ICE is to discover which pairs of addresses will work. The way that ICE does this is to systematically try all possible pairs (in a carefully sorted order) until it finds one or more that works. 2.1. Gathering Candidate Addresses In order to execute ICE, an agent has to identify all of its address candidates. Naturally, one viable candidate is one obtained directly from a local interface the client has towards the network. Such a candidate is called a HOST CANDIDATE. The local interface could be one on a local layer 2 network technology, such as ethernet or WiFi, or it could be one that is obtained through a tunnel mechanism, such as a Virtual Private Network (VPN) or Mobile IP (MIP). In all cases, these appear to the agent as a local interface from which ports (and thus a candidate) can be allocated. If an agent is multihomed, it can obtain a candidate from each interface. Depending on the location of the peer on the IP network relative to the agent, the agent may be reachable by the peer through one of those interfaces, or through another. Consider, for example, an agent which has a local interface to a private net 10 network, and also to the public Internet. A candidate from the net10 interface will be directly reachable when communicating with a peer on the same private net 10 network, while a candidate from the public interface will be directly reachable when communicating with a peer on the public Internet. Rather than trying to guess which interface will work prior to sending an offer, the offering agent includes both candidates in its offer. Once the agent has obtained host candidates, it uses STUN to obtain additional candidates. These come in two flavors: translated addresses on the public side of a NAT (SERVER REFLEXIVE CANDIDATES) and addresses of media relays (RELAYED CANDIDATES). The relationship of these candidates to the host candidate is shown in Figure 2. Both types of candidates are discovered using STUN. To Internet | | | /------------ Relayed | / Candidate +--------+ | | | STUN | | Server | | | +--------+ | | | /------------ Server |/ Reflexive +------------+ Candidate | NAT | +------------+ | | /------------ Host |/ Candidate +--------+ | | | Agent | | | +--------+ Figure 2 To find a server reflexive candidate, the agent sends a STUN Binding Request, using the Binding Discovery Usage [11] from each host candidate, to its STUN server. (It is assumed that the address of the STUN server is configured, or learned in some way.) When theagentsagent sends the Binding Request, the NAT (assuming there is one) will allocate a binding, mapping this server reflexive candidate to the host candidate. Outgoing packets sent from the host candidate will be translated by the NAT to the server reflexive candidate. Incoming packets sent to the server relexive candidate will be translated by the NAT to the host candidate and forwarded to the agent. We call the host candidate associated with a given server reflexive candidate the BASE. Note "Base" refers to the address you'd send from for a particular candidate. Thus, as a degenerate case host candidates also have a base, but it's the same as the host candidate. When there are multiple NATs between the agent and the STUN server, the STUN request will create a binding on each NAT, but only the outermost server reflexive candidate will be discovered by the agent. If the agent is not behind a NAT, then the base candidate will be the same as the server reflexive candidate and the server reflexive candidate can be ignored. The final type of candidate is a RELAYED candidate. The STUN Relay Usage [12] allows a STUN server to act as a media relay, forwarding traffic between L and R. In order to send traffic to L, R sends traffic to the media relay which forwards it to L and vice versa. The same thing happens in the other direction. Traffic from L to R has its addresses rewritten twice: first by the NAT and second by the STUN relay server. Thus, the address that R knows about and the one that it wants to send to is the one on the STUN relay server. This address is the final kind of candidate, which we call a RELAYED CANDIDATE. 2.2. Connectivity Checks Once L has gathered all of its candidates, it orders them highest to lowest priority and sends them to R over the signalling channel. The candidates are carried in attributes in the SDP offer. When R receives the offer, it performs the same gathering process and responds with its own list of candidates. At the end of this process, each agent has a complete list of both its candidates and its peer's candidates and is ready to perform connectivity checks by pairing up the candidates to see which pair works. The basic principle of the connectivity checks is simple: 1. Sort the candidate pairs in priority order. 2. Send checks on each candidate pair in priority order. 3. Acknowledge checks received from the other agent. A complete connectivity check for a single candidate pair is a simple 4-message handshake: L R - - STUN request -> \ L's <- STUN response / check <- STUN request \ R's STUN response -> / check Figure 3 As an optimization, as soon as R gets L's check message he immediately sends his own check message to L on the same candidate pair. This accelerates the process of finding a valid candidate. At the end of this handshake, both L and R know that they can send (and receive) messages end-to-end in both directions.Note that as soon as R receives L's STUN response it knows that the R->L path works and it can start sending media on that path right away, as shown below. This allows for 'early media' to flow as fast as possible: L R - - STUN request -> \ L's <- STUN response / check <- STUN request \ R's STUN response -> / check <- RTP Data Figure 4 Once any connectivity check for a candidate for a given media component succeeds, ICE uses that candidate and immediately abandons all other connectivity checks for that component. Note that due to race conditions and packet loss, this may mean that the "best" candidate isn't selected, but it does guarantee the selection of a candidate that works, and because of the sorting process it will generally be one of the most preferred ones. 2.3. Sorting Candidates Because2.3. Sorting Candidates Because the algorithm above searches all candidate pairs, if a working pair exists it will eventually find it no matter what order the candidates are tried in. In order to produce faster (and better) results, the candidates are sorted in a specified order. The algorithm is described in Section4.25.2 but follows two general principles: o Each agent gives its candidates a numeric priority which is sent along with the candidate to the peer o The local and remote priorities are combined so that each agent has the same ordering for the candidate pairs. The second property is important for getting ICE to work when there are NATs in front of A and B. Frequently, NATs will not allow packets in from a host until the agent behind the NAT has sent a packet towards that host. Consequently, ICE checks in each direction will not succeed until both sides have sent a check through their respective NATs. In general the priority algorithm is designed so that candidates of similar type get similar priorities and so that more direct routes are favored over indirect ones. Within those guidelines, however, agents have a fair amount of discretion about how to tune their algorithms. 2.4. Frozen Candidates The previous description only addresses the case where the agents wish to establish a single media component--i.e., a single flow with a single host-port quartet. However, in many cases (in particular RTP and RTCP) the agents actually need to establish connectivity for more than one flow. The naive way to attack this problem would be to simply do independent ICE exchanges for each media component. This is obviously inefficient because the network properties are likely to be very similar for each component (especially because RTP and RTCP are typically run on adjacent ports). Thus, it should be possible to leverage information from one media component in order to determine the best candidates for another. ICE does this with a mechanism called "frozen candidates." The basic principle behind frozen candidates is that initially only the candidates for a single media component are tested. The other media components are marked "frozen". When the connectivity checks for the first component succeed, the corresponding candidates for the other components are unfrozen and checked immediately. This avoids repeated checking of components which are superficially more attractive but in fact are likely to fail. While we've described "frozen" here as a separate mechanism for expository purposes, in fact it is an integral part of ICE and the the ICE prioritization algorithm automatically ensures that the right candidates are unfrozen and checked in the right order. 2.5. Security for Checks Because ICE is used to discover which addresses can be used to send media between two agents, it is important to ensure that the process cannot be hijacked to send media to the wrong location. Each STUN connectivity check is covered by a message authentication code (MAC) computed using a key exchanged in the signalling channel. This MAC provides message integrity and data origin authentication, thus stopping an attacker from forging or modifying connectivity check messages. The MAC also aids in disambiguating ICE exchanges from forked calls.3. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL"2.6. Concluding ICE ICE checks are performed inthis documenta specific sequence, so that high priority pairs are checked first, followed by lower priority ones. One way tobe interpretedconclude ICE is to declare victory asdescribed in RFC 2119 [1]. This specification makes usesoon as a check for each component of each media stream completes successfully. Indeed, this is a reasonable algorithm, and details for it are provided below. However, it is possible that packet losses will cause a higher priority check to take longer to complete, and allowing ICE to run a little longer might produce better results. More fundamentally, however, thefollowing terminology: Agent: Asprioritization definedin RFC 3264,by this specification may not yield "optimal" results. As anagent is the protocol implementation involved inexample, if theoffer/answer exchange. There are two agents involved in an offer/answer exchange. Peer: From the perspectiveaim is to select low latency media paths, usage of a relay is a hint that latencies may be higher, but it is nothing more than a hint. An actual RTT measurement could be made, and it might demonstrate that a pair with lower priority is actually better than one with higher priority. Consequently, ICE assigns one of the agents ina session, its peer is the other agent. Specifically, fromtheperspectiverole of theofferer, the peer is the answerer. Fromcontrolling agent, and theperspectiveother as passive. The controlling agent runs a selection algorithm, through which it can decide when to conclude ICE checks, and which pairs get selected. When a controlling agent selects a pair for a particular component of a media stream, it generates a check for that pair and includes a flag in theanswerer,check indicating that thepeer ispair has been selected. This will cause theofferer. Transport Address: The combination of an IP addresspassive agent to cease any other checks it has lined up for that component, andport. Candidate: A transport addressmark the pair validated by that check as "selected". Once there isto be tested by ICE procedures in order to determine its suitability for usagea selected pair forreceipt of media. Component: Aeach componentisof asingle transport addressmedia stream, the ICE checks for thatis usedmedia stream are considered tosupport abe completed, and mediastream. Forcan flow in each direction for that stream, as shown in Figure 4. Once all of the media streamsbased on RTP, therearetwo components per media stream - one for RTP, and one for RTCP. Host Candidate: A candidate obtained by binding to a specific port fromcompleted, the controlling endpoint sends aninterface onupdated offer if thehost. This includes both physical interfaces and logical ones, such as ones obtained through Virtual Private Networks (VPNs) and Realm Specific IP (RSIP) [17] (which lives atcurrently in- use candidates don't match theoperating system level). Server Reflexive Candidate: A candidate obtained by sending aones it selected. L R - - STUN requestfrom+ flag -> \ L's <- STUN response / check -> RTP Data <- RTP Data Figure 4 2.7. Passive-Only Agents ICE requires both sides of ahost candidatecall to support it. However, certain agents, such as those in gateways toa STUN server, distinct from the peer, whose address is configured or learned bytheclient priorPSTN, media servers, conferencing servers, and voicemail servers, are known toan offer/answer exchange. Peer Reflexive Candidate: A candidate obtained by sending a STUN request fromnot be behind ahost candidateNAT or firewall. To make it easier for these devices tothe STUN server running on a peer's candidate. Relayed Candidate: A candidate obtained by sending a STUN Allocate request fromsupport ICE, they can operate in ahost candidate"passive-only" mode (in contrast to aSTUN server. The relayed candidate is resident on the STUN server,"full" mode). In passive-only mode, they don't need to gather candidates and don't act as theSTUN server relays packets back towards thecontrolling agent.Translation: The translation of a relayed candidate is the transport address that the relay will forward a packet to, when one is received at the relayed candidate. For relayed candidates learned throughThey only need to respond to checks, generate triggered checks, and follow theSTUN Allocate request, the translationrules for sending media and keepalives. 3. 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 RFC 2119 [1]. This specification makes use of therelayed candidatefollowing terminology: Agent: As defined in RFC 3264, an agent is theserver reflexive candidate returned byprotocol implementation involved in theAllocate response. Base: The baseoffer/answer exchange. There are two agents involved in an offer/answer exchange. Peer: From the perspective of one of the agents in aserver reflexive candidatesession, its peer is thehost candidateother agent. Specifically, fromwhich it was derived. A host candidate is also said to have a base, equal to that candidate itself. Similarly,thebaseperspective ofa relayed candidate is that candidate itself. Foundation: Each candidate has a foundation, which is an identifier thatthe offerer, the peer isdistinct for two candidates that have different types, different interface IP addresses for their base, and different IP addresses for their STUN servers. Two candidates havethesame foundation when they areanswerer. From the perspective of thesame type, their bases haveanswerer, thesame IP address, and, for server reflexive or relayed candidates, they come frompeer is thesame STUN server. Foundations are used to correlate candidates, soofferer. Transport Address: The combination of an IP address and port. Candidate: A transport address thatwhen one candidateisfoundto bevalid, candidates sharing the same foundation can betestednext, as they are likelyby ICE procedures in order toalso be valid. Local Candidate: A candidate that an agent has obtained and included in an offer or answer it sent. Remote Candidate: A candidate that an agent received in an offer or answer fromdetermine itspeer. In-Use Candidate: A candidate is in-use when it appears in the m/c- linesuitability for usage for receipt ofan active media stream. Candidate Pair: A pairing containing a local candidate and a remote candidate. Check:media. Component: Acandidate pair where the local candidatecomponent is a single transport addressfrom which an agent can send a STUN connectivity check. Check List: An ordered set of STUN checksthatan agentis used togenerate towardssupport apeer. Periodic Check:media stream. For media streams based on RTP, there are two components per media stream - one for RTP, and one for RTCP. Host Candidate: Aconnectivity check generatedcandidate obtained byan agent as a consequence of a timer that fires periodically, instructing itbinding tosendacheck. Triggered Check: A connectivity check generatedspecific port from an interface on the host. This includes both physical interfaces and logical ones, such asa consequence ofones obtained through Virtual Private Networks (VPNs) and Realm Specific IP (RSIP) [17] (which lives at thereceipt ofoperating system level). Server Reflexive Candidate: A candidate obtained by sending aconnectivity checkSTUN request fromthe peer. Valid List: An ordered set ofa host candidatepairs that have been validated byto asuccessfulSTUNtransaction. 4. Sendingserver, distinct from theInitial Offer In order to sendpeer, whose address is configured or learned by theinitial offer inclient prior to an offer/answerexchange, an agent must gather candidates, priorize them, choose ones for inclusion in the m/c-line, and then formulate and send the SDP. Each of these steps is described in the subsections below. 4.1. Gathering Candidates An agent gathers candidates when it believes that communications is imminent. An offerer can do this based onexchange. Peer Reflexive Candidate: A candidate obtained by sending auser interface cue, or based on an explicitSTUN request from a host candidate toinitiatethe STUN server running on asession. Everypeer's candidate. Relayed Candidate: A candidateisobtained by sending atransport address. It also hasSTUN Allocate request from atype andhost candidate to abase. Three types are definedSTUN server. The relayed candidate is resident on the STUN server, andgathered by this specification - host candidates,the STUN serverreflexive candidates, and relayed candidates.relays packets back towards the agent. Translation: Thebasetranslation of a relayed candidate is thecandidatetransport address thatan agent must send fromthe relay will forward a packet to, whenusing that candidate. The first stepone isto gather host candidates. Host candidates are obtained by binding to ports (typically ephemeral) on an interface (physical or virtual, including VPN interfaces) on the host. The process for gathering host candidates depends onreceived at thetransport protocol. Procedures are specified here for UDP.relayed candidate. Foreach UDP media streamrelayed candidates learned through theagent wishes to use,STUN Allocate request, theagent SHOULD obtain a candidate for each componenttranslation of themedia stream on each interface thatrelayed candidate is thehost has. It obtains eachserver reflexive candidate returned bybinding to a UDP port onthespecific interface. A hostAllocate response. Base: The base of a server reflexive candidate(and indeed every candidate)isalways associated with a specific component forthe host candidate from which it was derived. A host candidate is also said to have acandidate. Each component has an ID assignedbase, equal toit, called the component ID. For RTP-based media streams,that candidate itself. Similarly, theRTP itself has a component IDbase of1, and RTCPacomponent ID of 2. If an agentrelayed candidate isusing RTCP it MUST obtain athat candidatefor it. Ifitself. Foundation: Each candidate has a foundation, which is anagentidentifier that isusing both RTP and RTCP, it would end up with 2*K hostdistinct for two candidatesif an agent has K interfaces. The basethat have different types, different interface IP addresses foreach host candidate is set to the candidate itself. Once the agent has obtained host candidates, it obtains server reflexivetheir base, andrelayed candidates. The processdifferent IP addresses forgathering server reflexive and relayedtheir STUN servers. Two candidatesdepends onhave thetransport protocol. Proceduressame foundation when they arespecified hereof the same type, their bases have the same IP address, and, forUDP. Agents which serve end users directly, such softphones, hardphones, terminal adapters and so on, SHOULD obtain relayed candidates and MUST obtainserver reflexivecandidates. The requirement to obtainor relayedcandidates is at SHOULD strength to allow for provider variation. Ifcandidates, they come from the same STUN server. Foundations arenot used, it is RECOMMENDED that it be implemented and just disabled through configuration,used to correlate candidates, so thatit can re-enabled through configuration if conditions change in the future. Agents which represent network servers underwhen one candidate is found to be valid, candidates sharing thecontrol of a service provider, suchsame foundation can be tested next, asgatewaysthey are likely tothe telephone network, media servers, or conferencing serversalso be valid. Local Candidate: A candidate thatare targeted at deployment only in networks with public IP addresses MAY skip obtaining server reflexivean agent has obtained andrelayed candidates. Theincluded in an offer or answer it sent. Remote Candidate: A candidate that an agentnext pairs each hostreceived in an offer or answer from its peer. In-Use Candidate: A candidatewith the STUN server with which itisconfigured or has discovered by some means. This specification only considers usagein-use when it appears in the m/c- line of an active media stream. Candidate Pair: A pairing containing asingle STUN server. Every Ta seconds, the agent chooses another such pair (the order is inconsequential),local candidate andsendsaSTUN request to the server from that hostremote candidate.IfCheck: A candidate pair where theagentlocal candidate isusing both relayed and server reflexive candidates, this request MUST beaSTUN Allocate requesttransport address fromthe relay usage [12]. If thewhich an agentis using only server reflexive candidates, the request MUST becan send a STUNBinding request using the binding discovery usage [11]. The value of Ta SHOULD be configurable, and SHOULD have a defaultconnectivity check. Check List: An ordered set of50ms. NoteSTUN checks thatthis pacing applies onlyan agent is tostarting STUN transactions with source and destination transport addresses (i.e., the host candidate and STUN server respectively) for which a STUN transaction has not previously been sent. Consequently, retransmissions ofgenerate towards aSTUN request are governed entirelypeer. Periodic Check: A connectivity check generated bythe retransmission rules defined in [11]. Similarly, retriesan agent as a consequence of arequest due to recoverable errors (such as an authentication challenge) happen immediately and are not paced bytimerTa. Because of this pacing,that fires periodically, instructing itwill take a certain amount of timetoobtain allsend a check. Triggered Check: A connectivity check generated as a consequence of theserver reflexive and relayed candidates. Implementations should be awarereceipt ofthe time required to do this, and if the application requiresatime budget, limitconnectivity check from theamount of candidates which are gathered.peer. Valid List: AnAllocate Response will provide the client with a server reflexiveordered set of candidate(obtained from the mapped address) andpairs for arelayed candidate in the RELAY-ADDRESS attribute. A Binding Response will provide the client withmedia stream that have been validated by aonly server reflexive candidate (also obtained from the mapped address).successful STUN transaction. Controlling Agent: Thebase of the server reflexive candidate is the host candidate fromSTUN agent which is responsible for selecting theAllocate or Binding request was sent. The basefinal choice ofa relayed candidate is that candidate itself. A server reflexivecandidateobtained frompairs and signaling them through STUN and anAllocate response isupdated offer, if needed. Passive Agent: The STUN agent which waits for thecalledcontrolling agent to select the"translation"final choice ofthe relayedcandidateobtained from the same response.pairs. 4. Choosing a Mode The first step in ICE processing is selection of a mode. An ICE agentwill need to remember the translation forcan operate in either full mode or passive-only mode. An agent MUST NOT act in passive-only mode unless therelayed candidate, sincefollowing are all true: 1. The device definitively knows that itis placed into the SDP. Ifhas arelayed candidate is identicalpublic IP address. Usage of tests and heuristics like those defined in RFC 3489 [13] are not sufficient toa host candidate (which can happenmake this determination. Rather, knowledge comes from explicit configuration due to known location inrare cases),therelayednetwork. Typically, this limits passive-only mode to devices like PSTN gateways, conferencing servers, voicemail servers and so on. 2. The device will only provide one candidateMUST be discarded. Proper operationfor each component ofICE depends oneachbase being unique. Next, redundant candidates are eliminated. A candidatemedia stream, matching the values in the m/c-line for each media stream. Full mode isredundant if its transport address equals another candidate,meant for general purpose endpoints, such as softphones, hard-phones, andits base equals the base of thatothercandidate. Notedevices thattwo candidates can have the same transport address yet have different bases, and these wouldmay or may not beconsidered redundant. Finally, each candidate is assigned a foundation. The foundation is an identifier, scoped within a session. Two candidates MUST have the same foundation ID when they are ofplaced in networks with public addresses. 5. Sending thesame type (host, relayed, server reflexive, peer reflexive or relayed), their bases haveInitial Offer In order to send thesame IP address (the ports can be different), and, for reflexive and relayedinitial offer in an offer/answer exchange, an agent must gather candidates, priorize them, choose ones for inclusion in theSTUN servers used to obtain them have the same IP address. Similarly, two candidates MUST have different foundations if their types are different, their bases have different IP addresses, orm/c-line, and then formulate and send theSTUN servers used to obtain them have different IP addresses. 4.2. Prioritizing Candidates The prioritization process resultsSDP. Each of these steps is described in theassignment of a priority to each candidate.subsections below. 5.1. Gathering Candidates An agentdoesgathers candidates when it believes that communications is imminent. An offerer can do thisby determiningbased on apreference for each type ofuser interface cue, or based on an explicit request to initiate a session. Every candidate(server reflexive, peer reflexive, relayed and host), and, when the agentismultihomed, choosingapreference for its interfaces. These two preferences are then combined to compute the priority fortransport address. It also has acandidate. That priority MUST be computed using the following formula: priority = (2^24)*(type preference) + (2^8)*(local preference) + (2^0)*(256 - component ID) Thetypepreference MUST be an integer from 0 to 126 inclusive,andrepresents the preference for the type of the candidate (where thea base. Three types arelocal,defined and gathered by this specification - host candidates, serverreflexive, peerreflexive candidates, andrelayed). A 126 is the highest preference, andrelayed candidates. The base of a0candidate is thelowest. Setting the value to a 0 meanscandidate thatcandidates of this type will only be used as a last resort.an agent must send from when using that candidate. Thetype preference MUST be identical for allfirst step is to gather host candidates. Host candidatesofare obtained by binding to ports (typically ephemeral) on an interface (physical or virtual, including VPN interfaces) on thesame type and MUST be different for candidates of different types.host. Thetype preferenceprocess forpeer reflexive candidates MUST be higher than that of server reflexive candidates. Note thatgathering host candidatesgathered baseddepends on theprocedures of Section 4.1 will never be peer reflexive candidates; candidates of these typetransport protocol. Procedures arelearned from the STUN connectivity checks performed by ICE. The component ID is the component IDspecified here for UDP. For each UDP media stream thecandidate, and MUST be between 1 and 256 inclusive. The local preference MUST be an integer from 0agent wishes to65535 inclusive. It representsuse, the agent SHOULD obtain apreferencecandidate for each component of theparticularmedia stream on each interfacefrom whichthat the host has. It obtains each candidatewas obtained, in cases where an agent is multihomed. 65535 represents the highest preference, andby binding to azero,UDP port on thelowest. When therespecific interface. A host candidate (and indeed every candidate) isonly a single interface, this value SHOULD be set to 65535. Generally speaking, if there are multiple candidates foralways associated with aparticularspecific component fora particular media streamwhichhaveit is a candidate. Each component has an ID assigned to it, called thesame type,component ID. For RTP-based media streams, thelocal preference MUST be unique for each one. In this specification, this only happens for multi-homed hosts. These rules guarantee that there isRTP itself has aunique priority for each candidate. This priority will be used by ICE to determine the ordercomponent ID ofthe connectivity checks1, andthe relative preference for candidates. Consequently, what follows are some guidelines for selection of these values. One criteria for selectionRTCP a component ID ofthe type and local preference values2. If an agent isthe use ofusing RTCP it MUST obtain a candidate for it. If anintermediary. That is,agent is using both RTP and RTCP, it would end up with 2*K host candidates ifmediaan agent has K interfaces. The base for each host candidate issentset tothat candidate, willthemedia first transit an intermediatecandidate itself. Agents implementing passive-only mode MUST NOT gather serverbefore being received. Relayedreflexive or relayed candidates. Agents implementing full mode SHOULD obtain relayed candidatesare clearly one type ofand MUST obtain server reflexive candidates. The requirement to obtain relayed candidatesthat involve an intermediary. Anotheris at SHOULD strength to allow for provider variation. If they arehost candidates obtained from a VPN interface. When medianot used, it istransitedRECOMMENDED that it be implemented and just disabled throughan intermediary,configuration, so that it canincreasere-enabled through configuration if conditions change in thelatency between transmission and reception. It can increasefuture. The full-mode agent next pairs each host candidate with thepacket losses, becauseSTUN server with which it is configured or has discovered by some means. This specification only considers usage of a single STUN server. Every Ta seconds, theadditional router hops that may be taken. It may increase the cost of providing service, since media will be routed infull-mode agent chooses another such pair (the order is inconsequential), andright back out of an intermediary run bysends a STUN request to theprovider.server from that host candidate. Ifthese concerns are important,thetype preference forfull-mode agent is using both relayedcandidates can be set lower than the type preference for reflexiveandhost candidates. Indeed, it is RECOMMENDED that in this case, host candidates have a type preference of 126,server reflexivecandidates havecandidates, this request MUST be atype preference of 100, peerSTUN Allocate request from the relay usage [12]. If the full-mode agent is using only server reflexivehavecandidates, the request MUST be atype prefenceSTUN Binding request using the binding discovery usage [11]. The value of110,Ta SHOULD be configurable, andrelayed candidatesSHOULD have atype preferencedefault ofzero. Furthermore, if an agent is multi-homed20ms. Note that this pacing applies only to starting STUN transactions with source andhas multiple interfaces,destination transport addresses (i.e., thelocal preference forhostcandidates from a VPN interface SHOULD havecandidate and STUN server respectively) for which aprioritySTUN transaction has not previously been sent. Consequently, retransmissions of0. Another criteria for selectiona STUN request are governed entirely by the retransmission rules defined in [11]. Similarly, retries ofpreferences is IP address family. ICE works with both IPv4 and IPv6. It therefore providesatransition mechanism that allows dual-stack hosts to prefer connectivity over IPv6, but to fall backrequest due toIPv4 in case the v6 networks are disconnected (due, for example, to a failure in a 6to4 relay) [22]. It can also help with hosts that have both a native IPv6 addressrecoverable errors (such as an authentication challenge) happen immediately anda 6to4 address. In such a case, lower local preferences could be assigned to the v6 interface, followed by the 6to4 interfaces, followedare not paced bythe v4 interfaces. This allowstimer Ta. Because of this pacing, it will take asitecertain amount of time to obtain all of the server reflexive andbegin using native v6 addresses immediately, yet still fallbackrelayed candidates. Implementations should be aware of the time required to6to4 addresses when communicating with agents in other sites thatdonot yet have native v6 connectivity. Another criteria for selecting preferences is security. Ifthis, and if the application requires auser istime budget, limit the amount of candidates which are gathered. An Allocate Response will provide the client with atelecommuter, and therefore connected to their corporate networkserver reflexive candidate (obtained from the mapped address) and alocal home network, they may prefer their voice traffic to be routed over the VPNrelayed candidate inorder to keep it on the corporate network when communicating withintheenterprise, but useRELAY-ADDRESS attribute. A Binding Response will provide thelocal network when communicatingclient withusers outsidea only server reflexive candidate (also obtained from the mapped address). The base of theenterprise. In suchserver reflexive candidate is the host candidate from which the Allocate or Binding request was sent. The base of acase, a VPN interface would have a higher local preference than any other interfaces. Another criteria for selecting preferences is topological awareness. Thisrelayed candidate ismost useful for candidatesthatmake use of relays. In those cases, ifcandidate itself. A server reflexive candidate obtained from anagent has preconfigured or dynamically discovered knowledge ofAllocate response is thetopological proximitycalled the "translation" of therelays to itself, it can use that to assign higher local preferences to candidatesrelayed candidate obtained fromcloser relays. 4.3. Choosing In-Use Candidates A candidate is saidthe same response. The agent will need tobe "in-use" if it appears inremember them/c-line of an offer or answer. When communicating with an ICE peer, being in- use implies that, should these candidates be selected bytranslation for theICE algorithm, bidirectional media can flow andrelayed candidate, since it is placed into thecandidates can be used.SDP. If a relayed candidate isselected by ICE but is not in-use, only unidirectional media can flow and only foridentical to abrief time; thehost candidatemust be made in-use through an updated offer/answer exchange. When communicating with a peer that is not ICE-aware, the in-use candidates will be used exclusively for the exchange of media, as defined(which can happen innormal offer/answer procedures. An agentrare cases), the relayed candidate MUSTchoose a set of candidates, one for each componentbe discarded. Proper operation of ICE depends on eachactive media stream, to be in-use.base being unique. Next, a full-mode agent eliminates redundant candidates. Amedia streamcandidate isactiveredundant ifit does not contain the a=inactive SDP attribute. It is RECOMMENDED that in-use candidates be chosen based onits transport address equals another candidate, and its base equals thelikelihoodbase ofthose candidates to work with the peerthatis being contacted. Unfortunately, it is difficult to ascertain which candidatesother candidate. Note thatmight be. As an example, considertwo candidates can have the same transport address yet have different bases, and these would not be considered redundant. Finally, all agents assign each candidate auser withinfoundation. The foundation is anenterprise. To reach non-ICE capable agentsidentifier, scoped withinthe enterprise, hosta session. Two candidates MUST haveto be used, sincetheenterprise policies may prevent communication between elements using a relay on the public network. However,same foundation ID whencommunicating to peers outsidethey are of theenterprise,same type (host, relayed, server reflexive, peer reflexive or relayed), their bases have the same IP address (the ports can be different), and, for reflexive and relayedcandidates from a publically accessiblecandidates, the STUNserverservers used to obtain them have the same IP address. Similarly, two candidates MUST have different foundations if their types areneeded. Indeed,different, their bases have different IP addresses, or thedifficultySTUN servers used to obtain them have different IP addresses. 5.2. Prioritizing Candidates The prioritization process results inpicking just one transport address that will work is the whole problem that motivatedthedevelopmentassignment of a priority to each candidate. An agent does thisspecification inby determining a preference for each type of candidate (server reflexive, peer reflexive, relayed and host), and, when thefirst place. As such, itagent isRECOMMENDED that relayed candidates be selectedmultihomed, choosing a preference for its interfaces. These two preferences are then combined tobe in-use. Furthermore, ICE is only truly effective when it is supported on both sides ofcompute thesession. It is therefore most prudent to deploy it to close-knit communities aspriority for awhole, rather than piecemeal. In the example above, this would mean that ICE would ideallycandidate. That priority MUST bedeployed completely within the enterprise, rather than just to parts of it. 4.4. Encodingcomputed using theSDPfollowing formula: priority = (2^24)*(type preference) + (2^8)*(local preference) + (2^0)*(256 - component ID) Theagent includes a single a=candidate media level attribute intype preference MUST be an integer from 0 to 126 inclusive, and represents theSDPpreference foreachthe type of the candidatefor that media stream. The a=candidate attribute contains(where theIP address, porttypes are local, server reflexive, peer reflexive andtransport protocol for that candidate.relayed). AFully Qualified Domain Name (FQDN) for a host MAY be used in place of a unicast address. In that case, when receiving an offer or answer containing an FQDN in an a=candidate attribute, the FQDN126 islooked up intheDNS using an A or AAAA record,highest preference, andthe resulting IP addressa 0 isused fortheremainder of ICE processing. The candidate attribute also includeslowest. Setting thecomponent ID forvalue to a 0 means thatcandidate. For media streams based on RTP,candidatesfor the actual RTP media MUST haveof this type will only be used as acomponent IDlast resort. The type preference MUST be identical for all candidates of1,the same type and MUST be different for candidates of different types. The type preference forRTCPpeer reflexive candidates MUSThave a component ID of 2. Other typesbe higher than that ofmedia streams which require multiple components MUST develop specifications which defineserver reflexive candidates. Note that candidates gathered based on themappingprocedures of Section 5.1 will never be peer reflexive candidates; candidates ofcomponents to component IDs, andthese type are learned from the STUN connectivity checks performed by ICE. The componentIDsID is the component ID for the candidate, and MUST be between 1 and256.256 inclusive. Thecandidate attribute also includeslocal preference MUST be an integer from 0 to 65535 inclusive. It represents a preference for thepriority,particular interface from whichis the value determined forthe candidateas describedwas obtained, inSection 4.2,cases where an agent is multihomed. 65535 represents the highest preference, and a zero, thefoundation, whichlowest. When there istheonly a single interface, this valuedetermined for the candidate as described in Section 4.1. The agentSHOULDincludebe set to 65535. Generally speaking, if there are multiple candidates for atypeparticular component foreach candidate by populatinga particular media stream which have thecandidate-types production withsame type, theappropriate value - "host"local preference MUST be unique forhost candidates, "srflx"each one. In this specification, this only happens forserver reflexive candidates, "prflx"multi-homed hosts. These rules guarantee that there is a unique priority forpeer reflexive candidates (though these never appear in an initial offer/answer exchange),each candidate. This priority will be used by ICE to determine the order of the connectivity checks and"relay"the relative preference forrelayedcandidates.The related address MUST NOT be included if a type was not included. If a type was included, the related address SHOULD be presentConsequently, what follows are some guidelines forserver reflexive, peer reflexiveselection of these values. One criteria for selection of the type andrelayed candidates. If a candidatelocal preference values isserver or peer reflexive,therelated addressuse of an intermediary. That is, if media isequalsent tothe base forthatserver or peer reflexive candidate. Ifcandidate, will thecandidatemedia first transit an intermediate server before being received. Relayed candidates are clearly one type of candidates that involve an intermediary. Another are host candidates obtained from a VPN interface. When media isrelayed,transited through an intermediary, it can increase therelated address is equal tolatency between transmission and reception. It can increase thetranslationpacket losses, because of therelayed address. Ifadditional router hops that may be taken. It may increase thecandidiate is a host candidate, there is no related addresscost of providing service, since media will be routed in and right back out of an intermediary run by therel-addr production MUSTprovider. If these concerns are important, the type preference for relayed candidates can beomitted. STUN connectivity checks between agents make use of a short term credential thatset lower than the type preference for reflexive and host candidates. Indeed, it isexchangedRECOMMENDED that inthe offer/answer process. The username part ofthiscredential is formed by concatenatingcase, host candidates have ausername fragment from each agent, separated bytype preference of 126, server reflexive candidates have acolon. Each agent also providestype preference of 100, peer reflexive have apassword, used to compute the message integrity for requests it receives. As such,type prefence of 110, and relayed candidates have a type preference of zero. Furthermore, if anSDP MUST contain the ice-ufragagent is multi-homed andice-pwd attributes, containinghas multiple interfaces, theusername fragment and password respectively. These can be either session or media level attributes, and thus common across all candidateslocal preference forall media streams, or allhost candidatesforfrom aparticular media stream, respectively. However, if two media streams have identical ice-ufrag's, they MUSTVPN interface SHOULD haveidentical ice-pwd's. The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the beginning ofasession. The ice-ufrag attribute MUST contain at least 24 bitspriority ofrandomness, and the ice- pwd attribute MUST contain at least 128 bits0. Another criteria for selection ofrandomness. This meanspreferences is IP address family. ICE works with both IPv4 and IPv6. It therefore provides a transition mechanism that allows dual-stack hosts to prefer connectivity over IPv6, but to fall back to IPv4 in case theice-ufrag attribute will be at least 4 characters long,v6 networks are disconnected (due, for example, to a failure in a 6to4 relay) [22]. It can also help with hosts that have both a native IPv6 address and a 6to4 address. In such a case, lower local preferences could be assigned to theice-pwd at least 22 characters long, sincev6 interface, followed by thegrammar for these attributes6to4 interfaces, followed by the v4 interfaces. This allowsfor 6 bits of randomness per character. The attributes MAY be longer than 4a site to obtain and21 characters respectively, of course. The m/c-line is populatedbegin using native v6 addresses immediately, yet still fallback to 6to4 addresses when communicating withthe candidatesagents in other sites thatare in-use. For streams based on RTP, thisdo not yet have native v6 connectivity. Another criteria for selecting preferences isdone by placing the RTP candidate into the m and c lines respectively.security. Ifthe agenta user isutilizing RTCP,a telecommuter, and therefore connected to their corporate network and a local home network, they may prefer their voice traffic to be routed over the VPN in order to keep itMUST encodeon theRTCP candidate intocorporate network when communicating within them/c-line usingenterprise, but use thea=rtcp attribute as defined in RFC 3605 [2]. If RTCP is not in use,local network when communicating with users outside of theagent MUST signal that using b=RS:0 and b=RR:0 as defined in RFC 3556 [5]. There MUST beenterprise. In such acandidate attributecase, a VPN interface would have a higher local preference than any other interfaces. Another criteria foreach componentselecting preferences is topological awareness. This is most useful for candidates that make use ofthe media stream in the m/c-line. Once an offer or answer are sent,relays. In those cases, if an agentMUST be preparedhas preconfigured or dynamically discovered knowledge of the topological proximity of the relays toreceive both STUN and media packets on each candidate. As discussed in Section 11.1, media packetsitself, it canbe sentuse that toaassign higher local preferences to candidates obtained from closer relays. 5.3. Choosing In-Use Candidates A candidateprioris said toits appearencebe "in-use" if it appears in them/c-line. 5. Receiving the Initial Offer Whenm/c-line of anagent receivesoffer or answer. When communicating with aninitial offer, it will check if the offeror supports ICE, gather candidates, prioritize them, choose one forICE peer, being in-use, encode and send an answer, and then formuse implies that, should these candidates be selected by thecheck listsICE algorithm, bidirectional media can flow andbegin connectivity checks. 5.1. Verifyingthe candidates can be used. If a candidate is selected by ICESupport The agent will proceedbut is not in-use, only unidirectional media can flow and only for a brief time; the candidate must be made in-use through an updated offer/answer exchange. When communicating with a peer that is not ICE-aware, theICE proceduresin-use candidates will be used exclusively for the exchange of media, as defined inthis specification if the following are both true: o There is at leastnormal offer/answer procedures. An agent MUST choose a set of candidates, onea=candidate attributefor eachmedia stream in the SDP it just received. o Forcomponent of each active media stream,at least one of the candidatesto be in-use. A media stream isa match for its respective in-use component in the m/c-line. If both of these conditions areactive if it does notmet, the agent MUST processcontain the a=inactive SDP attribute. It is RECOMMENDED that in-use candidates be chosen based onnormal RFC 3264 procedures, without using any of the ICE mechanisms described intheremainderlikelihood ofthis specification,those candidates to work with theexception of Section 10,peer that is being contacted. Unfortunately, it is difficult to ascertain whichdescribes keepalive procedures. 5.2. Gathering Candidates The process for gatheringcandidatesatthat might be. As an example, consider a user within an enterprise. To reach non-ICE capable agents within theanswerer is identicalenterprise, host candidates have to be used, since theprocess for the offerer as described in Section 4.1. It is RECOMMENDED that this process begin immediatelyenterprise policies may prevent communication between elements using a relay onreceipt oftheoffer, priorpublic network. However, when communicating touser acceptancepeers outside ofa session. Such gathering MAY even be done pre-emptively when an agent starts. 5.3. Prioritizing Candidates The process for prioritizingthe enterprise, relayed candidatesatfrom a publically accessible STUN server are needed. Indeed, theanswererdifficulty in picking just one transport address that will work isidentical totheprocess followed bywhole problem that motivated theofferer, as describeddevelopment of this specification inSection 4.2. 5.4. Choosing In Use Candidates The process for selecting in-use candidates attheanswererfirst place. As such, it isidenticalRECOMMENDED that full mode agents select relayed candidates to be in-use. Passive- only agents will, naturally, select their only candidates - theprocess followed by the offerer, as describedhost candidates - to be inSection 4.3. 5.5.use. 5.4. Encoding the SDP Theprocess for encodingagent includes a single a=candidate media level attribute in the SDPat the answerer is identical to the process followed byfor each candidate for that media stream. The a=candidate attribute contains theofferer, as described in Section 4.4. 5.6. Forming the Check Lists Next, the agent forms the check lists. There is one check list per in-use media stream resulting from the offer/answer exchange. A media stream is in-use as long as itsIP address, portis non-zero (which isand transport protocol for that candidate. A Fully Qualified Domain Name (FQDN) for a host MAY be used inRFC 3264 to reject a media stream). Each check list is a sequenceplace ofSTUN connectivity checksa unicast address. In thatare performed bycase, when receiving an offer or answer containing an FQDN in an a=candidate attribute, theagent. To formFQDN is looked up in thecheck listDNS using an A or AAAA record, and the resulting IP address is used fora media stream,theagent forms candidate pairs, computes aremainder of ICE processing. The candidatepair priority, orders the pairs by priority, prunes them, and sets their states. These steps are described in this section. First,attribute also includes theagent takes each of its candidatescomponent ID forathat candidate. For mediastream (called local candidates) and pairs them with thestreams based on RTP, candidatesit received from its peer (called remote candidates)forthatthe actual RTP mediastream. A local candidate is paired withMUST have aremote candidate ifcomponent ID of 1, andonly if the twocandidates for RTCP MUST havethe samea component IDand have the same IP address version. It is possible that someofthe local candidates don't get paired with a remote candidate, and some2. Other types of media streams which require multiple components MUST develop specifications which define theremote candidates don't get paired with local candidates. This can happen if one agent didn't include candidates for the allmapping ofthecomponents to component IDs, and these component IDs MUST be between 1 and 256. The candidate attribute also includes the priority, which is the value determined fora media stream. Inthecase of RTP,candidate as described in Section 5.2, and the foundation, which is the value determined forexample, this would happen when onethe candidate as described in Section 5.1. The agentprovided candidatesSHOULD include a type forRTCP, andeach candidate by populating theother did not. If this happens,candidate-types production with thenumber of componentsappropriate value - "host" forthat media stream is effectively reduced,host candidates, "srflx" for server reflexive candidates, "prflx" for peer reflexive candidates (though these never appear in an initial offer/answer exchange), andconsidered to"relay" for relayed candidates. The related address MUST NOT beequal to the minimum across both agents ofincluded if a type was not included. If a type was included, themaximum component ID provided by each agent across all componentsrelated address SHOULD be present forthe media stream. Once the pairs are formed,server reflexive, peer reflexive and relayed candidates. If a candidatepair priorityiscomputed. Let O-P beserver or peer reflexive, thepriorityrelated address is equal to the base for that server or peer reflexive candidate. If the candidateprovided byis relayed, theofferer. Let A-P berelated address is equal to thepriority fortranslation of thecandidate provided byrelayed address. If theanswerer. The priority for a paircandidiate iscomputed as: pair priority = 2^32*MIN(O-P,A-P) + 2*MAX(O-P,A-P) + (O-P>A-P:1?0) Where O-P>A-P:1?0 is an expression whose value is 1 if O-Pa host candidate, there isgreater than A-P,no related address and0 otherwise. This formula ensures a unique priority for each pair in most cases. Onethepriorityrel-addr production MUST be omitted. STUN connectivity checks between agents make use of a short term credential that isassigned, the agent sorts the candidate pairsexchanged indecreasing order of priority. If two pairs have identical priority,theordering amongst them is arbitrary. This sorted listoffer/answer process. The username part ofcandidate pairsthis credential isused to determine a sequence of connectivity checks that will be performed. Each check involves sendingformed by concatenating arequestusername fragment from each agent, separated by alocal candidate to a remote candidate. Since ancolon. Each agentcannot send requests directly fromalso provides areflexive candidate, but only from its base, the agent next goes through the sorted list of candidate pairs. For each pair where the local candidate is server reflexive,password, used to compute theserver reflexive candidatemessage integrity for requests it receives. As such, an SDP MUSTbe replaced by its base. Once this has been done,contain theagent MUST remove redundant pairs. A pair is redundant if its localice-ufrag andremote candidates are identical toice-pwd attributes, containing thelocalusername fragment andremote candidates of a pair higher up on the priority list. The result is called the check list for thatpassword respectively. These can be either session or mediastream,level attributes, andeach candidate pair on it is calledthus common across all candidates for all media streams, or all candidates for acheck. Each check is also said toparticular media stream, respectively. However, if two media streams havea foundation, which is merelyidentical ice-ufrag's, they MUST have identical ice-pwd's. The ice-ufrag and ice-pwd attributes MUST be chosen randomly at thecombinationbeginning of a session. The ice-ufrag attribute MUST contain at least 24 bits of randomness, and thefoundationsice- pwd attribute MUST contain at least 128 bits of randomness. This means that thelocalice-ufrag attribute will be at least 4 characters long, andremote candidates inthecheck. Finally, each checkice-pwd at least 22 characters long, since the grammar for these attributes allows for 6 bits of randomness per character. The attributes MAY be longer than 4 and 21 characters respectively, of course. If an agent is operating in passive-only mode, it MUST include thecheck list"a=ice-passive" session level attribute in its offer. If an agent isassociated with a state. This statein full mode, it MUST NOT include this attribute. The m/c-line isassigned oncepopulated with thecheck list for each media stream has been computed. There are five potential valuescandidates that are in-use. For streams based on RTP, this is done by placing thestate can have: Waiting: This check has not been performed,RTP candidate into the m andcan be performed as soon as itc lines respectively. If the agent is utilizing RTCP, it MUST encode thehighest priority Waiting check onRTCP candidate into thecheck list. In-Progress: A request has been sent for this check, butm/c-line using thetransactiona=rtcp attribute as defined in RFC 3605 [2]. If RTCP is not inprogress. Succeeded: This check was already doneuse, the agent MUST signal that using b=RS:0 andproducedb=RR:0 as defined in RFC 3556 [5]. There MUST be asuccessful result. Failed: This check was already done and failed, either never producing any responsecandidate attribute for each component of the media stream in the m/c-line. Once an offer orproducinganswer are sent, anunrecoverable failure response. Frozen: This check hasn't been performed,agent MUST be prepared to receive both STUN andit can't yetmedia packets on each candidate. As discussed in Section 12.1, media packets can beperformed until some other check succeeds, allowing itsent tomove intoa candidate prior to its appearence in theWaiting state. First,m/c-line. 6. Receiving the Initial Offer When an agentsets all of the checks in eachreceives an initial offer, it will checklist toif theFrozen state. Then, it takesofferor supports ICE, determine its role, gather candidates, prioritize them, choose one for in-use, encode and send an answer, and then form thefirstcheckinlists and begin connectivity checks. 6.1. Verifying ICE Support The answerer will proceed with thecheck list forICE procedures defined in this specification if thefirst media stream (a media streamfollowing are true: o There isthe firstat least one a=candidate attribute for each media streamwhen it is described by the first m-linein theSDPofferand answer), and sets its state to Waiting. It then finds allit just received. o For each media stream, at least one of theother checks in that check list with the same component ID, but different foundations, and sets all of their states to Waiting as well. Once thiscandidates isdone, one ofa match for its respective in-use component in thecheck lists will have some numberm/c-line. If both ofchecks inthese conditions are not met, theWaiting state, andagent MUST process theother check lists will have allSDP based on normal RFC 3264 procedures, without using any oftheir checksthe ICE mechanisms described in theFrozen state. A check listremainder of this specification, withat least one check that is not Frozen is called an active check list. 5.7. Performing Periodic Checks An agent performs two typesthe exception ofchecks. The first type are periodic checks. These checks occur periodically for each media stream, and involve choosingSection 11, which describes keepalive procedures. In addition, if thehighest priority check inoffer contains theWaiting state from each check list,"a=ice-passive" attribute, andperforming it. The other type of check is called a triggered check. This is a check thatthe answerer isperformedalso passive-only, the agent MUST process the SDP based onreceipt of a connectivity check fromnormal RFC 3264 procedures, as if it didn't support ICE, with thepeer. This sectionexception of Section 11, which describeshow periodic checks are performed. Oncekeepalive procedures. 6.2. Determining Role If the agenthas computed the check lists as describedis inSection 5.6,passive-only mode, itsets a timerassumes the passive role foreach active check list. The timer fires every Ta/N seconds, where N isthis session. If thenumber of active check lists (initially, thereagent isonly one active check list). Implementations MAY set the timer to fire less frequently than this. Tain full-mode, but its peer is in passive-only mode (as indicated by thesame value used to pace the gathering of candidates, as describeda=ice-passive attribute inSection 4.1. The first timerthe SDP), the agent assumes the controlling role foreach active check list fires immediately, so thatthis session. If the agentperforms a connectivity checkand its peer are both in full-mode, themomentagent which generated theoffer/answer exchange has been done, followed byoffer which started thenext periodic check Ta seconds later. WhenICE processing takes on thetimer fires,controlling role, and theagent MUST findother takes thehighest priority check in that check list thatpassive role. Based on this definition, once roles are determined for a session, they persist unless ICE isin the Waiting state. The agent then sendsrestarted, as discussed below. A restart causes aSTUN check from the local candidate of that check to the remote candidatenew selection ofthat check.roles. 6.3. Gathering Candidates Theproceduresprocess forforminggathering candidates at theSTUN requestanswerer is identical to the process forthis purpose arethe offerer as described in Section7.7.1. If none5.1. It is RECOMMENDED that this process begin immediately on receipt of thechecks in that check list are inoffer, prior to user acceptance of a session. Such gathering MAY even be done pre-emptively when an agent starts. 6.4. Prioritizing Candidates The process for prioritizing candidates at theWaiting state, but there are checks inanswerer is identical to theFrozen state,process followed by thehighest priority checkofferer, as described in Section 5.2. 6.5. Choosing In Use Candidates The process for selecting in-use candidates at theFrozen stateanswerer ismoved intoidentical to the process followed by the offerer, as described in Section 5.3. 6.6. Encoding the SDP The process for encoding the SDP at the answerer is identical to the process followed by the offerer, as described in Section 5.4. 6.7. Forming the Check Lists A full-mode agent MUST form theWaiting state, and thatcheck lists as described in this section. A passive-only agent MAY do so, but there isperformed. When ano need. There is one check list per in-use media stream resulting from the offer/answer exchange. A media stream isperformed,in-use as long as itsstateport isset to In-Progress. If there are no checksnon-zero (which is used ineither the WaitingRFC 3264 to reject a media stream). Consequently, a media stream is in-use even if it is marked as a=inactive orFrozen state, then the timer for thathas a bandwidth value of zero. Each check list isstopped. Performing thea sequence of STUN connectivitycheck requireschecks that are performed by theagent to knowagent. To form theusername fragmentcheck list for a media stream, thelocal and remote candidates,agent forms candidate pairs, computes a candidate pair priority, orders the pairs by priority, prunes them, and sets their states. These steps are described in this section. First, thepasswordagent takes each of its candidates forthe remote candidate. For periodic checks, the remote username fragmenta media stream (called local candidates) andpassword are learned directly frompairs them with theSDPcandidates it received fromthe peer, and theits peer (called remote candidates) for that media stream. A localusername fragmentcandidate isknown by the agent. 6. Receipt of the Initial Answer This section describespaired with a remote candidate if and only if theprocedures that an agent follows when it receivestwo candidates have theanswer fromsame component ID and have thepeer.same IP address version. Itverifiesis possible thatits peer supports ICE, formssome of thecheck listlocal candidates don't get paired with a remote candidate, andbegins performing periodic checks. 6.1. Verifying ICE Support The offerer followssome of thesame procedures describedremote candidates don't get paired with local candidates. This can happen if one agent didn't include candidates for theanswerer in Section 5.1. 6.2. Forming the Check List The offerer followsall of thesame procedures describedcomponents for a media stream. In theanswerer in Section 5.6. 6.3. Performing Periodic Checks The offerer follows the same procedures describedcase of RTP, forthe answerer in Section 5.7. 7. Connectivity Checks This section describes how connectivity checks are performed. Connectivity checks are a STUN usage,example, this would happen when one agent provided candidates for RTCP, and thebehaviors described here meetother did not. If this happens, theguidelines for definitionsnumber ofnew usages as outlined in [11] Notecomponents for thatall ICE implementations are requiredmedia stream is effectively reduced, and considered to becompliant to [11], as opposedequal to theolder [13]. 7.1. Applicability This STUN usage provides a connectivity check between two peers participating in an offer/answer exchange. This check serves to validate a pairminimum across both agents ofcandidatesthe maximum component ID provided by each agent across all components forusage of exchange of media. Connectivity checks also allow agents to discover reflexive candidates towards their peers, called peer reflexive candidates. Finally, connectivity checks serve to keep NAT bindings alive. It is fundamental to this STUN usage thattheaddresses and ports used formedia stream. Once the pairs are formed, a candidate pair priority is computed. Let O-P be thesame ones usedpriority for theBinding Requests and responses. Consequently, it willcandidate provided by the offerer. Let A-P benecessary to demultiplex STUN traffic from whateverthemedia traffic is. This demultiplexing is done usingpriority for thetechniques described in [11]. 7.2. Client Discovery of Server The client does not followcandidate provided by theDNS-based procedures definedanswerer. The priority for a pair is computed as: pair priority = 2^32*MIN(O-P,A-P) + 2*MAX(O-P,A-P) + (O-P>A-P:1?0) Where O-P>A-P:1?0 is an expression whose value is 1 if O-P is greater than A-P, and 0 otherwise. This formula ensures a unique priority for each pair in[11]. Rather, the remote candidate ofmost cases. One thecheck to be performedpriority isused asassigned, thetransport address ofagent sorts theSTUN server. Note thatcandidate pairs in decreasing order of priority. If two pairs have identical priority, theSTUN server is a logical entity, andordering amongst them isnot a physically distinct server in this usage. 7.3. Server Determinationarbitrary. This sorted list ofUsage The servercandidate pairs isawareused to determine a sequence ofthis usage because it signaled this port through the offer/answer exchange. Any STUN packets received on this portconnectivity checks that will befor the connectivityperformed. Each checkusage. 7.4. New Requests or Indications This usage does not define any new message types. 7.5. New Attributes This usage definesinvolves sending anew attribute, PRIORITY. This attribute indicates the priority that isrequest from a local candidate tobe associated withapeerremote candidate. Since an agent cannot send requests directly from a reflexive candidate,should onebut only from its base, the agent next goes through the sorted list of candidate pairs. For each pair where the local candidate is server reflexive, the server reflexive candidate MUST bediscoveredreplaced by its base. Once thischeck. It is a 32 bit unsigned integer, andhasan attribute type of 0x0024. 7.6. New Error Response Codes This usage does not define any new error response codes. 7.7. Client Procedures This section defines additional procedures for the Binding Request transaction, beyond those described in [11]. 7.7.1. Sendingbeen done, theRequest Theagentacting asMUST remove redundant pairs. A pair is redundant if its local and remote candidates are identical to theclient generateslocal and remote candidates of aconnectivity check either periodically, or triggered. In either case,pair higher up on the priority list. The result is called the check list for that media stream, and each candidate pair on it isgenerated by sending a Binding Request fromcalled alocal candidate,check. Each check is also said to have aremote candidate. The agent must knowfoundation, which is merely theusername fragment for both candidates andcombination of thepassword forfoundations of the local and remotecandidate. A Binding Request serving as a connectivity check MUST utilize a STUN short term credential. Rather than being learned from a Shared Secret request,candidates in theshort term credential is exchangedcheck. Each check in theoffer/ answer procedures. In particular, the usernamecheck list isformed by concatenating the username fragment provided by the peerassociated withthe username fragment of the agent sending the request, separated byacolon (":"). The passwordstate. This state isequal to the password provided by the peer. For example, considerassigned once thecase where agent A ischeck list for each media stream has been computed. There are five potential values that theofferer,state can have: Waiting: This check has not been performed, andagent Bcan be performed as soon as it is theanswerer. Agenthighest priority Waiting check on the check list. In-Progress: Aincluded a username fragment of AFRAGrequest has been sent forits candidates, and a password of APASS. Agent B provided a username fragment of BFRAGthis check, but the transaction is in progress. Succeeded: This check was already done and produced apassword of BPASS. A connectivitysuccessful result. Failed: This checkfrom A to B (and itswas already done and failed, either never producing any responseof course) utilize the username BFRAG:AFRAGor producing an unrecoverable failure response. Frozen: This check hasn't been performed, anda password of BPASS. A connectivityit can't yet be performed until some other checkfrom Bsucceeds, allowing it toA (and its response) utilizemove into theusername AFRAG:BFRAG and a passwordWaiting state. First, the agent sets all ofAPASS. All Binding Requests fortheconnectivitychecks in each checkusage MUST contain the PRIORITY attribute. This MUST be set equallist to thepriority that would be assigned, based onFrozen state. Then, it takes thealgorithmfirst check inSection 4.2, to a peer reflexive candidate learned from this check. Such a peer reflexive candidate has a stream ID, component ID and local preference that are equal to the host candidate from whichthe check list for the first media stream (a media stream isbeing sent, but a type preference equal tothevalue associated with peer reflexive candidates. The Binding Requestfirst media stream when it is described byan agent MUST includetheUSERNAME and MESSAGE-INTEGRITY attributes. That is, an agent MUST NOT wait to be challenged for short term credentials. Rather, it MUST provide themfirst m-line in theBinding Request right away. 7.7.2. Processing the Response If the STUN transaction generates an unrecoverable failure response or times out, the agentSDP offer and answer), and setstheits state to Waiting. It then finds all of the other checks in that checkto Failed. The remainderlist with the same component ID, but different foundations, and sets all ofthis section appliestheir states toprocessingWaiting as well. Once this is done, one ofsuccessful responses (any response from 200 to 299). The agent MUST check thatthesource IP address and portcheck lists will have some number of checks in theresponse equals the destination IP address and port that the Binding Request was sent to,Waiting state, andthatthedestination IP address and portother check lists will have all of their checks in theresponse match the source IP address and portFrozen state. A check list with at least one check thatthe Binding Request was sent from. If these dois notmatch, the agent sets the state of theFrozen is called an active checkto Failed.list. Theprocessing described in the remainder of this section MUST NOT be performed. If thechecksucceeds, processing continues and the agent changeslist itself is associated with a state, which captures the statefor this check to Succeeded. Next, the agent sees if the successofthis check can cause otherICE checksto be unfrozen. If the check had a component ID of one, the agent MUST change the statesforall other Frozenthat media stream. There are two states: Running: In this state, ICE checks are still in progress forthe samethis mediastream and same foundation, but different component IDs, to Waiting. Ifstream. Completed: In this state, thecomponent IDcontrolling agent has signaled that a candidate pair has been selected fortheeach component. Consequently, no further ICE checks are performed. When a checkwas equal tolist is first constructed as thenumberconsequence ofcomponents foran offer/answer exchange, it is placed in the Running state. ICE processing across all mediastream, the agent MUST change thestreams also has a stateforassociated with it. This state is equal to Running while checks are in progress. The state is Completed when allother Frozenchecks have been completed, Rules forthe first componenttransitioning between states are described below. 6.8. Performing Periodic Checks An agent performs two types ofdifferentchecks. The first type are periodic checks. These checks occur periodically for each mediastreams (and thus in different check lists) but the same foundation, to Waiting. Next,stream, and involve choosing theagent checkshighest priority check in themapped addressWaiting state fromthe STUN response. If the transport address does not match anyeach check list, and performing it. The other type ofthe local candidates that the agent knows about, the mapped address representescheck is called anew peer reflexive candidate. Its typetriggered check. This isequal to peer reflexive. Its basea check that isset equal to the candidateperformed on receipt of a connectivity check fromwhichtheSTUN check was sent. Its username fragmentpeer. Full mode agents MUST generate periodic checks, andpasswordall agents MUST generate triggered checks. This section describes how periodic checks areidenticalperformed, and thus applies only to full mode agents. Once thecandidate from whichfull-mode agent has computed the checkwas sent. It is assigned the priority value that was placed in the PRIORITY attribute of the request. Its foundation is selectedlists as described in Section4.1.6.7, it sets a timer for each active check list. Thepeer reflexive candidatetimer fires every Ta/N seconds, where N isthen added tothelistnumber oflocal candidates known byactive check lists (initially, there is only one active check list). Implementations MAY set theagent (though ittimer to fire less frequently than this. Ta isnot paired with other remote candidates at this time). In addition,theagent creates a candidate pair whose local candidate equalssame value used to pace themapped addressgathering of candidates, as described in Section 5.1. The first timer for each active check list fires immediately, so that theresponse, and whose remote candidate equalsagent performs a connectivity check thedestination address to whichmoment therequest was sent. This is called a validated pair, since itoffer/answer exchange has beenvalidateddone, followed bya STUN connectivity check. It is very important to note that this validated pair will often not be identical tothe next periodic checkitself; in many cases, the local candidate (learned through the mapped address in the response) will be different than the local candidateTa seconds later. When therequest was sent from. However,timer fires, the full-mode agentwill know, either from the SDP or throughMUST find thePRIORITY attributehighest priority check in thatwas presentcheck list that is in the Waiting state. The agent then sends a STUNrequest,check from theprioritieslocal candidate of that check to thelocal andremotecandidatescandidate of that check. The procedures for forming thevalidated pair. Based on these priorities, a prioritySTUN request for this purpose are described in Section 8.1.1. If none of thevalidated pair itself is computed if it was not already known, usingchecks in that check list are in thealgorithmWaiting state, but there are checks inSection 5.6, andthepairFrozen state, the highest priority check in the Frozen state isadded tomoved into thevalid list. 7.8. Server Procedures An agent MUST be prepared to receiveWaiting state, and that check is performed. When aBinding Request on the base of each candidate it included incheck is performed, itsmost recent offerstate is set to In- Progress. If there are no checks in either the Waiting oranswer. Receipt of a Binding Request on a transport address thatFrozen state, then theagent had included in a candidate attribute is an indicationtimer for that check list is stopped. Performing the connectivity checkusage applies torequires therequest. TheagentMUST use a short term credentialtoauthenticateknow therequestusername fragment for the local and remote candidates, andperform a message integrity check. The agent MUST accept a credential iftheusername consists of two values separated by a colon, wherepassword for thefirst value is equal toremote candidate. For periodic checks, the remote username fragmentgenerated by the agent in an offer or answer for a session in- progress,andthepasswordis equal toare learned directly from thepassword for thatSDP received from the peer, and the local usernamefragment. Itfragment ispossible (and in fact very likely)known by the agent. 7. Receipt of the Initial Answer This section describes the procedures that anofferor will receive a Binding Request prior to receivingagent follows when it receives the answer fromitsthe peer.However,It verifies that its peer supports ICE, determines its role, forms therequest can be processed without receiving this answer,check list anda response generated. For requests being received on a relayed candidate,begins performing periodic checks. 7.1. Verifying ICE Support The answerer will proceed with thesource transport address usedICE procedures defined in this specification if there is at least one a=candidate attribute forSTUN processing (namely, generation ofeach media stream in theXOR-MAPPED-ADDRESS attribute)answer it just received. If this condition is not met, thetransport address as seen byagent MUST process therelay. That source transport address will be presentSDP based on normal RFC 3264 procedures, without using any of the ICE mechanisms described in theREMOTE- ADDRESS attributeremainder ofa STUN Data Indication message, if the Binding Request was delivered through a Data Indication. Ifthis specification, with theBinding Request was not encapsulated in a Data Indication, that source address is equal toexception of Section 11, which describes keepalive procedures. 7.2. Determining Role The offerer follows thecurrent active destinationsame procedures described for theSTUN relay session. Whenanswerer in Section 6.2. 7.3. Forming theagent receives a STUN Binding RequestCheck List The offerer follows the same procedures described forwhich it generates a successful response,theagent checksanswerer in Section 6.7. 7.4. Performing Periodic Checks The offerer follows thesource transport address ofsame procedures described for therequest. If this transport address does not match any existing remote candidates, it represents a new peer reflexive remote candidate.answerer in Section 6.8. 8. Connectivity Checks Thiscandidate is given a priority equalsection describes how connectivity checks are performed. All ICE implementations are required to be compliant to [11], as opposed to thePRIORITY attribute fromolder [13]. 8.1. Client Procedures 8.1.1. Sending therequest.Request Thetype ofagent acting as thecandidate is equal to peer reflexive. Its foundationclient generates a connectivity check either periodically, or triggered. In either case, the check isset to an arbitrary value, differentgenerated by sending a Binding Request fromthe foundation for all othera local candidate, to a remotecandidates.candidate. The agent must know the username fragment forthis candidate is equal to the bottom half (the part after the colon) of the username inboth candidates and theBinding Request that was just received. Thepassword forthis username fragment is taken fromtheSDPremote candidate. A Binding Request serving as a connectivity check MUST utilize a STUN short term credential. Rather than being learned from a Shared Secret request, thepeer. If agent has not yet received this SDP (a likely case for the offerershort term credential is exchanged in theinitial offer/answer exchange), it MUST wait foroffer/ answer procedures. In particular, theSDP to be received, and then proceed with rest ofusername is formed by concatenating theprocessing described inusername fragment provided by theremainder of this section. This candidate is then added topeer with thelistusername fragment ofremote candidates. However, it is not paired with any local candidates. Next,the agentMUST generate a triggered check insending thereverse directon if it has not already sent suchrequest, separated by acheck.colon (":"). Thetriggered check has a local candidatepassword is equal to thecandidate on whichpassword provided by theSTUN request was received, and a remote candidate equal topeer. For example, consider thesource transport addresscase where agent A is therequest came from (which may be a newly formed peer reflexive candidate). Theofferer, and agentknowsB is theprioritiesanswerer. Agent A included a username fragment of AFRAG forthe localits candidates, andremote candidatesa password ofthis check,APASS. Agent B provided a username fragment of BFRAG andso can compute the priority for the check itself. If there is alreadya password of BPASS. A connectivity checkonfrom A to B (and its response of course) utilize thecheck list with this same local and remote candidates,username BFRAG:AFRAG andthe statea password ofthatBPASS. A connectivity checkis Waiting or Frozen, its state is changedfrom B toIn- Progress andA (and its response) utilize thecheck is performed. If there was already a check on the check list with this same local and remote candidates,username AFRAG:BFRAG andits state was In-Progress, the agent SHOULD generate an immediate retransmita password of APASS. A full-mode agent MUST include the PRIORITY attribute in its Binding Request. Thisisattribute MAY be omitted for passive-only agents. The attribute MUST be set equal tofacilitate rapid completion of ICE when both agents are behind NAT. If there was a check in the list already and its state was Succeeded or Failed, nothing further is done. If there was no matching check on the check list, it is inserted intothecheck listpriority that would be assigned, based onits priority, its state is setthe algorithm in Section 5.2, toIn-Progress,a peer reflexive candidate learned from this check. Such a peer reflexive candidate has a stream ID, component ID and local preference that are equal to thecheck is performed. 7.9. Security Considerations for Connectivity Check Security considerations forhost candidate from which theconnectivitycheckare discussed in Section 15. 8. Completing the ICE Checks When a pairisaddedbeing sent, but a type preference equal to thevalid list,value associated with peer reflexive candidates. The Binding Request by an agent MUST include the USERNAME and MESSAGE-INTEGRITY attributes. That is, an agent MUST NOT wait to be challenged for short term credentials. Rather, it MUST provide them in the Binding Request right away. The controlling agentwasMAY include theofferorUSE-CANDIDATE attribute in themost recent offer/answer exchange, theBinding Request. The passive agent MUSTcheck to see if there is a pair onNOT include it in its Binding Request. This attribute signals that thevalidated listcontrolling agent wishes to cease checks foreach component of each media stream. If there is, the offeror MUST stop timer Ta,this component, andMUST cease retransmitting any Binding Requestsuse the candidate pair resulting from the check fortransactions in progress. It MUST ignore any responses which may subsequently arrivethis component. Section 9 provides guidance on determining when totransactions previouslyinclude it. If the agent is using Diffserv Codepoint markings [25] inprogress. The offeror MUST generateits media packets, it SHOULD apply those same markings to its connectivity checks. 8.1.2. Processing the Response If the STUN transaction generates anupdated offer as described in Section 9. It does this regardless of whetherunrecoverable failure response or times out, a full-mode agent sets thehighest priority pairs instate of the checklist matchto Failed (passive-only agents do not maintain thecurrent in-use candidate pairs. When a pair is adedstate machinery). The remainder of this section applies to processing of successful responses (any response from 200 to 299). The agent MUST check that thevalid list,source IP address and port of theagentresponse equals the destination IP address and port that the Binding Request was sent to, and that theanswerer indestination IP address and port of themost recent offer/answer exchange,response match theagent MAY begin sending media usingsource IP address and port thatcandidate pair, asthe Binding Request was sent from. If these do not match, the processing described inSection 11.1.the remainder of this section MUST NOT be performed. In addition,if there isacandidate pair onfull-mode agent sets thevalid list for each componentstate ofeach media stream,theanswerer MUST stop timer Ta, and MUST cease retransmitting any Binding Requests for transactions in progress. It MUST ignore any responses which may subsequently arrivecheck totransactions previously in progress. Note that only agent that was the answerer inFailed. If themost recent offer/ answer exchange gets to send media right away.check succeeds, processing continues. Theofferor must wait foragent creates asubsequent offer/answer exchange if the valid candidates don't match those incandidate pair whose local candidate equals them/c-line. OPEN ISSUE: It is possible that higher priority checks may still succeed, if we allowed things to continue. This can happen for several reasons. First, an in-progress checkmapped address ofhigher priority had some packet lossthe response, andthus hasn't completed. Timer Twswhose remote candidate equals the destination address to which the request wasmeantsent. This is called a validated pair, since it has been validated by a STUN connectivity check. It is very important tohandle this (I removednote that thistimer from -10 to simplify). More interestingly, higher priority checks may havevalidated pair will often notbeen done because a triggeredbe identical to the checkof lower priority succeeded. This happensitself; incases wheremany cases, thenumber of checks at each agent are assymetric. It is possible to fix both of these problems by delayinglocal candidate (learned through thecompletion ofmapped address in theICE procedures for a bit more time. This adds complexity and latency. The basic algorithm wouldresponse) will bethis. You takedifferent than the local candidate the request was sent from. Next, the agent computes thelowestpriority for the pairinbased on thevalid list. You keep doing checks as long as there are higherprioritychecks onof each candidate, using thelistalgorithm in Section 6.7. For a passive-only agent, theWaiting state. If there are none, you wait a brief time (say 50ms) and then consider ICE finished. 9. Subsequent Offer/Answer Exchanges An agent MAY generate a subsequent offer at any time. However,priority of therules in Section 7.7.2 will causelocal candidate is theofferer to generate an updated offer whenone it signaled for thecandidatescandidate in its SDP, and thevalid list are not all in-use. 9.1. Generating the Offer When an agent generates an updated offer, the setpriority of the remote candidateattributes to include depend onis known either from thestateSDP, or if not there, from the value ofICE processing. If ICE is "done",the PRIORITY attribute in the Binding Request whichoccurs whentriggered thevalid list includescheck that just completed. For a full-mode agent, if the local candidatepair for each componentwas not one it signaled in its SDP, the priority ofeach media stream,theagent MUST include a candidate attribute for eachlocal candidateamongstmight additionally be equal to thepairsPRIORITY attribute the agent placed in the Binding Request which just completed. Once the priority of the candidate pair has been computed, the pair is added to the valid list(including peer reflexive candidates), and SHOULD NOT include any others. This will cause STUN keepalives to be sentfor that media stream. If thein-use candidates,response is a consequence of a triggered check, andthats it. If, however,thevalid list does not yet include arequest which caused the triggered check included the USE-CANDIDATE attribute, the candidate pairfor each component of each media stream, theis additionally marked as selected. If a full-mode agentSHOULD include all current candidates, including any peer reflexive candidates it has learned sincehad included thelast offer or answer it sent. This MAY include candidates it did not offer previously, but which it has gathered since the last offer/answer exchange. If a candidate was sentUSE-CANDIDATE attribute ina previous offer/answer exchange, it SHOULD havethesame priority. For a peer reflexive candidate,request that produced thepriority SHOULD besuccess response, thesame as determined byagent marks theprocessing in Section 7.7.2.candidate pair as selected. Next, a full-mode agent updates its ICE states. Thefoundation SHOULD befull-mode agent checks thesame. The username fragments and passwords for a media stream SHOULD remainmapped address from thesame asSTUN response. If theprevious offer or answer. Populationtransport address does not match any of them/c-lines also depends onlocal candidates that thestate of ICE processing. If, foragent knows about, the mapped address representes aparticular media stream,new peer reflexive candidate. Its type is equal to peer reflexive. Its base is set equal to thevalid list hascandidatepairs for all offrom which thecomponents of that media stream, those pairsSTUN check was sent. Its username fragment and password areused. In particular, the m/c-line would be constructed by fromidentical to thelocalcandidate fromeach of those candidate pairs. In addition,which theagent MUST includecheck was sent. It is assigned thea=remote-candidates attribute forpriority value thatmedia stream, and includewas placed inittheremote candidates for eachPRIORITY attribute of thepairs that were used. If, for a particular media stream,request. Its foundation is selected as described in Section 5.1. The peer reflexive candidate is then added to thevalidlistdoes not have pairs for allof local candidates known by thecomponentsagent (though it is not paired with other remote candidates at this time). Next, the full-mode agent changes the state for this check to Succeeded. The full-mode agent sees if the success of this check can cause other checks to be unfrozen. If thestream,check had a component ID of one, the full-mode agentSHOULD populateMUST change them/c-linestates forthatall other Frozen checks for the same media streambased onand same foundation, but different component IDs, to Waiting. If theconsiderations in Section 4.3. Thecomponent ID for the check was equal to the number of components for the media stream, the full-mode agent MUSTusechange thesame ice-pwd and ice-ufragstate foraall other Frozen checks for the first component of different mediastream as its previous offer or answer. Note that it is permissible to use a session-level attributestreams (and thus inone offer,different check lists) butto providethe samepassword asfoundation, to Waiting. 8.2. Server Procedures An agent MUST be prepared to receive amedia-level attributeBinding Request on the base of each candidate it included in its most recent offer or answer. Receipt of asubsequent offer. This is notBinding Request on achangetransport address that the agent had included inpassword, justachange in its representation. 9.2. Receiving the Offer and Generatingcandidate attribute is anAnswer When the answerer generates its answer, it must decide what candidates to include inindication that theanswer, and howconnectivity check usage applies topopulate the m/c- line. For each media stream in the offer,the request. The agentchecksMUST use a short term credential tosee if the stream containedauthenticate theremote-candidates attribute. If it did, it means thatrequest and perform a message integrity check. The agent MUST accept a credential if theofferer believed that ICE processing has completed for that media stream. In this case,username consists of two values separated by a colon, where theremote-candidates attribute containsfirst value is equal to thecandidates thatusername fragment generated by theanswereragent in an offer or answer for a session in- progress, and the password issupposedequal touse.the password for that username fragment. It is possible (and in fact very likely) thatthe agent doesn't even know of these candidates yet; theyan offeror will receive a Binding Request prior to receiving the answer from its peer. However, the request can bediscovered shortly throughprocessed without receiving this answer, and a responseto an in-progress check. The agent MUST populategenerated. For requests being received on a relayed candidate, them/c-line withsource transport address used for STUN processing (namely, generation of thecandidates fromXOR-MAPPED-ADDRESS attribute) is thea=remote-candidates attribute. In addition, it MUST include an a=candidatetransport address as seen by the relay. That source transport address will be present in the REMOTE- ADDRESS attribute of a STUN Data Indication message, if the Binding Request was delivered through a Data Indication. If the Binding Request was not encapsulated inits answera Data Indication, that source address is equal to the current active destination foreach candidate inthea=remote-candidates attribute.STUN relay session. If the agent isnot aware of the candidate yet,using Diffserv Codepoint markings [25] in its media packets, itwill needSHOULD apply those same markings togenerate a priority value for it. The type preference inits responses to Binding Requests. If thecomputationSTUN request resulted in an error response, no further processing ispeer-reflexive, and the stream ID and component ID are known fromperformed. Otherwise, theoffer. Theagentchooses an arbitrary local preference valueMUST generate a triggered check in the reverse directon if itis multi-homed, since it won't yet know the interface associated with this candidate. If a media stream doeshas notyet containalready sent such a check. The triggered check has a local candidate equal to thea=remote-candidates attribute, it means thatcandidate on which theofferer believes that ICE checks are still in progress for that media stream. In this case,STUN request was received, and a remote candidate equal to theanswerer SHOULD include an a=candidate attribute for all ofsource transport address where the request came from (which may not be amongst the candidatesfor that media stream it knows about (including peer-reflexive candidates). The m/c-line is populated based onsignaled previously from theconsiderationspeer inSection 4.3. Constructionits SDP). The username fragment and password of theice-pwd and ice-ufragpeer areidentical toreadily determined from theprocedures followed bySDP and from theofferer, as described in Section 9.1. Notecheck thatthe a=remote-candidates attribute SHOULD NOT be included in the answer, and if included, willwas justbe ignored by the offerer, since itreceived. The username fragment for this candidate isnot used in any processingequal to the bottom half (the part after the colon) of theanswer. 9.3. UpdatingUSERNAME in theCheck and Valid Lists OnceBinding Request that was just received. Using that username fragment, thesubsequent offer/answer exchange has completed, eachagentneeds to compute the newcan checklists resultingthe SDP messages received fromthis exchange,its peer (there may be more than one in cases of forking), and find this username fragment. The corresponding password is thenremove any pairs from the valid list which are no longer usable. Once these adjustments are made, ICE processing continues using these new lists. Eachselected. If agentrecomputeshas not yet received this SDP (a likely case for the offerer in the initial offer/answer exchange), it MUST wait for the SDP to be received, and then proceed with the triggered checklists usingand theproceduresrest of the processing described inSection 5.6. If a check onthenew check lists was also onremainder of this section. The remainder of theprevious check lists, and its state was Waiting, In-Progress, Succeeded or Failed, itsprocessing in this section applies to stateis copied over.updates performed by full-mode agents. Ifa check onthenew check listssource transport address of the request does nothave a state (because its a new check on anmatch any existingcheck list, or a check onremote candidates, it represents a newcheck list, orpeer reflexive remote candidate. The full-mode agent gives thecheck was on an old check list but its state was not copied over) its statecandidate a priority equal to the PRIORITY attribute from the request. The type of the candidate is equal to peer reflexive. Its foundation is set toFrozen. If none ofan arbitrary value, different from thecheck lists are active (meaning thatfoundation for all other remote candidates. This candidate is then added to thechecks in each checklistare Frozen),of remote candidates. However, the full-mode agentsets the first check in the check listdoes not pair this candidate with any local candidates. A full-mode agent knows the priorities for thefirst media stream to Waiting,local andthen sets the stateremote candidates ofall other checks in that check list forthesame component IDtriggered check described above, andwithso can compute thesame foundation to Waiting as well. Next,priority for theagent goes through eachchecklist, starting with the highest priority check.itself. If there is already a checkhas a state of Succeeded, and it has a component ID of 1, then all Frozen checks inon thesamecheck list withthethis samefoundation whose component IDs are not one, have their state set to Waiting. If, for a particular check list, there are checks for each component of that media stream in the Succeeded state, the agent moveslocal and remote candidates, and the state ofall Frozen checks for the first component of all other media streams (and thus in differentthat checklists) with the same foundationis Waiting or Frozen, its state is changed toWaiting.In- Progress. Ifa checkthere wason the oldalready a checklist, but was noton thenewchecklist,list with this same local andhad aremote candidates, and its stateofwas In-Progress, thecorresponding STUN transactionagent SHOULD generate an immediate retransmit of the Binding Request. This isabandoned. No further retransmits will be sent forto facilitate rapid completion of ICE when both agents are behind NAT. If there was a check in theSTUN request,list already and its state was Succeeded, andany response that might be received is ignored. Next,theagent prunesBinding Request just received contained thevalid list. For each pair on the valid list,USE-CANDIDATE attribute, it means that the pair resulting from that previous check has been selected. The agentexamines each candidate in the pair. If the candidate was not peer reflexive, and was not present in the most recent offer/answer exchange,MUST take the candidate pairis removed fromin the validlist. OPEN ISSUE: This meanslist thatyou cannot forcefully remove a peer reflexive candidate. This featurewaspossible, at much complexity, inlearned from that previousversions of the spec. An alternative is to remove a peer reflexive candidate ifsuccessful check, and mark it as selected. If there wasnot present ina check on theoffer/answer,check list with this same local and remote candidates, and its state wasdiscovered more than 500ms ago. 10. Keepalives STUN connectivity checks are also used to keep NAT bindings open once a session is underway. ThisFailed, nothing further isaccomplished by periodically re- starting thedone. If there was no matching checkprocess, as described in this section. Onceon theinitial offer/answer exchange has taken place,check list, it is inserted into theagent sets a timer to fire in Tr seconds. Tr SHOULD be configurablecheck list based on its priority, andSHOULD have a defaultits state is set to In-Progress. 9. Concluding ICE Concluding ICE involves selection of15 seconds. When Tr fires,pairs by theagent MUST resetcontrolling agent, updating of state machinery by full-mode agents, and possibly thestates for allgeneration of an updated offer by thecheckscontrolling agent. Since a passive-only agent can never be in thecheck list usingcontrolling role, theprocedures defined in Section 5.6 and then begin performing periodic checks as describedprocessing inSection 5.7. By the time the timer fires for the first time, the check list will includethis section onlythe in-use candidates. Reperforming these checks will therefore performingapplies to full-mode agents. The controlling agent can use any algorithm it likes for deciding when to select aperiod keepalive. OPEN ISSUE: ICE isn't saying anything about what happens if these periodic keepalives should fail. It they do, something really bad has happened, likecandidate pair. However, it MUST eventually include aNAT reboot or failure. I think we should keep that outUSE-CANDIDATE attribute in a check for each component ofscope. When an ICEeach media stream. The following trivial algorithm chooses the first candidate pair that validates for each media stream: the controlling agent includes the USE-CANDIDATE attribute in every check it sends. Once a candidate pair in the Valid list iscommunicating with anmarked as selected, a full-mode agentthat is not ICE- aware, keepalives still need to be utilized. Indeed, these keepalives are essential even if neither endpoint implements ICE. As such, this specification defines keepalive behavior generally,MUST NOT generate any further periodic checks forendpointsthatsupport ICE,component of that media stream, andthoseSHOULD cease any retransmissions in progress for checks for thatdo not. All endpoints MUST send keepalivescomponent of that media stream. Once there is at least one candidate pair for eachmedia session. These keepalives MUST be sent regardlesscomponent ofwhether thea media stream that iscurrently inactive, sendonly, recvonly or sendrecv. The keepalive SHOULD be sent using a format which is supported by its peer. ICE endpoints allow for STUN-based keepalives for UDP streams, andmarked assuch, STUN keepalives MUST be used when an agent is communicating withselected, apeer that supports ICE. Anfull-mode agentcan determine that its peer supports ICE byMUST change thepresencestate ofthe a=candidate attributesprocessing foreachits check list to Completed. Once all of the mediasession. Ifstreams enter thepeer does not support ICE,Completed state, thechoice of a packet format for keepalives is a matter of local implementation. A format which allows packets to easily be sent incontrolling agent takes theabsencehighest priority candidate pair for each component ofactualeach mediacontent is RECOMMENDED. Examples of formatsstream whichreadily meet this goal are RTP No-Op [27] and RTP comfort noise [23].has been marked as selected. Ifthe peer doesn't supportanyformats that are particularly well suited for keepalives, an agent SHOULD send RTP packets with an incorrect version number, or some other formoferror which would cause them to be discarded bythose candidate pairs differ from thepeer. STUN-based keepalives will be sent periodically every Tr seconds as described above. If STUN keepalives are notin-use candidates inuse (becausem/c-lines of thepeer does not support ICE), anmost recent offer/answer exchange, the controlling agentSHOULD ensure that a media packet is sent every Tr seconds. If one is not sentMUST generate an updated offer asa consequence of normal media communications, a keepalive packet using one of the formats discussed above SHOULD be sent. 11. Media Handling 11.1. Sending Media Agents always send media using a candidate pair.described in Section 10. 10. Subsequent Offer/Answer Exchanges An agentwill send media toMAY generate a subsequent offer at any time. However, theremote candidaterules in Section 9 will cause thepair (setting the destination address and port of the packet equalcontrolling agent tothat remote candidate), and willsendit froman updated offer at thelocal candidate. When the localconclusion of ICE processing when ICE has selected different candidateis server or peer reflexive, media is originatedpairs from thebase. Media sent fromin-use pairs. 10.1. Generating the Offer An agent MAY change the ice-pwd and/or ice-ufrag for arelayed candidatemedia stream in an offer. Doing so issent througha signal to restart ICE processing for thatrelay, using procedures defined in [12]. Ifmedia stream. When an agentwas the offerer in the most recent offer/answer exchange, when it sends media, it MUST use the candidates in the m/c-linerestarts ICE foreacha mediastream. However,stream, it MUSTonly send media once those candidates also appear inNOT include thevalid list. Ifa=remote-candidates attribute, since thecandidates instate of them/c-line aremedia stream would notthe ones that are ultimately selected by ICE,be Completed at thisimpliespoint. Note thatthe offerer will needit is permissible towait foruse a session-level attribute in one offer, but to provide the same password as a media-level attribute in a subsequentoffer/ answer exchange to complete before it can send media. If anoffer. This is not a change in password, just a change in its representation. An agentwasMUST restart ICE processing if theanswerer inoffer is being generated for themost recent offer/answer exchange,purposes of changing therules are different. Whentarget of the media stream. In other words, if an agentwisheswants tosend media, and the candidate pairsgenerated an updated offer which, had ICE not been in use, would result in a new value for them/c-lines are also the highest priority onestransport address in thevalid list for eachm/c-line, the agent MUST restart ICE for that mediastream, it uses those candidate pairs. If, however,stream. This implies that setting thehighest priority pairsIP address in thevalid listc line to 0.0.0.0 will cause an ICE restart. Consequently, ICE implementations SHOULD NOT utilize this mechanism for call hold, and instead use a=inactive as described in [4] If an agent removes a media streamare notby setting its port to zero, it MUST NOT include any candidate attributes for that media stream. When a full-mode agent generates an updated offer, thesame asset of candidate attributes to include for each media stream depend on theones instate of ICE processing for that media stream. If them/c-lines,processing for that media stream is in the Completed state, a full-mode agent MUST include a candidate attribute for the local candidate of each pair that has been chosen for use by ICE for that media stream. A pair is chosen if it is the highest prioritypairsselected pair in the validlist. However, the agent MUST discontinue using those candidate pairs Tlo seconds after the next opportunity its peer would have to send an updated offer. In the case of an answer delivered in a 200 OK to an offer inlist for aSIP INVITE (regardlesscomponent ofwhetherthatsame answer appeared in an earlier unreliable provisional response), this would be Tlo seconds after receipt of the ACK. Tlo SHOULD be configurable andmedia stream. A full-mode agent SHOULDhaveNOT include any other candidate attributes for that media stream. If ICE processing for adefault of 5 seconds. This time represents the amount of time it should take the offerer to perform its connectivity checks, arrive atmedia stream is in thesame conclusion aboutRunning state, thecandidate pair, and then generate an updated offer. If, after Tlo seconds, no updatedagent MUST include all current candidates (including peer reflexive candidates learned through ICE processing) for that media stream. It MAY include candidates it did not offerarrives,previously, but which it has gathered since theanswerer MUST cease sending media, and will need to waitlast offer/answer exchange. If a media stream is new or ICE checks are restarting for that stream, a full-mode agent includes theupdated offer. OPEN ISSUE: In previous versionsset ofICE, once this timer fired, you just sent mediacandidates it wishes to utilize. This MAY include some, none, or all of theoneprevious candidates for that stream in them/c-line. This causes the media streams to flip backcase of a restart, andforth between addresses, which I am trying to avoid. Since this timer should never go off anyway, I removed this feature. ICE has interactions with jitter buffer adaptation mechanisms. An RTP stream can begin usingMAY include a totally new set of candidates gathered as described in Section 5.1. A passive-only agent includes its onecandidate,andswitch to another one, though this happens rarely with ICE. The neweronly candidatemay resultfor each component of each media stream inRTP packets takingan a=candidate attribute in any subsequent offer. If adifferent path through the network - one with different delay characteristics. As discussed below, agents are encouraged to re-adjust jitter buffers when there are changescandidate was sent insource or destination address. Furthermore, many audio codecs use the marker bit to signal the beginning ofatalkspurt, forprevious offer/answer exchange, it SHOULD have thepurposes of jitter buffer adaptation.same priority. Forsuch codecs, it is RECOMMENDED that the sender changea peer reflexive candidate, themarker bit when an agent switches transmission of media from one candidate pair to another. 11.2. Receiving Media ICE implementations MUSTpriority SHOULD beprepared to receive media on any candidates providedthe same as determined by the processing in Section 8.1.2. The foundation SHOULD be themost recent offer/answer exchange. It is RECOMMENDED that, when an agent receives an RTP packet with a new source or destination IP addresssame. The username fragments and passwords for aparticularmediastream, thatstream SHOULD remain theagent re-adjust its jitter buffers. RFC 3550 [20] describes an algorithm in Section 8.2same as the previous offer or answer. Population of the m/c-lines fordetecting SSRC collisions and loops. These algorithms are based, in part,full-mode agents also depends onseeing different source transport addresses withthesame SSRC. However, whenstate of ICEis used, such changes will sometimes occur as the media streams switch between candidates. An agent will be able to determine thatprocessing. If ICE processing for a media stream is in the Completed state, the m/c-line MUST use the local candidate from thesame peer as a consequence ofhighest priority selected pair in theSTUN exchangevalid list for each component of thatproceedsmediatransmission. Thus, if therestream. If ICE processing isa changeinsource transport address, butthe Running state, a full-mode agent SHOULD populate the m/c-line for that mediapackets come fromstream based on thesame peer agent, this SHOULD NOT be treated as an SSRC collision. 12. Usageconsiderations in Section 5.3. A passive agent populates the m/c-lines withSIP 12.1. Latency Guidelines ICE requires a series of STUN-based connectivity checks to take place between endpoints. These checks start from the answerer on generation ofitsanswer, and start from the offerer when it receives the answer. These checks can take time to complete, and as such, the selection of messages to use with offersone andanswers can effect perceived user latency. Two latency figures areonly one candidate for each component ofparticular interest. These are the post-pickup delay and the post-dial delay. The post-pickup delay refers toeach media stream. In addition, thetime between when a user "answerscontrolling agent MUST include thephone" and when any speech they utter can be delivered toa=remote- candidates attribute for each media stream that is in thecaller.Completed state. Thepost-dial delay refers to the time between when a user entersattribute contains thedestination address forremote candidates from theuser, and ringback begins as a consequence of having succesfully started ringinghighest priority selected pair in thephonevalid list for each component ofthe called party. To reduce post-dial delays, it is RECOMMENDEDthatthe caller begin gathering candidates prior to actually sendingmedia stream. An agent MUST NOT change itsinitial INVITE. This can be started upon user interface cues that a call is pending, such as activity on a keypadmode (passive-only or full) by adding or removing thephone going offhook. Ifa=ice-passive attribute from anofferupdated offer, unless ICE processing isreceivedbeing restarted for all media streams inan INVITE request,thecallee SHOULD immediately gather its candidates and then generateoffer. Note that ananswer inagent can add aprovisional response. When reliable provisional responses are not used, the SDP innew media stream at any time, even if ICE has long finished for theprovisional response isexisting media streams. Based on theanswer,rules described here, checks will begin for this new stream as if it was in an initial offer. 10.2. Receiving the Offer andthat exact same answer reappearsGenerating an Answer When receiving a subsequent offer within an existing session, an agent MUST re-apply the verification procedures in Section 6.1 without regard to the200 OK. To deal withresults of verification from any previous offer/answer exchanges. Indeed, it is possiblelossesthat a previous offer/answer exchange resulted in ICE not being used, but it is used as a consequence of a subsequent exchange. When theprovisional response,answerer generates its answer, itSHOULD be retransmitted until some indication of receipt. This indication can either be through PRACK [9], or throughmust decide what candidates to include in thereceiptanswer, how to populate the m/c-line, and how to adjust the states ofa successful STUN Binding Request. Even if PRACK is not used,ICE processing. The rules for inclusion of candidate attributes in an answer are identical to theprovisional response SHOULD be retransmitted usingrules followed by theexponential backoffofferer as described in[9]. Furthermore, once the answer has been sent,Section 10.1. However, theagent SHOULD begin its connectivity checks. Once candidate pairsrules foreach componentsetting the contents ofa media stream enterthevalid list,m/c-line are different. For a full-mode agent, processing of thecallee can begin sending mediaoffer depends onthatthe presence or absence of the a=remote-candidates attribute in a media stream.However, prior to this point, any mediaIf present, it means thatneeds to be sent towardsthecaller (suchofferer (acting asSIP early media [25] cannot be transmitted. For this reason, implementations SHOULD delay alertingthecalled party until candidatescontrolling agent) believed that ICE processing has completed foreach component of eachthat mediastream have entered the valid list.stream. Inthe case of a PSTN gateway, this would mean that the setup message into the PSTN is delayed untilthispoint. Doing this increases the post-dial delay, but hascase, theeffect of eliminating 'ghost rings'. Ghost rings are cases whereremote-candidates attribute contains thecalled party hearscandidates that thephone ring, picks up, but hears nothing and cannot be heard. This technique works without requiring support for, or usage of, preconditions [6], since its a localized decision.answerer is supposed to use. Italso has the benefit of guaranteeingis possible thatnot a single packetthe agent doesn't even know ofmediathese candidates yet; they willget clipped, so that post-pickup delay is zero. If an agent chooses to delay local alerting in this way, it SHOULD generatebe discovered shortly through a180responseonce alerting begins. Based on the rules in Section 11.1, the offerer will not be abletosend media untilan in-progress check. The full-mode agent MUST populate the m/c-line with thehighest priority validcandidatesmatchfrom them/c- line. When used with SIP, ifa=remote-candidates attribute. If theinitialofferis sent indid not contain theINVITE, anda=remote-candidates attribute, or theansweragent issent in botha passive-only agent, theprovisional and final 200 OK response,agent follows the same procedures for populating the m/c-line as described for the offererwill generally not be able to send media until it sends a re-INVITE and receivesin Section 10.1. An agent MUST NOT include the200 OK response to that re-INVITE. This can take several hundred milliseconds. If this latency is an issue (it is generally not considered an issue for voice systems), reliable provisional responses [9] MAY be used,a=remote-candidates attribute inwhich caseanUPDATE [24] can be used to sendanswer. An agent MUST NOT change the a=ice-ufrag or a=ice-pwd attributes in anupdated offer prioranswer relative to thecall being answered. As discussedlast SDP it provided. Such a change can only take place inSection 15, offer/answer exchanges SHOULD be secured against eavesdropping and man-in-the-middle attacks. To do that,an offer. However, if theusage of SIPS [3] is RECOMMENDED when usedoffer contained a change inconcert with ICE. 12.2. Interactions with Forking ICE interacts very well with forking. Indeed, ICE fixes some oftheproblems associated with forking. Without ICE, when a call forks anda=ice-ufrag or a=ice-pwd attributes compared to thecaller receives multiple incoming media streams,previous SDP from the peer, itcannot determine which media stream corresponds to which callee. With ICE, this problemisresolved. The connectivity checks which occur prior to transmission of media carry username fragments, which in turn are correlated toaspecific callee. Subsequentsignal that ICE is restarting for this mediapackets which arrivestream. An agent MUST NOT change its mode from a previous answer unless, based on thesame 5-tuple asoffer, ICE procedures are being restarted for all media streams in theconnectivity check will be associated withoffer. In thatsame callee. Thus, the caller can perform this correlation as long ascase, ithas received an answer. 12.3. Interactions with Preconditions Quality of Service (QoS) preconditions, which are defined in RFC 3312 [6]MAY change its mode. 10.3. Updating the Check andRFC 4032 [7], apply onlyValid Lists Once the subsequent offer/answer exchange has completed, each agent needs to determine thetransport addresses listed inimpact, if any, on them/c lines inCheck and Valid lists. Unless there is anoffer/answer. IfICEchangesrestart, an offer/answer exchange has no impact on thetransport address wherestate of ICE processing for each media stream; that isreceived, this change is reflecteddetermined entirely by the checks themselves. An updated offer/ answer exchange can impact the transmission rules for media, as described in Section 12.1. If them/c lines ofoffer had anew offer/answer. As such, it appears like any other re- INVITE would, and is fully treatedchange inRFC 3312 and 4032, which apply without regard to the fact thatthem/c lines are changing due to ICE negotiations ocurring "inice-ufrag and/or ice-pwd for a media stream, thebackground". Indeed, anagentSHOULD NOT indicateMUST start a new Valid list for thatQos preconditions have been met untilmedia stream. However, it retains the old Valid list for the purposes of sending media until ICEchecks have completedprocessing completes, at which point the old Valid list is discarded andselectedthecandidate pairsnew one is utilized tobe used for media. ICEdetermine media and keepalive targets. A full-mode agent MUST alsohas (purposeful) interactions with connectivity preconditions [26]. Those interactions are described there. Note thatflush theprocedurescheck list for the affected media streams, and then recompute the check list and its states as described in Section12.1 describe their own type of "preconditions", albeit with less functionality than those provided by6.7. If theexplicit preconditions in [26]. 12.4. Interactions with Third Party Call Control ICE works with Flows I and IVsubsequent offer added a new media stream, a full-mode agent MUST create a new check list for it (and an empty Valid list to start of course), as described in[16]. Flow I works withoutSection 6.7. If thecontroller supportingsubsequent offer removed a media stream, orbeing aware of ICE. Flow IV will work as long as the controller passes along the ICE attributes without alteration. Flow III may disrupt ICE processing, since it will distortan answer rejected an offered media stream, an agent MUST flush thestream ID values usedValid list for that media stream. It MUST terminate any STUN transactions in progress for that media stream. A full-mode agent MUST remove thecomputation of priorities. When there is butcheck list for that media stream and cancel any pending periodic checks for it. If asinglemediastream, Flow III will work as long asstream existed previously, and remains after thecontroller passes throughoffer/ answer exchange, theICE attributes unmodified. Flow II is fundamentally incompatible with ICE; eachagentwill believe itself to beMUST NOT modify theanswerer and thus never generateValid list for that media stream. However, if are-INVITE. OPEN ISSUE: Its really too bad flow III doesn't work with multimedia; should consider ways to make it work. There are several ways. The flowsfull-mode agent is in the Running state forcontinued operation, asthat media stream, the check list is updated. To do that, the full-mode agent recomputes the check lists using the procedures described in Section7 of RFC 3725, require additional behavior of ICE implementations to support. In particular, if an agent receives6.7. If amid-dialog re-INVITE that contains no offer, it MUST go throughcheck on theprocess of gathering candidates, prioritizing themnew check lists was also on the previous check lists, andgenerating an offer, as if thisits state was Waiting, In-Progress, Succeeded or Failed, its state is copied over. If a check on the new check lists does not have a state (because its a new check on aninitial offer forexisting check list, or asession. Furthermore, thatcheck on a new check list, or the check was on an old check list but its state was not copied over) its state is set to Frozen. If none ofcandidates SHOULD includetheones currently in-use. 13. Grammar This specification defines four new SDP attributes -check lists are active (meaning that the"candidate", "remote-candidates", "ice-ufrag"checks in each check list are Frozen), the full-mode agent sets the first check in the check list for the first media stream to Waiting, and"ice-pwd" attributes. The candidate attribute isthen sets the state of all other checks in that check list for the same component ID and with the same foundation to Waiting as well. Next, the full-mode agent goes through each check list, starting with the highest priority check. If amedia-level attribute only. It containscheck has atransport address forstate of Succeeded, and it has acandidate that can be used for connectivity checks. The syntaxcomponent ID ofthis attribute is defined using Augmented BNF as defined1, then all Frozen checks inRFC 4234 [8]: candidate-attribute = "candidate" ":"the same check list with the same foundationSP component-id SP transport SP priority SP connection-address SP ;from RFC 4566 port ;port from RFC 4566 [SP cand-type] [SP rel-addr] [SP rel-port] *(SP extension-att-name SP extension-att-value) foundation = 1*ice-char component-id = 1*DIGIT transport = "UDP" / transport-extension transport-extension = token ; from RFC 3261 priority = 1*DIGIT cand-type = "typ" SP candidate-types candidate-types = "host" / "srflx" / "prflx" / "relay" / token rel-addr = "raddr" SP connection-address rel-port = "rport" SP port extension-att-name = byte-string ;from RFC 4566 extension-att-value = byte-string ice-char = ALPHA / DIGIT / "+" / "/" The foundation is composed of one or more ice-char. The component-id is a positive integer, which identifies the specificwhose component IDs are not one, have their state set to Waiting. If, forwhich the transport address isacandidate. It MUST start at 1 and MUST increment by 1particular check list, there are checks for each component ofa particular candidate. The connect-address production is taken from RFC 4566 [10], allowing for IPv4 addresses, IPv6 addresses and FQDNs. The port production is also taken from RFC 4566 [10]. The token production is taken from RFC 3261 [3]. The transport production indicatesthat media stream in thetransport protocol forSucceeded state, thecandidate. This specification only defines UDP. However, extensibility is provided to allow for future transport protocols to be used with ICE, such as TCP oragent moves theDatagram Congestion Control Protocol (DCCP) [28]. The cand-type production encodesstate of all Frozen checks for thetypefirst component ofcandidate. This specification definesall other media streams (and thus in different check lists) with thevalues "host", "srflx", "prflx" and "relay" for host, server reflexive, peer reflexive and relayed candidates, respectively. The set of candidate typessame foundation to Waiting. 11. Keepalives STUN connectivity checks are also used to keep NAT bindings open once ICE processing has completed. This isextensible for the future. Inclusion ofaccomplished by periodically generating a check on the candidatetype is optional. The rel-addr and rel-port productions convey information the related transport addresses. Rulespair currently being used forinclusion of these values is described in Section 4.4. The a=candidate attribute can itself be extended. The grammarmedia. Specifically, once ICE processing allowsfor new name/value pairsmedia tobe added at the end of the attribute. An implementation MUST ignore any name/value pairs it doesn't understand. The syntax of the "remote-candidates" attribute is defined using Augmented BNFbegin flowing, asdefineddescribed inRFC 4234 [8]. The remote-candidates attribute is a media level attribute only. remote-candidate-att = "remote-candidates" ":" remote-candidate 0*(SP remote-candidate) remote-candidate = component-ID SP connection-address SP port The attribute containsSection 12.1, the agent sets aconnection-addresstimer to fire in Tr seconds. Tr SHOULD be configurable andport for each component. The orderingSHOULD have a default ofcomponents is irrelevant. However,15 seconds. When Tr fires, the agent creates avalue MUST be presentconnectivity check for each component ofathat media stream.The syntax of the "ice-pwd" and "ice-ufrag" attributes are defined as: ice-pwd-att = "ice-pwd" ":" password ice-ufrag-att = "ice-ufrag" ":" ufrag password = 22*ice-char ufrag = 4*ice-char The "ice-pwd" and "ice-ufrag" attributes can appear at either the session-level or media-level. When present in both,This check is sent on thevaluecandidate pair currently being used to send media, as described in Section 12.1. This specification makes no recommendations on themedia-level takes precedence. Thus,behaviors should thevalue atkeepalive itself fail. However, an agent SHOULD NOT blindly restart ICE processing for that stream; if thesession levelkeepalive was lost due to congestion, the ICE restart will only aggravate the problem. When an ICE agent iseffectively a defaultcommunicating with an agent thatappliesis not ICE- aware, keepalives still need toall media streams, unless overriden by a media-level value. 14. Example Two agents, L and R,be utilized. Indeed, these keepalives areusingessential even if neither endpoint implements ICE.Both agents have a single IPv4 interface. For agent L, it is 10.0.1.1,As such, this specification defines keepalive behavior generally, for endpoints that support ICE, and those that do not. All endpoints MUST send keepalives foragent R, 192.0.2.1. Both are configured with a single STUN servereach(indeed,media session. These keepalives MUST be sent regardless of whether thesame one for each), whichmedia stream islistening for STUN requests at an IP address of 192.0.2.2currently inactive, sendonly, recvonly or sendrecv, andport 3478. This STUN server supports bothregardless of theBinding Discovery usage andpresence or value of theRelay usage. Agent L is behindbandwidth attribute. The keepalive SHOULD be sent using aNAT,format which is supported by its peer. ICE endpoints allow for STUN-based keepalives for UDP streams, and as such, STUN keepalives MUST be used when an agentRisoncommunicating with a peer that supports ICE. An agent can determine that its peer supports ICE by thepublic Internet. The NAT has an endpoint independent mapping property and an address dependent filtering property. The public sidepresence of a=candidate attributes for each media session. If theNAT has an IP addresspeer does not support ICE, the choice of192.0.2.3. To facilitate understanding, transport addresses are listed using variables that have mnemonic names. Thea packet formatof the namefor keepalives isentity-type-seqno, where entity refersa matter of local implementation. A format which allows packets to easily be sent in theentity whose interface the transport address is on, and is oneabsence of"L", "R", "STUN", or "NAT". The typeactual media content iseither "PUB" for transport addresses thatRECOMMENDED. Examples of formats which readily meet this goal arepublic,RTP No-Op [27] and"PRIV" for transport addressesRTP comfort noise [23]. If the peer doesn't support any formats that areprivate. Finally, seq-no is a sequence number that is differentparticularly well suited foreach transport address of the same type on a particular entity. Each variable haskeepalives, anIP address and port, denoted by varname.IP and varname.PORT, respectively, where varname is the nameagent SHOULD send RTP packets with an incorrect version number, or some other form of error which would cause them to be discarded by thevariable. Thepeer. STUN-based keepalives will be sent periodically every Tr seconds as described above. If STUNserver has advertised transport address STUN-PUB-1 (which is 192.0.2.2:3478) for both the binding discovery usage andkeepalives are not in use (because therelay usage. However, neitherpeer does not support ICE), an agent SHOULD ensure that a media packet isusing the relay usage. Insent every Tr seconds. If one is not sent as a consequence of normal media communications, a keepalive packet using one of thecall flow itself, STUN messages are annotated with several attributes. The "S=" attribute indicatesformats discussed above SHOULD be sent. 12. Media Handling 12.1. Sending Media Agents always send media using a candidate pair. An agent will send media to thesource transport address ofremote candidate in themessage. The "D=" attribute indicatespair (setting the destinationtransportaddress and port of themessage. The "MA=" attributepacket equal to that remote candidate), and will send it from the local candidate. When the local candidate isusedserver or peer reflexive, media is originated from the base. Media sent from a relayed candidate is sent through that relay, using procedures defined inSTUN Binding Response messages and refers[12]. If the state of a media stream is Running, there is no old Valid list for that media stream (which would be due to an ICE restart), a full- mode agent MUST NOT send media. For passive-only agents, which do not retain states about ICE processing, it MUST NOT send media until there is a selected candidate pair in either themapped address. The call flow examples omit STUN authentication operations and RTCP, and focus on RTPold or new Valid list for each component of the media stream. When an agent sends media, it MUST send it using the highest priority selected pair for each component in either the old Valid list for asinglemedia stream (if it exists), else the new Valid list for that media stream.L NAT STUNIn several cases, this will not be the same candidate pairs present in the m/c-line. When ICE first completes, if the selected pairs aren't a match for the m/c-line, an updated offer/answer exchange will take place to remedy this disparity. However, until that update offer arrives, there will not be a match. Furthermore, in very unusual cases, the m/c-lines in the updated offer/answer will not be a match. ICE has interactions with jitter buffer adaptation mechanisms. An RTP stream can begin using one candidate, and switch to another one, though this happens rarely with ICE. The newer candidate may result in RTP packets taking a different path through the network - one with different delay characteristics. As discussed below, agents are encouraged to re-adjust jitter buffers when there are changes in source or destination address. Furthermore, many audio codecs use the marker bit to signal the beginning of a talkspurt, for the purposes of jitter buffer adaptation. For such codecs, it is RECOMMENDED that the sender change the marker bit when an agent switches transmission of media from one candidate pair to another. 12.2. Receiving Media ICE implementations MUST be prepared to receive media on any candidates provided in the most recent offer/answer exchange. It is RECOMMENDED that, when an agent receives an RTP packet with a new source or destination IP address for a particular media stream, that the agent re-adjust its jitter buffers. RFC 3550 [20] describes an algorithm in Section 8.2 for detecting SSRC collisions and loops. These algorithms are based, in part, on seeing different source transport addresses with the same SSRC. However, when ICE is used, such changes will sometimes occur as the media streams switch between candidates. An agent will be able to determine that a media stream is from the same peer as a consequence of the STUN exchange that proceeds media transmission. Thus, if there is a change in source transport address, but the media packets come from the same peer agent, this SHOULD NOT be treated as an SSRC collision. 13. Usage with SIP 13.1. Latency Guidelines ICE requires a series of STUN-based connectivity checks to take place between endpoints. These checks start from the answerer on generation of its answer, and start from the offerer when it receives the answer. These checks can take time to complete, and as such, the selection of messages to use with offers and answers can effect perceived user latency. Two latency figures are of particular interest. These are the post-pickup delay and the post-dial delay. The post-pickup delay refers to the time between when a user "answers the phone" and when any speech they utter can be delivered to the caller. The post-dial delay refers to the time between when a user enters the destination address for the user, and ringback begins as a consequence of having succesfully started ringing the phone of the called party. To reduce post-dial delays, it is RECOMMENDED that the caller begin gathering candidates prior to actually sending its initial INVITE. This can be started upon user interface cues that a call is pending, such as activity on a keypad or the phone going offhook. If an offer is received in an INVITE request, the callee SHOULD immediately gather its candidates and then generate an answer in a provisional response. When reliable provisional responses are not used, the SDP in the provisional response is the answer, and that exact same answer reappears in the 200 OK. To deal with possible losses of the provisional response, it SHOULD be retransmitted until some indication of receipt. This indication can either be through PRACK [9], or through the receipt of a successful STUN Binding Request. Even if PRACK is not used, the provisional response SHOULD be retransmitted using the exponential backoff and timers described in [9]. Note, however, that if PRACK is not used, the rules for when an agent can send an updated offer or answer do not change from those specified in RFC 3262, even though the provisional response has been delivered "reliably". Specifically, if the offer contained an INVITE, the same answer appears in all of the 1xx and in the 2xx response to the INVITE. Only after that 2xx has been sent can an updated offer/answer exchange occur. Once the answer has been sent, the agent SHOULD begin its connectivity checks. Once candidate pairs for each component of a media stream enter the valid list, the callee can begin sending media on that media stream. However, prior to this point, any media that needs to be sent towards the caller (such as SIP early media [24] cannot be transmitted. For this reason, implementations SHOULD delay alerting the called party until candidates for each component of each media stream have entered the valid list. In the case of a PSTN gateway, this would mean that the setup message into the PSTN is delayed until this point. Doing this increases the post-dial delay, but has the effect of eliminating 'ghost rings'. Ghost rings are cases where the called party hears the phone ring, picks up, but hears nothing and cannot be heard. This technique works without requiring support for, or usage of, preconditions [6], since its a localized decision. It also has the benefit of guaranteeing that not a single packet of media will get clipped, so that post-pickup delay is zero. If an agent chooses to delay local alerting in this way, it SHOULD generate a 180 response once alerting begins. As discussed in Section 16, offer/answer exchanges SHOULD be secured against eavesdropping and man-in-the-middle attacks. To do that, the usage of SIPS [3] is RECOMMENDED when used in concert with ICE. 13.2. Interactions with Forking ICE interacts very well with forking. Indeed, ICE fixes some of the problems associated with forking. Without ICE, when a call forks and the caller receives multiple incoming media streams, it cannot determine which media stream corresponds to which callee. With ICE, this problem is resolved. The connectivity checks which occur prior to transmission of media carry username fragments, which in turn are correlated to a specific callee. Subsequent media packets which arrive on the same 5-tuple as the connectivity check will be associated with that same callee. Thus, the caller can perform this correlation as long as it has received an answer. 13.3. Interactions with Preconditions Quality of Service (QoS) preconditions, which are defined in RFC 3312 [6] and RFC 4032 [7], apply only to the transport addresses listed in the m/c lines in an offer/answer. If ICE changes the transport address where media is received, this change is reflected in the m/c lines of a new offer/answer. As such, it appears like any other re- INVITE would, and is fully treated in RFC 3312 and 4032, which apply without regard to the fact that the m/c lines are changing due to ICE negotiations ocurring "in the background". Indeed, an agent SHOULD NOT indicate that Qos preconditions have been met until the ICE checks have completed and selected the candidate pairs to be used for media. ICE also has (purposeful) interactions with connectivity preconditions [26]. Those interactions are described there. Note that the procedures described in Section 13.1 describe their own type of "preconditions", albeit with less functionality than those provided by the explicit preconditions in [26]. 13.4. Interactions with Third Party Call Control ICE works with Flows I, III and IV as described in [16]. Flow I works without the controller supporting or being aware of ICE. Flow IV will work as long as the controller passes along the ICE attributes without alteration. Flow II is fundamentally incompatible with ICE; each agent will believe itself to be the answerer and thus never generate a re-INVITE. The flows for continued operation, as described in Section 7 of RFC 3725, require additional behavior of ICE implementations to support. In particular, if an agent receives a mid-dialog re-INVITE that contains no offer, it MUST restart ICE for each media stream and go through the process of gathering new candidates. Furthermore, that list of candidates SHOULD include the ones currently in-use. 14. Grammar This specification defines five new SDP attributes - the "candidate", "remote-candidates", "ice-passive", "ice-ufrag" and "ice-pwd" attributes. The candidate attribute is a media-level attribute only. It contains a transport address for a candidate that can be used for connectivity checks. The syntax of this attribute is defined using Augmented BNF as defined in RFC 4234 [8]: candidate-attribute = "candidate" ":" foundation SP component-id SP transport SP priority SP connection-address SP ;from RFC 4566 port ;port from RFC 4566 [SP cand-type] [SP rel-addr] [SP rel-port] *(SP extension-att-name SP extension-att-value) foundation = 1*ice-char component-id = 1*DIGIT transport = "UDP" / transport-extension transport-extension = token ; from RFC 3261 priority = 1*DIGIT cand-type = "typ" SP candidate-types candidate-types = "host" / "srflx" / "prflx" / "relay" / token rel-addr = "raddr" SP connection-address rel-port = "rport" SP port extension-att-name = byte-string ;from RFC 4566 extension-att-value = byte-string ice-char = ALPHA / DIGIT / "+" / "/" The foundation is composed of one or more ice-char. The component-id is a positive integer, which identifies the specific component for which the transport address is a candidate. It MUST start at 1 and MUST increment by 1 for each component of a particular candidate. The connect-address production is taken from RFC 4566 [10], allowing for IPv4 addresses, IPv6 addresses and FQDNs. The port production is also taken from RFC 4566 [10]. The token production is taken from RFC 3261 [3]. The transport production indicates the transport protocol for the candidate. This specification only defines UDP. However, extensibility is provided to allow for future transport protocols to be used with ICE, such as TCP or the Datagram Congestion Control Protocol (DCCP) [28]. The cand-type production encodes the type of candidate. This specification defines the values "host", "srflx", "prflx" and "relay" for host, server reflexive, peer reflexive and relayed candidates, respectively. The set of candidate types is extensible for the future. Inclusion of the candidate type is optional. The rel-addr and rel-port productions convey information the related transport addresses. Rules for inclusion of these values is described in Section 5.4. The a=candidate attribute can itself be extended. The grammar allows for new name/value pairs to be added at the end of the attribute. An implementation MUST ignore any name/value pairs it doesn't understand. The syntax of the "remote-candidates" attribute is defined using Augmented BNF as defined in RFC 4234 [8]. The remote-candidates attribute is a media level attribute only. remote-candidate-att = "remote-candidates" ":" remote-candidate 0*(SP remote-candidate) remote-candidate = component-ID SP connection-address SP port The attribute contains a connection-address and port for each component. The ordering of components is irrelevant. However, a value MUST be present for each component of a media stream. The syntax of the "ice-passive" candidate is: ice-passive = "ice-passive" The syntax of the "ice-pwd" and "ice-ufrag" attributes are defined as: ice-pwd-att = "ice-pwd" ":" password ice-ufrag-att = "ice-ufrag" ":" ufrag password = 22*ice-char ufrag = 4*ice-char The "ice-pwd" and "ice-ufrag" attributes can appear at either the session-level or media-level. When present in both, the value in the media-level takes precedence. Thus, the value at the session level is effectively a default that applies to all media streams, unless overriden by a media-level value. 15. Example Two agents, L and R, are using ICE. Both are full-mode ICE implementations. Both agents have a single IPv4 interface. For agent L, it is 10.0.1.1, and for agent R, 192.0.2.1. Both are configured with a single STUN server each (indeed, the same one for each), which is listening for STUN requests at an IP address of 192.0.2.2 and port 3478. This STUN server supports only the Binding Discovery usage; relays are not used in this example. Agent L is behind a NAT, and agent R is on the public Internet. The NAT has an endpoint independent mapping property and an address dependent filtering property. The public side of the NAT has an IP address of 192.0.2.3. To facilitate understanding, transport addresses are listed using variables that have mnemonic names. The format of the name is entity-type-seqno, where entity refers to the entity whose interface the transport address is on, and is one of "L", "R", "STUN", or "NAT". The type is either "PUB" for transport addresses that are public, and "PRIV" for transport addresses that are private. Finally, seq-no is a sequence number that is different for each transport address of the same type on a particular entity. Each variable has an IP address and port, denoted by varname.IP and varname.PORT, respectively, where varname is the name of the variable. The STUN server has advertised transport address STUN-PUB-1 (which is 192.0.2.2:3478) for the binding discovery usage. In the call flow itself, STUN messages are annotated with several attributes. The "S=" attribute indicates the source transport address of the message. The "D=" attribute indicates the destination transport address of the message. The "MA=" attribute is used in STUN Binding Response messages and refers to the mapped address. The call flow examples omit STUN authentication operations and RTCP, and focus on RTP for a single media stream. L NAT STUN R |RTP STUN alloc. | | |(1) STUN Req | | | |S=$L-PRIV-1 | | | |D=$STUN-PUB-1 | | | |------------->| | | | |(2) STUN Req | | | |S=$NAT-PUB-1 | | | |D=$STUN-PUB-1 | | | |------------->| | | |(3) STUN Res | | | |S=$STUN-PUB-1 | | | |D=$NAT-PUB-1 | | | |MA=$NAT-PUB-1 | | | |<-------------| | |(4) STUN Res | | | |S=$STUN-PUB-1 | | | |D=$L-PRIV-1 | | | |MA=$NAT-PUB-1 | | | |<-------------| | | |(5) Offer | | | |------------------------------------------->| | | | |RTP STUN alloc. | | |(6) STUN Req | | | |S=$R-PUB-1 | | | |D=$STUN-PUB-1 | | | |<-------------| | | |(7) STUN Res | | | |S=$STUN-PUB-1 | | | |D=$R-PUB-1 | | | |MA=$R-PUB-1 | | | |------------->| |(8) answer | | | |<-------------------------------------------| | |(9) Bind Req | | | |S=$R-PUB-1 | | | |D=L-PRIV-1 | | | |<----------------------------| | |Dropped | | |(10) Bind Req | | | |S=$L-PRIV-1 | | | |D=$R-PUB-1 | | | |------------->| | | | |(11) Bind Req | | | |S=$NAT-PUB-1 | | | |D=$R-PUB-1 | | | |---------------------------->| | |(12) Bind Res | | | |S=$R-PUB-1 | | | |D=$NAT-PUB-1 | | | |MA=$NAT-PUB-1 | | | |<----------------------------| |(13) Bind Res | | | |S=$R-PUB-1 | | | |D=$L-PRIV-1 | | | |MA=$NAT-PUB-1 | | ||<-------------| | | |(14) Offer ||<-------------| | ||------------------------------------------->| |(15) Answer|RTP flows | | ||<-------------------------------------------|||(16)|(14) Bind Req | | | |S=$R-PUB-1 | | | |D=$NAT-PUB-1 | | | |<----------------------------||(17)|(15) Bind Req | | | |S=$R-PUB-1 | | | |D=$L-PRIV-1 | | | |<-------------| | ||(18)|(16) Bind Res | | | |S=$L-PRIV-1 | | | |D=$R-PUB-1 | | | |MA=$R-PUB-1 | | | |------------->| | | ||(19)|(17) Bind Res | | | |S=$NAT-PUB-1 | | | |D=$R-PUB-1 | | | |MA=$R-PUB-1 | | | |---------------------------->||RTP flows| | | |RTP flows Figure910 First, agent L obtains a host candidate from its local interface (not shown), and from that, sends a STUN Binding Request to the STUN server to get a server reflexive candidate (messages 1-4). Recall that the NAT has the address and port independent mapping property. Here, it creates a binding of NAT-PUB-1 for this UDP request, and this becomes the server reflexive candidate for RTP. Agent L sets a type preference of 126 for the host candidate and 100 for the server reflexive. The local preference is 65535. Based on this, the priority of the host candidate is 2130706178 and for the server reflexive candidate is 1694498562. The host candidate is assigned a foundation of 1, and the server reflexive, a foundation of 2. It chooses its server reflexive candidate as the in-use candidate, and encodes it into the m/c-line. The resulting offer (message 5) looks like (lines folded for clarity): v=0 o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP s= c=IN IP4 $NAT-PUB-1.IP t=0 0 a=ice-pwd:asd88fgpdd777uzjYhagZg a=ice-ufrag:8hhY m=audio $NAT-PUB-1.PORT RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=candidate:1 1 UDP 2130706178 $L-PRIV-1.IP $L-PRIV-1.PORT typ local a=candidate:2 1 UDP 1694498562 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT The offer, with the variables replaced with their values, will look like (lines folded for clarity): v=0 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 s= c=IN IP4 192.0.2.3 t=0 0 a=ice-pwd:asd88fgpdd777uzjYhagZg a=ice-ufrag:8hhY m=audio 45664 RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=candidate:1 1 UDP 2130706178 10.0.1.1 8998 typ local a=candidate:2 1 UDP 1694498562 192.0.2.3 45664 typ srflx raddr 10.0.1.1 rport 8998 This offer is received at agent R. Agent R will obtain a host candidate, and from it, obtain a server reflexive candidate (messages 6-7). Since R is not behind a NAT, this candidate is identical to its host candidate, and they share the same base. It therefore discards this candidate and ends up with a single host candidate. With identical type and local preferences as L, the priority for this candidate is 2130706178. It chooses a foundation of 1 for its single candidate. Its resulting answer looks like: v=0 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP s= c=IN IP4 $R-PUB-1.IP t=0 0 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh a=ice-ufrag:9uB6 m=audio $R-PUB-1.PORT RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=candidate:1 1 UDP 2130706178 $R-PUB-1.IP $R-PUB-1.PORT typ local With the variables filled in: v=0 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 s= c=IN IP4 192.0.2.1 t=0 0 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh a=ice-ufrag:9uB6 m=audio 3478 RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=candidate:1 1 UDP 2130706178 192.0.2.1 3478 typ local Since neither side indicated that they are passive-only, the agent which sent the offer that began ICE processing (agent L) becomes the controlling agent. Agents L and R both pair up the candidates. They both initially have two. However, agent L will prune the pair containing its server reflexive candidate, resulting in just one. At agent L, this pair (the check) has a local candidate of $L_PRIV_1 and remote candidate of $R_PUB_1, and has a candidate pair priority of 4.57566E+18 (note that an implementation would represent this as a 64 bit integer so as not to lose precision). At agent R, there are two checks. The highest priority has a local candidate of $R_PUB_1 and remote candidate of $L_PRIV_1 and has a priority of 4.57566E+18, and the second has a local candidate of $R_PUB_1 and remote candidate of $NAT_PUB_1 and priority 3.63891E+18. Agent R begins its connectivity check (message 9) for the first pair (between the two host candidates). Since R is the passive agent for this session, the check omits the USE-CANDIDATE attribute. The host candidate from agent L is private and behind a different NAT, and thus this check is discarded. When agent L gets the answer, it performs its one and only connectivity check (messages 10-13).This will succeed. This causesIt implements the default algorithm for candidate selection, and thus includes a USE-CANDIDATE attribute in this check. Since the check succeeds, agent Lto createcreates a new pair,whoswhose local candidate is from the mapped address in the binding response (NAT-PUB-1 from message 13) and whose remote candidate is the destination of the request (R-PUB-1 from message 10). This is added to the valid list.At this point, agent L examines the valid list and sees that there is a candidate there for each component of each media stream (whichIn addition, it isjust RTP for the single audio stream). It therefore considers ICE checks complete and sends an updated offer (message 14). This offer serves only to remove the candidate that was notmarked as selectedand indicate the remote candidates;since them/c-line remains unchanged. This offer looks like: v=0 o=jdoe 2890844528 2890842809 IN IP4 10.0.1.1 s= c=IN IP4 192.0.2.3 t=0 0 a=ice-pwd:asd88fgpdd777uzjYhagZg a=ice-ufrag:8hhY m=audio 45664 RTP/AVP 0 a=remote-candidates 1 192.0.2.1 3478 a=rtpmap:0 PCMU/8000 a=candidate:2 1 UDP 1694498562 192.0.2.3 45664 typ srflx raddr 10.0.1.1 rport 8998 Agent R can constructBinding Request contained theanswer.USE-CANDIDATE attribute. Sincethe remote-candidates listedthere is a selected candidate in theoffer match the ones that agent R had already selectedValid list for them/c-line in the previous answer, there is no change there. Its answer therefore looks like: v=0 o=bob 2808844565 2808844566 IN IP4 192.0.2.1 s= c=IN IP4 192.0.2.1 t=0 0 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh a=ice-ufrag:9uB6 m=audio 3478 RTP/AVP 0 a=rtpmap:0 PCMU/8000 a=candidate:1 1 UDP 2130706178 192.0.2.1 3478 typ localone component of this media stream, ICE processing for this stream moves into the Completed state. Agent L can now send media if it so chooses. Upon receipt of the check from agent L (message 11), agent R will generate its triggered check. This check happens to match the next one on its check list - from its host candidate to agent L's server reflexive candidate. This check (messages16-19)14-17) will succeed. Consequently, agent R constructs a new candidate pair using the mapped address from the response as the local candidate (R-PUB-1) and the destination of the request (NAT-PUB-1) as the remote candidate. This pair is added to thevalid list.Valid list for that media stream. Sincethis pair matchesthepaircheck was generated in them/c-lines,reverse direction of a check that contained the USE-CANDIDATE attribute, the candidate pair is marked as selected. Consequently, processing for this stream moves into the Completed state, and agent R can also sendmedia as well. 15.media. 16. Security Considerations There are several types of attacks possible in an ICE system. This section considers these attacks and their countermeasures.15.1.16.1. Attacks on Connectivity Checks An attacker might attempt to disrupt the STUN connectivity checks. Ultimately, all of these attacks fool an agent into thinking something incorrect about the results of the connectivity checks. The possible false conclusions an attacker can try and cause are: False Invalid: An attacker can fool a pair of agents into thinking a candidate pair is invalid, when it isn't. This can be used to cause an agent to prefer a different candidate (such as one injected by the attacker), or to disrupt a call by forcing all candidates to fail. False Valid: An attacker can fool a pair of agents into thinking a candidate pair is valid, when it isn't. This can cause an agent to proceed with a session, but then not be able to receive any media. False Peer-Reflexive Candidate: An attacker can cause an agent to discover a new peer reflexive candidate, when it shouldn't have. This can be used to redirect media streams to a DoS target or to the attacker, for eavesdropping or other purposes. False Valid on False Candidate: An attacker has already convinced an agent that there is a candidate with an address that doesn't actually route to that agent (for example, by injecting a false peer reflexive candidate or false server reflexive candidate). It must then launch an attack that forces the agents to believe that this candidate is valid. Of the various techniques for creating faked STUN messages described in [11], many are not applicable for the connectivity checks. Compromises of STUN servers are not much of a concern, since the STUN servers are embedded in endpoints and distributed throughout the network. Thus, compromising the STUN server is equivalent to comprimising the endpoint, and if that happens, far more problematic attacks are possible than those against ICE. Similarly, DNS attacks are usually irrelevant since STUN servers are not typically discovered via DNS, they are signaled via IP addresses embedded in SDP. Injection of fake responses and relaying modified requests all can be handled in ICE with the countermeasures discussed below. To force the false invalid result, the attacker has to wait for the connectivity check from one of the agents to be sent. When it is, the attacker needs to inject a fake response with an unrecoverable error response, such as a 600. However, since the candidate is, in fact, valid, the original request may reach the peer agent, and result in a success response. The attacker needs to force this packet or its response to be dropped, through a DoS attack, layer 2 network disruption, or other technique. If it doesn't do this, the success response will also reach the originator, alerting it to a possible attack. Fortunately, this attack is mitigated completely through the STUN message integrity mechanism. The attacker needs to inject a fake response, and in order for this response to be processed, the attacker needs the password. If the offer/answer signaling is secured, the attacker will not have the password. Forcing the fake valid result works in a similar way. The agent needs to wait for the Binding Request from each agent, and inject a fake success response. The attacker won't need to worry about disrupting the actual response since, if the candidate is not valid, it presumably wouldn't be received anyway. However, like the fake invalid attack, this attack is mitigated completely through the STUN message integrity and offer/answer security techniques. Forcing the false peer reflexive candidate result can be done either with fake requests or responses, or with replays. We consider the fake requests and responses case first. It requires the attacker to send a Binding Request to one agent with a source IP address andport forport for the false candidate. In addition, the attacker must wait for a Binding Request from the other agent, and generate a fake response with a XOR-MAPPED-ADDRESS attribute containing the false candidate. Like the other attacks described here, this attack is mitigated by the STUN message integrity mechanisms and secure offer/answer exchanges. Forcing the false peer reflexive candidate result with packet replays is different. The attacker waits until one of the agents sends a check. It intercepts this request, and replays it towards the other agent with a faked source IP address. It must also prevent the original request from reaching the remote agent, either by launching a DoS attack to cause the packet to be dropped, or forcing it to be dropped using layer 2 mechanisms. The replayed packet is received at the other agent, and accepted, since the integrity check passes (the integrity check cannot and does not cover the source IP address and port). It is then responded to. This response will contain a XOR- MAPPED-ADDRESS with the false candidate, and will be sent to that false candidate. The attacker must then intercept it and relay it towards the originator. The other agent will then initiate a connectivity check towards that false candidate.In addition,This validation needs to succeed. This requires the attackermust wait for a Binding Request from the other agent, and generateto force afake response withfalse valid on aXOR-MAPPED-ADDRESS attribute containing thefalse candidate.Like the other attacks described here,Injecting of fake requests or responses to achieve thisattackgoal ismitigated byprevented using theSTUN messageintegrity mechanisms of STUN andsecurethe offer/answerexchanges. Forcingexchange. Thus, this attack can only be launched through replays. To do that, thefalse peer reflexive candidate result with packet replays is different. Theattackerwaits until one ofmust intercept theagents sends a check. It interceptscheck towards thisrequest,false candidate, andreplaysreplay it towards the otheragent with a faked source IP address. Itagent. Then, it mustalso preventintercept the response and replay that back as well. This attack is very hard to launch unless the attacker themself is identified by the fake candidate. This is because it requires the attacker to intercept and replay packets sent by two different hosts. If both agents are on different networks (for example, across the public Internet), this attack can be hard to coordinate, since it needs to occur against two different endpoints on different parts of the network at the same time. If the attacker themself is identified by the fake candidate the attack is easier to coordinate. However, if SRTP is used [21], the attacker will not be able to play the media packets, they will only be able to discard them, effectively disabling theoriginal request from reachingmedia stream for theremote agent, either by launching a DoScall. However, this attackto causerequires thepacketagent tobe dropped, or forcing itdisrupt packets in order tobe dropped using layer 2 mechanisms. The replayed packet is received at the other agent, and accepted, sinceblock theintegrity check passes (the integrityconnectivity checkcannot and does not coverfrom reaching thesource IP address and port). Ittarget. In that case, if the goal isthen responded to. This response will contain a XOR- MAPPED-ADDRESS withto disrupt thefalse candidate, and will be sentmedia stream, its much easier tothat false candidate. The attacker must then intercept it and relayjust disrupt ittowardswith theoriginator. The other agent will then initiatesame mechanism, rather than attack ICE. 16.2. Attacks on Address Gathering ICE endpoints make use of STUN for gathering candidates rom aconnectivity check towards that false candidate.STUN server in the network. Thisvalidation needsis corresponds tosucceed. This requiresthe Binding Discovery usage of STUN described in [11]. As a consequence, the attacks against STUN itself that are described in that specification can still be used against the binding discovery usage when utilized with ICE. However, the additional mechanisms provided by ICE actually counteract such attacks, making binding discovery with STUN more secure when combined with ICE than without ICE. Consider an attacker which is able toforceprovide an agent with afalse valid onfaked mapped address in afalse candidate. Injecting of fake requests or responses to achieve this goalSTUN Binding Request that is used for address gathering. This isprevented usingtheintegrity mechanisms of STUN andprimary attack primitive described in [11]. This address will be used as a server reflexive candidate in theoffer/answerICE exchange.Thus,For thisattack can onlycandidate to actually belaunched through replays. To do that,used for media, the attacker mustintercept the check towards this false candidate, and replay it towards the other agent. Then, it must interceptalso attack theresponseconnectivity checks, andreplay that back as well.in particular, force a false valid on a false candidate. This attack is very hard to launchunlessif theattacker themselffalse address identifies a third party, and isidentifiedprevented bythe fake candidate. This is becauseSRTP if itrequiresidentifies the attackerto intercept and replay packets sent by two different hosts.themself. Ifboth agents are on different networks (for example, acrossthepublic Internet), this attack can be hard to coordinate, since it needsattacker elects not tooccur against two different endpoints on different parts of the network atattack thesame time. Ifconnectivity checks, theattacker themselfworst it can do isidentified byprevent thefakeserver reflexive candidatethe attack is easier to coordinate.from being used. However, ifSRTPthe peer agent has at least one candidate that isused [21],reachable by theattacker will not be able to playagent under attack, themedia packets, theySTUN connectivity checks themselves willonlyprovide a peer reflexive candidate that can beable to discard them, effectively disabling the media streamused for thecall. However, thisexchange of media. Peer reflexive candidates are generally preferred over server reflexive candidates. As such, an attackrequires the agent to disrupt packets in order to blocksolely on theconnectivity check from reachingSTUN address gathering will normally have no impact on a session at all. 16.3. Attacks on thetarget. InOffer/Answer Exchanges An attacker thatcase, if the goal is tocan modify or disrupt themedia stream, its much easier to just disrupt itoffer/answer exchanges themselves can readily launch a variety of attacks withthe same mechanism, rather than attackICE.15.2. Attacks on Address Gathering ICE endpoints make useThey could direct media to a target ofSTUN for gathering candidates romaSTUN server inDoS attack, they could insert themselves into thenetwork. This is correspondsmedia stream, and so on. These are similar to theBinding Discovery usage of STUN described in [11]. As a consequence,general security considerations for offer/answer exchanges, and theattacks against STUN itself that are describedsecurity considerations inthat specification can still be used againstRFC 3264 [4] apply. These require techniques for message integrity and encryption for offers and answers, which are satisfied by thebinding discovery usageSIPS mechanism [3] whenutilized with ICE. However,SIP is used. As such, theadditional mechanisms provided by ICE actually counteract such attacks, making binding discovery with STUN more secure when combinedusage of SIPS with ICEthan without ICE. Consider an attacker whichisableRECOMMENDED. 16.4. Insider Attacks In addition toprovide an agent with a faked mapped address in a STUN Binding Request that is used for address gathering. Thisattacks where the attacker is a third party trying to insert fake offers, answers or stun messages, there are several attacks possible with ICE when theprimary attack primitive described in [11]. This address will be used as a server reflexive candidateattacker is an authenticated and valid participant in the ICE exchange.For16.4.1. The Voice Hammer Attack The voice hammer attack is an amplification attack. In thiscandidate to actually be used for media,attack, the attackermust also attackinitiates sessions to other agents, and includes theconnectivity checks,IP address and port of a DoS target inparticular, forcethe m/c-line of their SDP. This causes substantial amplification; afalse valid onsingle offer/answer exchange can create afalse candidate.continuing flood of media packets, possibly at high rates (consider video sources). This attack isvery hardnot specific tolaunchICE, but ICE can help provide remediation. Specifically, if ICE is used, thefalse address identifiesagent receiving the malicious SDP will first peform connectivity checks to the target of media before sending it there. If this target is a thirdparty,party host, the checks will not succeed, and media isprevented by SRTPnever sent. Unfortunately, ICE doesn't help ifit identifies theits not used, in which case an attackerthemself. Ifcould simply send theattacker elects not to attackoffer without theconnectivity checks,ICE parameters. However, in environments where theworst it can do is preventset of clients are known, and limited to ones that support ICE, the serverreflexive candidate from being used. However, if the peer agent has at least one candidatecan reject any offers or answers that don't indicate ICE support. 16.4.2. STUN Amplification Attack The STUN amplification attack isreachable bysimilar to theagent under attack,voice hammer. However, instead of voice packets being directed to the target, STUN connectivity checksthemselves will provide a peer reflexive candidate that can be used for the exchange of media. Peer reflexive candidatesaregenerally preferred over server reflexive candidates. As such, andirected to the target. This attacksolely onis accomplished by having theSTUN address gathering will normally have no impact onofferer send an offer with asession at all. 15.3. Attacks onlarge number of candidates, say 50. The answerer receives theOffer/Answer Exchanges An attacker that can modify or disruptoffer, and starts its checks, which are directed at theoffer/answer exchanges themselves can readily launchtarget, and consequently, never generate avariety of attacks with ICE. They could direct media toresponse. The answerer will start atargetnew connectivity check every 50ms, and each check is a STUN transaction consisting of 9 retransmits of aDoS attack, they could insert themselves into the media stream, and so on. These are similar tomessage 65 bytes in length (plus 28 bytes for thegeneral security considerationsIP/UDP header) that runs foroffer/answer exchanges, and7.9 seconds, for a total of 105 bytes/ second per transaction on average. In thesecurity considerationsworst case, there can be 158 transactions inRFC 3264 [4] apply. These require techniquesprogress at once (7.9 seconds divided by 50ms), formessage integrity and encryptiona total of 132 kbps, just foroffers and answers, which are satisfied by the SIPS mechanism [3] when SIPSTUN requests. It isused. As such,impossible to eliminate the amplification, but the volume can be reduced through a variety of heuristics. For example, agents can limit theusagenumber ofSIPS with ICE is RECOMMENDED. 15.4. Insider Attacks In addition to attacks wherecandidates they'll accept in an offer or answer, they can increase theattacker is a third party trying to insert fake offers, answersvalue of Ta, orstun messages, there are several attacks possible with ICE whenexponentially increase Ta as time goes on. All of these ultimately trade off theattacker is an authenticated and valid participant intime for the ICEexchange. 15.4.1. The Voice Hammer Attack The voice hammer attack is an amplification attack. In this attack, the attacker initiates sessionsexchanges toother agents, and includescomplete, with theIP address and portamount of traffic that gets sent. OPEN ISSUE: Need better remediation for this. 17. Definition of Connectivity Check Usage STUN [11] requires that new usages provide aDoS target in the m/c-linespecific set of information as part of theirSDP.formal definition. Thiscauses substantial amplification;section meets the requirements spelled out there. 17.1. Applicability This STUN usage provides asingleconnectivity check between two peers participating in an offer/answerexchange can createexchange. This check serves to validate acontinuing floodpair ofmedia packets, possibly at high rates (consider video sources). This attack is not specificcandidates for usage of exchange of media. Connectivity checks also allow agents toICE, but ICE can help provide remediation. Specifically, if ICEdiscover reflexive candidates towards their peers, called peer reflexive candidates. Finally, connectivity checks serve to keep NAT bindings alive. It isused,fundamental to this STUN usage that theagent receivingaddresses and ports used for media are themalicious SDPsame ones used for the Binding Requests and responses. Consequently, it willfirst peform connectivity checksbe necessary to demultiplex STUN traffic from whatever thetarget ofmediabefore sending it there. If this targettraffic is. This demultiplexing isa third party host,done using thechecks will not succeed, and media is never sent. Unfortunately, ICE doesn't help if its not used,techniques described inwhich case an attacker could simply send the offer without[11]. 17.2. Client Discovery of Server The client does not follow theICE parameters. However,DNS-based procedures defined inenvironments where[11]. Rather, thesetremote candidate ofclients are known, and limited to ones that support ICE,theserver can reject any offers or answers that don't indicate ICE support. 15.4.2. STUN Amplification Attack The STUN amplification attack is similarcheck to be performed is used as thevoice hammer. However, insteadtransport address ofvoice packets being directed tothetarget,STUNconnectivity checks are directed toserver. Note that thetarget. This attackSTUN server isaccomplished by having the offerer send an offer withalarge number of candidates, say 50. The answerer receives the offer, and starts its checks, which are directed at the target,logical entity, andconsequently, never generateis not aresponse.physically distinct server in this usage. 17.3. Server Determination of Usage Theanswererserver is aware of this usage because it signaled this port through the offer/answer exchange. Any STUN packets received on this port willstart a newbe for the connectivity checkevery 50ms, and each check is a STUN transaction consisting of 9 retransmits of ausage. 17.4. New Requests or Indications This usage does not define any new message65 bytes in length (plus 28 bytes fortypes. 17.5. New Attributes This usage defines two new attributes, PRIORITY and USE-CANDIDATE. The PRIORITY attribute indicates theIP/UDP header)priority thatruns for 7.9 seconds, foris to be associated with atotal of 105 bytes/ second per transaction on average. In the worst case, there canpeer reflexive candidate, should one be158 transactions in progress at once (7.9 seconds divideddiscovered by50ms), for a total of 132 kbps, just for STUN requests.this check. It isimpossible to eliminate the amplification, but the volume can be reduced throughavariety32 bit unsigned integer, and has an attribute type ofheuristics. For example, agents can limit0x0024. The USE-CANDIDATE attribute indicates that thenumbercandidate pair resulting from this check should be used for transmission ofcandidates they'll accept in an offer or answer, they can increase the valuemedia. The attribute has no content (the Length field ofTa, or exponentially increase Tathe attribute is zero); it serves astime goes on. Alla flag. It has an attribute type ofthese ultimately trade off the time0x0025. 17.6. New Error Response Codes This usage does not define any new error response codes. 17.7. Client Procedures Client procedures are defined in Section 8.1. 17.8. Server Procedures Server procedures are defined in Section 8.2. 17.9. Security Considerations forthe ICE exchanges to complete, with the amount of traffic that gets sent. OPEN ISSUE: Need better remediationConnectivity Check Security considerations forthis. Especially an issue if we reduce Ta to be as fast as media packets themselves, in which case this attack is as equally devastating asthevoice hammer.connectivity check are discussed in Section 16. 18. IANA Considerations This specification registers new SDP attributes and new STUN attributes. 18.1. SDP Attributes This specification definesfourfive new SDP attributes per the procedures of Section 8.2.4 of [10]. The required information for the registrations are included here.16.1.18.1.1. candidate Attribute Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. Attribute Name: candidate Long Form: candidate Type of Attribute: media level Charset Considerations: The attribute is not subject to the charset attribute. Purpose: This attribute is used with Interactive Connectivity Establishment (ICE), and provides one of many possible candidate addresses for communication. These addresses are validated with an end-to-end connectivity check using Simple Traversal Underneath NAT (STUN). Appropriate Values: See Section1314 of RFC XXXX [Note to RFC-ed: please replace XXXX with the RFC number of this specification].16.2.18.1.2. remote-candidates Attribute Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. Attribute Name: remote-candidates Long Form: remote-candidates Type of Attribute: media level Charset Considerations: The attribute is not subject to the charset attribute. Purpose: This attribute is used with Interactive Connectivity Establishment (ICE), and provides the identity of the remote candidates that the offerer wishes the answerer to use in its answer. Appropriate Values: See Section1314 of RFC XXXX [Note to RFC-ed: please replace XXXX with the RFC number of this specification].16.3.18.1.3. ice-passive Attribute Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. Attribute Name: ice-passive Long Form: ice-passive Type of Attribute: session level Charset Considerations: The attribute is not subject to the charset attribute. Purpose: This attribute is used with Interactive Connectivity Establishment (ICE), and indicates that an agent can only operate in ICE's passive mode. Appropriate Values: See Section 14 of RFC XXXX [Note to RFC-ed: please replace XXXX with the RFC number of this specification]. 18.1.4. ice-pwd Attribute Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. Attribute Name: ice-pwd Long Form: ice-pwd Type of Attribute: session or media level Charset Considerations: The attribute is not subject to the charset attribute. Purpose: This attribute is used with Interactive Connectivity Establishment (ICE), and provides the password used to protect STUN connectivity checks. Appropriate Values: See Section1314 of RFC XXXX [Note to RFC-ed: please replace XXXX with the RFC number of this specification].16.4.18.1.5. ice-ufrag Attribute Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. Attribute Name: ice-ufrag Long Form: ice-ufrag Type of Attribute: session or media level Charset Considerations: The attribute is not subject to the charset attribute. Purpose: This attribute is used with Interactive Connectivity Establishment (ICE), and provides the fragments used to construct the username in STUN connectivity checks. Appropriate Values: See Section1314 of RFC XXXX [Note to RFC-ed: please replace XXXX with the RFC number of this specification].17.18.2. STUN Attributes This section registers two new STUN attributes per the procedures in [11]. 0x0024 PRIORITY 0x0025 USE-CANDIDATE 19. IAB Considerations The IAB has studied the problem of "Unilateral Self Address Fixing", which is the general process by which a agent attempts to determine its address in another realm on the other side of a NAT through a collaborative protocol reflection mechanism [19]. ICE is an example of a protocol that performs this type of function. Interestingly, the process for ICE is not unilateral, but bilateral, and the difference has a signficant impact on the issues raised by IAB. Indeed, ICE can be considered a B-SAF (Bilateral Self-Address Fixing) protocol, rather than an UNSAF protocol. Regardless, the IAB has mandated that any protocols developed for this purpose document a specific set of considerations. This section meets those requirements.17.1.19.1. Problem Definition From RFC 3424 any UNSAF proposal must provide: Precise definition of a specific, limited-scope problem that is to be solved with the UNSAF proposal. A short term fix should not be generalized to solve other problems; this is why "short term fixes usually aren't". The specific problems being solved by ICE are: Provide a means for two peers to determine the set of transport addresses which can be used for communication. Provide a means for resolving many of the limitations of other UNSAF mechanisms by wrapping them in an additional layer of processing (the ICE methodology). Provide a means for a agent to determine an address that is reachable by another peer with which it wishes to communicate.17.2.19.2. Exit Strategy From RFC 3424, any UNSAF proposal must provide: Description of an exit strategy/transition plan. The better short term fixes are the ones that will naturally see less and less use as the appropriate technology is deployed. ICE itself doesn't easily get phased out. However, it is useful even in a globally connected Internet, to serve as a means for detecting whether a router failure has temporarily disrupted connectivity, for example. ICE also helps prevent certain security attacks which have nothing to do with NAT. However, what ICE does is help phase out other UNSAF mechanisms. ICE effectively selects amongst those mechanisms, prioritizing ones that are better, and deprioritizing ones that are worse. Local IPv6 addresses can be preferred. As NATs begin to dissipate as IPv6 is introduced, server reflexive and relayed candidates (both forms of UNSAF mechanisms) simply never get used, because higher priority connectivity exists to the native host candidates. Therefore, the servers get used less and less, and can eventually be remove when their usage goes to zero. Indeed, ICE can assist in the transition from IPv4 to IPv6. It can be used to determine whether to use IPv6 or IPv4 when two dual-stack hosts communicate with SIP (IPv6 gets used). It can also allow a network with both 6to4 and native v6 connectivity to determine which address to use when communicating with a peer.17.3.19.3. Brittleness Introduced by ICE From RFC3424, any UNSAF proposal must provide: Discussion of specific issues that may render systems more "brittle". For example, approaches that involve using data at multiple network layers create more dependencies, increase debugging challenges, and make it harder to transition. ICE actually removes brittleness from existing UNSAF mechanisms. In particular, traditional STUN (as described in RFC 3489 [13]) has several points of brittleness. One of them is the discovery process which requires a agent to try and classify the type of NAT it is behind. This process is error-prone. With ICE, that discovery process is simply not used. Rather than unilaterally assessing the validity of the address, its validity is dynamically determined by measuring connectivity to a peer. The process of determining connectivity is very robust. Another point of brittleness in traditional STUN and any other unilateral mechanism is its absolute reliance on an additional server. ICE makes use of a server for allocating unilateral addresses, but allows agents to directly connect if possible. Therefore, in some cases, the failure of a STUN server would still allow for a call to progress when ICE is used. Another point of brittleness in traditional STUN is that it assumes that the STUN server is on the public Internet. Interestingly, with ICE, that is not necessary. There can be a multitude of STUN servers in a variety of address realms. ICE will discover the one that has provided a usable address. The most troubling point of brittleness in traditional STUN is that it doesn't work in all network topologies. In cases where there is a shared NAT between each agent and the STUN server, traditional STUN may not work. With ICE, that restriction is removed. Traditional STUN also introduces some security considerations. Fortunately, those security considerations are also mitigated by ICE. Consequently, ICE serves to repair the brittleness introduced in other UNSAF mechanisms, and does not introduce any additional brittleness into the system.17.4.19.4. Requirements for a Long Term Solution From RFC 3424, any UNSAF proposal must provide: Identify requirements for longer term, sound technical solutions -- contribute to the process of finding the right longer term solution. Our conclusions from STUN remain unchanged. However, we feel ICE actually helps because we believe it can be part of the long term solution.17.5.19.5. Issues with Existing NAPT Boxes From RFC 3424, any UNSAF proposal must provide: Discussion of the impact of the noted practical issues with existing, deployed NA[P]Ts and experience reports. A number of NAT boxes are now being deployed into the market which try and provide "generic" ALG functionality. These generic ALGs hunt for IP addresses, either in text or binary form within a packet, and rewrite them if they match a binding. This interferes with traditional STUN. However, the update to STUN [11] uses an encoding which hides these binary addresses from generic ALGs. Since [11] is required for all ICE implementations, this NAPT problem does not impact ICE. Existing NAPT boxes have non-deterministic and typically short expiration times for UDP-based bindings. This requires implementations to send periodic keepalives to maintain those bindings. ICE uses a default of 15s, which is a very conservative estimate. Eventually, over time, as NAT boxes become compliant to behave [30], this minimum keepalive will become deterministic and well-known, and the ICE timers can be adjusted. Having a way to discover and control the minimum keepalive interval would be far better still.18.20. Acknowledgements The authors would like to thank Flemming Andreasen, Rohan Mahy, Dean Willis, Eric Cooper, Dan Wing, Douglas Otis, Tim Moore, and Francois Audet for their comments and input. A special thanks goes to Bill May, who suggested several of the concepts in this specification, Philip Matthews, who suggested many of the key performance optimizations in this specification, Eric Rescorla, who drafted the text in theintroduction,introduction, and Magnus Westerlund, for doing several detailed reviews on the various revisions of this specification. 21. References 21.1. Normative References [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [2] Huitema, C., "Real Time Control Protocol (RTCP) attribute in Session Description Protocol (SDP)", RFC 3605, October 2003. [3] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [4] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model with Session Description Protocol (SDP)", RFC 3264, June 2002. [5] Casner, S., "Session Description Protocol (SDP) Bandwidth Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 3556, July 2003. [6] Camarillo, G., Marshall, W., and J. Rosenberg, "Integration of Resource Management and Session Initiation Protocol (SIP)", RFC 3312, October 2002. [7] Camarillo, G. and P. Kyzivat, "Update to the Session Initiation Protocol (SIP) Preconditions Framework", RFC 4032, March 2005. [8] Crocker, D. andMagnus Westerlund,P. Overell, "Augmented BNF fordoing several detailed reviews on the various revisionsSyntax Specifications: ABNF", RFC 4234, October 2005. [9] Rosenberg, J. and H. Schulzrinne, "Reliability ofthis specification. 19. References 19.1. Normative References [1] Bradner, S., "Key words for useProvisional Responses inRFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [2] Huitema, C., "Real Time ControlSession Initiation Protocol(RTCP) attribute in(SIP)", RFC 3262, June 2002. [10] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session DescriptionProtocol (SDP)",Protocol", RFC3605,4566, July 2006. [11] Rosenberg, J., "Simple Traversal Underneath Network Address Translators (NAT) (STUN)", draft-ietf-behave-rfc3489bis-04 (work in progress), July 2006. [12] Rosenberg, J., "Obtaining Relay Addresses from Simple Traversal Underneath NAT (STUN)", draft-ietf-behave-turn-02 (work in progress), October 2006. 21.2. Informative References [13] Rosenberg, J., Weinberger, J., Huitema, C., and R. Mahy, "STUN - Simple Traversal of User Datagram Protocol (UDP) Through Network Address Translators (NATs)", RFC 3489, March 2003.[3][14] Senie, D., "Network Address Translator (NAT)-Friendly Application Design Guidelines", RFC 3235, January 2002. [15] Srisuresh, P., Kuthan, J., Rosenberg, J.,Schulzrinne, H., Camarillo, G., Johnston,Molitor, A., and A. Rayhan, "Middlebox communication architecture and framework", RFC 3303, August 2002. [16] Rosenberg, J., Peterson, J.,Sparks, R., Handley, M.,Schulzrinne, H., andE. Schooler, "SIP:G. Camarillo, "Best Current Practices for Third Party Call Control (3pcc) in the Session InitiationProtocol",Protocol (SIP)", BCP 85, RFC3261, June 2002. [4] Rosenberg, J.3725, April 2004. [17] Borella, M., Lo, J., Grabelsky, D., and G. Montenegro, "Realm Specific IP: Framework", RFC 3102, October 2001. [18] Borella, M., Grabelsky, D., Lo, J., andH. Schulzrinne, "An Offer/Answer Model with Session DescriptionK. Taniguchi, "Realm Specific IP: Protocol(SDP)",Specification", RFC3264, June3103, October 2001. [19] Daigle, L. and IAB, "IAB Considerations for UNilateral Self- Address Fixing (UNSAF) Across Network Address Translation", RFC 3424, November 2002.[5][20] Schulzrinne, H., Casner, S.,"Session DescriptionFrederick, R., and V. Jacobson, "RTP: A Transport Protocol(SDP) Bandwidth ModifiersforRTP Control Protocol (RTCP) Bandwidth",Real-Time Applications", RFC3556,3550, July 2003.[6] Camarillo, G., Marshall, W., and J. Rosenberg, "Integration of Resource Management and Session Initiation Protocol (SIP)", RFC 3312, October 2002. [7] Camarillo, G.[21] Baugher, M., McGrew, D., Naslund, M., Carrara, E., andP. Kyzivat, "Update to the Session InitiationK. Norrman, "The Secure Real-time Transport Protocol(SIP) Preconditions Framework",(SRTP)", RFC4032,3711, March2005. [8] Crocker, D.2004. [22] Carpenter, B. andP. Overell, "Augmented BNFK. Moore, "Connection of IPv6 Domains via IPv4 Clouds", RFC 3056, February 2001. [23] Zopf, R., "Real-time Transport Protocol (RTP) Payload forSyntax Specifications: ABNF",Comfort Noise (CN)", RFC4234, October 2005. [9] Rosenberg, J.3389, September 2002. [24] Camarillo, G. and H. Schulzrinne,"Reliability of Provisional Responses"Early Media and Ringing Tone Generation in the Session Initiation Protocol (SIP)", RFC3262, June 2002. [10] Handley,3960, December 2004. [25] Blake, S., Black, D., Carlson, M.,Jacobson, V.,Davies, E., Wang, Z., andC. Perkins, "SDP:W. Weiss, "An Architecture for Differentiated Services", RFC 2475, December 1998. [26] Andreasen, F., "Connectivity Preconditions for Session DescriptionProtocol", RFC 4566, July 2006. [11] Rosenberg, J., "Simple Traversal Underneath Network Address Translators (NAT) (STUN)", draft-ietf-behave-rfc3489bis-04 (work in progress), July 2006. [12] Rosenberg, J., "Obtaining Relay Addresses from Simple Traversal of UDP Through NAT (STUN)", draft-ietf-behave-turn-01Protocol Media Streams", draft-ietf-mmusic-connectivity-precon-02 (work in progress), June 2006.19.2. Informative References [13] Rosenberg, J., Weinberger, J., Huitema, C.,[27] Andreasen, F., "A No-Op Payload Format for RTP", draft-ietf-avt-rtp-no-op-00 (work in progress), May 2005. [28] Kohler, E., Handley, M., andR. Mahy, "STUN - Simple Traversal of User DatagramS. Floyd, "Datagram Congestion Control Protocol(UDP) Through Network Address Translators (NATs)",(DCCP)", RFC3489,4340, March2003. [14] Senie, D., "Network Address Translator (NAT)-Friendly Application Design Guidelines", RFC 3235, January 2002. [15] Srisuresh, P., Kuthan, J., Rosenberg, J., Molitor, A., and A. Rayhan, "Middlebox communication architecture2006. [29] Hellstrom, G. andframework",P. Jones, "RTP Payload for Text Conversation", RFC3303, August 2002. [16] Rosenberg, J., Peterson, J., Schulzrinne, H.,4103, June 2005. [30] Audet, F. andG. Camarillo, "Best Current PracticesC. Jennings, "NAT Behavioral Requirements forThird Party Call Control (3pcc)Unicast UDP", draft-ietf-behave-nat-udp-08 (work in progress), October 2006. [31] Jennings, C. and R. Mahy, "Managing Client Initiated Connections in the Session Initiation Protocol (SIP)",BCP 85, RFC 3725, April 2004. [17] Borella, M., Lo, J., Grabelsky, D.,draft-ietf-sip-outbound-04 (work in progress), June 2006. Appendix A. Passive-Only ICE ICE allows for two modes of operation in an agent - passive-only andG. Montenegro, "Realm Specific IP: Framework", RFC 3102, October 2001. [18] Borella, M., Grabelsky, D., Lo, J.,full. Passive-only mode is applicable to entities like PSTN gateways, media servers and conferencing servers that are always publicly connected and are not behind a firewall or NAT. This leads to an important question - why would such an endpoint even bother with ICE? If it has a public IP address, what additional value do the ICE procedures bring? There are many, actually. First, doing so greatly facilitates NAT traversal for clients that connect to it. Consider a PC softphone behind a NAT whose mapping policy is address andK. Taniguchi, "Realm Specific IP: Protocol Specification", RFC 3103, October 2001. [19] Daigle, L.port dependent. The softphone initiates a call through a gateway that implements ICE. The gateway doesn't obtain any server reflexive or relayed candidates, but it implements ICE, andIAB, "IAB Considerationsconsequently, is prepared to receive STUN connectivity checks on its host candidates. The softphone will send a STUN connectivity check to the gateway, which passes through the intervending NAT. This causes the NAT to allocate a new binding forUNilateral Self- Address Fixing (UNSAF) Across Network Address Translation", RFC 3424, November 2002. [20] Schulzrinne, H., Casner, S., Frederick, R.,the softphone. The connectivity is received by the gateway, andV. Jacobson, "RTP:will cause it gateway to send a check back to the softphone, at this newly created candidate. ATransport Protocol for Real-Time Applications", RFC 3550, July 2003. [21] Baugher, M., McGrew, D., Naslund, M., Carrara, E.,successful response confirms that this candidate is usable, andK. Norrman, "The Secure Real-time Transport Protocol (SRTP)", RFC 3711, March 2004. [22] Carpenter, B.the gateway can send media immediately to the softphone. This allows direct media transmission between the gateway andK. Moore, "Connectionsoftphone, without the need for relays, even though the softphone was behind a 'bad' NAT. Second, implementation ofIPv6 Domains via IPv4 Clouds", RFC 3056, February 2001. [23] Zopf, R., "Real-time Transport Protocol (RTP) Payloadthe STUN connectivity checks allows for NAT bindings along the way to be kept open. Keeping these bindings open is essential forComfort Noise (CN)", RFC 3389, September 2002. [24] Rosenberg, J., "The Session Initiation Protocol (SIP) UPDATE Method", RFC 3311, October 2002. [25] Camarillo, G. and H. Schulzrinne, "Early Mediacontinued communications between the gateway andRinging Tone Generationsoftphone. Third, ICE prevents a fairly destructive attack in multimedia systems, called theSession Initiation Protocol (SIP)", RFC 3960, December 2004. [26] Andreasen, F., "Connectivity Preconditions for Session Description Protocol Media Streams", draft-ietf-mmusic-connectivity-precon-02 (workvoice hammer. The STUN connectivity check used by an ICE endpoint allows it to be certain that the target of media packets is, inprogress), June 2006. [27] Andreasen, F., "A No-Op Payload Formatfact, the same entity that requested the packets through the offer/answer exchange. See Section 16 forRTP", draft-ietf-avt-rtp-no-op-00 (worka more complete discussion on this attack. Because of the benefits of implementing ICE inprogress), May 2005. [28] Kohler, E., Handley, M., and S. Floyd, "Datagram Congestion Control Protocol (DCCP)", RFC 4340, March 2006. [29] Hellstrom, G. and P. Jones, "RTP Payload for Text Conversation", RFC 4103, June 2005. [30] Audet, F. and C. Jennings, "NAT Behavioral Requirementsendpoints that don't themselves require NAT traversal, ICE reduces the cost of implementation by allowing them to run in passive-only mode. The rules forUnicast UDP", draft-ietf-behave-nat-udp-07 (workpassive-only endpoints are described throughout the specification. What follows is an informative summary to give implementors a good sense of what is required: o A passive-only agent obtains candidates just from its host interfaces, just like it would do without ICE. It doesn't need to implement the STUN Binding Discovery usage [11] or the relay usage [12] to gather server reflexive or relayed candidates. It needs to assign its candidates a foundation ID; however it can use the IP address itself as the foundation ID. o The prioritization inprogress), June 2006. [31] Jennings, C.Section 5.2 is trivially accomplished for passive-only agents utilizing RTP. The type preference is set to 126 andR. Mahy, "Managing Client Initiated Connections intheSession Initiation Protocol (SIP)", draft-ietf-sip-outbound-04 (worklocal preference to 65535, resulting inprogress), June 2006. Appendix A. Design Motivations ICE containsanumberpriority ofnormative behaviors which may themselves be simple, but derive from complicated or non-obvious thinking or2130706431 for RTP and 2130706430 for RTCP. o In usecases which merit further discussion. Since these design motivationscandidates Section 5.3 arenot neccesary to understand for purposes of implementation,trivially selected - they arediscussed here in an appendixequal to thespecification. This section is non-normative. A.1. Applicabilityhost candidates. o A passive-only agent will need toGateways and Servers Section 4.1 discusses procedures for gathering candidates, including host, server reflexiveselect a username andrelayed. In that section, recommendations are givenpassword forwheneach session. An SDP offer (and answer) constructed by an RTP-based audio-only agentshould obtain each of these three types. In particular, for agents embeddedwill contain two a=candidate lines, which mirror the RTP and RTCP transport addresses inPSTN gateways, media servers, conferencing servers,the m/c-line. Each a=candidate line contains the priority andso on, ICE specifiesfoundation computed above, and indicates thatan agent can stick with justit is a hostcandidates, sincecandidate Section 5.4. o A passive-only agent doesn't need to construct check lists or maintain the states of ICE processing Section 6.7. It only needs to maintain the valid list, which are the list of checks it hasa public IP address. This leads to an important question - why would suchcompleted. Once it places its candidate lines into anendpoint even bother with ICE? Ifoffer or answer, ithas a public IP address, what additional value dowaits for theICE procedures bring? Therereceipt of checks. o A passive-only agent doesn't generate periodic checks. It only generates triggered checks, which aremany, actually. First, doing so greatly facilitates NAT traversal for clientschecks thatconnect to it. Consider a PC softphone behind a NAT whose mapping policy is address and port dependent. The softphone initiatesare created as acall throughconsequence of receiving agateway that implements ICE. The gateway doesn't obtain any server reflexive or relayed candidates, but it implements ICE, and consequently, is preparedcheck. A passive-only agent does need to be able to respond toreceive STUN connectivity checks on its host candidates. The softphone will senda STUNconnectivitychecktoit receives. o A passive-only agent does not add thegateway, which passes throughPRIORITY or USE-CANDIDATE attributes to its STUN requests. Its STUN requests only contain theintervending NAT. This causesUSERNAME and MESSAGE-INTEGRITY attributes, set based on theNAT to allocate a new binding forusername fragments and passwords exchanged in thesoftphone. The connectivityoffer and answer. o Handling of subsequent offer/answer exchanges isreceived bydone trivially - thegateway,passive-only agent includes its one andwill causeonly candidate for each component of each media stream in an a=candidate attribute and in the m/c-line, just like an initial offer or answer. o A passive-only agent never needs to compute or include the a=remote-candidates attribute in any offer itgatewaysends. It never needs tosendgenerate an updated offer as acheck back to the softphone, at this newly created candidate.consequence of ICE processing. o Asuccessful response confirms that this candidate is usable, and the gateway can send media immediately to the softphone. This allows directpassive-only agent sends mediatransmission between the gateway and softphone, without the needonce a selected candidate pair appears in its Valid list forrelays, even though the softphone was behindthat media stream. Appendix B. Design Motivations ICE contains a'bad' NAT. Second, implementationnumber ofthe STUN connectivity checks allows for NAT bindings along the way tonormative behaviors which may themselves bekept open. Keepingsimple, but derive from complicated or non-obvious thinking or use cases which merit further discussion. Since thesebindings open is essentialdesign motivations are not neccesary to understand forcontinued communications between the gateway and softphone. Third, ICE prevents a fairly destructive attackpurposes of implementation, they are discussed here inmultimedia systems, called the voice hammer. The STUN connectivity check used byanICE endpoint allows itappendix tobe certain that the target of media packets is, in fact, the same entity that requested the packets throughtheoffer/answer exchange. See Section 15 for a more complete discussion on this attack. A.2.specification. This section is non-normative. B.1. Pacing of STUN Transactions STUN transactions used to gather candidates and to verify connectivity are paced out at an approximate rate of one new transaction every Ta seconds, where Ta has a default of 50ms. Why are these transactions paced, and why was 50ms chosen as default? Sending of these STUN requests will often have the effect of creating bindings on NAT devices between the client and the STUN servers. Experience has shown that many NAT devices have upper limits on the rate at which they will create new bindings. Furthermore, transmission of these packets on the network makes use of bandwidth and needs to be rate limited by the agent. As a consequence, the pacing ensures that the NAT devices does not get overloaded and that traffic is kept at a reasonable rate. Another aspect of the STUN requests is their bandwidth usage. In ICE, each STUN request contains the STUN 20 byte header, in addition to the USERNAME, MESSAGE-INTEGRITY and PRIORITY attributes. The USERNAME attribute contains a 4-byte attribute overhead, plus the username value itself. This username is the concatenation of the two fragments, plus a colon. Each fragment is supposed to be at least 4 bytes long, making the total length of the USERNAME attribute (4*2 + 1 + 4) = 13 bytes. The MESSAGE-INTEGRITY attribute is 4 bytes of overhead plus 20 bytes value, for 24 bytes. The PRIORITY attribute is 4 bytes of overhead plus 4 bytes of value, for 8 bytes. Thus, the total length of the STUN Binding Request is (20 + 13 + 24 + 8) = 65 bytes, with 28 bytes of overhead for IP and UDP for a total of 93 bytes. The response contains the STUN 20 byte header, the XOR- MAPPED-ADDRESS, and MESSAGE-INTEGRITY attributes. XOR-MAPPED-ADDRESS has 4 bytes overhead plus an 8 byte value, for a total of 12 bytes. Thus, each STUN response is (20 + 12 + 24) = 56 bytes plus 28 bytes of UDP/IP overhead for a total of 84 bytes. Checks typically fall into one of two cases. If a check works, each transaction has a single request and a single response, for a total of 2 packets and 177 bytes over one RTT interval. Assuming a fairly agressive RTT of 70ms, this produces 20.23 kbps, but only briefly. If a check fails because the pair is invalid, there will be nine requests and no responses. This produces 837 bytes over 7.9s, for a total of 105.9 bps, but over a long period of time. OPEN ISSUE: The bandwidth computations are pretty complex because ICE is not a CBR stream, and its bandwidth utilization depends on how many transactions it ends up generating before it finishes. Need to work this model more. Given that these numbers are close to, if not greater than, the bandwidths utilized by many voice codecs, this seems a reasonable value to use. OPEN ISSUE: There is some debate about whether to reduce this pacing interval smaller, say 20ms, to speed up ICE, or perhaps make it equal to the bandwidth that would be utilized by the media streams themselves.A.3.B.2. Candidates with Multiple Bases Section4.15.1 talks about merging together candidates that are identical but have different bases. When can an agent have two candidates that have the same IP address and port, but different bases? Consider the topology of Figure 16: +----------+ | STUN Srvr| +----------+ | | ----- // \\ | | | B:net10 | | | \\ // ----- | | +----------+ | NAT | +----------+ | | ----- // \\ | A | |192.168/16 | | | \\ // ----- | | |192.168.1.1 ----- +----------+ // \\ +----------+ | | | | | | | Offerer |---------| C:net10 |---------| Answerer | | |10.0.1.1 | | 10.0.1.2 | | +----------+ \\ // +----------+ ----- Figure 16 In this case, the offerer is multi-homed. It has one interface, 10.0.1.1, on network C, which is a net 10 private network. The Answerer is on this same network. The offerer is also connected to network A, which is 192.168/16. The offerer has an interface of 192.168.1.1 on this network. There is a NAT on this network, natting into network B, which is another net10 private network, but not connected to network C. There is a STUN server on network B. The offerer obtains a host candidate on its interface on network C (10.0.1.1:2498) and a host candidate on its interface on network A (192.168.1.1:3344). It performs a STUN query to its configured STUN server from 192.168.1.1:3344. This query passes through the NAT, which happens to assign the binding 10.0.1.1:2498. The STUN server reflects this in the STUN Binding Response. Now, the offerer has obtained a server reflexive candidate with a transport address that is identical to a host candidate (10.0.1.1:2498). However, the server reflexive candidate has a base of 192.168.1.1:3344, and the host candidate has a base of 10.0.1.1:2498.A.4.B.3. Purpose of the Translation When a candidate is relayed, the SDP offer or answer contain both the relayed candidate and its translation. However, the translation is never used by ICE itself. Why is it present in the message? There are two motivations for its inclusion. The first is diagnostic. It is very useful to know the relationship between the different types of candidates. By including the translation, an agent can know which relayed candidate is associated with which reflexive candidate, which in turn is associated with a specific host candidate. When checks for one candidate succeed and not the others, this provides useful diagnostics on what is going on in the network. The second reason has to do with off-path Quality of Service (QoS) mechanisms. When ICE is used in environments such as PacketCable 2.0 [[TODO: need PC2.0 reference]], proxies will, in addition to performing normal SIP operations, inspect the SDP in SIP messages, and extract the IP address and port for media traffic. They can then interact, through policy servers, with access routers in the network, to establish guaranteed QoS for the media flows. This QoS is provided by classifying the RTP traffic based on 5-tuple, and then providing it a guaranteed rate, or marking its Diffserv codepoints appropriately. When a residential NAT is present, and a relayed candidate gets selected for media, this relayed candidate will be a transport address on an actual STUN relay. That address says nothing about the actual transport address in the access router that would be used to classify packets for QoS treatment. Rather, the translation of that relayed address is needed. By carrying the translation in the SDP, the proxy can use that transport address to request QoS from the access router.A.5.B.4. Importance of the STUN Username ICE requires the usage of message integrity with STUN using its short term credential functionality. The actual short term credential is formed by exchanging username fragments in the SDP offer/answer exchange. The need for this mechanism goes beyond just security; it is actual required for correct operation of ICE in the first place. Consider agents A, B, and C. A and B are within private enterprise 1, which is using 10.0.0.0/8. C is within private enterprise 2, which is also using 10.0.0.0/8. As it turns out, B and C both have IP address 10.0.1.1. A sends an offer to C. C, in its answer, provides A with its host candidates. In this case, those candidates are 10.0.1.1:8866 and 10.0.1.1:8877. As it turns out, B is in a session at that same time, and is also using 10.0.1.1:8866 and 10.0.1.1:8877 as host candidates. This means that B is prepared to accept STUN messages on those ports, just as C is. A will send a STUN request to 10.0.1.1:8866 and and another to 10.0.1.1:8877. However, these do not go to C as expected. Instead, they go to B! If B just replied to them, A would believe it has connectivity to C, when in fact it has connectivity to a completely different user, B. To fix this, the STUN short term credential mechanisms are used. The username fragments are sufficiently random that it is highly unlikely that B would be using the same values as A. Consequently, B would reject the STUN request since the credentials were invalid. In essence, the STUN username fragments provide a form of transient host identifiers, bound to a particular offer/answer session. An unfortunate consequence of the non-uniqueness of IP addresses is that, in the above example, B might not even be an ICE agent. It could be any host, and the port to which the STUN packet is directed could be any ephemeral port on that host. If there is an application listening on this socket for packets, and it is not prepared to handle malformed packets for whatever protocol is in use, the operation of that application could be affected. Fortunately, since the ports exchanged in SDP are ephemeral and usually drawn from the dynamic or registered range, the odds are good that the port is not used to run a server on host B, but rather is the agent side of some protocol. This decreases the probability of hitting a port in-use, due to the transient nature of port usage in this range. However, the possibility of a problem does exist, and network deployers should be prepared for it. Note that this is not a problem specific to ICE; stray packets can arrive at a port at any time for any type of protocol, especially ones on the public Internet. As such, this requirement is just restating a general design guideline for Internet applications - be prepared for unknown packets on any port.A.6.B.5. The Candidate Pair Sequence Number Formula The sequence number for a candidate pair has an odd form. It is:PAIR-SNpair priority =10000*MAX(O-SN,A-SN)2^32*MIN(O-P,A-P) +MIN(O-SN,A-SN)2*MAX(O-P,A-P) +O-IP/SZ(O-P>A-P:1?0) Why is this? When the candidate pairs are sorted based on this value, the resulting sorting has the MAX/MIN property. This means that the pairs are first sorted based onincreasingdecreasing value of the maximum of the two sequence numbers. For pairs that have the same value of the maximum sequence number, the minimum sequence number is used to sort amongst them. If the max and the min sequence numbers are the same, theIP address of theoffererscandidate servespriority is used asathe tiebreaker.breaker in the last part of the expression. The factor of10002*32 isused since there will always be fewer than a 1000 candidates, and thus the largest value a sequence number (and thus the minimum sequence number) can haveused since the priority of a single candidate is always less than1000.2*32, resulting in the pair priority being a "concatenation" of the two component priorities. This creates the desired sorting property.Recall that candidate sequence numbers are assigned such that, for a particular set of candidates of the same type, the RTP components have lower sequence numbers than the corresponding RTCP component. Also recall that, if an agent prefers host candidates to server reflexive to relayed, sequence numbers for host candidates are always lower than server reflexive which are always lower than relayed. Because of this, A.7.B.6. The Frozen State The Frozen state is used for two purposes. Firstly, it allows ICE to first perform checks for the first component of a media stream. Once a successful check has completed for the first component, the other components of the same type and local preference will get performed. Secondly, when there are multiple media streams, it allows ICE to first check candidates for a single media stream, and once a set of candidates has been found, candidates of that same type for other media streams can be checked first. This effectively 'caches' the results of a check for one media stream, and applies them to another. For example, if only the relayed candidates for audio (which were the last resort candidates) succeed, ICE will check the relayed candidates for video first.A.8.B.7. The remote-candidates attribute The a=remote-candidates attribute exists to eliminate a race condition between the updated offer and the response to the STUN Binding Request that moved a candidate into the Valid list. This race condition is shown in Figure 17. On receipt of message 4, agent A adds a candidate pair to the valid list. If there was only a single media stream with a single component, agent A could now send an updated offer. However, the check from agent B has not yet generated a response, and agent B receives the updated offer (message 7) before getting the response (message 10). Thus, it does not yet know that this particular pair is valid. To eliminate this condition, the actual candidates at B that were selected by the offerer (the remote candidates) are included in the offer itself. Note, however, that agent B will not send media until it has received this STUN response. Agent A Network Agent B |(1) Offer | | |------------------------------------------>| |(2) Answer | | |<------------------------------------------| |(3) STUN Req. | | |------------------------------------------>| |(4) STUN Res. | | |<------------------------------------------| |(5) STUN Req. | | |<------------------------------------------| |(6) STUN Res. | | |-------------------->| | | |Lost | |(7) Offer | | |------------------------------------------>| |(8) Answer | | |<------------------------------------------| |(9) STUN Req. | | |<------------------------------------------| |(10) STUN Res. | | |------------------------------------------>| Figure 17A.9.B.8. Why are Keepalives Needed? Once media begins flowing on a candidate pair, it is still necessary to keep the bindings alive at intermediate NATs for the duration of the session. Normally, the media stream packets themselves (e.g., RTP) meet this objective. However, several cases merit further discussion. Firstly, in some RTP usages, such as SIP, the media streams can be "put on hold". This is accomplished by using the SDP "sendonly" or "inactive" attributes, as defined in RFC 3264 [4]. RFC 3264 directs implementations to cease transmission of media in these cases. However, doing so may cause NAT bindings to timeout, and media won't be able to come off hold. Secondly, some RTP payload formats, such as the payload format for text conversation [29], may send packets so infrequently that the interval exceeds the NAT binding timeouts. Thirdly, if silence suppression is in use, long periods of silence may cause media transmission to cease sufficiently long for NAT bindings to time out. For these reasons, the media packets themselves cannot be relied upon. ICE defines a simple periodic keepalive that operates indpendently of media transmission. This makes its bandwidth requirements highly predictable, and thus amenable to QoS reservations.A.10.B.9. Why Prefer Peer Reflexive Candidates? Section4.25.2 describes procedures for computing the priority of candidate based on its type and local preferences. That section requires that the type preference for peer reflexive candidates always be lower than server reflexive. Why is that? The reason has to do with the security considerations in Section15.16. It is much easier for an attacker to cause an agent to use a false server reflexive candidate than it is for an attacker to cause an agent to use a false peer reflexive candidate. Consequently, attacks against the STUN binding discovery usage are thwarted by ICE by preferring the peer reflexive candidates.A.11.B.10. WhyCan't OfferersSendMedia When a Pair Validatesan Updated Offer? Section11.112.1 describes rules for sending media.The rules are asymmetric, and not the same for offerers and answerers. In particular, an answererBoth agents can send mediaright away to a candidate paironceit validates, even if it doesnt match the pairs in the m/c-line. THe offerer cannot - it must waitICE checks complete, without waiting for an updatedoffer/answer exchange. Whyoffer. Indeed, the only purpose of the updated offer isthat? This, in fact, relatestoa bigger"correct" the m/c-line so that it matches where media is being sent, based on ICE procedures. This begs the question - why is the updated offer/answer exchange needed at all? Indeed, in a pure offer/answer environment, it would not be. The offerer and answerer will agree on the candidates to use through ICE, and then can begin using them. As far as the agents themselves are concerned, the updated offer/answer provides no new information. However, in practice, numerous components along the signaling path look at the SDP information. These include entities performing off-path QoS reservations, NAT traversal components such as ALGs and Session Border Controllers (SBCs) and diagnostic tools that passively monitor the network. For these tools to continue to function without change, the core property of SDP - that them/c-linesm/c- lines represent the addresses used for media - must be retained. For this reason, an updated offer must be sent.To ensure that an updated offerer is sent, ICE purposefully prevents the offerer from sending media until that offer is sent. It furthermore restricts the answerer in how long it can send media until an updated offer is received. This provides protocol incentives for sending the updated offer. The updated offer also helps ensure that ICE did the right thing. In very unusual cases, the offerer and answerer might not agree on the candidates selected by ICE. This would be detected in the updated offer/answer exchange, allowing them to restart ICE procedures to fix the problem.Author's Address Jonathan Rosenberg Cisco Systems 600 Lanidex Plaza Parsippany, NJ 07054 US Phone: +1 973 952-5000 Email: jdrosen@cisco.com URI: http://www.jdrosen.net Intellectual Property Statement The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Disclaimer of Validity This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Copyright Statement Copyright (C) The Internet Society (2006). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society.