idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-06.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 (September 10, 2015) is 3144 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) == Unused Reference: 'RFC3550' is defined on line 1597, but no explicit reference was found in the text ** 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) ** Downref: Normative reference to an Informational RFC: RFC 7092 == Outdated reference: A later version (-05) exists of draft-ietf-mmusic-rfc5245bis-04 Summary: 6 errors (**), 0 flaws (~~), 5 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: March 13, 2016 Ericsson 6 S. Nandakumar 7 Cisco Systems 8 September 10, 2015 10 Using Interactive Connectivity Establishment (ICE) with 11 Session Description Protocol (SDP) offer/answer and Session Initiation 12 Protocol (SIP) 13 draft-ietf-mmusic-ice-sip-sdp-06 15 Abstract 17 This document describes how Interactive Connectivity Establishment 18 (ICE) is used with Session Description Protocol (SDP) offer/answer 19 and Session Initiation Protocol (SIP). 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on March 13, 2016. 38 Copyright Notice 40 Copyright (c) 2015 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 This document may contain material from IETF Documents or IETF 54 Contributions published or made publicly available before November 55 10, 2008. The person(s) controlling the copyright in some of this 56 material may not have granted the IETF Trust the right to allow 57 modifications of such material outside the IETF Standards Process. 58 Without obtaining an adequate license from the person(s) controlling 59 the copyright in such materials, this document may not be modified 60 outside the IETF Standards Process, and derivative works of it may 61 not be created outside the IETF Standards Process, except to format 62 it for publication as an RFC or to translate it into languages other 63 than English. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 68 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 3. Sending the Initial Offer . . . . . . . . . . . . . . . . . . 4 70 3.1. Choosing Default Candidates . . . . . . . . . . . . . . . 4 71 3.2. Encoding the SDP . . . . . . . . . . . . . . . . . . . . 5 72 4. Receiving the Initial Offer . . . . . . . . . . . . . . . . . 6 73 4.1. Choosing Default Candidates . . . . . . . . . . . . . . . 6 74 4.2. Verifying ICE Support . . . . . . . . . . . . . . . . . . 6 75 4.3. Determining Role . . . . . . . . . . . . . . . . . . . . 7 76 5. Receipt of the Initial Answer . . . . . . . . . . . . . . . . 7 77 5.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 7 78 6. Performing Connectivity Checks . . . . . . . . . . . . . . . 8 79 7. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . . 8 80 7.1. Procedures for Full Implementations . . . . . . . . . . . 8 81 7.1.1. Updating states . . . . . . . . . . . . . . . . . . . 8 82 7.2. Freeing Candidates . . . . . . . . . . . . . . . . . . . 8 83 7.2.1. Full Implementation Procedures . . . . . . . . . . . 8 84 8. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 85 8.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 9 86 8.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 11 87 8.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 11 88 8.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 12 89 8.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 12 90 8.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 13 91 9. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 13 92 9.1. Generating the Offer . . . . . . . . . . . . . . . . . . 13 93 9.1.1. Procedures for All Implementations . . . . . . . . . 13 94 9.1.2. Procedures for Full Implementations . . . . . . . . . 14 95 9.1.3. Procedures for Lite Implementations . . . . . . . . . 16 96 9.2. Receiving the Offer and Generating an Answer . . . . . . 17 97 9.2.1. Procedures for All Implementations . . . . . . . . . 17 98 9.2.2. Procedures for Full Implementations . . . . . . . . . 18 99 9.2.3. Procedures for Lite Implementations . . . . . . . . . 19 100 9.3. Receiving the Answer for a Subsequent Offer . . . . . . . 20 101 9.3.1. Procedures for All Implementations . . . . . . . . . 20 102 9.4. Updating the Check and Valid Lists . . . . . . . . . . . 21 103 9.4.1. Procedures for Full Implementations . . . . . . . . . 21 104 9.4.2. Procedures for Lite Implementations . . . . . . . . . 22 105 10. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 23 106 11. Media Handling . . . . . . . . . . . . . . . . . . . . . . . 23 107 12. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . 23 108 12.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 23 109 12.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . 24 110 12.1.2. Offer in Response . . . . . . . . . . . . . . . . . 25 111 12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 25 112 12.3. Interactions with Forking . . . . . . . . . . . . . . . 26 113 12.4. Interactions with Preconditions . . . . . . . . . . . . 26 114 12.5. Interactions with Third Party Call Control . . . . . . . 26 115 13. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 27 116 14. Setting Ta and RTO for RTP Media Streams . . . . . . . . . . 27 117 15. Security Considerations . . . . . . . . . . . . . . . . . . . 27 118 15.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . 27 119 15.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . 28 120 15.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . 28 121 15.2.2. Interactions with Application Layer Gateways and SIP 28 122 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 29 123 16.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 29 124 16.1.1. candidate Attribute . . . . . . . . . . . . . . . . 29 125 16.1.2. remote-candidates Attribute . . . . . . . . . . . . 30 126 16.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 30 127 16.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 31 128 16.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . 31 129 16.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . 32 130 16.1.7. ice-pacing Attribute . . . . . . . . . . . . . . . . 32 131 16.1.8. ice-options Attribute . . . . . . . . . . . . . . . 32 132 16.2. Interactive Connectivity Establishment (ICE) Options 133 Registry . . . . . . . . . . . . . . . . . . . . . . . . 33 134 17. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 34 135 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 34 136 18.1. Normative References . . . . . . . . . . . . . . . . . . 34 137 18.2. Informative References . . . . . . . . . . . . . . . . . 36 138 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 36 139 Appendix B. The remote-candidates Attribute . . . . . . . . . . 38 140 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 38 141 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 39 142 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 40 144 1. Introduction 146 This document describes how Interactive Connectivity Establishment 147 (ICE) is used with Session Description Protocol (SDP) offer/answer 148 [RFC3264] and Session Initiation Protocol (SIP). The ICE 149 specification [ICE-BIS] describes procedures that are common to all 150 usages of ICE and this document gives the additional details needed 151 to use ICE with SDP offer/answer and SIP. 153 Note that ICE is not intended for NAT traversal for SIP, which is 154 assumed to be provided via another mechanism [RFC5626]. 156 2. Terminology 158 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 159 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 160 "OPTIONAL" in this document are to be interpreted as described in RFC 161 2119 [RFC2119]. 163 Readers should be familiar with the terminology defined in [RFC3264], 164 in [ICE-BIS] and the following: 166 Default Destination/Candidate: The default destination for a 167 component of a media stream is the transport address that would be 168 used by an agent that is not ICE aware. A default candidate for a 169 component is one whose transport address matches the default 170 destination for that component. For the RTP component, the 171 default IP address is in the "c=" line of the SDP, and the port is 172 in the "m=" line. For the RTCP component, it is in the rtcp 173 attribute when present, and when not present, the IP address is in 174 the "c=" line and 1 plus the port is in the "m=" line. 176 3. Sending the Initial Offer 178 3.1. Choosing Default Candidates 180 A candidate is said to be default if it would be the target of media 181 from a non-ICE peer; that target is called the DEFAULT DESTINATION. 182 If the default candidates are not selected by the ICE algorithm when 183 communicating with an ICE-aware peer, an updated offer/answer will be 184 required after ICE processing completes in order to "fix up" the SDP 185 so that the default destination for media matches the candidates 186 selected by ICE. If ICE happens to select the default candidates, no 187 updated offer/answer is required. 189 An agent MUST choose a set of candidates, one for each component of 190 each in-use media stream, to be default. A media stream is in-use if 191 it does not have a port of zero (which is used in RFC 3264 to reject 192 a media stream). Consequently, a media stream is in-use even if it 193 is marked as a=inactive [RFC4566] or has a bandwidth value of zero. 195 It is RECOMMENDED that default candidates be chosen based on the 196 likelihood of those candidates to work with the peer that is being 197 contacted if ICE is not being used. It is RECOMMENDED that the 198 default candidates are the relayed candidates (if relayed candidates 199 are available), server reflexive candidates (if server reflexive 200 candidates are available), and finally host candidates. 202 3.2. Encoding the SDP 204 The process of encoding the SDP is identical between full and lite 205 implementations. 207 The agent will include an "m=" line for each media stream it wishes 208 to use. The ordering of media streams in the SDP is relevant for 209 ICE. ICE will perform its connectivity checks for the first "m=" 210 line first, and consequently media will be able to flow for that 211 stream first. Agents SHOULD place their most important media stream, 212 if there is one, first in the SDP. 214 There will be a candidate attribute for each candidate for a 215 particular media stream. Section 8 provides detailed rules for 216 constructing this attribute. 218 STUN connectivity checks between agents are authenticated using the 219 short-term credential mechanism defined for STUN [RFC5389]. This 220 mechanism relies on a username and password that are exchanged 221 through protocol machinery between the client and server. The 222 username fragment and password are exchanged in the ice-ufrag and 223 ice-pwd attributes, respectively. 225 If an agent is a lite implementation, it MUST include an "a=ice-lite" 226 session-level attribute in its SDP to indicate this. If an agent is 227 a full implementation, it MUST NOT include this attribute. 229 The default candidates are added to the SDP as the default 230 destination for media. For streams based on RTP, this is done by 231 placing the IP address and port of the RTP candidate into the "c=" 232 and "m=" lines, respectively. If the agent is utilizing RTCP, it 233 MUST encode the RTCP candidate using the a=rtcp attribute as defined 234 in RFC 3605 [RFC3605]. If RTCP is not in use, the agent MUST signal 235 that using b=RS:0 and b=RR:0 as defined in RFC 3556 [RFC3556]. 237 The transport addresses that will be the default destination for 238 media when communicating with non-ICE peers MUST also be present as 239 candidates in one or more a=candidate lines. 241 ICE provides for extensibility by allowing an offer or answer to 242 contain a series of tokens that identify the ICE extensions used by 243 that agent. If an agent supports an ICE extension, it MUST include 244 the token defined for that extension in the ice-options attribute. 246 The following is an example SDP message that includes ICE attributes 247 (lines folded for readability): 249 v=0 250 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 251 s= 252 c=IN IP4 192.0.2.3 253 t=0 0 254 a=ice-pwd:asd88fgpdd777uzjYhagZg 255 a=ice-ufrag:8hhY 256 m=audio 45664 RTP/AVP 0 257 b=RS:0 258 b=RR:0 259 a=rtpmap:0 PCMU/8000 260 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 261 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 262 10.0.1.1 rport 8998 264 Once an agent has sent its offer or its answer, that agent MUST be 265 prepared to receive both STUN and media packets on each candidate. 266 As discussed in Section 10.1 of [ICE-BIS], media packets can be sent 267 to a candidate prior to its appearance as the default destination for 268 media in an offer or answer. 270 4. Receiving the Initial Offer 272 4.1. Choosing Default Candidates 274 The process for selecting default candidates at the answerer is 275 identical to the process followed by the offerer, as described in 276 Section 3.1 for full implementations and 4.2 of [ICE-BIS] for lite 277 implementations. 279 4.2. Verifying ICE Support 281 The agent will proceed with the ICE procedures defined in [ICE-BIS] 282 and this specification if, for each media stream in the SDP it 283 received, the default destination for each component of that media 284 stream appears in a candidate attribute. For example, in the case of 285 RTP, the IP address and port in the "c=" and "m=" lines, 286 respectively, appear in a candidate attribute and the value in the 287 rtcp attribute appears in a candidate attribute. 289 If this condition is not met, the agent MUST process the SDP based on 290 normal RFC 3264 procedures, without using any of the ICE mechanisms 291 described in the remainder of this specification with the following 292 exceptions: 294 1. The agent MUST follow the rules of section 10 of [ICE-BIS], which 295 describe keepalive procedures for all agents. 297 2. If the agent is not proceeding with ICE because there were 298 a=candidate attributes, but none that matched the default 299 destination of the media stream, the agent MUST include an a=ice- 300 mismatch attribute in its answer. 302 3. If the default candidates were relayed candidates learned through 303 a TURN server, the agent MUST create permissions in the TURN 304 server for the IP addresses learned from its peer in the SDP it 305 just received. If this is not done, initial packets in the media 306 stream from the peer may be lost. 308 4.3. Determining Role 310 In unusual cases, described in Appendix C, it is possible for both 311 agents to mistakenly believe they are controlled or controlling. To 312 resolve this, each agent MUST select a random number, called the tie- 313 breaker, uniformly distributed between 0 and (2**64) - 1 (that is, a 314 64-bit positive integer). This number is used in connectivity checks 315 to detect and repair this case, as described in Section 7.1.2.2 of 316 [ICE-BIS]. 318 5. Receipt of the Initial Answer 320 When ICE is used with SIP, forking may result in a single offer 321 generating a multiplicity of answers. In that case, ICE proceeds 322 completely in parallel and independently for each answer, treating 323 the combination of its offer and each answer as an independent offer/ 324 answer exchange, with its own set of pairs, check lists, states, and 325 so on. The only case in which processing of one pair impacts another 326 is freeing of candidates, discussed below in Section 7.2. 328 5.1. Verifying ICE Support 330 The logic at the offerer is identical to that of the answerer as 331 described in section 5.1 of [ICE-BIS], with the exception that an 332 offerer would not ever generate a=ice-mismatch attributes in an SDP. 334 In some cases, the answer may omit a=candidate attributes for the 335 media streams, and instead include an a=ice-mismatch attribute for 336 one or more of the media streams in the SDP. This signals to the 337 offerer that the answerer supports ICE, but that ICE processing was 338 not used for the session because a signaling intermediary modified 339 the default destination for media components without modifying the 340 corresponding candidate attributes. See Section 15.2.2 for a 341 discussion of cases where this can happen. This specification 342 provides no guidance on how an agent should proceed in such a failure 343 case. 345 6. Performing Connectivity Checks 347 The possibility for role conflicts described in Section 7.2.1.1 of 348 [ICE-BIS] applies to this usage and hence all full agents MUST 349 implement the role conflict repairing mechanism. Also both full and 350 lite agents MUST utilize the ICE-CONTROLLED and ICE-CONTROLLING 351 attributes as described in Section 7.1.2.2 of [ICE-BIS]. 353 7. Concluding ICE 355 Once all of the media streams are completed, the controlling endpoint 356 sends an updated offer if the transport destination in the "m=" and 357 "c=" lines for the media stream (called the DEFAULT CANDIDATES) don't 358 match ICE's SELECTED CANDIDATES. 360 7.1. Procedures for Full Implementations 362 7.1.1. Updating states 364 Once the state of each check list is Completed, If an agent is 365 controlling, it examines the highest-priority nominated candidate 366 pair for each component of each media stream. If any of those 367 candidate pairs differ from the default candidate pairs in the most 368 recent offer/answer exchange, the controlling agent MUST generate an 369 updated offer as described in Section 9. 371 7.2. Freeing Candidates 373 7.2.1. Full Implementation Procedures 375 When ICE is used with SIP, and an offer is forked to multiple 376 recipients, ICE proceeds in parallel and independently with each 377 answerer, all using the same local candidates. Once ICE processing 378 has reached the Completed state for all peers for media streams using 379 those candidates, the agent SHOULD wait an additional three seconds, 380 and then it MAY cease responding to checks or generating triggered 381 checks on that candidate. It MAY free the candidate at that time. 382 Freeing of server reflexive candidates is never explicit; it happens 383 by lack of a keepalive. The three-second delay handles cases when 384 aggressive nomination is used, and the selected pairs can quickly 385 change after ICE has completed. 387 8. Grammar 389 This specification defines eight new SDP attributes -- the 390 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 391 ufrag", "ice-pwd", "ice-pacing", and "ice-options" attributes. 393 8.1. "candidate" Attribute 395 The candidate attribute is a media-level attribute only. It contains 396 a transport address for a candidate that can be used for connectivity 397 checks. 399 The syntax of this attribute is defined using Augmented BNF as 400 defined in [RFC5234]: 402 candidate-attribute = "candidate" ":" foundation SP component-id SP 403 transport SP 404 priority SP 405 connection-address SP ;from RFC 4566 406 port ;port from RFC 4566 407 SP cand-type 408 [SP rel-addr] 409 [SP rel-port] 410 *(SP extension-att-name SP 411 extension-att-value) 413 foundation = 1*32ice-char 414 component-id = 1*5DIGIT 415 transport = "UDP" / transport-extension 416 transport-extension = token ; from RFC 3261 417 priority = 1*10DIGIT 418 cand-type = "typ" SP candidate-types 419 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 420 rel-addr = "raddr" SP connection-address 421 rel-port = "rport" SP port 422 extension-att-name = token 423 extension-att-value = *VCHAR 424 ice-char = ALPHA / DIGIT / "+" / "/" 426 This grammar encodes the primary information about a candidate: its 427 IP address, port and transport protocol, and its properties: the 428 foundation, component ID, priority, type, and related transport 429 address: 431 : is taken from RFC 4566 [RFC4566]. It is the 432 IP address of the candidate, allowing for IPv4 addresses, IPv6 433 addresses, and fully qualified domain names (FQDNs). When parsing 434 this field, an agent can differentiate an IPv4 address and an IPv6 435 address by presence of a colon in its value -- the presence of a 436 colon indicates IPv6. An agent MUST ignore candidate lines that 437 include candidates with IP address versions that are not supported 438 or recognized. An IP address SHOULD be used, but an FQDN MAY be 439 used in place of an IP address. In that case, when receiving an 440 offer or answer containing an FQDN in an a=candidate attribute, 441 the FQDN is looked up in the DNS first using an AAAA record 442 (assuming the agent supports IPv6), and if no result is found or 443 the agent only supports IPv4, using an A. If the DNS query 444 returns more than one IP address, one is chosen, and then used for 445 the remainder of ICE processing. 447 : is also taken from RFC 4566 [RFC4566]. It is the port of 448 the candidate. 450 : indicates the transport protocol for the candidate. 451 This specification only defines UDP. However, extensibility is 452 provided to allow for future transport protocols to be used with 453 ICE, such as TCP or the Datagram Congestion Control Protocol 454 (DCCP) [RFC4340]. 456 : is composed of 1 to 32 s. It is an 457 identifier that is equivalent for two candidates that are of the 458 same type, share the same base, and come from the same STUN 459 server. The foundation is used to optimize ICE performance in the 460 Frozen algorithm. 462 : is a positive integer between 1 and 256 that 463 identifies the specific component of the media stream for which 464 this is a candidate. It MUST start at 1 and MUST increment by 1 465 for each component of a particular candidate. For media streams 466 based on RTP, candidates for the actual RTP media MUST have a 467 component ID of 1, and candidates for RTCP MUST have a component 468 ID of 2. See section 12 in [ICE-BIS] for additional discussion on 469 extending ICE to new media streams. 471 : is a positive integer between 1 and (2**31 - 1). 473 : encodes the type of candidate. This specification 474 defines the values "host", "srflx", "prflx", and "relay" for host, 475 server reflexive, peer reflexive, and relayed candidates, 476 respectively. The set of candidate types is extensible for the 477 future. 479 and : convey transport addresses related to the 480 candidate, useful for diagnostics and other purposes. 481 and MUST be present for server reflexive, peer 482 reflexive, and relayed candidates. If a candidate is server or 483 peer reflexive, and are equal to the base 484 for that server or peer reflexive candidate. If the candidate is 485 relayed, and is equal to the mapped address 486 in the Allocate response that provided the client with that 487 relayed candidate (see section Appendix B.3 of [ICE-BIS] for a 488 discussion of its purpose). If the candidate is a host candidate, 489 and MUST be omitted. 491 In some cases, e.g., for privacy reasons, an agent may not want to 492 reveal the related address and port. In this case the address 493 MUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 494 candidates) and the port to zero. 496 The candidate attribute can itself be extended. The grammar allows 497 for new name/value pairs to be added at the end of the attribute. An 498 implementation MUST ignore any name/value pairs it doesn't 499 understand. 501 8.2. "remote-candidates" Attribute 503 The syntax of the "remote-candidates" attribute is defined using 504 Augmented BNF as defined in RFC 5234 [RFC5234]. The remote- 505 candidates attribute is a media-level attribute only. 507 remote-candidate-att = "remote-candidates" ":" remote-candidate 508 0*(SP remote-candidate) 509 remote-candidate = component-ID SP connection-address SP port 511 The attribute contains a connection-address and port for each 512 component. The ordering of components is irrelevant. However, a 513 value MUST be present for each component of a media stream. This 514 attribute MUST be included in an offer by a controlling agent for a 515 media stream that is Completed, and MUST NOT be included in any other 516 case. 518 8.3. "ice-lite" and "ice-mismatch" Attributes 520 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 521 which are flags, is: 523 ice-lite = "ice-lite" 524 ice-mismatch = "ice-mismatch" 525 "ice-lite" is a session-level attribute only, and indicates that an 526 agent is a lite implementation. "ice-mismatch" is a media-level 527 attribute only, and when present in an answer, indicates that the 528 offer arrived with a default destination for a media component that 529 didn't have a corresponding candidate attribute. 531 8.4. "ice-ufrag" and "ice-pwd" Attributes 533 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 534 and password used by ICE for message integrity. Their syntax is: 536 ice-pwd-att = "ice-pwd" ":" password 537 ice-ufrag-att = "ice-ufrag" ":" ufrag 538 password = 22*256ice-char 539 ufrag = 4*256ice-char 541 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 542 session-level or media-level. When present in both, the value in the 543 media-level takes precedence. Thus, the value at the session-level 544 is effectively a default that applies to all media streams, unless 545 overridden by a media-level value. Whether present at the session or 546 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 547 each media stream. If two media streams have identical ice-ufrag's, 548 they MUST have identical ice-pwd's. 550 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 551 beginning of a session. The ice-ufrag attribute MUST contain at 552 least 24 bits of randomness, and the ice-pwd attribute MUST contain 553 at least 128 bits of randomness. This means that the ice-ufrag 554 attribute will be at least 4 characters long, and the ice-pwd at 555 least 22 characters long, since the grammar for these attributes 556 allows for 6 bits of randomness per character. The attributes MAY be 557 longer than 4 and 22 characters, respectively, of course, up to 256 558 characters. The upper limit allows for buffer sizing in 559 implementations. Its large upper limit allows for increased amounts 560 of randomness to be added over time. For compatibility with the 512 561 character limitation for the STUN username attribute value and for 562 bandwidth conservation considerations, the ice-ufrag attribute MUST 563 NOT be longer than 32 characters when sending, but an implementation 564 MUST accept up to 256 characters when receiving. 566 8.5. "ice-pacing" Attribute 568 The "ice-pacing" attribute indicates the desired connectivity check 569 pacing, in milliseconds, for this agent (see Section 13 of 570 [ICE-BIS]). The syntax is: 572 ice-pacing-att = "ice-pacing" ":" pacing-value 573 pacing-value = 1*10DIGIT 575 8.6. "ice-options" Attribute 577 The "ice-options" attribute is a session- and media-level attribute. 578 It contains a series of tokens that identify the options supported by 579 the agent. Its grammar is: 581 ice-options = "ice-options" ":" ice-option-tag 582 0*(SP ice-option-tag) 583 ice-option-tag = 1*ice-char 585 The existence of an ice-option can indicate that a certain extension 586 is supported by the agent and will be used or that the extension is 587 used only if the other agent is willing to use it too. In order to 588 avoid ambiguity, documents defining new options must indicate which 589 case applies to the defined extensions. 591 9. Subsequent Offer/Answer Exchanges 593 Either agent MAY generate a subsequent offer at any time allowed by 594 RFC 3264 [RFC3264]. The rules in Section 7 will cause the 595 controlling agent to send an updated offer at the conclusion of ICE 596 processing when ICE has selected different candidate pairs from the 597 default pairs. This section defines rules for construction of 598 subsequent offers and answers. 600 Should a subsequent offer be rejected, ICE processing continues as if 601 the subsequent offer had never been made. 603 9.1. Generating the Offer 605 9.1.1. Procedures for All Implementations 607 9.1.1.1. ICE Restarts 609 An agent MAY restart ICE processing for an existing media stream. An 610 ICE restart, as the name implies, will cause all previous states of 611 ICE processing to be flushed and checks to start anew. The only 612 difference between an ICE restart and a brand new media session is 613 that, during the restart, media can continue to be sent to the 614 previously validated pair. 616 An agent MUST restart ICE for a media stream if: 618 o The offer is being generated for the purposes of changing the 619 target of the media stream. In other words, if an agent wants to 620 generate an updated offer that, had ICE not been in use, would 621 result in a new value for the destination of a media component. 623 o An agent is changing its implementation level. This typically 624 only happens in third party call control use cases, where the 625 entity performing the signaling is not the entity receiving the 626 media, and it has changed the target of media mid-session to 627 another entity that has a different ICE implementation. 629 These rules imply that setting the IP address in the "c=" line to 630 0.0.0.0 will cause an ICE restart. Consequently, ICE implementations 631 MUST NOT utilize this mechanism for call hold, and instead MUST use 632 a=inactive and a=sendonly as described in [RFC3264]. 634 To restart ICE, an agent MUST change both the ice-pwd and the ice- 635 ufrag for the media stream in an offer. Note that it is permissible 636 to use a session-level attribute in one offer, but to provide the 637 same ice-pwd or ice-ufrag as a media-level attribute in a subsequent 638 offer. This is not a change in password, just a change in its 639 representation, and does not cause an ICE restart. 641 An agent sets the rest of the fields in the SDP for this media stream 642 as it would in an initial offer of this media stream (see 643 Section 3.2). Consequently, the set of candidates MAY include some, 644 none, or all of the previous candidates for that stream and MAY 645 include a totally new set of candidates. 647 9.1.1.2. Removing a Media Stream 649 If an agent removes a media stream by setting its port to zero, it 650 MUST NOT include any candidate attributes for that media stream and 651 SHOULD NOT include any other ICE-related attributes defined in 652 Section 8 for that media stream. 654 9.1.1.3. Adding a Media Stream 656 If an agent wishes to add a new media stream, it sets the fields in 657 the SDP for this media stream as if this was an initial offer for 658 that media stream (see Section 3.2). This will cause ICE processing 659 to begin for this media stream. 661 9.1.2. Procedures for Full Implementations 663 This section describes additional procedures for full 664 implementations, covering existing media streams. 666 The username fragments, password, and implementation level MUST 667 remain the same as used previously. If an agent needs to change one 668 of these, it MUST restart ICE for that media stream. 670 Additional behavior depends on the state ICE processing for that 671 media stream. 673 9.1.2.1. Existing Media Streams with ICE Running 675 If an agent generates an updated offer including a media stream that 676 was previously established, and for which ICE checks are in the 677 Running state, the agent follows the procedures defined here. 679 An agent MUST include candidate attributes for all local candidates 680 it had signaled previously for that media stream. The properties of 681 that candidate as signaled in SDP -- the priority, foundation, type, 682 and related transport address -- SHOULD remain the same. The IP 683 address, port, and transport protocol, which fundamentally identify 684 that candidate, MUST remain the same (if they change, it would be a 685 new candidate). The component ID MUST remain the same. The agent 686 MAY include additional candidates it did not offer previously, but 687 which it has gathered since the last offer/answer exchange, including 688 peer reflexive candidates. 690 The agent MAY change the default destination for media. As with 691 initial offers, there MUST be a set of candidate attributes in the 692 offer matching this default destination. 694 9.1.2.2. Existing Media Streams with ICE Completed 696 If an agent generates an updated offer including a media stream that 697 was previously established, and for which ICE checks are in the 698 Completed state, the agent follows the procedures defined here. 700 The default destination for media (i.e., the values of the IP 701 addresses and ports in the "m=" and "c=" lines used for that media 702 stream) MUST be the local candidate from the highest-priority 703 nominated pair in the valid list for each component. This "fixes" 704 the default destination for media to equal the destination ICE has 705 selected for media. 707 The agent MUST include candidate attributes for candidates matching 708 the default destination for each component of the media stream, and 709 MUST NOT include any other candidates. 711 In addition, if the agent is controlling, it MUST include the 712 a=remote-candidates attribute for each media stream whose check list 713 is in the Completed state. The attribute contains the remote 714 candidates from the highest-priority nominated pair in the valid list 715 for each component of that media stream. It is needed to avoid a 716 race condition whereby the controlling agent chooses its pairs, but 717 the updated offer beats the connectivity checks to the controlled 718 agent, which doesn't even know these pairs are valid, let alone 719 selected. See Appendix B for elaboration on this race condition. 721 9.1.3. Procedures for Lite Implementations 723 9.1.3.1. Existing Media Streams with ICE Running 725 This section describes procedures for lite implementations for 726 existing streams for which ICE is running. 728 A lite implementation MUST include all of its candidates for each 729 component of each media stream in an a=candidate attribute in any 730 subsequent offer. These candidates are formed identically to the 731 procedures for initial offers, as described in section 4.2 of 732 [ICE-BIS]. 734 A lite implementation MUST NOT add additional host candidates in a 735 subsequent offer. If an agent needs to offer additional candidates, 736 it MUST restart ICE. 738 The username fragments, password, and implementation level MUST 739 remain the same as used previously. If an agent needs to change one 740 of these, it MUST restart ICE for that media stream. 742 9.1.3.2. Existing Media Streams with ICE Completed 744 If ICE has completed for a media stream, the default destination for 745 that media stream MUST be set to the remote candidate of the 746 candidate pair for that component in the valid list. For a lite 747 implementation, there is always just a single candidate pair in the 748 valid list for each component of a media stream. Additionally, the 749 agent MUST include a candidate attribute for each default 750 destination. 752 Additionally, if the agent is controlling (which only happens when 753 both agents are lite), the agent MUST include the a=remote-candidates 754 attribute for each media stream. The attribute contains the remote 755 candidates from the candidate pairs in the valid list (one pair for 756 each component of each media stream). 758 9.2. Receiving the Offer and Generating an Answer 760 9.2.1. Procedures for All Implementations 762 When receiving a subsequent offer within an existing session, an 763 agent MUST reapply the verification procedures in Section 4.2 without 764 regard to the results of verification from any previous offer/answer 765 exchanges. Indeed, it is possible that a previous offer/answer 766 exchange resulted in ICE not being used, but it is used as a 767 consequence of a subsequent exchange. 769 9.2.1.1. Detecting ICE Restart 771 If the offer contained a change in the a=ice-ufrag or a=ice-pwd 772 attributes compared to the previous SDP from the peer, it indicates 773 that ICE is restarting for this media stream. If all media streams 774 are restarting, then ICE is restarting overall. 776 If ICE is restarting for a media stream: 778 o The agent MUST change the a=ice-ufrag and a=ice-pwd attributes in 779 the answer. 781 o The agent MAY change its implementation level in the answer. 783 An agent sets the rest of the fields in the SDP for this media stream 784 as it would in an initial answer to this media stream (see 785 Section 3.2). Consequently, the set of candidates MAY include some, 786 none, or all of the previous candidates for that stream and MAY 787 include a totally new set of candidates. 789 9.2.1.2. New Media Stream 791 If the offer contains a new media stream, the agent sets the fields 792 in the answer as if it had received an initial offer containing that 793 media stream (see Section 3.2). This will cause ICE processing to 794 begin for this media stream. 796 9.2.1.3. Removed Media Stream 798 If an offer contains a media stream whose port is zero, the agent 799 MUST NOT include any candidate attributes for that media stream in 800 its answer and SHOULD NOT include any other ICE-related attributes 801 defined in Section 8 for that media stream. 803 9.2.2. Procedures for Full Implementations 805 Unless the agent has detected an ICE restart from the offer, the 806 username fragments, password, and implementation level MUST remain 807 the same as used previously. If an agent needs to change one of 808 these it MUST restart ICE for that media stream by generating an 809 offer; ICE cannot be restarted in an answer. 811 Additional behaviors depend on the state of ICE processing for that 812 media stream. 814 9.2.2.1. Existing Media Streams with ICE Running and no remote- 815 candidates 817 If ICE is running for a media stream, and the offer for that media 818 stream lacked the remote-candidates attribute, the rules for 819 construction of the answer are identical to those for the offerer as 820 described in Section 9.1.2.1. 822 9.2.2.2. Existing Media Streams with ICE Completed and no remote- 823 candidates 825 If ICE is Completed for a media stream, and the offer for that media 826 stream lacked the remote-candidates attribute, the rules for 827 construction of the answer are identical to those for the offerer as 828 described in Section 9.1.2.2, except that the answerer MUST NOT 829 include the a=remote-candidates attribute in the answer. 831 9.2.2.3. Existing Media Streams and remote-candidates 833 A controlled agent will receive an offer with the a=remote-candidates 834 attribute for a media stream when its peer has concluded ICE 835 processing for that media stream. This attribute is present in the 836 offer to deal with a race condition between the receipt of the offer, 837 and the receipt of the Binding response that tells the answerer the 838 candidate that will be selected by ICE. See Appendix B for an 839 explanation of this race condition. Consequently, processing of an 840 offer with this attribute depends on the winner of the race. 842 The agent forms a candidate pair for each component of the media 843 stream by: 845 o Setting the remote candidate equal to the offerer's default 846 destination for that component (e.g., the contents of the "m=" and 847 "c=" lines for RTP, and the a=rtcp attribute for RTCP) 849 o Setting the local candidate equal to the transport address for 850 that same component in the a=remote-candidates attribute in the 851 offer. 853 The agent then sees if each of these candidate pairs is present in 854 the valid list. If a particular pair is not in the valid list, the 855 check has "lost" the race. Call such a pair a "losing pair". 857 The agent finds all the pairs in the check list whose remote 858 candidates equal the remote candidate in the losing pair: 860 o If none of the pairs are In-Progress, and at least one is Failed, 861 it is most likely that a network failure, such as a network 862 partition or serious packet loss, has occurred. The agent SHOULD 863 generate an answer for this media stream as if the remote- 864 candidates attribute had not been present, and then restart ICE 865 for this stream. 867 o If at least one of the pairs is In-Progress, the agent SHOULD wait 868 for those checks to complete, and as each completes, redo the 869 processing in this section until there are no losing pairs. 871 Once there are no losing pairs, the agent can generate the answer. 872 It MUST set the default destination for media to the candidates in 873 the remote-candidates attribute from the offer (each of which will 874 now be the local candidate of a candidate pair in the valid list). 875 It MUST include a candidate attribute in the answer for each 876 candidate in the remote-candidates attribute in the offer. 878 9.2.3. Procedures for Lite Implementations 880 If the received offer contains the remote-candidates attribute for a 881 media stream, the agent forms a candidate pair for each component of 882 the media stream by: 884 o Setting the remote candidate equal to the offerer's default 885 destination for that component (e.g., the contents of the "m=" and 886 "c=" lines for RTP, and the a=rtcp attribute for RTCP). 888 o Setting the local candidate equal to the transport address for 889 that same component in the a=remote-candidates attribute in the 890 offer. 892 It then places those candidates into the Valid list for the media 893 stream. The state of ICE processing for that media stream is set to 894 Completed. 896 Furthermore, if the agent believed it was controlling, but the offer 897 contained the remote-candidates attribute, both agents believe they 898 are controlling. In this case, both would have sent updated offers 899 around the same time. However, the signaling protocol carrying the 900 offer/answer exchanges will have resolved this glare condition, so 901 that one agent is always the 'winner' by having its offer received 902 before its peer has sent an offer. The winner takes the role of 903 controlled, so that the loser (the answerer under consideration in 904 this section) MUST change its role to controlled. Consequently, if 905 the agent was going to send an updated offer since, based on the 906 rules in section 8.2 of [ICE-BIS], it was controlling, it no longer 907 needs to. 909 Besides the potential role change, change in the Valid list, and 910 state changes, the construction of the answer is performed 911 identically to the construction of an offer as described in 912 Section 9.1.3. 914 9.3. Receiving the Answer for a Subsequent Offer 916 Some deployments of ICE include e.g. SDP-Modifying Signaling-only 917 Back-to-Back User Agents (B2BUAs) [RFC7092] that modify the SDP body 918 during the subsequent offer/answer exchange. With the B2BUA being 919 ICE-unaware a subsequent answer might be manipulated and might not 920 include ICE candidates although the initial answer did. 922 An example of a situation where such an "unexpected" answer might be 923 experienced appears when such a B2BUA introduces a media server 924 during call hold using 3rd party call-control procedures. Omitting 925 further details how this is done this could result in an answer being 926 received at the holding UA that was constructed by the B2BUA. With 927 the B2BUA being ICE-unaware that answer would not include ICE 928 candidates. 930 Receiving an answer without ICE attributes in this situation might be 931 unexpected, but would not necessarily impair the user experience. 933 In addition to procedures for the expected answer, the following 934 sections advice on how to recover from the unexpected situation. 936 9.3.1. Procedures for All Implementations 938 When receiving an answer within an existing session for a subsequent 939 offer as specified in Section 9.1.2.2, an agent MUST verify ICE 940 support as specified in Section 5.1. 942 9.3.1.1. ICE Restarts 944 If ICE support is indicated in the SDP answer, the agent MUST perform 945 ICE restart procedures as specified in Section 9.4. 947 If ICE support is no longer indicated in the SDP answer, the agent 948 MUST fall-back to RFC 3264 procedures and SHOULD NOT drop the dialog 949 just because of missing ICE support. If the agent sends a new offer 950 later on it SHOULD perform an ICE restart as specified in 951 Section 9.1.1.1. 953 9.3.1.2. Existing Media Streams with ICE Running 955 If ICE support is indicated in the SDP answer, the agent MUST 956 continue ICE procedures as specified in Section 9.4.1.4. 958 If ICE support is no longer indicated in the SDP answer, the agent 959 MUST abort the ongoing ICE processing and fall-back to RFC 3264 960 procedures. The agent SHOULD NOT drop the dialog just because of 961 missing ICE support. If the agent sends a new offer later on, it 962 SHOULD perform an ICE restart as specified in Section 9.1.1.1. 964 9.3.1.3. Existing Media Streams with ICE Completed 966 If ICE support is indicated in the SDP answer and if the answer 967 conforms to Section 9.2.2.3, the agent MUST remain in the ICE 968 Completed state. 970 If ICE support is no longer indicated in the SDP answer, the agent 971 MUST fall-back to RFC 3264 procedures and SHOULD NOT drop the dialog 972 just because of this unexpected answer. Once the agent sends a new 973 offer later on it MUST perform an ICE restart. 975 9.4. Updating the Check and Valid Lists 977 9.4.1. Procedures for Full Implementations 979 9.4.1.1. ICE Restarts 981 The agent MUST remember the highest-priority nominated pairs in the 982 Valid list for each component of the media stream, called the 983 previous selected pairs, prior to the restart. The agent will 984 continue to send media using these pairs, as described in Section 11. 985 Once these destinations are noted, the agent MUST flush the valid and 986 check lists, and then recompute the check list and its states as 987 described in section 6.3 of [ICE-BIS]. 989 9.4.1.2. New Media Stream 991 If the offer/answer exchange added a new media stream, the agent MUST 992 create a new check list for it (and an empty Valid list to start of 993 course), as described in section 6.3 of [ICE-BIS]. 995 9.4.1.3. Removed Media Stream 997 If the offer/answer exchange removed a media stream, or an answer 998 rejected an offered media stream, an agent MUST flush the Valid list 999 for that media stream. It MUST terminate any STUN transactions in 1000 progress for that media stream. An agent MUST remove the check list 1001 for that media stream and cancel any pending ordinary checks for it. 1003 9.4.1.4. ICE Continuing for Existing Media Stream 1005 The valid list is not affected by an updated offer/answer exchange 1006 unless ICE is restarting. 1008 If an agent is in the Running state for that media stream, the check 1009 list is updated (the check list is irrelevant if the state is 1010 completed). To do that, the agent recomputes the check list using 1011 the procedures described in section 6.3 of [ICE-BIS]. If a pair on 1012 the new check list was also on the previous check list, and its state 1013 was Waiting, In-Progress, Succeeded, or Failed, its state is copied 1014 over. Otherwise, its state is set to Frozen. 1016 If none of the check lists are active (meaning that the pairs in each 1017 check list are Frozen), the full-mode agent sets the first pair in 1018 the check list for the first media stream to Waiting, and then sets 1019 the state of all other pairs in that check list for the same 1020 component ID and with the same foundation to Waiting as well. 1022 Next, the agent goes through each check list, starting with the 1023 highest-priority pair. If a pair has a state of Succeeded, and it 1024 has a component ID of 1, then all Frozen pairs in the same check list 1025 with the same foundation whose component IDs are not 1 have their 1026 state set to Waiting. If, for a particular check list, there are 1027 pairs for each component of that media stream in the Succeeded state, 1028 the agent moves the state of all Frozen pairs for the first component 1029 of all other media streams (and thus in different check lists) with 1030 the same foundation to Waiting. 1032 9.4.2. Procedures for Lite Implementations 1034 If ICE is restarting for a media stream, the agent MUST start a new 1035 Valid list for that media stream. It MUST remember the pairs in the 1036 previous Valid list for each component of the media stream, called 1037 the previous selected pairs, and continue to send media there as 1038 described in Section 11. The state of ICE processing for each media 1039 stream MUST change to Running, and the state of ICE processing MUST 1040 change to Running. 1042 10. Keepalives 1044 The procedures defined in Section 10 of [ICE-BIS] MUST be followed. 1045 The keepalives MUST be sent regardless of whether the media stream is 1046 currently inactive, sendonly, recvonly, or sendrecv, and regardless 1047 of the presence or value of the bandwidth attribute. An agent can 1048 determine that its peer supports ICE by the presence of a=candidate 1049 attributes for each media session. 1051 11. Media Handling 1053 Section 11.1.3 of [ICE-BIS] defines procedures common for sending 1054 media across Full and Lite implementations. 1056 Section 11.2 of [ICE-BIS] defines procedures on receiving media. 1058 When sending media, note that the selected pair for a component of a 1059 media stream may not equal the default pair for that same component 1060 from the most recen offer/answer exchange. When this happens, the 1061 selected pair is used for media, not the default pair. When ICE 1062 first completes, if the selected pairs aren't a match for the default 1063 pairs, the controlling agent sends an updated offer/answer exchange 1064 to remedy this disparity. However, until that updated offer arrives, 1065 there will not be a match. Furthermore, in very unusual cases, the 1066 default candidates in the updated offer/answer will not be a match. 1068 12. Usage with SIP 1070 12.1. Latency Guidelines 1072 ICE requires a series of STUN-based connectivity checks to take place 1073 between endpoints. These checks start from the answerer on 1074 generation of its answer, and start from the offerer when it receives 1075 the answer. These checks can take time to complete, and as such, the 1076 selection of messages to use with offers and answers can affect 1077 perceived user latency. Two latency figures are of particular 1078 interest. These are the post-pickup delay and the post-dial delay. 1079 The post-pickup delay refers to the time between when a user "answers 1080 the phone" and when any speech they utter can be delivered to the 1081 caller. The post-dial delay refers to the time between when a user 1082 enters the destination address for the user and ringback begins as a 1083 consequence of having successfully started ringing the phone of the 1084 called party. 1086 Two cases can be considered -- one where the offer is present in the 1087 initial INVITE and one where it is in a response. 1089 12.1.1. Offer in INVITE 1091 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1092 gathering candidates prior to actually sending its initial INVITE. 1093 This can be started upon user interface cues that a call is pending, 1094 such as activity on a keypad or the phone going off-hook. 1096 If an offer is received in an INVITE request, the answerer SHOULD 1097 begin to gather its candidates on receipt of the offer and then 1098 generate an answer in a provisional response once it has completed 1099 that process. ICE requires that a provisional response with an SDP 1100 be transmitted reliably. This can be done through the existing 1101 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1102 through an optimization that is specific to ICE. With this 1103 optimization, provisional responses containing an SDP answer that 1104 begins ICE processing for one or more media streams can be sent 1105 reliably without RFC 3262. To do this, the agent retransmits the 1106 provisional response with the exponential backoff timers described in 1107 RFC 3262. Retransmits MUST cease on receipt of a STUN Binding 1108 request for one of the media streams signaled in that SDP (because 1109 receipt of a Binding request indicates the offerer has received the 1110 answer) or on transmission of the answer in a 2xx response. If the 1111 peer agent is lite, there will never be a STUN Binding request. In 1112 such a case, the agent MUST cease retransmitting the 18x after 1113 sending it four times (ICE will actually work even if the peer never 1114 receives the 18x; however, experience has shown that sending it is 1115 important for middleboxes and firewall traversal). If no Binding 1116 request is received prior to the last retransmit, the agent does not 1117 consider the session terminated. Despite the fact that the 1118 provisional response will be delivered reliably, the rules for when 1119 an agent can send an updated offer or answer do not change from those 1120 specified in RFC 3262. Specifically, if the INVITE contained an 1121 offer, the same answer appears in all of the 1xx and in the 2xx 1122 response to the INVITE. Only after that 2xx has been sent can an 1123 updated offer/answer exchange occur. This optimization SHOULD NOT be 1124 used if both agents support PRACK. Note that the optimization is 1125 very specific to provisional response carrying answers that start ICE 1126 processing; it is not a general technique for 1xx reliability. 1128 Alternatively, an agent MAY delay sending an answer until the 200 OK; 1129 however, this results in a poor user experience and is NOT 1130 RECOMMENDED. 1132 Once the answer has been sent, the agent SHOULD begin its 1133 connectivity checks. Once candidate pairs for each component of a 1134 media stream enter the valid list, the answerer can begin sending 1135 media on that media stream. 1137 However, prior to this point, any media that needs to be sent towards 1138 the caller (such as SIP early media [RFC3960]) MUST NOT be 1139 transmitted. For this reason, implementations SHOULD delay alerting 1140 the called party until candidates for each component of each media 1141 stream have entered the valid list. In the case of a PSTN gateway, 1142 this would mean that the setup message into the PSTN is delayed until 1143 this point. Doing this increases the post-dial delay, but has the 1144 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1145 called party hears the phone ring, picks up, but hears nothing and 1146 cannot be heard. This technique works without requiring support for, 1147 or usage of, preconditions [RFC3312], since it's a localized 1148 decision. It also has the benefit of guaranteeing that not a single 1149 packet of media will get clipped, so that post-pickup delay is zero. 1150 If an agent chooses to delay local alerting in this way, it SHOULD 1151 generate a 180 response once alerting begins. 1153 12.1.2. Offer in Response 1155 In addition to uses where the offer is in an INVITE, and the answer 1156 is in the provisional and/or 200 OK response, ICE works with cases 1157 where the offer appears in the response. In such cases, which are 1158 common in third party call control [RFC3725], ICE agents SHOULD 1159 generate their offers in a reliable provisional response (which MUST 1160 utilize RFC 3262), and not alert the user on receipt of the INVITE. 1161 The answer will arrive in a PRACK. This allows for ICE processing to 1162 take place prior to alerting, so that there is no post-pickup delay, 1163 at the expense of increased call setup delays. Once ICE completes, 1164 the callee can alert the user and then generate a 200 OK when they 1165 answer. The 200 OK would contain no SDP, since the offer/answer 1166 exchange has completed. 1168 Alternatively, agents MAY place the offer in a 2xx instead (in which 1169 case the answer comes in the ACK). When this happens, the callee 1170 will alert the user on receipt of the INVITE, and the ICE exchanges 1171 will take place only after the user answers. This has the effect of 1172 reducing call setup delay, but can cause substantial post-pickup 1173 delays and media clipping. 1175 12.2. SIP Option Tags and Media Feature Tags 1177 [RFC5768] specifies a SIP option tag and media feature tag for usage 1178 with ICE. ICE implementations using SIP SHOULD support this 1179 specification, which uses a feature tag in registrations to 1180 facilitate interoperability through signaling intermediaries. 1182 12.3. Interactions with Forking 1184 ICE interacts very well with forking. Indeed, ICE fixes some of the 1185 problems associated with forking. Without ICE, when a call forks and 1186 the caller receives multiple incoming media streams, it cannot 1187 determine which media stream corresponds to which callee. 1189 With ICE, this problem is resolved. The connectivity checks which 1190 occur prior to transmission of media carry username fragments, which 1191 in turn are correlated to a specific callee. Subsequent media 1192 packets that arrive on the same candidate pair as the connectivity 1193 check will be associated with that same callee. Thus, the caller can 1194 perform this correlation as long as it has received an answer. 1196 12.4. Interactions with Preconditions 1198 Quality of Service (QoS) preconditions, which are defined in RFC 3312 1199 [RFC3312] and RFC 4032 [RFC4032], apply only to the transport 1200 addresses listed as the default targets for media in an offer/answer. 1201 If ICE changes the transport address where media is received, this 1202 change is reflected in an updated offer that changes the default 1203 destination for media to match ICE's selection. As such, it appears 1204 like any other re-INVITE would, and is fully treated in RFCs 3312 and 1205 4032, which apply without regard to the fact that the destination for 1206 media is changing due to ICE negotiations occurring "in the 1207 background". 1209 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1210 met until the checks have completed and selected the candidate pairs 1211 to be used for media. 1213 ICE also has (purposeful) interactions with connectivity 1214 preconditions [RFC5898]. Those interactions are described there. 1215 Note that the procedures described in Section 12.1 describe their own 1216 type of "preconditions", albeit with less functionality than those 1217 provided by the explicit preconditions in [RFC5898]. 1219 12.5. Interactions with Third Party Call Control 1221 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1222 I works without the controller supporting or being aware of ICE. 1223 Flow IV will work as long as the controller passes along the ICE 1224 attributes without alteration. Flow II is fundamentally incompatible 1225 with ICE; each agent will believe itself to be the answerer and thus 1226 never generate a re-INVITE. 1228 The flows for continued operation, as described in Section 7 of RFC 1229 3725, require additional behavior of ICE implementations to support. 1231 In particular, if an agent receives a mid-dialog re-INVITE that 1232 contains no offer, it MUST restart ICE for each media stream and go 1233 through the process of gathering new candidates. Furthermore, that 1234 list of candidates SHOULD include the ones currently being used for 1235 media. 1237 13. Relationship with ANAT 1239 RFC 4091 [RFC4091], the Alternative Network Address Types (ANAT) 1240 Semantics for the SDP grouping framework, and RFC 4092 [RFC4092], its 1241 usage with SIP, define a mechanism for indicating that an agent can 1242 support both IPv4 and IPv6 for a media stream, and it does so by 1243 including two "m=" lines, one for v4 and one for v6. This is similar 1244 to ICE, which allows for an agent to indicate multiple transport 1245 addresses using the candidate attribute. However, ANAT relies on 1246 static selection to pick between choices, rather than a dynamic 1247 connectivity check used by ICE. 1249 This specification deprecates RFC 4091 and RFC 4092. Instead, agents 1250 wishing to support dual-stack will utilize ICE. 1252 14. Setting Ta and RTO for RTP Media Streams 1254 During the gathering phase of ICE (section 4.1.1 [ICE-BIS]) and while 1255 ICE is performing connectivity checks (section 7 [ICE-BIS]), an agent 1256 sends STUN and TURN transactions. These transactions are paced at a 1257 rate of one every Ta milliseconds, and utilize a specific RTO. See 1258 Section 13.1 of [ICE-BIS] for details on how the valies of Ta and RTO 1259 are computed with a real-time media stream of known maximum bandwith 1260 to rate-control the ICE exchanges. 1262 15. Security Considerations 1264 15.1. Attacks on the Offer/Answer Exchanges 1266 An attacker that can modify or disrupt the offer/answer exchanges 1267 themselves can readily launch a variety of attacks with ICE. They 1268 could direct media to a target of a DoS attack, they could insert 1269 themselves into the media stream, and so on. These are similar to 1270 the general security considerations for offer/answer exchanges, and 1271 the security considerations in RFC 3264 [RFC3264] apply. These 1272 require techniques for message integrity and encryption for offers 1273 and answers, which are satisfied by the SIPS mechanism [RFC3261] when 1274 SIP is used. As such, the usage of SIPS with ICE is RECOMMENDED. 1276 15.2. Insider Attacks 1278 In addition to attacks where the attacker is a third party trying to 1279 insert fake offers, answers, or stun messages, there are several 1280 attacks possible with ICE when the attacker is an authenticated and 1281 valid participant in the ICE exchange. 1283 15.2.1. The Voice Hammer Attack 1285 The voice hammer attack is an amplification attack. In this attack, 1286 the attacker initiates sessions to other agents, and maliciously 1287 includes the IP address and port of a DoS target as the destination 1288 for media traffic signaled in the SDP. This causes substantial 1289 amplification; a single offer/answer exchange can create a continuing 1290 flood of media packets, possibly at high rates (consider video 1291 sources). This attack is not specific to ICE, but ICE can help 1292 provide remediation. 1294 Specifically, if ICE is used, the agent receiving the malicious SDP 1295 will first perform connectivity checks to the target of media before 1296 sending media there. If this target is a third-party host, the 1297 checks will not succeed, and media is never sent. 1299 Unfortunately, ICE doesn't help if its not used, in which case an 1300 attacker could simply send the offer without the ICE parameters. 1301 However, in environments where the set of clients is known, and is 1302 limited to ones that support ICE, the server can reject any offers or 1303 answers that don't indicate ICE support. 1305 15.2.2. Interactions with Application Layer Gateways and SIP 1307 Application Layer Gateways (ALGs) are functions present in a NAT 1308 device that inspect the contents of packets and modify them, in order 1309 to facilitate NAT traversal for application protocols. Session 1310 Border Controllers (SBCs) are close cousins of ALGs, but are less 1311 transparent since they actually exist as application layer SIP 1312 intermediaries. ICE has interactions with SBCs and ALGs. 1314 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1315 long as the ALG correctly modifies the SDP. A correct ALG 1316 implementation behaves as follows: 1318 o The ALG does not modify the "m=" and "c=" lines or the rtcp 1319 attribute if they contain external addresses. 1321 o If the "m=" and "c=" lines contain internal addresses, the 1322 modification depends on the state of the ALG: 1324 If the ALG already has a binding established that maps an 1325 external port to an internal IP address and port matching the 1326 values in the "m=" and "c=" lines or rtcp attribute, the ALG 1327 uses that binding instead of creating a new one. 1329 If the ALG does not already have a binding, it creates a new 1330 one and modifies the SDP, rewriting the "m=" and "c=" lines and 1331 rtcp attribute. 1333 Unfortunately, many ALGs are known to work poorly in these corner 1334 cases. ICE does not try to work around broken ALGs, as this is 1335 outside the scope of its functionality. ICE can help diagnose these 1336 conditions, which often show up as a mismatch between the set of 1337 candidates and the "m=" and "c=" lines and rtcp attributes. The ice- 1338 mismatch attribute is used for this purpose. 1340 ICE works best through ALGs when the signaling is run over TLS. This 1341 prevents the ALG from manipulating the SDP messages and interfering 1342 with ICE operation. Implementations that are expected to be deployed 1343 behind ALGs SHOULD provide for TLS transport of the SDP. 1345 If an SBC is SIP aware but not ICE aware, the result depends on the 1346 behavior of the SBC. If it is acting as a proper Back-to-Back User 1347 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1348 understand, including the ICE attributes. Consequently, the call 1349 will appear to both endpoints as if the other side doesn't support 1350 ICE. This will result in ICE being disabled, and media flowing 1351 through the SBC, if the SBC has requested it. If, however, the SBC 1352 passes the ICE attributes without modification, yet modifies the 1353 default destination for media (contained in the "m=" and "c=" lines 1354 and rtcp attribute), this will be detected as an ICE mismatch, and 1355 ICE processing is aborted for the call. It is outside of the scope 1356 of ICE for it to act as a tool for "working around" SBCs. If one is 1357 present, ICE will not be used and the SBC techniques take precedence. 1359 16. IANA Considerations 1361 16.1. SDP Attributes 1363 Original ICE specification defined seven new SDP attributes per the 1364 procedures of Section 8.2.4 of [RFC4566]. The registration 1365 information is reproduced here. 1367 16.1.1. candidate Attribute 1369 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1371 Attribute Name: candidate 1372 Long Form: candidate 1374 Type of Attribute: media-level 1376 Charset Considerations: The attribute is not subject to the charset 1377 attribute. 1379 Purpose: This attribute is used with Interactive Connectivity 1380 Establishment (ICE), and provides one of many possible candidate 1381 addresses for communication. These addresses are validated with 1382 an end-to-end connectivity check using Session Traversal Utilities 1383 for NAT (STUN). 1385 Appropriate Values: See Section 8 of RFC XXXX. 1387 16.1.2. remote-candidates Attribute 1389 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1391 Attribute Name: remote-candidates 1393 Long Form: remote-candidates 1395 Type of Attribute: media-level 1397 Charset Considerations: The attribute is not subject to the charset 1398 attribute. 1400 Purpose: This attribute is used with Interactive Connectivity 1401 Establishment (ICE), and provides the identity of the remote 1402 candidates that the offerer wishes the answerer to use in its 1403 answer. 1405 Appropriate Values: See Section 8 of RFC XXXX. 1407 16.1.3. ice-lite Attribute 1409 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1411 Attribute Name: ice-lite 1413 Long Form: ice-lite 1415 Type of Attribute: session-level 1417 Charset Considerations: The attribute is not subject to the charset 1418 attribute. 1420 Purpose: This attribute is used with Interactive Connectivity 1421 Establishment (ICE), and indicates that an agent has the minimum 1422 functionality required to support ICE inter-operation with a peer 1423 that has a full implementation. 1425 Appropriate Values: See Section 8 of RFC XXXX. 1427 16.1.4. ice-mismatch Attribute 1429 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1431 Attribute Name: ice-mismatch 1433 Long Form: ice-mismatch 1435 Type of Attribute: session-level 1437 Charset Considerations: The attribute is not subject to the charset 1438 attribute. 1440 Purpose: This attribute is used with Interactive Connectivity 1441 Establishment (ICE), and indicates that an agent is ICE capable, 1442 but did not proceed with ICE due to a mismatch of candidates with 1443 the default destination for media signaled in the SDP. 1445 Appropriate Values: See Section 8 of RFC XXXX. 1447 16.1.5. ice-pwd Attribute 1449 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1451 Attribute Name: ice-pwd 1453 Long Form: ice-pwd 1455 Type of Attribute: session- or media-level 1457 Charset Considerations: The attribute is not subject to the charset 1458 attribute. 1460 Purpose: This attribute is used with Interactive Connectivity 1461 Establishment (ICE), and provides the password used to protect 1462 STUN connectivity checks. 1464 Appropriate Values: See Section 8 of RFC XXXX. 1466 16.1.6. ice-ufrag Attribute 1468 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1470 Attribute Name: ice-ufrag 1472 Long Form: ice-ufrag 1474 Type of Attribute: session- or media-level 1476 Charset Considerations: The attribute is not subject to the charset 1477 attribute. 1479 Purpose: This attribute is used with Interactive Connectivity 1480 Establishment (ICE), and provides the fragments used to construct 1481 the username in STUN connectivity checks. 1483 Appropriate Values: See Section 8 of RFC XXXX. 1485 16.1.7. ice-pacing Attribute 1487 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1489 Attribute Name: ice-pacing 1491 Long Form: ice-pacing 1493 Type of Attribute: session-level 1495 Charset Considerations: The attribute is not subject to the charset 1496 attribute. 1498 Purpose: This attribute is used with Interactive Connectivity 1499 Establishment (ICE) to indicate desired connectivity check pacing 1500 values. 1502 Appropriate Values: See Section 8 of RFC XXXX. 1504 16.1.8. ice-options Attribute 1506 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1508 Attribute Name: ice-options 1510 Long Form: ice-options 1512 Type of Attribute: session- or media-level 1513 Charset Considerations: The attribute is not subject to the charset 1514 attribute. 1516 Purpose: This attribute is used with Interactive Connectivity 1517 Establishment (ICE), and indicates the ICE options or extensions 1518 used by the agent. 1520 Appropriate Values: See Section 8 of RFC XXXX. 1522 16.2. Interactive Connectivity Establishment (ICE) Options Registry 1524 IANA maintains a registry for ice-options identifiers under the 1525 Specification Required policy as defined in "Guidelines for Writing 1526 an IANA Considerations Section in RFCs" [RFC5226]. 1528 ICE options are of unlimited length according to the syntax in 1529 Section 8.6; however, they are RECOMMENDED to be no longer than 20 1530 characters. This is to reduce message sizes and allow for efficient 1531 parsing. 1533 In RFC 5245 ICE options could only be defined at the session level. 1534 ICE options can now also be defined at the media level. This can be 1535 used when aggregating between different ICE agents in the same 1536 endpoint, but future options may require to be defined at the media- 1537 level. To ensure compatibility with legacy implementation, the 1538 media-level ICE options MUST be aggregated into a session-level ICE 1539 option. Because aggregation rules depend on the specifics of each 1540 option, all new ICE options MUST also define in their specification 1541 how the media-level ICE option values are aggregated to generate the 1542 value of the session-level ICE option. 1544 The only ICE option defined at the time of publication is "rtp+ecn" 1545 [RFC6679]. The aggregation rule for this ICE option is that if all 1546 aggregated media using ICE contain a media-level "rtp+ecn" ICE option 1547 then an "rtp+ecn" ICE option MUST be inserted at the session-level. 1548 If one of the media does not contain the option, then it MUST NOT be 1549 inserted at the session-level. 1551 A registration request MUST include the following information: 1553 o The ICE option identifier to be registered 1555 o Name, Email, and Address of a contact person for the registration 1557 o Organization or individuals having the change control 1559 o Short description of the ICE extension to which the option relates 1560 o Reference(s) to the specification defining the ICE option and the 1561 related extensions 1563 17. Acknowledgments 1565 A large part of the text in this document was taken from RFC 5245, 1566 authored by Jonathan Rosenberg. 1568 Some of the text in this document was taken from RFC 6336, authored 1569 by Magnus Westerlund and Colin Perkins. 1571 Thanks to Thomas Stach for the text in Section 9.3 1573 18. References 1575 18.1. Normative References 1577 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1578 Requirement Levels", BCP 14, RFC 2119, March 1997. 1580 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1581 A., Peterson, J., Sparks, R., Handley, M., and E. 1582 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1583 June 2002. 1585 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1586 Provisional Responses in Session Initiation Protocol 1587 (SIP)", RFC 3262, June 2002. 1589 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1590 with Session Description Protocol (SDP)", RFC 3264, June 1591 2002. 1593 [RFC3312] Camarillo, G., Marshall, W., and J. Rosenberg, 1594 "Integration of Resource Management and Session Initiation 1595 Protocol (SIP)", RFC 3312, October 2002. 1597 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1598 Jacobson, "RTP: A Transport Protocol for Real-Time 1599 Applications", STD 64, RFC 3550, July 2003. 1601 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1602 Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 1603 3556, July 2003. 1605 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1606 in Session Description Protocol (SDP)", RFC 3605, October 1607 2003. 1609 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1610 Initiation Protocol (SIP) Preconditions Framework", RFC 1611 4032, March 2005. 1613 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1614 Address Types (ANAT) Semantics for the Session Description 1615 Protocol (SDP) Grouping Framework", RFC 4091, June 2005. 1617 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1618 Description Protocol (SDP) Alternative Network Address 1619 Types (ANAT) Semantics in the Session Initiation Protocol 1620 (SIP)", RFC 4092, June 2005. 1622 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1623 Description Protocol", RFC 4566, July 2006. 1625 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1626 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1627 May 2008. 1629 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1630 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1632 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1633 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1634 October 2008. 1636 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1637 Connectivity Establishment (ICE) in the Session Initiation 1638 Protocol (SIP)", RFC 5768, April 2010. 1640 [RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., 1641 and K. Carlberg, "Explicit Congestion Notification (ECN) 1642 for RTP over UDP", RFC 6679, August 2012. 1644 [RFC7092] Kaplan, H. and V. Pascual, "A Taxonomy of Session 1645 Initiation Protocol (SIP) Back-to-Back User Agents", RFC 1646 7092, December 2013. 1648 [ICE-BIS] Keranen, A. and J. Rosenberg, "Interactive Connectivity 1649 Establishment (ICE): A Protocol for Network Address 1650 Translator (NAT) Traversal for Offer/Answer Protocols", 1651 draft-ietf-mmusic-rfc5245bis-04 (work in progress), March 1652 2015. 1654 18.2. Informative References 1656 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1657 Camarillo, "Best Current Practices for Third Party Call 1658 Control (3pcc) in the Session Initiation Protocol (SIP)", 1659 BCP 85, RFC 3725, April 2004. 1661 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1662 Tone Generation in the Session Initiation Protocol (SIP)", 1663 RFC 3960, December 2004. 1665 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1666 Congestion Control Protocol (DCCP)", RFC 4340, March 2006. 1668 [RFC5626] Jennings, C., Mahy, R., and F. Audet, "Managing Client- 1669 Initiated Connections in the Session Initiation Protocol 1670 (SIP)", RFC 5626, October 2009. 1672 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1673 "Connectivity Preconditions for Session Description 1674 Protocol (SDP) Media Streams", RFC 5898, July 2010. 1676 Appendix A. Examples 1678 For the example shown in Section 14 of [ICE-BIS] the resulting offer 1679 (message 5) encoded in SDP looks like: 1681 v=0 1682 o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP 1683 s= 1684 c=IN IP4 $NAT-PUB-1.IP 1685 t=0 0 1686 a=ice-pwd:asd88fgpdd777uzjYhagZg 1687 a=ice-ufrag:8hhY 1688 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1689 b=RS:0 1690 b=RR:0 1691 a=rtpmap:0 PCMU/8000 1692 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1693 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1694 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1696 The offer, with the variables replaced with their values, will look 1697 like (lines folded for clarity): 1699 v=0 1700 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 1701 s= 1702 c=IN IP4 192.0.2.3 1703 t=0 0 1704 a=ice-pwd:asd88fgpdd777uzjYhagZg 1705 a=ice-ufrag:8hhY 1706 m=audio 45664 RTP/AVP 0 1707 b=RS:0 1708 b=RR:0 1709 a=rtpmap:0 PCMU/8000 1710 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 1711 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 1712 10.0.1.1 rport 8998 1714 The resulting answer looks like: 1716 v=0 1717 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1718 s= 1719 c=IN IP4 $R-PUB-1.IP 1720 t=0 0 1721 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1722 a=ice-ufrag:9uB6 1723 m=audio $R-PUB-1.PORT RTP/AVP 0 1724 b=RS:0 1725 b=RR:0 1726 a=rtpmap:0 PCMU/8000 1727 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1729 With the variables filled in: 1731 v=0 1732 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1733 s= 1734 c=IN IP4 192.0.2.1 1735 t=0 0 1736 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1737 a=ice-ufrag:9uB6 1738 m=audio 3478 RTP/AVP 0 1739 b=RS:0 1740 b=RR:0 1741 a=rtpmap:0 PCMU/8000 1742 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1744 Appendix B. The remote-candidates Attribute 1746 The a=remote-candidates attribute exists to eliminate a race 1747 condition between the updated offer and the response to the STUN 1748 Binding request that moved a candidate into the Valid list. This 1749 race condition is shown in Figure 1. On receipt of message 4, agent 1750 L adds a candidate pair to the valid list. If there was only a 1751 single media stream with a single component, agent L could now send 1752 an updated offer. However, the check from agent R has not yet 1753 generated a response, and agent R receives the updated offer (message 1754 7) before getting the response (message 9). Thus, it does not yet 1755 know that this particular pair is valid. To eliminate this 1756 condition, the actual candidates at R that were selected by the 1757 offerer (the remote candidates) are included in the offer itself, and 1758 the answerer delays its answer until those pairs validate. 1760 Agent L Network Agent R 1761 |(1) Offer | | 1762 |------------------------------------------>| 1763 |(2) Answer | | 1764 |<------------------------------------------| 1765 |(3) STUN Req. | | 1766 |------------------------------------------>| 1767 |(4) STUN Res. | | 1768 |<------------------------------------------| 1769 |(5) STUN Req. | | 1770 |<------------------------------------------| 1771 |(6) STUN Res. | | 1772 |-------------------->| | 1773 | |Lost | 1774 |(7) Offer | | 1775 |------------------------------------------>| 1776 |(8) STUN Req. | | 1777 |<------------------------------------------| 1778 |(9) STUN Res. | | 1779 |------------------------------------------>| 1780 |(10) Answer | | 1781 |<------------------------------------------| 1783 Figure 1: Race Condition Flow 1785 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1787 When ICE runs between two peers, one agent acts as controlled, and 1788 the other as controlling. Rules are defined as a function of 1789 implementation type and offerer/answerer to determine who is 1790 controlling and who is controlled. However, the specification 1791 mentions that, in some cases, both sides might believe they are 1792 controlling, or both sides might believe they are controlled. How 1793 can this happen? 1795 The condition when both agents believe they are controlled shows up 1796 in third party call control cases. Consider the following flow: 1798 A Controller B 1799 |(1) INV() | | 1800 |<-------------| | 1801 |(2) 200(SDP1) | | 1802 |------------->| | 1803 | |(3) INV() | 1804 | |------------->| 1805 | |(4) 200(SDP2) | 1806 | |<-------------| 1807 |(5) ACK(SDP2) | | 1808 |<-------------| | 1809 | |(6) ACK(SDP1) | 1810 | |------------->| 1812 Figure 2: Role Conflict Flow 1814 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1815 it works better than flow III since it produces fewer messages. In 1816 this flow, the controller sends an offerless INVITE to agent A, which 1817 responds with its offer, SDP1. The agent then sends an offerless 1818 INVITE to agent B, which it responds to with its offer, SDP2. The 1819 controller then uses the offer from each agent to generate the 1820 answers. When this flow is used, ICE will run between agents A and 1821 B, but both will believe they are in the controlling role. With the 1822 role conflict resolution procedures, this flow will function properly 1823 when ICE is used. 1825 At this time, there are no documented flows that can result in the 1826 case where both agents believe they are controlled. However, the 1827 conflict resolution procedures allow for this case, should a flow 1828 arise that would fit into this category. 1830 Appendix D. Why Send an Updated Offer? 1832 Section 11.1 describes rules for sending media. Both agents can send 1833 media once ICE checks complete, without waiting for an updated offer. 1834 Indeed, the only purpose of the updated offer is to "correct" the SDP 1835 so that the default destination for media matches where media is 1836 being sent based on ICE procedures (which will be the highest- 1837 priority nominated candidate pair). 1839 This begs the question -- why is the updated offer/answer exchange 1840 needed at all? Indeed, in a pure offer/answer environment, it would 1841 not be. The offerer and answerer will agree on the candidates to use 1842 through ICE, and then can begin using them. As far as the agents 1843 themselves are concerned, the updated offer/answer provides no new 1844 information. However, in practice, numerous components along the 1845 signaling path look at the SDP information. These include entities 1846 performing off-path QoS reservations, NAT traversal components such 1847 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1848 that passively monitor the network. For these tools to continue to 1849 function without change, the core property of SDP -- that the 1850 existing, pre-ICE definitions of the addresses used for media -- the 1851 "m=" and "c=" lines and the rtcp attribute -- must be retained. For 1852 this reason, an updated offer must be sent. 1854 Authors' Addresses 1856 Marc Petit-Huguenin 1857 Impedance Mismatch 1859 Email: marc@petit-huguenin.org 1861 Ari Keranen 1862 Ericsson 1863 Jorvas 02420 1864 Finland 1866 Email: ari.keranen@ericsson.com 1868 Suhas Nandakumar 1869 Cisco Systems 1870 707 Tasman Dr 1871 Milpitas 95035 1872 USA 1874 Email: snandaku@cisco.com