idnits 2.17.1 draft-petithuguenin-mmusic-ice-sip-sdp-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 6 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 25, 2013) is 4076 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 4091 (Obsoleted by RFC 5245) ** Obsolete normative reference: RFC 4092 (Obsoleted by RFC 5245) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5389 (Obsoleted by RFC 8489) Summary: 5 errors (**), 0 flaws (~~), 3 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 MMUSIC M. Petit-Huguenin 3 Internet-Draft Impedance Mismatch 4 Intended status: Standards Track A. Keranen 5 Expires: August 29, 2013 Ericsson 6 February 25, 2013 8 Using Interactive Connectivity Establishment (ICE) with 9 Session Description Protocol (SDP) offer/answer and 10 Session Initiation Protocol (SIP) 11 draft-petithuguenin-mmusic-ice-sip-sdp-01 13 Abstract 15 This document describes how Interactive Connectivity Establishment 16 (ICE) is used with Session Description Protocol (SDP) offer/answer 17 and Session Initiation Protocol (SIP). 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on August 29, 2013. 36 Copyright Notice 38 Copyright (c) 2013 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 This document may contain material from IETF Documents or IETF 52 Contributions published or made publicly available before November 53 10, 2008. The person(s) controlling the copyright in some of this 54 material may not have granted the IETF Trust the right to allow 55 modifications of such material outside the IETF Standards Process. 56 Without obtaining an adequate license from the person(s) controlling 57 the copyright in such materials, this document may not be modified 58 outside the IETF Standards Process, and derivative works of it may 59 not be created outside the IETF Standards Process, except to format 60 it for publication as an RFC or to translate it into languages other 61 than English. 63 Table of Contents 65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 66 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 67 3. Sending the Initial Offer . . . . . . . . . . . . . . . . . . 4 68 3.1. Choosing Default Candidates . . . . . . . . . . . . . . . 4 69 3.2. Encoding the SDP . . . . . . . . . . . . . . . . . . . . 5 70 4. Receiving the Initial Offer . . . . . . . . . . . . . . . . . 6 71 4.1. Choosing Default Candidates . . . . . . . . . . . . . . . 6 72 4.2. Verifying ICE Support . . . . . . . . . . . . . . . . . . 7 73 4.3. Determining Role . . . . . . . . . . . . . . . . . . . . 7 74 5. Receipt of the Initial Answer . . . . . . . . . . . . . . . . 7 75 5.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 8 76 6. Performing Connectivity Checks . . . . . . . . . . . . . . . 8 77 7. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . . 8 78 7.1. Procedures for Full Implementations . . . . . . . . . . . 8 79 7.1.1. Updating states . . . . . . . . . . . . . . . . . . . 8 80 7.2. Freeing Candidates . . . . . . . . . . . . . . . . . . . 9 81 7.2.1. Full Implementation Procedures . . . . . . . . . . . 9 82 8. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 83 8.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 9 84 8.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 11 85 8.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 12 86 8.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 12 87 8.5. "ice-options" Attribute . . . . . . . . . . . . . . . . . 13 88 9. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 13 89 9.1. Generating the Offer . . . . . . . . . . . . . . . . . . 13 90 9.1.1. Procedures for All Implementations . . . . . . . . . 13 91 9.1.2. Procedures for Full Implementations . . . . . . . . . 14 92 9.1.3. Procedures for Lite Implementations . . . . . . . . . 15 93 9.2. Receiving the Offer and Generating an Answer . . . . . . 16 94 9.2.1. Procedures for All Implementations . . . . . . . . . 16 95 9.2.2. Procedures for Full Implementations . . . . . . . . . 17 96 9.2.3. Procedures for Lite Implementations . . . . . . . . . 19 97 9.3. Updating the Check and Valid Lists . . . . . . . . . . . 20 98 9.3.1. Procedures for Full Implementations . . . . . . . . . 20 99 9.3.2. Procedures for Lite Implementations . . . . . . . . . 21 100 10. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 21 101 11. Media Handling . . . . . . . . . . . . . . . . . . . . . . . 21 102 11.1. Sending Media . . . . . . . . . . . . . . . . . . . . . 21 103 11.1.1. Procedures for All Implementations . . . . . . . . . 21 104 11.2. Receiving Media . . . . . . . . . . . . . . . . . . . . 22 105 12. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . 22 106 12.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 22 107 12.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . 23 108 12.1.2. Offer in Response . . . . . . . . . . . . . . . . . 24 109 12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 24 110 12.3. Interactions with Forking . . . . . . . . . . . . . . . 25 111 12.4. Interactions with Preconditions . . . . . . . . . . . . 25 112 12.5. Interactions with Third Party Call Control . . . . . . . 25 113 13. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 26 114 14. Setting Ta and RTO for RTP Media Streams . . . . . . . . . . 26 115 15. Security Considerations . . . . . . . . . . . . . . . . . . . 28 116 15.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . 28 117 15.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . 28 118 15.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . 28 119 15.2.2. Interactions with Application Layer Gateways and SIP 29 120 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 121 16.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 30 122 16.1.1. candidate Attribute . . . . . . . . . . . . . . . . 30 123 16.1.2. remote-candidates Attribute . . . . . . . . . . . . 30 124 16.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 31 125 16.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 31 126 16.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . 32 127 16.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . 32 128 16.1.7. ice-options Attribute . . . . . . . . . . . . . . . 33 129 16.2. Interactive Connectivity Establishment (ICE) Options 130 Registry . . . . . . . . . . . . . . . . . . . . . . . . 33 131 17. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 34 132 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 34 133 18.1. Normative References . . . . . . . . . . . . . . . . . . 34 134 18.2. Informative References . . . . . . . . . . . . . . . . . 35 135 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 36 136 Appendix B. The remote-candidates Attribute . . . . . . . . . . 37 137 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 38 138 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 39 139 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 40 141 1. Introduction 143 [NOTE: this version of the document shows merely which parts of the 144 original ICE document could be split to a separate document if the 145 split of SDP is accepted by the WG. Later versions will define the 146 additional procedures needed] 148 This document describes how Interactive Connectivity Establishment 149 (ICE) is used with Session Description Protocol (SDP) offer/answer 150 and Session Initiation Protocol (SIP). The ICE specification 151 [ICE-BIS] describes procedures that are common to all usages of ICE 152 and this document gives the additional details needed to use ICE with 153 SIP and SDP offer/answer. 155 Note that ICE is not intended for NAT traversal for SIP, which is 156 assumed to be provided via another mechanism [RFC5626]. 158 2. Terminology 160 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 161 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 162 "OPTIONAL" in this document are to be interpreted as described in RFC 163 2119 [RFC2119]. 165 This document uses the terms defined in [ICE-BIS] and the following: 167 Default Destination/Candidate: The default destination for a 168 component of a media stream is the transport address that would be 169 used by an agent that is not ICE aware. A default candidate for a 170 component is one whose transport address matches the default 171 destination for that component. For the RTP component, the 172 default IP address is in the c line of the SDP, and the port is in 173 the m line. For the RTCP component, it is in the rtcp attribute 174 when present, and when not present, the IP address is in the c 175 line and 1 plus the port is in the m line. 177 3. Sending the Initial Offer 179 3.1. Choosing Default Candidates 181 A candidate is said to be default if it would be the target of media 182 from a non-ICE peer; that target is called the DEFAULT DESTINATION. 183 If the default candidates are not selected by the ICE algorithm when 184 communicating with an ICE-aware peer, an updated offer/answer will be 185 required after ICE processing completes in order to "fix up" the SDP 186 so that the default destination for media matches the candidates 187 selected by ICE. If ICE happens to select the default candidates, no 188 updated offer/answer is required. 190 An agent MUST choose a set of candidates, one for each component of 191 each in-use media stream, to be default. A media stream is in-use if 192 it does not have a port of zero (which is used in RFC 3264 to reject 193 a media stream). Consequently, a media stream is in-use even if it 194 is marked as a=inactive [RFC4566] or has a bandwidth value of zero. 196 It is RECOMMENDED that default candidates be chosen based on the 197 likelihood of those candidates to work with the peer that is being 198 contacted. It is RECOMMENDED that the default candidates are the 199 relayed candidates (if relayed candidates are available), server 200 reflexive candidates (if server reflexive candidates are available), 201 and finally host candidates. 203 3.2. Encoding the SDP 205 The process of encoding the SDP is identical between full and lite 206 implementations. 208 The agent will include an m line for each media stream it wishes to 209 use. The ordering of media streams in the SDP is relevant for ICE. 210 ICE will perform its connectivity checks for the first m line first, 211 and consequently media will be able to flow for that stream first. 212 Agents SHOULD place their most important media stream, if there is 213 one, first in the SDP. 215 There will be a candidate attribute for each candidate for a 216 particular media stream. Section 8 provides detailed rules for 217 constructing this attribute. 219 STUN connectivity checks between agents are authenticated using the 220 short-term credential mechanism defined for STUN [RFC5389]. This 221 mechanism relies on a username and password that are exchanged 222 through protocol machinery between the client and server. The 223 username fragment and password are exchanged in the ice-ufrag and 224 ice-pwd attributes, respectively. 226 If an agent is a lite implementation, it MUST include an "a=ice-lite" 227 session-level attribute in its SDP to indicate this. If an agent is 228 a full implementation, it MUST NOT include this attribute. 230 The default candidates are added to the SDP as the default 231 destination for media. For streams based on RTP, this is done by 232 placing the IP address and port of the RTP candidate into the c and m 233 lines, respectively. If the agent is utilizing RTCP, it MUST encode 234 the RTCP candidate using the a=rtcp attribute as defined in RFC 3605 235 [RFC3605]. If RTCP is not in use, the agent MUST signal that using 236 b=RS:0 and b=RR:0 as defined in RFC 3556 [RFC3556]. 238 The transport addresses that will be the default destination for 239 media when communicating with non-ICE peers MUST also be present as 240 candidates in one or more a=candidate lines. 242 ICE provides for extensibility by allowing an offer or answer to 243 contain a series of tokens that identify the ICE extensions used by 244 that agent. If an agent supports an ICE extension, it MUST include 245 the token defined for that extension in the ice-options attribute. 247 The following is an example SDP message that includes ICE attributes 248 (lines folded for readability): 250 v=0 251 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 252 s= 253 c=IN IP4 192.0.2.3 254 t=0 0 255 a=ice-pwd:asd88fgpdd777uzjYhagZg 256 a=ice-ufrag:8hhY 257 m=audio 45664 RTP/AVP 0 258 b=RS:0 259 b=RR:0 260 a=rtpmap:0 PCMU/8000 261 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 262 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 263 10.0.1.1 rport 8998 265 Once an agent has sent its offer or its answer, that agent MUST be 266 prepared to receive both STUN and media packets on each candidate. 267 As discussed in Section 10.1 of [ICE-BIS], media packets can be sent 268 to a candidate prior to its appearance as the default destination for 269 media in an offer or answer. 271 4. Receiving the Initial Offer 273 4.1. Choosing Default Candidates 275 The process for selecting default candidates at the answerer is 276 identical to the process followed by the offerer, as described in 277 Section 3.1 for full implementations and 4.2 of [ICE-BIS] for lite 278 implementations. 280 4.2. Verifying ICE Support 282 The agent will proceed with the ICE procedures defined in [ICE-BIS] 283 and this specification if, for each media stream in the SDP it 284 received, the default destination for each component of that media 285 stream appears in a candidate attribute. For example, in the case of 286 RTP, the IP address and port in the c and m lines, respectively, 287 appear in a candidate attribute and the value in the rtcp attribute 288 appears in a candidate attribute. 290 If this condition is not met, the agent MUST process the SDP based on 291 normal RFC 3264 procedures, without using any of the ICE mechanisms 292 described in the remainder of this specification with the following 293 exceptions: 295 1. The agent MUST follow the rules of section 9 of [ICE-BIS], which 296 describe keepalive procedures for all agents. 298 2. If the agent is not proceeding with ICE because there were 299 a=candidate attributes, but none that matched the default 300 destination of the media stream, the agent MUST include an a=ice- 301 mismatch attribute in its answer. 303 3. If the default candidates were relayed candidates learned through 304 a TURN server, the agent MUST create permissions in the TURN 305 server for the IP addresses learned from its peer in the SDP it 306 just received. If this is not done, initial packets in the media 307 stream from the peer may be lost. 309 4.3. Determining Role 311 In unusual cases, described in Appendix C, it is possible for both 312 agents to mistakenly believe they are controlled or controlling. To 313 resolve this, each agent MUST select a random number, called the tie- 314 breaker, uniformly distributed between 0 and (2**64) - 1 (that is, a 315 64-bit positive integer). This number is used in connectivity checks 316 to detect and repair this case, as described in Section 7.1.2.2 of 317 [ICE-BIS]. 319 5. Receipt of the Initial Answer 321 When ICE is used with SIP, forking may result in a single offer 322 generating a multiplicity of answers. In that case, ICE proceeds 323 completely in parallel and independently for each answer, treating 324 the combination of its offer and each answer as an independent offer/ 325 answer exchange, with its own set of pairs, check lists, states, and 326 so on. The only case in which processing of one pair impacts another 327 is freeing of candidates, discussed below in Section 7.2. 329 5.1. Verifying ICE Support 331 The logic at the offerer is identical to that of the answerer as 332 described in section 5.1 of [ICE-BIS], with the exception that an 333 offerer would not ever generate a=ice-mismatch attributes in an SDP. 335 In some cases, the answer may omit a=candidate attributes for the 336 media streams, and instead include an a=ice-mismatch attribute for 337 one or more of the media streams in the SDP. This signals to the 338 offerer that the answerer supports ICE, but that ICE processing was 339 not used for the session because a signaling intermediary modified 340 the default destination for media components without modifying the 341 corresponding candidate attributes. See Section 15.2.2 for a 342 discussion of cases where this can happen. This specification 343 provides no guidance on how an agent should proceed in such a failure 344 case. 346 6. Performing Connectivity Checks 348 The possibility for role conflicts described in Section 7.2.1.1 of 349 [ICE-BIS] applies to this usage and hence all full agents MUST 350 implement the role conflict repairing mechanism. Also both full and 351 lite agents MUST utilize the ICE-CONTROLLED and ICE-CONTROLLING 352 attributes as described in Section 7.1.2.2 of [ICE-BIS]. 354 7. Concluding ICE 356 Once all of the media streams are completed, the controlling endpoint 357 sends an updated offer if the candidates in the m and c lines for the 358 media stream (called the DEFAULT CANDIDATES) don't match ICE's 359 SELECTED CANDIDATES. 361 7.1. Procedures for Full Implementations 363 7.1.1. Updating states 365 Once the state of each check list is Completed, If an agent is 366 controlling, it examines the highest-priority nominated candidate 367 pair for each component of each media stream. If any of those 368 candidate pairs differ from the default candidate pairs in the most 369 recent offer/answer exchange, the controlling agent MUST generate an 370 updated offer as described in Section 9. 372 7.2. Freeing Candidates 374 7.2.1. Full Implementation Procedures 376 When ICE is used with SIP, and an offer is forked to multiple 377 recipients, ICE proceeds in parallel and independently with each 378 answerer, all using the same local candidates. Once ICE processing 379 has reached the Completed state for all peers for media streams using 380 those candidates, the agent SHOULD wait an additional three seconds, 381 and then it MAY cease responding to checks or generating triggered 382 checks on that candidate. It MAY free the candidate at that time. 383 Freeing of server reflexive candidates is never explicit; it happens 384 by lack of a keepalive. The three-second delay handles cases when 385 aggressive nomination is used, and the selected pairs can quickly 386 change after ICE has completed. 388 8. Grammar 390 This specification defines seven new SDP attributes -- the 391 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 392 ufrag", "ice-pwd", and "ice-options" attributes. 394 8.1. "candidate" Attribute 396 The candidate attribute is a media-level attribute only. It contains 397 a transport address for a candidate that can be used for connectivity 398 checks. 400 The syntax of this attribute is defined using Augmented BNF as 401 defined in [RFC5234]: 403 candidate-attribute = "candidate" ":" foundation SP component-id SP 404 transport SP 405 priority SP 406 connection-address SP ;from RFC 4566 407 port ;port from RFC 4566 408 SP cand-type 409 [SP rel-addr] 410 [SP rel-port] 411 *(SP extension-att-name SP 412 extension-att-value) 414 foundation = 1*32ice-char 415 component-id = 1*5DIGIT 416 transport = "UDP" / transport-extension 417 transport-extension = token ; from RFC 3261 418 priority = 1*10DIGIT 419 cand-type = "typ" SP candidate-types 420 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 421 rel-addr = "raddr" SP connection-address 422 rel-port = "rport" SP port 423 extension-att-name = byte-string ;from RFC 4566 424 extension-att-value = byte-string 425 ice-char = ALPHA / DIGIT / "+" / "/" 427 This grammar encodes the primary information about a candidate: its 428 IP address, port and transport protocol, and its properties: the 429 foundation, component ID, priority, type, and related transport 430 address: 432 : is taken from RFC 4566 [RFC4566]. It is the 433 IP address of the candidate, allowing for IPv4 addresses, IPv6 434 addresses, and fully qualified domain names (FQDNs). When parsing 435 this field, an agent can differentiate an IPv4 address and an IPv6 436 address by presence of a colon in its value -- the presence of a 437 colon indicates IPv6. An agent MUST ignore candidate lines that 438 include candidates with IP address versions that are not supported 439 or recognized. An IP address SHOULD be used, but an FQDN MAY be 440 used in place of an IP address. In that case, when receiving an 441 offer or answer containing an FQDN in an a=candidate attribute, 442 the FQDN is looked up in the DNS first using an AAAA record 443 (assuming the agent supports IPv6), and if no result is found or 444 the agent only supports IPv4, using an A. If the DNS query 445 returns more than one IP address, one is chosen, and then used for 446 the remainder of ICE processing. 448 : is also taken from RFC 4566 [RFC4566]. It is the port of 449 the candidate. 451 : indicates the transport protocol for the candidate. 452 This specification only defines UDP. However, extensibility is 453 provided to allow for future transport protocols to be used with 454 ICE, such as TCP or the Datagram Congestion Control Protocol 455 (DCCP) [RFC4340]. 457 : is composed of 1 to 32 s. It is an 458 identifier that is equivalent for two candidates that are of the 459 same type, share the same base, and come from the same STUN 460 server. The foundation is used to optimize ICE performance in the 461 Frozen algorithm. 463 : is a positive integer between 1 and 256 that 464 identifies the specific component of the media stream for which 465 this is a candidate. It MUST start at 1 and MUST increment by 1 466 for each component of a particular candidate. For media streams 467 based on RTP, candidates for the actual RTP media MUST have a 468 component ID of 1, and candidates for RTCP MUST have a component 469 ID of 2. See section 11 in [ICE-BIS] for additional discussion on 470 extending ICE to new media streams. 472 : is a positive integer between 1 and (2**31 - 1). 474 : encodes the type of candidate. This specification 475 defines the values "host", "srflx", "prflx", and "relay" for host, 476 server reflexive, peer reflexive, and relayed candidates, 477 respectively. The set of candidate types is extensible for the 478 future. 480 and : convey transport addresses related to the 481 candidate, useful for diagnostics and other purposes. 482 and MUST be present for server reflexive, peer 483 reflexive, and relayed candidates. If a candidate is server or 484 peer reflexive, and are equal to the base 485 for that server or peer reflexive candidate. If the candidate is 486 relayed, and is equal to the mapped address 487 in the Allocate response that provided the client with that 488 relayed candidate (see section Appendix B.3 of [ICE-BIS] for a 489 discussion of its purpose). If the candidate is a host candidate, 490 and MUST be omitted. 492 The candidate attribute can itself be extended. The grammar allows 493 for new name/value pairs to be added at the end of the attribute. An 494 implementation MUST ignore any name/value pairs it doesn't 495 understand. 497 8.2. "remote-candidates" Attribute 499 The syntax of the "remote-candidates" attribute is defined using 500 Augmented BNF as defined in RFC 5234 [RFC5234]. The remote- 501 candidates attribute is a media-level attribute only. 503 remote-candidate-att = "remote-candidates" ":" remote-candidate 504 0*(SP remote-candidate) 505 remote-candidate = component-ID SP connection-address SP port 507 The attribute contains a connection-address and port for each 508 component. The ordering of components is irrelevant. However, a 509 value MUST be present for each component of a media stream. This 510 attribute MUST be included in an offer by a controlling agent for a 511 media stream that is Completed, and MUST NOT be included in any other 512 case. 514 8.3. "ice-lite" and "ice-mismatch" Attributes 516 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 517 which are flags, is: 519 ice-lite = "ice-lite" 520 ice-mismatch = "ice-mismatch" 522 "ice-lite" is a session-level attribute only, and indicates that an 523 agent is a lite implementation. "ice-mismatch" is a media-level 524 attribute only, and when present in an answer, indicates that the 525 offer arrived with a default destination for a media component that 526 didn't have a corresponding candidate attribute. 528 8.4. "ice-ufrag" and "ice-pwd" Attributes 530 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 531 and password used by ICE for message integrity. Their syntax is: 533 ice-pwd-att = "ice-pwd" ":" password 534 ice-ufrag-att = "ice-ufrag" ":" ufrag 535 password = 22*256ice-char 536 ufrag = 4*256ice-char 538 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 539 session-level or media-level. When present in both, the value in the 540 media-level takes precedence. Thus, the value at the session-level 541 is effectively a default that applies to all media streams, unless 542 overridden by a media-level value. Whether present at the session or 543 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 544 each media stream. If two media streams have identical ice-ufrag's, 545 they MUST have identical ice-pwd's. 547 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 548 beginning of a session. The ice-ufrag attribute MUST contain at 549 least 24 bits of randomness, and the ice-pwd attribute MUST contain 550 at least 128 bits of randomness. This means that the ice-ufrag 551 attribute will be at least 4 characters long, and the ice-pwd at 552 least 22 characters long, since the grammar for these attributes 553 allows for 6 bits of randomness per character. The attributes MAY be 554 longer than 4 and 22 characters, respectively, of course, up to 256 555 characters. The upper limit allows for buffer sizing in 556 implementations. Its large upper limit allows for increased amounts 557 of randomness to be added over time. 559 8.5. "ice-options" Attribute 561 The "ice-options" attribute is a session-level attribute. It 562 contains a series of tokens that identify the options supported by 563 the agent. Its grammar is: 565 ice-options = "ice-options" ":" ice-option-tag 566 0*(SP ice-option-tag) 567 ice-option-tag = 1*ice-char 569 9. Subsequent Offer/Answer Exchanges 571 Either agent MAY generate a subsequent offer at any time allowed by 572 RFC 3264 [RFC3264]. The rules in Section 7 will cause the 573 controlling agent to send an updated offer at the conclusion of ICE 574 processing when ICE has selected different candidate pairs from the 575 default pairs. This section defines rules for construction of 576 subsequent offers and answers. 578 Should a subsequent offer be rejected, ICE processing continues as if 579 the subsequent offer had never been made. 581 9.1. Generating the Offer 583 9.1.1. Procedures for All Implementations 585 9.1.1.1. ICE Restarts 587 An agent MAY restart ICE processing for an existing media stream. An 588 ICE restart, as the name implies, will cause all previous states of 589 ICE processing to be flushed and checks to start anew. The only 590 difference between an ICE restart and a brand new media session is 591 that, during the restart, media can continue to be sent to the 592 previously validated pair. 594 An agent MUST restart ICE for a media stream if: 596 o The offer is being generated for the purposes of changing the 597 target of the media stream. In other words, if an agent wants to 598 generate an updated offer that, had ICE not been in use, would 599 result in a new value for the destination of a media component. 601 o An agent is changing its implementation level. This typically 602 only happens in third party call control use cases, where the 603 entity performing the signaling is not the entity receiving the 604 media, and it has changed the target of media mid-session to 605 another entity that has a different ICE implementation. 607 These rules imply that setting the IP address in the c line to 608 0.0.0.0 will cause an ICE restart. Consequently, ICE implementations 609 MUST NOT utilize this mechanism for call hold, and instead MUST use 610 a=inactive and a=sendonly as described in [RFC3264]. 612 To restart ICE, an agent MUST change both the ice-pwd and the ice- 613 ufrag for the media stream in an offer. Note that it is permissible 614 to use a session-level attribute in one offer, but to provide the 615 same ice-pwd or ice-ufrag as a media-level attribute in a subsequent 616 offer. This is not a change in password, just a change in its 617 representation, and does not cause an ICE restart. 619 An agent sets the rest of the fields in the SDP for this media stream 620 as it would in an initial offer of this media stream (see 621 Section 3.2). Consequently, the set of candidates MAY include some, 622 none, or all of the previous candidates for that stream and MAY 623 include a totally new set of candidates. 625 9.1.1.2. Removing a Media Stream 627 If an agent removes a media stream by setting its port to zero, it 628 MUST NOT include any candidate attributes for that media stream and 629 SHOULD NOT include any other ICE-related attributes defined in 630 Section 8 for that media stream. 632 9.1.1.3. Adding a Media Stream 634 If an agent wishes to add a new media stream, it sets the fields in 635 the SDP for this media stream as if this was an initial offer for 636 that media stream (see Section 3.2). This will cause ICE processing 637 to begin for this media stream. 639 9.1.2. Procedures for Full Implementations 641 This section describes additional procedures for full 642 implementations, covering existing media streams. 644 The username fragments, password, and implementation level MUST 645 remain the same as used previously. If an agent needs to change one 646 of these, it MUST restart ICE for that media stream. 648 Additional behavior depends on the state ICE processing for that 649 media stream. 651 9.1.2.1. Existing Media Streams with ICE Running 652 If an agent generates an updated offer including a media stream that 653 was previously established, and for which ICE checks are in the 654 Running state, the agent follows the procedures defined here. 656 An agent MUST include candidate attributes for all local candidates 657 it had signaled previously for that media stream. The properties of 658 that candidate as signaled in SDP -- the priority, foundation, type, 659 and related transport address -- SHOULD remain the same. The IP 660 address, port, and transport protocol, which fundamentally identify 661 that candidate, MUST remain the same (if they change, it would be a 662 new candidate). The component ID MUST remain the same. The agent 663 MAY include additional candidates it did not offer previously, but 664 which it has gathered since the last offer/answer exchange, including 665 peer reflexive candidates. 667 The agent MAY change the default destination for media. As with 668 initial offers, there MUST be a set of candidate attributes in the 669 offer matching this default destination. 671 9.1.2.2. Existing Media Streams with ICE Completed 673 If an agent generates an updated offer including a media stream that 674 was previously established, and for which ICE checks are in the 675 Completed state, the agent follows the procedures defined here. 677 The default destination for media (i.e., the values of the IP 678 addresses and ports in the m and c lines used for that media stream) 679 MUST be the local candidate from the highest-priority nominated pair 680 in the valid list for each component. This "fixes" the default 681 destination for media to equal the destination ICE has selected for 682 media. 684 The agent MUST include candidate attributes for candidates matching 685 the default destination for each component of the media stream, and 686 MUST NOT include any other candidates. 688 In addition, if the agent is controlling, it MUST include the a 689 =remote-candidates attribute for each media stream whose check list 690 is in the Completed state. The attribute contains the remote 691 candidates from the highest-priority nominated pair in the valid list 692 for each component of that media stream. It is needed to avoid a 693 race condition whereby the controlling agent chooses its pairs, but 694 the updated offer beats the connectivity checks to the controlled 695 agent, which doesn't even know these pairs are valid, let alone 696 selected. See Appendix B for elaboration on this race condition. 698 9.1.3. Procedures for Lite Implementations 699 9.1.3.1. Existing Media Streams with ICE Running 701 This section describes procedures for lite implementations for 702 existing streams for which ICE is running. 704 A lite implementation MUST include all of its candidates for each 705 component of each media stream in an a=candidate attribute in any 706 subsequent offer. These candidates are formed identically to the 707 procedures for initial offers, as described in section 4.2 of 708 [ICE-BIS]. 710 A lite implementation MUST NOT add additional host candidates in a 711 subsequent offer. If an agent needs to offer additional candidates, 712 it MUST restart ICE. 714 The username fragments, password, and implementation level MUST 715 remain the same as used previously. If an agent needs to change one 716 of these, it MUST restart ICE for that media stream. 718 9.1.3.2. Existing Media Streams with ICE Completed 720 If ICE has completed for a media stream, the default destination for 721 that media stream MUST be set to the remote candidate of the 722 candidate pair for that component in the valid list. For a lite 723 implementation, there is always just a single candidate pair in the 724 valid list for each component of a media stream. Additionally, the 725 agent MUST include a candidate attribute for each default 726 destination. 728 Additionally, if the agent is controlling (which only happens when 729 both agents are lite), the agent MUST include the a=remote-candidates 730 attribute for each media stream. The attribute contains the remote 731 candidates from the candidate pairs in the valid list (one pair for 732 each component of each media stream). 734 9.2. Receiving the Offer and Generating an Answer 736 9.2.1. Procedures for All Implementations 738 When receiving a subsequent offer within an existing session, an 739 agent MUST reapply the verification procedures in Section 4.2 without 740 regard to the results of verification from any previous offer/answer 741 exchanges. Indeed, it is possible that a previous offer/answer 742 exchange resulted in ICE not being used, but it is used as a 743 consequence of a subsequent exchange. 745 9.2.1.1. Detecting ICE Restart 746 If the offer contained a change in the a=ice-ufrag or a=ice-pwd 747 attributes compared to the previous SDP from the peer, it indicates 748 that ICE is restarting for this media stream. If all media streams 749 are restarting, then ICE is restarting overall. 751 If ICE is restarting for a media stream: 753 o The agent MUST change the a=ice-ufrag and a=ice-pwd attributes in 754 the answer. 756 o The agent MAY change its implementation level in the answer. 758 An agent sets the rest of the fields in the SDP for this media stream 759 as it would in an initial answer to this media stream (see 760 Section 3.2). Consequently, the set of candidates MAY include some, 761 none, or all of the previous candidates for that stream and MAY 762 include a totally new set of candidates. 764 9.2.1.2. New Media Stream 766 If the offer contains a new media stream, the agent sets the fields 767 in the answer as if it had received an initial offer containing that 768 media stream (see Section 3.2). This will cause ICE processing to 769 begin for this media stream. 771 9.2.1.3. Removed Media Stream 773 If an offer contains a media stream whose port is zero, the agent 774 MUST NOT include any candidate attributes for that media stream in 775 its answer and SHOULD NOT include any other ICE-related attributes 776 defined in Section 8 for that media stream. 778 9.2.2. Procedures for Full Implementations 780 Unless the agent has detected an ICE restart from the offer, the 781 username fragments, password, and implementation level MUST remain 782 the same as used previously. If an agent needs to change one of 783 these it MUST restart ICE for that media stream by generating an 784 offer; ICE cannot be restarted in an answer. 786 Additional behaviors depend on the state of ICE processing for that 787 media stream. 789 9.2.2.1. Existing Media Streams with ICE Running and no remote- 790 candidates 792 If ICE is running for a media stream, and the offer for that media 793 stream lacked the remote-candidates attribute, the rules for 794 construction of the answer are identical to those for the offerer as 795 described in Section 9.1.2.1. 797 9.2.2.2. Existing Media Streams with ICE Completed and no remote- 798 candidates 800 If ICE is Completed for a media stream, and the offer for that media 801 stream lacked the remote-candidates attribute, the rules for 802 construction of the answer are identical to those for the offerer as 803 described in Section 9.1.2.2, except that the answerer MUST NOT 804 include the a=remote-candidates attribute in the answer. 806 9.2.2.3. Existing Media Streams and remote-candidates 808 A controlled agent will receive an offer with the a=remote-candidates 809 attribute for a media stream when its peer has concluded ICE 810 processing for that media stream. This attribute is present in the 811 offer to deal with a race condition between the receipt of the offer, 812 and the receipt of the Binding response that tells the answerer the 813 candidate that will be selected by ICE. See Appendix B for an 814 explanation of this race condition. Consequently, processing of an 815 offer with this attribute depends on the winner of the race. 817 The agent forms a candidate pair for each component of the media 818 stream by: 820 o Setting the remote candidate equal to the offerer's default 821 destination for that component (e.g., the contents of the m and c 822 lines for RTP, and the a=rtcp attribute for RTCP) 824 o Setting the local candidate equal to the transport address for 825 that same component in the a=remote-candidates attribute in the 826 offer. 828 The agent then sees if each of these candidate pairs is present in 829 the valid list. If a particular pair is not in the valid list, the 830 check has "lost" the race. Call such a pair a "losing pair". 832 The agent finds all the pairs in the check list whose remote 833 candidates equal the remote candidate in the losing pair: 835 o If none of the pairs are In-Progress, and at least one is Failed, 836 it is most likely that a network failure, such as a network 837 partition or serious packet loss, has occurred. The agent SHOULD 838 generate an answer for this media stream as if the remote- 839 candidates attribute had not been present, and then restart ICE 840 for this stream. 842 o If at least one of the pairs is In-Progress, the agent SHOULD wait 843 for those checks to complete, and as each completes, redo the 844 processing in this section until there are no losing pairs. 846 Once there are no losing pairs, the agent can generate the answer. 847 It MUST set the default destination for media to the candidates in 848 the remote-candidates attribute from the offer (each of which will 849 now be the local candidate of a candidate pair in the valid list). 850 It MUST include a candidate attribute in the answer for each 851 candidate in the remote-candidates attribute in the offer. 853 9.2.3. Procedures for Lite Implementations 855 If the received offer contains the remote-candidates attribute for a 856 media stream, the agent forms a candidate pair for each component of 857 the media stream by: 859 o Setting the remote candidate equal to the offerer's default 860 destination for that component (e.g., the contents of the m and c 861 lines for RTP, and the a=rtcp attribute for RTCP). 863 o Setting the local candidate equal to the transport address for 864 that same component in the a=remote-candidates attribute in the 865 offer. 867 It then places those candidates into the Valid list for the media 868 stream. The state of ICE processing for that media stream is set to 869 Completed. 871 Furthermore, if the agent believed it was controlling, but the offer 872 contained the remote-candidates attribute, both agents believe they 873 are controlling. In this case, both would have sent updated offers 874 around the same time. However, the signaling protocol carrying the 875 offer/answer exchanges will have resolved this glare condition, so 876 that one agent is always the 'winner' by having its offer received 877 before its peer has sent an offer. The winner takes the role of 878 controlled, so that the loser (the answerer under consideration in 879 this section) MUST change its role to controlled. Consequently, if 880 the agent was going to send an updated offer since, based on the 881 rules in section 8.2 of [ICE-BIS], it was controlling, it no longer 882 needs to. 884 Besides the potential role change, change in the Valid list, and 885 state changes, the construction of the answer is performed 886 identically to the construction of an offer as described in 887 Section 9.1.3. 889 9.3. Updating the Check and Valid Lists 891 9.3.1. Procedures for Full Implementations 893 9.3.1.1. ICE Restarts 895 The agent MUST remember the highest-priority nominated pairs in the 896 Valid list for each component of the media stream, called the 897 previous selected pairs, prior to the restart. The agent will 898 continue to send media using these pairs, as described in 899 Section 11.1. Once these destinations are noted, the agent MUST 900 flush the valid and check lists, and then recompute the check list 901 and its states as described in section 6.3 of [ICE-BIS]. 903 9.3.1.2. New Media Stream 905 If the offer/answer exchange added a new media stream, the agent MUST 906 create a new check list for it (and an empty Valid list to start of 907 course), as described in section 6.3 of [ICE-BIS]. 909 9.3.1.3. Removed Media Stream 911 If the offer/answer exchange removed a media stream, or an answer 912 rejected an offered media stream, an agent MUST flush the Valid list 913 for that media stream. It MUST terminate any STUN transactions in 914 progress for that media stream. An agent MUST remove the check list 915 for that media stream and cancel any pending ordinary checks for it. 917 9.3.1.4. ICE Continuing for Existing Media Stream 919 The valid list is not affected by an updated offer/answer exchange 920 unless ICE is restarting. 922 If an agent is in the Running state for that media stream, the check 923 list is updated (the check list is irrelevant if the state is 924 completed). To do that, the agent recomputes the check list using 925 the procedures described in section 6.3 of [ICE-BIS]. If a pair on 926 the new check list was also on the previous check list, and its state 927 was Waiting, In-Progress, Succeeded, or Failed, its state is copied 928 over. Otherwise, its state is set to Frozen. 930 If none of the check lists are active (meaning that the pairs in each 931 check list are Frozen), the full-mode agent sets the first pair in 932 the check list for the first media stream to Waiting, and then sets 933 the state of all other pairs in that check list for the same 934 component ID and with the same foundation to Waiting as well. 936 Next, the agent goes through each check list, starting with the 937 highest-priority pair. If a pair has a state of Succeeded, and it 938 has a component ID of 1, then all Frozen pairs in the same check list 939 with the same foundation whose component IDs are not 1 have their 940 state set to Waiting. If, for a particular check list, there are 941 pairs for each component of that media stream in the Succeeded state, 942 the agent moves the state of all Frozen pairs for the first component 943 of all other media streams (and thus in different check lists) with 944 the same foundation to Waiting. 946 9.3.2. Procedures for Lite Implementations 948 If ICE is restarting for a media stream, the agent MUST start a new 949 Valid list for that media stream. It MUST remember the pairs in the 950 previous Valid list for each component of the media stream, called 951 the previous selected pairs, and continue to send media there as 952 described in Section 11.1. The state of ICE processing for each 953 media stream MUST change to Running, and the state of ICE processing 954 MUST change to Running. 956 10. Keepalives 958 The keepalives MUST be sent regardless of whether the media stream is 959 currently inactive, sendonly, recvonly, or sendrecv, and regardless 960 of the presence or value of the bandwidth attribute. An agent can 961 determine that its peer supports ICE by the presence of a=candidate 962 attributes for each media session. 964 11. Media Handling 966 11.1. Sending Media 968 Note that the selected pair for a component of a media stream may not 969 equal the default pair for that same component from the most recent 970 offer/answer exchange. When this happens, the selected pair is used 971 for media, not the default pair. When ICE first completes, if the 972 selected pairs aren't a match for the default pairs, the controlling 973 agent sends an updated offer/answer exchange to remedy this 974 disparity. However, until that updated offer arrives, there will not 975 be a match. Furthermore, in very unusual cases, the default 976 candidates in the updated offer/answer will not be a match. 978 11.1.1. Procedures for All Implementations 980 ICE has interactions with jitter buffer adaptation mechanisms. An 981 RTP stream can begin using one candidate, and switch to another one, 982 though this happens rarely with ICE. The newer candidate may result 983 in RTP packets taking a different path through the network -- one 984 with different delay characteristics. As discussed below, agents are 985 encouraged to re-adjust jitter buffers when there are changes in 986 source or destination address of media packets. Furthermore, many 987 audio codecs use the marker bit to signal the beginning of a 988 talkspurt, for the purposes of jitter buffer adaptation. For such 989 codecs, it is RECOMMENDED that the sender set the marker bit 990 [RFC3550] when an agent switches transmission of media from one 991 candidate pair to another. 993 11.2. Receiving Media 995 ICE implementations MUST be prepared to receive media on each 996 component on any candidates provided for that component in the most 997 recent offer/answer exchange (in the case of RTP, this would include 998 both RTP and RTCP if candidates were provided for both). 1000 It is RECOMMENDED that, when an agent receives an RTP packet with a 1001 new source or destination IP address for a particular media stream, 1002 that the agent re-adjust its jitter buffers. 1004 RFC 3550 [RFC3550] describes an algorithm in Section 8.2 for 1005 detecting synchronization source (SSRC) collisions and loops. These 1006 algorithms are based, in part, on seeing different source transport 1007 addresses with the same SSRC. However, when ICE is used, such 1008 changes will sometimes occur as the media streams switch between 1009 candidates. An agent will be able to determine that a media stream 1010 is from the same peer as a consequence of the STUN exchange that 1011 proceeds media transmission. Thus, if there is a change in source 1012 transport address, but the media packets come from the same peer 1013 agent, this SHOULD NOT be treated as an SSRC collision. 1015 12. Usage with SIP 1017 12.1. Latency Guidelines 1019 ICE requires a series of STUN-based connectivity checks to take place 1020 between endpoints. These checks start from the answerer on 1021 generation of its answer, and start from the offerer when it receives 1022 the answer. These checks can take time to complete, and as such, the 1023 selection of messages to use with offers and answers can affect 1024 perceived user latency. Two latency figures are of particular 1025 interest. These are the post-pickup delay and the post-dial delay. 1026 The post-pickup delay refers to the time between when a user "answers 1027 the phone" and when any speech they utter can be delivered to the 1028 caller. The post-dial delay refers to the time between when a user 1029 enters the destination address for the user and ringback begins as a 1030 consequence of having successfully started ringing the phone of the 1031 called party. 1033 Two cases can be considered -- one where the offer is present in the 1034 initial INVITE and one where it is in a response. 1036 12.1.1. Offer in INVITE 1038 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1039 gathering candidates prior to actually sending its initial INVITE. 1040 This can be started upon user interface cues that a call is pending, 1041 such as activity on a keypad or the phone going off-hook. 1043 If an offer is received in an INVITE request, the answerer SHOULD 1044 begin to gather its candidates on receipt of the offer and then 1045 generate an answer in a provisional response once it has completed 1046 that process. ICE requires that a provisional response with an SDP 1047 be transmitted reliably. This can be done through the existing 1048 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1049 through an optimization that is specific to ICE. With this 1050 optimization, provisional responses containing an SDP answer that 1051 begins ICE processing for one or more media streams can be sent 1052 reliably without RFC 3262. To do this, the agent retransmits the 1053 provisional response with the exponential backoff timers described in 1054 RFC 3262. Retransmits MUST cease on receipt of a STUN Binding 1055 request for one of the media streams signaled in that SDP (because 1056 receipt of a Binding request indicates the offerer has received the 1057 answer) or on transmission of the answer in a 2xx response. If the 1058 peer agent is lite, there will never be a STUN Binding request. In 1059 such a case, the agent MUST cease retransmitting the 18x after 1060 sending it four times (ICE will actually work even if the peer never 1061 receives the 18x; however, experience has shown that sending it is 1062 important for middleboxes and firewall traversal). If no Binding 1063 request is received prior to the last retransmit, the agent does not 1064 consider the session terminated. Despite the fact that the 1065 provisional response will be delivered reliably, the rules for when 1066 an agent can send an updated offer or answer do not change from those 1067 specified in RFC 3262. Specifically, if the INVITE contained an 1068 offer, the same answer appears in all of the 1xx and in the 2xx 1069 response to the INVITE. Only after that 2xx has been sent can an 1070 updated offer/answer exchange occur. This optimization SHOULD NOT be 1071 used if both agents support PRACK. Note that the optimization is 1072 very specific to provisional response carrying answers that start ICE 1073 processing; it is not a general technique for 1xx reliability. 1075 Alternatively, an agent MAY delay sending an answer until the 200 OK; 1076 however, this results in a poor user experience and is NOT 1077 RECOMMENDED. 1079 Once the answer has been sent, the agent SHOULD begin its 1080 connectivity checks. Once candidate pairs for each component of a 1081 media stream enter the valid list, the answerer can begin sending 1082 media on that media stream. 1084 However, prior to this point, any media that needs to be sent towards 1085 the caller (such as SIP early media [RFC3960]) MUST NOT be 1086 transmitted. For this reason, implementations SHOULD delay alerting 1087 the called party until candidates for each component of each media 1088 stream have entered the valid list. In the case of a PSTN gateway, 1089 this would mean that the setup message into the PSTN is delayed until 1090 this point. Doing this increases the post-dial delay, but has the 1091 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1092 called party hears the phone ring, picks up, but hears nothing and 1093 cannot be heard. This technique works without requiring support for, 1094 or usage of, preconditions [RFC3312], since it's a localized 1095 decision. It also has the benefit of guaranteeing that not a single 1096 packet of media will get clipped, so that post-pickup delay is zero. 1097 If an agent chooses to delay local alerting in this way, it SHOULD 1098 generate a 180 response once alerting begins. 1100 12.1.2. Offer in Response 1102 In addition to uses where the offer is in an INVITE, and the answer 1103 is in the provisional and/or 200 OK response, ICE works with cases 1104 where the offer appears in the response. In such cases, which are 1105 common in third party call control [RFC3725], ICE agents SHOULD 1106 generate their offers in a reliable provisional response (which MUST 1107 utilize RFC 3262), and not alert the user on receipt of the INVITE. 1108 The answer will arrive in a PRACK. This allows for ICE processing to 1109 take place prior to alerting, so that there is no post-pickup delay, 1110 at the expense of increased call setup delays. Once ICE completes, 1111 the callee can alert the user and then generate a 200 OK when they 1112 answer. The 200 OK would contain no SDP, since the offer/answer 1113 exchange has completed. 1115 Alternatively, agents MAY place the offer in a 2xx instead (in which 1116 case the answer comes in the ACK). When this happens, the callee 1117 will alert the user on receipt of the INVITE, and the ICE exchanges 1118 will take place only after the user answers. This has the effect of 1119 reducing call setup delay, but can cause substantial post-pickup 1120 delays and media clipping. 1122 12.2. SIP Option Tags and Media Feature Tags 1124 [RFC5768] specifies a SIP option tag and media feature tag for usage 1125 with ICE. ICE implementations using SIP SHOULD support this 1126 specification, which uses a feature tag in registrations to 1127 facilitate interoperability through signaling intermediaries. 1129 12.3. Interactions with Forking 1131 ICE interacts very well with forking. Indeed, ICE fixes some of the 1132 problems associated with forking. Without ICE, when a call forks and 1133 the caller receives multiple incoming media streams, it cannot 1134 determine which media stream corresponds to which callee. 1136 With ICE, this problem is resolved. The connectivity checks which 1137 occur prior to transmission of media carry username fragments, which 1138 in turn are correlated to a specific callee. Subsequent media 1139 packets that arrive on the same candidate pair as the connectivity 1140 check will be associated with that same callee. Thus, the caller can 1141 perform this correlation as long as it has received an answer. 1143 12.4. Interactions with Preconditions 1145 Quality of Service (QoS) preconditions, which are defined in RFC 3312 1146 [RFC3312] and RFC 4032 [RFC4032], apply only to the transport 1147 addresses listed as the default targets for media in an offer/answer. 1148 If ICE changes the transport address where media is received, this 1149 change is reflected in an updated offer that changes the default 1150 destination for media to match ICE's selection. As such, it appears 1151 like any other re-INVITE would, and is fully treated in RFCs 3312 and 1152 4032, which apply without regard to the fact that the destination for 1153 media is changing due to ICE negotiations occurring "in the 1154 background". 1156 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1157 met until the checks have completed and selected the candidate pairs 1158 to be used for media. 1160 ICE also has (purposeful) interactions with connectivity 1161 preconditions [RFC5898]. Those interactions are described there. 1162 Note that the procedures described in Section 12.1 describe their own 1163 type of "preconditions", albeit with less functionality than those 1164 provided by the explicit preconditions in [RFC5898]. 1166 12.5. Interactions with Third Party Call Control 1168 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1169 I works without the controller supporting or being aware of ICE. 1170 Flow IV will work as long as the controller passes along the ICE 1171 attributes without alteration. Flow II is fundamentally incompatible 1172 with ICE; each agent will believe itself to be the answerer and thus 1173 never generate a re-INVITE. 1175 The flows for continued operation, as described in Section 7 of RFC 1176 3725, require additional behavior of ICE implementations to support. 1178 In particular, if an agent receives a mid-dialog re-INVITE that 1179 contains no offer, it MUST restart ICE for each media stream and go 1180 through the process of gathering new candidates. Furthermore, that 1181 list of candidates SHOULD include the ones currently being used for 1182 media. 1184 13. Relationship with ANAT 1186 RFC 4091 [RFC4091], the Alternative Network Address Types (ANAT) 1187 Semantics for the SDP grouping framework, and RFC 4092 [RFC4092], its 1188 usage with SIP, define a mechanism for indicating that an agent can 1189 support both IPv4 and IPv6 for a media stream, and it does so by 1190 including two m lines, one for v4 and one for v6. This is similar to 1191 ICE, which allows for an agent to indicate multiple transport 1192 addresses using the candidate attribute. However, ANAT relies on 1193 static selection to pick between choices, rather than a dynamic 1194 connectivity check used by ICE. 1196 This specification deprecates RFC 4091 and RFC 4092. Instead, agents 1197 wishing to support dual-stack will utilize ICE. 1199 14. Setting Ta and RTO for RTP Media Streams 1201 During the gathering phase of ICE (section 4.1.1 [ICE-BIS]) and while 1202 ICE is performing connectivity checks (section 7 [ICE-BIS]), an agent 1203 sends STUN and TURN transactions. These transactions are paced at a 1204 rate of one every Ta milliseconds, and utilize a specific RTO. This 1205 section describes how the values of Ta and RTO are computed with a 1206 real-time media stream (such as RTP). When ICE is used for a stream 1207 with a known maximum bandwidth, the following computation MAY be 1208 followed to rate-control the ICE exchanges. 1210 The values of RTO and Ta change during the lifetime of ICE 1211 processing. One set of values applies during the gathering phase, 1212 and the other, for connectivity checks. 1214 The value of Ta SHOULD be configurable, and SHOULD have a default of: 1216 For each media stream i: 1217 Ta_i = (stun_packet_size / rtp_packet_size) * rtp_ptime 1219 1 1220 Ta = MAX (20ms, ------------------- ) 1221 k 1222 ---- 1223 \ 1 1224 > ------ 1225 / Ta_i 1226 ---- 1227 i=1 1229 where k is the number of media streams. During the gathering phase, 1230 Ta is computed based on the number of media streams the agent has 1231 indicated in its offer or answer, and the RTP packet size and RTP 1232 ptime are those of the most preferred codec for each media stream. 1233 Once an offer and answer have been exchanged, the agent recomputes Ta 1234 to pace the connectivity checks. In that case, the value of Ta is 1235 based on the number of media streams that will actually be used in 1236 the session, and the RTP packet size and RTP ptime are those of the 1237 most preferred codec with which the agent will send. 1239 In addition, the retransmission timer for the STUN transactions, RTO, 1240 defined in [RFC5389], SHOULD be configurable and during the gathering 1241 phase, SHOULD have a default of: 1243 RTO = MAX (100ms, Ta * (number of pairs)) 1245 where the number of pairs refers to the number of pairs of candidates 1246 with STUN or TURN servers. 1248 For connectivity checks, RTO SHOULD be configurable and SHOULD have a 1249 default of: 1251 RTO = MAX (100ms, Ta*N * (Num-Waiting + Num-In-Progress)) 1253 where Num-Waiting is the number of checks in the check list in the 1254 Waiting state, and Num-In-Progress is the number of checks in the In- 1255 Progress state. Note that the RTO will be different for each 1256 transaction as the number of checks in the Waiting and In-Progress 1257 states change. 1259 These formulas are aimed at causing STUN transactions to be paced at 1260 the same rate as media. This ensures that ICE will work properly 1261 under the same network conditions needed to support the media as 1262 well. See section B.1 of [ICE-BIS] for additional discussion and 1263 motivations. Because of this pacing, it will take a certain amount 1264 of time to obtain all of the server reflexive and relayed candidates. 1265 Implementations should be aware of the time required to do this, and 1266 if the application requires a time budget, limit the number of 1267 candidates that are gathered. 1269 The formulas result in a behavior whereby an agent will send its 1270 first packet for every single connectivity check before performing a 1271 retransmit. This can be seen in the formulas for the RTO (which 1272 represents the retransmit interval). Those formulas scale with N, 1273 the number of checks to be performed. As a result of this, ICE 1274 maintains a nicely constant rate, but becomes more sensitive to 1275 packet loss. The loss of the first single packet for any 1276 connectivity check is likely to cause that pair to take a long time 1277 to be validated, and instead, a lower-priority check (but one for 1278 which there was no packet loss) is much more likely to complete 1279 first. This results in ICE performing sub-optimally, choosing lower- 1280 priority pairs over higher-priority pairs. Implementors should be 1281 aware of this consequence, but still should utilize the timer values 1282 described here. 1284 15. Security Considerations 1286 15.1. Attacks on the Offer/Answer Exchanges 1288 An attacker that can modify or disrupt the offer/answer exchanges 1289 themselves can readily launch a variety of attacks with ICE. They 1290 could direct media to a target of a DoS attack, they could insert 1291 themselves into the media stream, and so on. These are similar to 1292 the general security considerations for offer/answer exchanges, and 1293 the security considerations in RFC 3264 [RFC3264] apply. These 1294 require techniques for message integrity and encryption for offers 1295 and answers, which are satisfied by the SIPS mechanism [RFC3261] when 1296 SIP is used. As such, the usage of SIPS with ICE is RECOMMENDED. 1298 15.2. Insider Attacks 1300 In addition to attacks where the attacker is a third party trying to 1301 insert fake offers, answers, or stun messages, there are several 1302 attacks possible with ICE when the attacker is an authenticated and 1303 valid participant in the ICE exchange. 1305 15.2.1. The Voice Hammer Attack 1307 The voice hammer attack is an amplification attack. In this attack, 1308 the attacker initiates sessions to other agents, and maliciously 1309 includes the IP address and port of a DoS target as the destination 1310 for media traffic signaled in the SDP. This causes substantial 1311 amplification; a single offer/answer exchange can create a continuing 1312 flood of media packets, possibly at high rates (consider video 1313 sources). This attack is not specific to ICE, but ICE can help 1314 provide remediation. 1316 Specifically, if ICE is used, the agent receiving the malicious SDP 1317 will first perform connectivity checks to the target of media before 1318 sending media there. If this target is a third-party host, the 1319 checks will not succeed, and media is never sent. 1321 Unfortunately, ICE doesn't help if its not used, in which case an 1322 attacker could simply send the offer without the ICE parameters. 1323 However, in environments where the set of clients is known, and is 1324 limited to ones that support ICE, the server can reject any offers or 1325 answers that don't indicate ICE support. 1327 15.2.2. Interactions with Application Layer Gateways and SIP 1329 Application Layer Gateways (ALGs) are functions present in a NAT 1330 device that inspect the contents of packets and modify them, in order 1331 to facilitate NAT traversal for application protocols. Session 1332 Border Controllers (SBCs) are close cousins of ALGs, but are less 1333 transparent since they actually exist as application layer SIP 1334 intermediaries. ICE has interactions with SBCs and ALGs. 1336 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1337 long as the ALG correctly modifies the SDP. A correct ALG 1338 implementation behaves as follows: 1340 o The ALG does not modify the m and c lines or the rtcp attribute if 1341 they contain external addresses. 1343 o If the m and c lines contain internal addresses, the modification 1344 depends on the state of the ALG: 1346 If the ALG already has a binding established that maps an 1347 external port to an internal IP address and port matching the 1348 values in the m and c lines or rtcp attribute, the ALG uses 1349 that binding instead of creating a new one. 1351 If the ALG does not already have a binding, it creates a new 1352 one and modifies the SDP, rewriting the m and c lines and rtcp 1353 attribute. 1355 Unfortunately, many ALGs are known to work poorly in these corner 1356 cases. ICE does not try to work around broken ALGs, as this is 1357 outside the scope of its functionality. ICE can help diagnose these 1358 conditions, which often show up as a mismatch between the set of 1359 candidates and the m and c lines and rtcp attributes. The ice- 1360 mismatch attribute is used for this purpose. 1362 ICE works best through ALGs when the signaling is run over TLS. This 1363 prevents the ALG from manipulating the SDP messages and interfering 1364 with ICE operation. Implementations that are expected to be deployed 1365 behind ALGs SHOULD provide for TLS transport of the SDP. 1367 If an SBC is SIP aware but not ICE aware, the result depends on the 1368 behavior of the SBC. If it is acting as a proper Back-to-Back User 1369 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1370 understand, including the ICE attributes. Consequently, the call 1371 will appear to both endpoints as if the other side doesn't support 1372 ICE. This will result in ICE being disabled, and media flowing 1373 through the SBC, if the SBC has requested it. If, however, the SBC 1374 passes the ICE attributes without modification, yet modifies the 1375 default destination for media (contained in the m and c lines and 1376 rtcp attribute), this will be detected as an ICE mismatch, and ICE 1377 processing is aborted for the call. It is outside of the scope of 1378 ICE for it to act as a tool for "working around" SBCs. If one is 1379 present, ICE will not be used and the SBC techniques take precedence. 1381 16. IANA Considerations 1383 16.1. SDP Attributes 1385 Original ICE specification defined seven new SDP attributes per the 1386 procedures of Section 8.2.4 of [RFC4566]. The registration 1387 information is reproduced here. 1389 16.1.1. candidate Attribute 1391 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1393 Attribute Name: candidate 1395 Long Form: candidate 1397 Type of Attribute: media-level 1399 Charset Considerations: The attribute is not subject to the charset 1400 attribute. 1402 Purpose: This attribute is used with Interactive Connectivity 1403 Establishment (ICE), and provides one of many possible candidate 1404 addresses for communication. These addresses are validated with 1405 an end-to-end connectivity check using Session Traversal Utilities 1406 for NAT (STUN). 1408 Appropriate Values: See Section 8 of RFC XXXX. 1410 16.1.2. remote-candidates Attribute 1411 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1413 Attribute Name: remote-candidates 1415 Long Form: remote-candidates 1417 Type of Attribute: media-level 1419 Charset Considerations: The attribute is not subject to the charset 1420 attribute. 1422 Purpose: This attribute is used with Interactive Connectivity 1423 Establishment (ICE), and provides the identity of the remote 1424 candidates that the offerer wishes the answerer to use in its 1425 answer. 1427 Appropriate Values: See Section 8 of RFC XXXX. 1429 16.1.3. ice-lite Attribute 1431 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1433 Attribute Name: ice-lite 1435 Long Form: ice-lite 1437 Type of Attribute: session-level 1439 Charset Considerations: The attribute is not subject to the charset 1440 attribute. 1442 Purpose: This attribute is used with Interactive Connectivity 1443 Establishment (ICE), and indicates that an agent has the minimum 1444 functionality required to support ICE inter-operation with a peer 1445 that has a full implementation. 1447 Appropriate Values: See Section 8 of RFC XXXX. 1449 16.1.4. ice-mismatch Attribute 1451 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1453 Attribute Name: ice-mismatch 1455 Long Form: ice-mismatch 1457 Type of Attribute: session-level 1458 Charset Considerations: The attribute is not subject to the charset 1459 attribute. 1461 Purpose: This attribute is used with Interactive Connectivity 1462 Establishment (ICE), and indicates that an agent is ICE capable, 1463 but did not proceed with ICE due to a mismatch of candidates with 1464 the default destination for media signaled in the SDP. 1466 Appropriate Values: See Section 8 of RFC XXXX. 1468 16.1.5. ice-pwd Attribute 1470 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1472 Attribute Name: ice-pwd 1474 Long Form: ice-pwd 1476 Type of Attribute: session- or media-level 1478 Charset Considerations: The attribute is not subject to the charset 1479 attribute. 1481 Purpose: This attribute is used with Interactive Connectivity 1482 Establishment (ICE), and provides the password used to protect 1483 STUN connectivity checks. 1485 Appropriate Values: See Section 8 of RFC XXXX. 1487 16.1.6. ice-ufrag Attribute 1489 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1491 Attribute Name: ice-ufrag 1493 Long Form: ice-ufrag 1495 Type of Attribute: session- or media-level 1497 Charset Considerations: The attribute is not subject to the charset 1498 attribute. 1500 Purpose: This attribute is used with Interactive Connectivity 1501 Establishment (ICE), and provides the fragments used to construct 1502 the username in STUN connectivity checks. 1504 Appropriate Values: See Section 8 of RFC XXXX. 1506 16.1.7. ice-options Attribute 1508 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1510 Attribute Name: ice-options 1512 Long Form: ice-options 1514 Type of Attribute: session-level 1516 Charset Considerations: The attribute is not subject to the charset 1517 attribute. 1519 Purpose: This attribute is used with Interactive Connectivity 1520 Establishment (ICE), and indicates the ICE options or extensions 1521 used by the agent. 1523 Appropriate Values: See Section 8 of RFC XXXX. 1525 16.2. Interactive Connectivity Establishment (ICE) Options Registry 1527 IANA maintains a registry for ice-options identifiers under the 1528 Specification Required policy as defined in "Guidelines for Writing 1529 an IANA Considerations Section in RFCs" [RFC5226]. 1531 ICE options are of unlimited length according to the syntax in 1532 Section 8.5; however, they are RECOMMENDED to be no longer than 20 1533 characters. This is to reduce message sizes and allow for efficient 1534 parsing. 1536 A registration request MUST include the following information: 1538 o The ICE option identifier to be registered 1540 o Name, Email, and Address of a contact person for the registration 1542 o Organization or individuals having the change control 1544 o Short description of the ICE extension to which the option relates 1546 o Reference(s) to the specification defining the ICE option and the 1547 related extensions 1549 17. Acknowledgments 1551 A large part of the text in this document was taken from RFC 5245, 1552 authored by Jonathan Rosenberg. 1554 Some of the text in this document was taken from RFC 6336, authored 1555 by Magnus Westerlund and Colin Perkins. 1557 18. References 1559 18.1. Normative References 1561 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1562 Requirement Levels", BCP 14, RFC 2119, March 1997. 1564 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1565 A., Peterson, J., Sparks, R., Handley, M., and E. 1566 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1567 June 2002. 1569 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1570 Provisional Responses in Session Initiation Protocol 1571 (SIP)", RFC 3262, June 2002. 1573 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1574 with Session Description Protocol (SDP)", RFC 3264, June 1575 2002. 1577 [RFC3312] Camarillo, G., Marshall, W., and J. Rosenberg, 1578 "Integration of Resource Management and Session Initiation 1579 Protocol (SIP)", RFC 3312, October 2002. 1581 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1582 Jacobson, "RTP: A Transport Protocol for Real-Time 1583 Applications", STD 64, RFC 3550, July 2003. 1585 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1586 Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 1587 3556, July 2003. 1589 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1590 in Session Description Protocol (SDP)", RFC 3605, October 1591 2003. 1593 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1594 Initiation Protocol (SIP) Preconditions Framework", RFC 1595 4032, March 2005. 1597 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1598 Address Types (ANAT) Semantics for the Session Description 1599 Protocol (SDP) Grouping Framework", RFC 4091, June 2005. 1601 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1602 Description Protocol (SDP) Alternative Network Address 1603 Types (ANAT) Semantics in the Session Initiation Protocol 1604 (SIP)", RFC 4092, June 2005. 1606 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1607 Description Protocol", RFC 4566, July 2006. 1609 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1610 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1611 May 2008. 1613 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1614 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1616 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1617 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1618 October 2008. 1620 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1621 Connectivity Establishment (ICE) in the Session Initiation 1622 Protocol (SIP)", RFC 5768, April 2010. 1624 [ICE-BIS] Keranen, A. and J. Rosenberg, "Interactive Connectivity 1625 Establishment (ICE): A Protocol for Network Address 1626 Translator (NAT) Traversal for Offer/Answer Protocols", 1627 draft-keranen-mmusic-rfc5245bis-01 (work in progress), 1628 February 2013. 1630 18.2. Informative References 1632 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1633 Camarillo, "Best Current Practices for Third Party Call 1634 Control (3pcc) in the Session Initiation Protocol (SIP)", 1635 BCP 85, RFC 3725, April 2004. 1637 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1638 Tone Generation in the Session Initiation Protocol (SIP)", 1639 RFC 3960, December 2004. 1641 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1642 Congestion Control Protocol (DCCP)", RFC 4340, March 2006. 1644 [RFC5626] Jennings, C., Mahy, R., and F. Audet, "Managing Client- 1645 Initiated Connections in the Session Initiation Protocol 1646 (SIP)", RFC 5626, October 2009. 1648 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1649 "Connectivity Preconditions for Session Description 1650 Protocol (SDP) Media Streams", RFC 5898, July 2010. 1652 Appendix A. Examples 1654 For the example shown in Section 13 of [ICE-BIS] the resulting offer 1655 (message 5) encoded in SDP looks like: 1657 v=0 1658 o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP 1659 s= 1660 c=IN IP4 $NAT-PUB-1.IP 1661 t=0 0 1662 a=ice-pwd:asd88fgpdd777uzjYhagZg 1663 a=ice-ufrag:8hhY 1664 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1665 b=RS:0 1666 b=RR:0 1667 a=rtpmap:0 PCMU/8000 1668 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1669 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1670 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1672 The offer, with the variables replaced with their values, will look 1673 like (lines folded for clarity): 1675 v=0 1676 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 1677 s= 1678 c=IN IP4 192.0.2.3 1679 t=0 0 1680 a=ice-pwd:asd88fgpdd777uzjYhagZg 1681 a=ice-ufrag:8hhY 1682 m=audio 45664 RTP/AVP 0 1683 b=RS:0 1684 b=RR:0 1685 a=rtpmap:0 PCMU/8000 1686 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 1687 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 1688 10.0.1.1 rport 8998 1690 The resulting answer looks like: 1692 v=0 1693 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1694 s= 1695 c=IN IP4 $R-PUB-1.IP 1696 t=0 0 1697 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1698 a=ice-ufrag:9uB6 1699 m=audio $R-PUB-1.PORT RTP/AVP 0 1700 b=RS:0 1701 b=RR:0 1702 a=rtpmap:0 PCMU/8000 1703 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1705 With the variables filled in: 1707 v=0 1708 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1709 s= 1710 c=IN IP4 192.0.2.1 1711 t=0 0 1712 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1713 a=ice-ufrag:9uB6 1714 m=audio 3478 RTP/AVP 0 1715 b=RS:0 1716 b=RR:0 1717 a=rtpmap:0 PCMU/8000 1718 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1720 Appendix B. The remote-candidates Attribute 1722 The a=remote-candidates attribute exists to eliminate a race 1723 condition between the updated offer and the response to the STUN 1724 Binding request that moved a candidate into the Valid list. This 1725 race condition is shown in Figure 1. On receipt of message 4, agent 1726 L adds a candidate pair to the valid list. If there was only a 1727 single media stream with a single component, agent L could now send 1728 an updated offer. However, the check from agent R has not yet 1729 generated a response, and agent R receives the updated offer (message 1730 7) before getting the response (message 9). Thus, it does not yet 1731 know that this particular pair is valid. To eliminate this 1732 condition, the actual candidates at R that were selected by the 1733 offerer (the remote candidates) are included in the offer itself, and 1734 the answerer delays its answer until those pairs validate. 1736 Agent A Network Agent B 1737 |(1) Offer | | 1738 |------------------------------------------>| 1739 |(2) Answer | | 1740 |<------------------------------------------| 1741 |(3) STUN Req. | | 1742 |------------------------------------------>| 1743 |(4) STUN Res. | | 1744 |<------------------------------------------| 1745 |(5) STUN Req. | | 1746 |<------------------------------------------| 1747 |(6) STUN Res. | | 1748 |-------------------->| | 1749 | |Lost | 1750 |(7) Offer | | 1751 |------------------------------------------>| 1752 |(8) STUN Req. | | 1753 |<------------------------------------------| 1754 |(9) STUN Res. | | 1755 |------------------------------------------>| 1756 |(10) Answer | | 1757 |<------------------------------------------| 1759 Figure 1: Race Condition Flow 1761 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1763 When ICE runs between two peers, one agent acts as controlled, and 1764 the other as controlling. Rules are defined as a function of 1765 implementation type and offerer/answerer to determine who is 1766 controlling and who is controlled. However, the specification 1767 mentions that, in some cases, both sides might believe they are 1768 controlling, or both sides might believe they are controlled. How 1769 can this happen? 1771 The condition when both agents believe they are controlled shows up 1772 in third party call control cases. Consider the following flow: 1774 A Controller B 1775 |(1) INV() | | 1776 |<-------------| | 1777 |(2) 200(SDP1) | | 1778 |------------->| | 1779 | |(3) INV() | 1780 | |------------->| 1781 | |(4) 200(SDP2) | 1782 | |<-------------| 1783 |(5) ACK(SDP2) | | 1784 |<-------------| | 1785 | |(6) ACK(SDP1) | 1786 | |------------->| 1788 Figure 2: Role Conflict Flow 1790 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1791 it works better than flow III since it produces fewer messages. In 1792 this flow, the controller sends an offerless INVITE to agent A, which 1793 responds with its offer, SDP1. The agent then sends an offerless 1794 INVITE to agent B, which it responds to with its offer, SDP2. The 1795 controller then uses the offer from each agent to generate the 1796 answers. When this flow is used, ICE will run between agents A and 1797 B, but both will believe they are in the controlling role. With the 1798 role conflict resolution procedures, this flow will function properly 1799 when ICE is used. 1801 At this time, there are no documented flows that can result in the 1802 case where both agents believe they are controlled. However, the 1803 conflict resolution procedures allow for this case, should a flow 1804 arise that would fit into this category. 1806 Appendix D. Why Send an Updated Offer? 1808 Section 11.1 describes rules for sending media. Both agents can send 1809 media once ICE checks complete, without waiting for an updated offer. 1810 Indeed, the only purpose of the updated offer is to "correct" the SDP 1811 so that the default destination for media matches where media is 1812 being sent based on ICE procedures (which will be the highest- 1813 priority nominated candidate pair). 1815 This begs the question -- why is the updated offer/answer exchange 1816 needed at all? Indeed, in a pure offer/answer environment, it would 1817 not be. The offerer and answerer will agree on the candidates to use 1818 through ICE, and then can begin using them. As far as the agents 1819 themselves are concerned, the updated offer/answer provides no new 1820 information. However, in practice, numerous components along the 1821 signaling path look at the SDP information. These include entities 1822 performing off-path QoS reservations, NAT traversal components such 1823 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1824 that passively monitor the network. For these tools to continue to 1825 function without change, the core property of SDP -- that the 1826 existing, pre-ICE definitions of the addresses used for media -- the 1827 m and c lines and the rtcp attribute -- must be retained. For this 1828 reason, an updated offer must be sent. 1830 Authors' Addresses 1832 Marc Petit-Huguenin 1833 Impedance Mismatch 1835 Email: petithug@acm.org 1837 Ari Keranen 1838 Ericsson 1839 Jorvas 02420 1840 Finland 1842 Email: ari.keranen@ericsson.com