idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-05.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 (March 9, 2015) is 3328 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) ** 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 (~~), 4 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: September 10, 2015 Ericsson 6 March 9, 2015 8 Using Interactive Connectivity Establishment (ICE) with 9 Session Description Protocol (SDP) offer/answer and Session Initiation 10 Protocol (SIP) 11 draft-ietf-mmusic-ice-sip-sdp-05 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 September 10, 2015. 36 Copyright Notice 38 Copyright (c) 2015 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 . . . . . . . . . . . . . . . . . . 6 73 4.3. Determining Role . . . . . . . . . . . . . . . . . . . . 7 74 5. Receipt of the Initial Answer . . . . . . . . . . . . . . . . 7 75 5.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 7 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 . . . . . . . . . . . . . . . . . . . 8 81 7.2.1. Full Implementation Procedures . . . . . . . . . . . 8 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 . . . . . . . . 11 86 8.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 12 87 8.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 12 88 8.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 13 89 9. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 13 90 9.1. Generating the Offer . . . . . . . . . . . . . . . . . . 13 91 9.1.1. Procedures for All Implementations . . . . . . . . . 13 92 9.1.2. Procedures for Full Implementations . . . . . . . . . 14 93 9.1.3. Procedures for Lite Implementations . . . . . . . . . 16 94 9.2. Receiving the Offer and Generating an Answer . . . . . . 17 95 9.2.1. Procedures for All Implementations . . . . . . . . . 17 96 9.2.2. Procedures for Full Implementations . . . . . . . . . 18 97 9.2.3. Procedures for Lite Implementations . . . . . . . . . 19 98 9.3. Receiving the Answer for a Subsequent Offer . . . . . . . 20 99 9.3.1. Procedures for All Implementations . . . . . . . . . 20 100 9.4. Updating the Check and Valid Lists . . . . . . . . . . . 21 101 9.4.1. Procedures for Full Implementations . . . . . . . . . 21 102 9.4.2. Procedures for Lite Implementations . . . . . . . . . 22 103 10. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 23 104 11. Media Handling . . . . . . . . . . . . . . . . . . . . . . . 23 105 11.1. Sending Media . . . . . . . . . . . . . . . . . . . . . 23 106 11.1.1. Procedures for All Implementations . . . . . . . . . 23 107 11.2. Receiving Media . . . . . . . . . . . . . . . . . . . . 23 108 12. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . 24 109 12.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 24 110 12.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . 24 111 12.1.2. Offer in Response . . . . . . . . . . . . . . . . . 26 112 12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 26 113 12.3. Interactions with Forking . . . . . . . . . . . . . . . 26 114 12.4. Interactions with Preconditions . . . . . . . . . . . . 27 115 12.5. Interactions with Third Party Call Control . . . . . . . 27 116 13. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 27 117 14. Setting Ta and RTO for RTP Media Streams . . . . . . . . . . 28 118 15. Security Considerations . . . . . . . . . . . . . . . . . . . 30 119 15.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . 30 120 15.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . 30 121 15.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . 30 122 15.2.2. Interactions with Application Layer Gateways and SIP 30 123 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 32 124 16.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 32 125 16.1.1. candidate Attribute . . . . . . . . . . . . . . . . 32 126 16.1.2. remote-candidates Attribute . . . . . . . . . . . . 32 127 16.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 33 128 16.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 33 129 16.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . 33 130 16.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . 34 131 16.1.7. ice-pacing Attribute . . . . . . . . . . . . . . . . 34 132 16.1.8. ice-options Attribute . . . . . . . . . . . . . . . 35 133 16.2. Interactive Connectivity Establishment (ICE) Options 134 Registry . . . . . . . . . . . . . . . . . . . . . . . . 35 135 17. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 36 136 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 36 137 18.1. Normative References . . . . . . . . . . . . . . . . . . 36 138 18.2. Informative References . . . . . . . . . . . . . . . . . 38 139 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 38 140 Appendix B. The remote-candidates Attribute . . . . . . . . . . 40 141 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 41 142 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 42 143 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 145 1. Introduction 147 This document describes how Interactive Connectivity Establishment 148 (ICE) is used with Session Description Protocol (SDP) offer/answer 149 and Session Initiation Protocol (SIP). The ICE specification 150 [ICE-BIS] describes procedures that are common to all usages of ICE 151 and this document gives the additional details needed to use ICE with 152 SIP and SDP offer/answer. 154 Note that ICE is not intended for NAT traversal for SIP, which is 155 assumed to be provided via another mechanism [RFC5626]. 157 2. Terminology 159 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 160 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 161 "OPTIONAL" in this document are to be interpreted as described in RFC 162 2119 [RFC2119]. 164 This document uses the terms defined 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 in 172 the m line. For the RTCP component, it is in the rtcp attribute 173 when present, and when not present, the IP address is in the c 174 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 to 208 use. The ordering of media streams in the SDP is relevant for ICE. 209 ICE will perform its connectivity checks for the first m line first, 210 and consequently media will be able to flow for that stream first. 211 Agents SHOULD place their most important media stream, if there is 212 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 and m 232 lines, respectively. If the agent is utilizing RTCP, it MUST encode 233 the RTCP candidate using the a=rtcp attribute as defined in RFC 3605 234 [RFC3605]. If RTCP is not in use, the agent MUST signal that using 235 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, respectively, 286 appear in a candidate attribute and the value in the rtcp attribute 287 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 9 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 candidates in the m and c lines for the 357 media stream (called the DEFAULT CANDIDATES) don't match ICE's 358 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 11 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 12.2 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 stream) 702 MUST be the local candidate from the highest-priority nominated pair 703 in the valid list for each component. This "fixes" the default 704 destination for media to equal the destination ICE has selected for 705 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 c 847 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 c 886 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 985 Section 11.1. Once these destinations are noted, the agent MUST 986 flush the valid and check lists, and then recompute the check list 987 and its states as 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.1. The state of ICE processing for each 1039 media stream MUST change to Running, and the state of ICE processing 1040 MUST change to Running. 1042 10. Keepalives 1044 The keepalives MUST be sent regardless of whether the media stream is 1045 currently inactive, sendonly, recvonly, or sendrecv, and regardless 1046 of the presence or value of the bandwidth attribute. An agent can 1047 determine that its peer supports ICE by the presence of a=candidate 1048 attributes for each media session. 1050 11. Media Handling 1052 11.1. Sending Media 1054 Note that the selected pair for a component of a media stream may not 1055 equal the default pair for that same component from the most recent 1056 offer/answer exchange. When this happens, the selected pair is used 1057 for media, not the default pair. When ICE first completes, if the 1058 selected pairs aren't a match for the default pairs, the controlling 1059 agent sends an updated offer/answer exchange to remedy this 1060 disparity. However, until that updated offer arrives, there will not 1061 be a match. Furthermore, in very unusual cases, the default 1062 candidates in the updated offer/answer will not be a match. 1064 11.1.1. Procedures for All Implementations 1066 ICE has interactions with jitter buffer adaptation mechanisms. An 1067 RTP stream can begin using one candidate, and switch to another one, 1068 though this happens rarely with ICE. The newer candidate may result 1069 in RTP packets taking a different path through the network -- one 1070 with different delay characteristics. As discussed below, agents are 1071 encouraged to re-adjust jitter buffers when there are changes in 1072 source or destination address of media packets. Furthermore, many 1073 audio codecs use the marker bit to signal the beginning of a 1074 talkspurt, for the purposes of jitter buffer adaptation. For such 1075 codecs, it is RECOMMENDED that the sender set the marker bit 1076 [RFC3550] when an agent switches transmission of media from one 1077 candidate pair to another. 1079 11.2. Receiving Media 1081 ICE implementations MUST be prepared to receive media on each 1082 component on any candidates provided for that component in the most 1083 recent offer/answer exchange (in the case of RTP, this would include 1084 both RTP and RTCP if candidates were provided for both). 1086 It is RECOMMENDED that, when an agent receives an RTP packet with a 1087 new source or destination IP address for a particular media stream, 1088 that the agent re-adjust its jitter buffers. 1090 RFC 3550 [RFC3550] describes an algorithm in Section 8.2 for 1091 detecting synchronization source (SSRC) collisions and loops. These 1092 algorithms are based, in part, on seeing different source transport 1093 addresses with the same SSRC. However, when ICE is used, such 1094 changes will sometimes occur as the media streams switch between 1095 candidates. An agent will be able to determine that a media stream 1096 is from the same peer as a consequence of the STUN exchange that 1097 proceeds media transmission. Thus, if there is a change in source 1098 transport address, but the media packets come from the same peer 1099 agent, this SHOULD NOT be treated as an SSRC collision. 1101 12. Usage with SIP 1103 12.1. Latency Guidelines 1105 ICE requires a series of STUN-based connectivity checks to take place 1106 between endpoints. These checks start from the answerer on 1107 generation of its answer, and start from the offerer when it receives 1108 the answer. These checks can take time to complete, and as such, the 1109 selection of messages to use with offers and answers can affect 1110 perceived user latency. Two latency figures are of particular 1111 interest. These are the post-pickup delay and the post-dial delay. 1112 The post-pickup delay refers to the time between when a user "answers 1113 the phone" and when any speech they utter can be delivered to the 1114 caller. The post-dial delay refers to the time between when a user 1115 enters the destination address for the user and ringback begins as a 1116 consequence of having successfully started ringing the phone of the 1117 called party. 1119 Two cases can be considered -- one where the offer is present in the 1120 initial INVITE and one where it is in a response. 1122 12.1.1. Offer in INVITE 1124 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1125 gathering candidates prior to actually sending its initial INVITE. 1126 This can be started upon user interface cues that a call is pending, 1127 such as activity on a keypad or the phone going off-hook. 1129 If an offer is received in an INVITE request, the answerer SHOULD 1130 begin to gather its candidates on receipt of the offer and then 1131 generate an answer in a provisional response once it has completed 1132 that process. ICE requires that a provisional response with an SDP 1133 be transmitted reliably. This can be done through the existing 1134 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1135 through an optimization that is specific to ICE. With this 1136 optimization, provisional responses containing an SDP answer that 1137 begins ICE processing for one or more media streams can be sent 1138 reliably without RFC 3262. To do this, the agent retransmits the 1139 provisional response with the exponential backoff timers described in 1140 RFC 3262. Retransmits MUST cease on receipt of a STUN Binding 1141 request for one of the media streams signaled in that SDP (because 1142 receipt of a Binding request indicates the offerer has received the 1143 answer) or on transmission of the answer in a 2xx response. If the 1144 peer agent is lite, there will never be a STUN Binding request. In 1145 such a case, the agent MUST cease retransmitting the 18x after 1146 sending it four times (ICE will actually work even if the peer never 1147 receives the 18x; however, experience has shown that sending it is 1148 important for middleboxes and firewall traversal). If no Binding 1149 request is received prior to the last retransmit, the agent does not 1150 consider the session terminated. Despite the fact that the 1151 provisional response will be delivered reliably, the rules for when 1152 an agent can send an updated offer or answer do not change from those 1153 specified in RFC 3262. Specifically, if the INVITE contained an 1154 offer, the same answer appears in all of the 1xx and in the 2xx 1155 response to the INVITE. Only after that 2xx has been sent can an 1156 updated offer/answer exchange occur. This optimization SHOULD NOT be 1157 used if both agents support PRACK. Note that the optimization is 1158 very specific to provisional response carrying answers that start ICE 1159 processing; it is not a general technique for 1xx reliability. 1161 Alternatively, an agent MAY delay sending an answer until the 200 OK; 1162 however, this results in a poor user experience and is NOT 1163 RECOMMENDED. 1165 Once the answer has been sent, the agent SHOULD begin its 1166 connectivity checks. Once candidate pairs for each component of a 1167 media stream enter the valid list, the answerer can begin sending 1168 media on that media stream. 1170 However, prior to this point, any media that needs to be sent towards 1171 the caller (such as SIP early media [RFC3960]) MUST NOT be 1172 transmitted. For this reason, implementations SHOULD delay alerting 1173 the called party until candidates for each component of each media 1174 stream have entered the valid list. In the case of a PSTN gateway, 1175 this would mean that the setup message into the PSTN is delayed until 1176 this point. Doing this increases the post-dial delay, but has the 1177 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1178 called party hears the phone ring, picks up, but hears nothing and 1179 cannot be heard. This technique works without requiring support for, 1180 or usage of, preconditions [RFC3312], since it's a localized 1181 decision. It also has the benefit of guaranteeing that not a single 1182 packet of media will get clipped, so that post-pickup delay is zero. 1183 If an agent chooses to delay local alerting in this way, it SHOULD 1184 generate a 180 response once alerting begins. 1186 12.1.2. Offer in Response 1188 In addition to uses where the offer is in an INVITE, and the answer 1189 is in the provisional and/or 200 OK response, ICE works with cases 1190 where the offer appears in the response. In such cases, which are 1191 common in third party call control [RFC3725], ICE agents SHOULD 1192 generate their offers in a reliable provisional response (which MUST 1193 utilize RFC 3262), and not alert the user on receipt of the INVITE. 1194 The answer will arrive in a PRACK. This allows for ICE processing to 1195 take place prior to alerting, so that there is no post-pickup delay, 1196 at the expense of increased call setup delays. Once ICE completes, 1197 the callee can alert the user and then generate a 200 OK when they 1198 answer. The 200 OK would contain no SDP, since the offer/answer 1199 exchange has completed. 1201 Alternatively, agents MAY place the offer in a 2xx instead (in which 1202 case the answer comes in the ACK). When this happens, the callee 1203 will alert the user on receipt of the INVITE, and the ICE exchanges 1204 will take place only after the user answers. This has the effect of 1205 reducing call setup delay, but can cause substantial post-pickup 1206 delays and media clipping. 1208 12.2. SIP Option Tags and Media Feature Tags 1210 [RFC5768] specifies a SIP option tag and media feature tag for usage 1211 with ICE. ICE implementations using SIP SHOULD support this 1212 specification, which uses a feature tag in registrations to 1213 facilitate interoperability through signaling intermediaries. 1215 12.3. Interactions with Forking 1217 ICE interacts very well with forking. Indeed, ICE fixes some of the 1218 problems associated with forking. Without ICE, when a call forks and 1219 the caller receives multiple incoming media streams, it cannot 1220 determine which media stream corresponds to which callee. 1222 With ICE, this problem is resolved. The connectivity checks which 1223 occur prior to transmission of media carry username fragments, which 1224 in turn are correlated to a specific callee. Subsequent media 1225 packets that arrive on the same candidate pair as the connectivity 1226 check will be associated with that same callee. Thus, the caller can 1227 perform this correlation as long as it has received an answer. 1229 12.4. Interactions with Preconditions 1231 Quality of Service (QoS) preconditions, which are defined in RFC 3312 1232 [RFC3312] and RFC 4032 [RFC4032], apply only to the transport 1233 addresses listed as the default targets for media in an offer/answer. 1234 If ICE changes the transport address where media is received, this 1235 change is reflected in an updated offer that changes the default 1236 destination for media to match ICE's selection. As such, it appears 1237 like any other re-INVITE would, and is fully treated in RFCs 3312 and 1238 4032, which apply without regard to the fact that the destination for 1239 media is changing due to ICE negotiations occurring "in the 1240 background". 1242 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1243 met until the checks have completed and selected the candidate pairs 1244 to be used for media. 1246 ICE also has (purposeful) interactions with connectivity 1247 preconditions [RFC5898]. Those interactions are described there. 1248 Note that the procedures described in Section 12.1 describe their own 1249 type of "preconditions", albeit with less functionality than those 1250 provided by the explicit preconditions in [RFC5898]. 1252 12.5. Interactions with Third Party Call Control 1254 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1255 I works without the controller supporting or being aware of ICE. 1256 Flow IV will work as long as the controller passes along the ICE 1257 attributes without alteration. Flow II is fundamentally incompatible 1258 with ICE; each agent will believe itself to be the answerer and thus 1259 never generate a re-INVITE. 1261 The flows for continued operation, as described in Section 7 of RFC 1262 3725, require additional behavior of ICE implementations to support. 1263 In particular, if an agent receives a mid-dialog re-INVITE that 1264 contains no offer, it MUST restart ICE for each media stream and go 1265 through the process of gathering new candidates. Furthermore, that 1266 list of candidates SHOULD include the ones currently being used for 1267 media. 1269 13. Relationship with ANAT 1271 RFC 4091 [RFC4091], the Alternative Network Address Types (ANAT) 1272 Semantics for the SDP grouping framework, and RFC 4092 [RFC4092], its 1273 usage with SIP, define a mechanism for indicating that an agent can 1274 support both IPv4 and IPv6 for a media stream, and it does so by 1275 including two m lines, one for v4 and one for v6. This is similar to 1276 ICE, which allows for an agent to indicate multiple transport 1277 addresses using the candidate attribute. However, ANAT relies on 1278 static selection to pick between choices, rather than a dynamic 1279 connectivity check used by ICE. 1281 This specification deprecates RFC 4091 and RFC 4092. Instead, agents 1282 wishing to support dual-stack will utilize ICE. 1284 14. Setting Ta and RTO for RTP Media Streams 1286 During the gathering phase of ICE (section 4.1.1 [ICE-BIS]) and while 1287 ICE is performing connectivity checks (section 7 [ICE-BIS]), an agent 1288 sends STUN and TURN transactions. These transactions are paced at a 1289 rate of one every Ta milliseconds, and utilize a specific RTO. This 1290 section describes how the values of Ta and RTO are computed with a 1291 real-time media stream (such as RTP). When ICE is used for a stream 1292 with a known maximum bandwidth, the following computation MAY be 1293 followed to rate-control the ICE exchanges. 1295 The values of RTO and Ta change during the lifetime of ICE 1296 processing. One set of values applies during the gathering phase, 1297 and the other, for connectivity checks. 1299 The value of Ta SHOULD be configurable, and SHOULD have a default of: 1301 For each media stream i: 1302 Ta_i = (stun_packet_size / rtp_packet_size) * rtp_ptime 1304 1 1305 Ta = MAX (20ms, ------------------- ) 1306 k 1307 ---- 1308 \ 1 1309 > ------ 1310 / Ta_i 1311 ---- 1312 i=1 1314 where k is the number of media streams. During the gathering phase, 1315 Ta is computed based on the number of media streams the agent has 1316 indicated in its offer or answer, and the RTP packet size and RTP 1317 ptime are those of the most preferred codec for each media stream. 1318 Once an offer and answer have been exchanged, the agent recomputes Ta 1319 to pace the connectivity checks. In that case, the value of Ta is 1320 based on the number of media streams that will actually be used in 1321 the session, and the RTP packet size and RTP ptime are those of the 1322 most preferred codec with which the agent will send. 1324 In addition, the retransmission timer for the STUN transactions, RTO, 1325 defined in [RFC5389], SHOULD be configurable and during the gathering 1326 phase, SHOULD have a default of: 1328 RTO = MAX (100ms, Ta * (number of pairs)) 1330 where the number of pairs refers to the number of pairs of candidates 1331 with STUN or TURN servers. 1333 For connectivity checks, RTO SHOULD be configurable and SHOULD have a 1334 default of: 1336 RTO = MAX (100ms, Ta*N * (Num-Waiting + Num-In-Progress)) 1338 where Num-Waiting is the number of checks in the check list in the 1339 Waiting state, and Num-In-Progress is the number of checks in the In- 1340 Progress state. Note that the RTO will be different for each 1341 transaction as the number of checks in the Waiting and In-Progress 1342 states change. 1344 These formulas are aimed at causing STUN transactions to be paced at 1345 the same rate as media. This ensures that ICE will work properly 1346 under the same network conditions needed to support the media as 1347 well. See section B.1 of [ICE-BIS] for additional discussion and 1348 motivations. Because of this pacing, it will take a certain amount 1349 of time to obtain all of the server reflexive and relayed candidates. 1350 Implementations should be aware of the time required to do this, and 1351 if the application requires a time budget, limit the number of 1352 candidates that are gathered. 1354 The formulas result in a behavior whereby an agent will send its 1355 first packet for every single connectivity check before performing a 1356 retransmit. This can be seen in the formulas for the RTO (which 1357 represents the retransmit interval). Those formulas scale with N, 1358 the number of checks to be performed. As a result of this, ICE 1359 maintains a nicely constant rate, but becomes more sensitive to 1360 packet loss. The loss of the first single packet for any 1361 connectivity check is likely to cause that pair to take a long time 1362 to be validated, and instead, a lower-priority check (but one for 1363 which there was no packet loss) is much more likely to complete 1364 first. This results in ICE performing sub-optimally, choosing lower- 1365 priority pairs over higher-priority pairs. Implementors should be 1366 aware of this consequence, but still should utilize the timer values 1367 described here. 1369 15. Security Considerations 1371 15.1. Attacks on the Offer/Answer Exchanges 1373 An attacker that can modify or disrupt the offer/answer exchanges 1374 themselves can readily launch a variety of attacks with ICE. They 1375 could direct media to a target of a DoS attack, they could insert 1376 themselves into the media stream, and so on. These are similar to 1377 the general security considerations for offer/answer exchanges, and 1378 the security considerations in RFC 3264 [RFC3264] apply. These 1379 require techniques for message integrity and encryption for offers 1380 and answers, which are satisfied by the SIPS mechanism [RFC3261] when 1381 SIP is used. As such, the usage of SIPS with ICE is RECOMMENDED. 1383 15.2. Insider Attacks 1385 In addition to attacks where the attacker is a third party trying to 1386 insert fake offers, answers, or stun messages, there are several 1387 attacks possible with ICE when the attacker is an authenticated and 1388 valid participant in the ICE exchange. 1390 15.2.1. The Voice Hammer Attack 1392 The voice hammer attack is an amplification attack. In this attack, 1393 the attacker initiates sessions to other agents, and maliciously 1394 includes the IP address and port of a DoS target as the destination 1395 for media traffic signaled in the SDP. This causes substantial 1396 amplification; a single offer/answer exchange can create a continuing 1397 flood of media packets, possibly at high rates (consider video 1398 sources). This attack is not specific to ICE, but ICE can help 1399 provide remediation. 1401 Specifically, if ICE is used, the agent receiving the malicious SDP 1402 will first perform connectivity checks to the target of media before 1403 sending media there. If this target is a third-party host, the 1404 checks will not succeed, and media is never sent. 1406 Unfortunately, ICE doesn't help if its not used, in which case an 1407 attacker could simply send the offer without the ICE parameters. 1408 However, in environments where the set of clients is known, and is 1409 limited to ones that support ICE, the server can reject any offers or 1410 answers that don't indicate ICE support. 1412 15.2.2. Interactions with Application Layer Gateways and SIP 1414 Application Layer Gateways (ALGs) are functions present in a NAT 1415 device that inspect the contents of packets and modify them, in order 1416 to facilitate NAT traversal for application protocols. Session 1417 Border Controllers (SBCs) are close cousins of ALGs, but are less 1418 transparent since they actually exist as application layer SIP 1419 intermediaries. ICE has interactions with SBCs and ALGs. 1421 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1422 long as the ALG correctly modifies the SDP. A correct ALG 1423 implementation behaves as follows: 1425 o The ALG does not modify the m and c lines or the rtcp attribute if 1426 they contain external addresses. 1428 o If the m and c lines contain internal addresses, the modification 1429 depends on the state of the ALG: 1431 If the ALG already has a binding established that maps an 1432 external port to an internal IP address and port matching the 1433 values in the m and c lines or rtcp attribute, the ALG uses 1434 that binding instead of creating a new one. 1436 If the ALG does not already have a binding, it creates a new 1437 one and modifies the SDP, rewriting the m and c lines and rtcp 1438 attribute. 1440 Unfortunately, many ALGs are known to work poorly in these corner 1441 cases. ICE does not try to work around broken ALGs, as this is 1442 outside the scope of its functionality. ICE can help diagnose these 1443 conditions, which often show up as a mismatch between the set of 1444 candidates and the m and c lines and rtcp attributes. The ice- 1445 mismatch attribute is used for this purpose. 1447 ICE works best through ALGs when the signaling is run over TLS. This 1448 prevents the ALG from manipulating the SDP messages and interfering 1449 with ICE operation. Implementations that are expected to be deployed 1450 behind ALGs SHOULD provide for TLS transport of the SDP. 1452 If an SBC is SIP aware but not ICE aware, the result depends on the 1453 behavior of the SBC. If it is acting as a proper Back-to-Back User 1454 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1455 understand, including the ICE attributes. Consequently, the call 1456 will appear to both endpoints as if the other side doesn't support 1457 ICE. This will result in ICE being disabled, and media flowing 1458 through the SBC, if the SBC has requested it. If, however, the SBC 1459 passes the ICE attributes without modification, yet modifies the 1460 default destination for media (contained in the m and c lines and 1461 rtcp attribute), this will be detected as an ICE mismatch, and ICE 1462 processing is aborted for the call. It is outside of the scope of 1463 ICE for it to act as a tool for "working around" SBCs. If one is 1464 present, ICE will not be used and the SBC techniques take precedence. 1466 16. IANA Considerations 1468 16.1. SDP Attributes 1470 Original ICE specification defined seven new SDP attributes per the 1471 procedures of Section 8.2.4 of [RFC4566]. The registration 1472 information is reproduced here. 1474 16.1.1. candidate Attribute 1476 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1478 Attribute Name: candidate 1480 Long Form: candidate 1482 Type of Attribute: media-level 1484 Charset Considerations: The attribute is not subject to the charset 1485 attribute. 1487 Purpose: This attribute is used with Interactive Connectivity 1488 Establishment (ICE), and provides one of many possible candidate 1489 addresses for communication. These addresses are validated with 1490 an end-to-end connectivity check using Session Traversal Utilities 1491 for NAT (STUN). 1493 Appropriate Values: See Section 8 of RFC XXXX. 1495 16.1.2. remote-candidates Attribute 1497 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1499 Attribute Name: remote-candidates 1501 Long Form: remote-candidates 1503 Type of Attribute: media-level 1505 Charset Considerations: The attribute is not subject to the charset 1506 attribute. 1508 Purpose: This attribute is used with Interactive Connectivity 1509 Establishment (ICE), and provides the identity of the remote 1510 candidates that the offerer wishes the answerer to use in its 1511 answer. 1513 Appropriate Values: See Section 8 of RFC XXXX. 1515 16.1.3. ice-lite Attribute 1517 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1519 Attribute Name: ice-lite 1521 Long Form: ice-lite 1523 Type of Attribute: session-level 1525 Charset Considerations: The attribute is not subject to the charset 1526 attribute. 1528 Purpose: This attribute is used with Interactive Connectivity 1529 Establishment (ICE), and indicates that an agent has the minimum 1530 functionality required to support ICE inter-operation with a peer 1531 that has a full implementation. 1533 Appropriate Values: See Section 8 of RFC XXXX. 1535 16.1.4. ice-mismatch Attribute 1537 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1539 Attribute Name: ice-mismatch 1541 Long Form: ice-mismatch 1543 Type of Attribute: session-level 1545 Charset Considerations: The attribute is not subject to the charset 1546 attribute. 1548 Purpose: This attribute is used with Interactive Connectivity 1549 Establishment (ICE), and indicates that an agent is ICE capable, 1550 but did not proceed with ICE due to a mismatch of candidates with 1551 the default destination for media signaled in the SDP. 1553 Appropriate Values: See Section 8 of RFC XXXX. 1555 16.1.5. ice-pwd Attribute 1557 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1559 Attribute Name: ice-pwd 1561 Long Form: ice-pwd 1562 Type of Attribute: session- or media-level 1564 Charset Considerations: The attribute is not subject to the charset 1565 attribute. 1567 Purpose: This attribute is used with Interactive Connectivity 1568 Establishment (ICE), and provides the password used to protect 1569 STUN connectivity checks. 1571 Appropriate Values: See Section 8 of RFC XXXX. 1573 16.1.6. ice-ufrag Attribute 1575 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1577 Attribute Name: ice-ufrag 1579 Long Form: ice-ufrag 1581 Type of Attribute: session- or media-level 1583 Charset Considerations: The attribute is not subject to the charset 1584 attribute. 1586 Purpose: This attribute is used with Interactive Connectivity 1587 Establishment (ICE), and provides the fragments used to construct 1588 the username in STUN connectivity checks. 1590 Appropriate Values: See Section 8 of RFC XXXX. 1592 16.1.7. ice-pacing Attribute 1594 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1596 Attribute Name: ice-pacing 1598 Long Form: ice-pacing 1600 Type of Attribute: session-level 1602 Charset Considerations: The attribute is not subject to the charset 1603 attribute. 1605 Purpose: This attribute is used with Interactive Connectivity 1606 Establishment (ICE) to indicate desired connectivity check pacing 1607 values. 1609 Appropriate Values: See Section 8 of RFC XXXX. 1611 16.1.8. ice-options Attribute 1613 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1615 Attribute Name: ice-options 1617 Long Form: ice-options 1619 Type of Attribute: session- or media-level 1621 Charset Considerations: The attribute is not subject to the charset 1622 attribute. 1624 Purpose: This attribute is used with Interactive Connectivity 1625 Establishment (ICE), and indicates the ICE options or extensions 1626 used by the agent. 1628 Appropriate Values: See Section 8 of RFC XXXX. 1630 16.2. Interactive Connectivity Establishment (ICE) Options Registry 1632 IANA maintains a registry for ice-options identifiers under the 1633 Specification Required policy as defined in "Guidelines for Writing 1634 an IANA Considerations Section in RFCs" [RFC5226]. 1636 ICE options are of unlimited length according to the syntax in 1637 Section 8.6; however, they are RECOMMENDED to be no longer than 20 1638 characters. This is to reduce message sizes and allow for efficient 1639 parsing. 1641 In RFC 5245 ICE options could only be defined at the session level. 1642 ICE options can now also be defined at the media level. This can be 1643 used when aggregating between different ICE agents in the same 1644 endpoint, but future options may require to be defined at the media- 1645 level. To ensure compatibility with legacy implementation, the 1646 media-level ICE options MUST be aggregated into a session-level ICE 1647 option. Because aggregation rules depend on the specifics of each 1648 option, all new ICE options MUST also define in their specification 1649 how the media-level ICE option values are aggregated to generate the 1650 value of the session-level ICE option. 1652 The only ICE option defined at the time of publication is "rtp+ecn" 1653 [RFC6679]. The aggregation rule for this ICE options is that if all 1654 aggregated media using ICE contain a media-level "rtp+ecn" ICE option 1655 then an "rtp+ecn" ICE option MUST be inserted at the session-level. 1656 If one of the media does not contain the option, then it MUST NOT be 1657 inserted at the session-level. 1659 A registration request MUST include the following information: 1661 o The ICE option identifier to be registered 1663 o Name, Email, and Address of a contact person for the registration 1665 o Organization or individuals having the change control 1667 o Short description of the ICE extension to which the option relates 1669 o Reference(s) to the specification defining the ICE option and the 1670 related extensions 1672 17. Acknowledgments 1674 A large part of the text in this document was taken from RFC 5245, 1675 authored by Jonathan Rosenberg. 1677 Some of the text in this document was taken from RFC 6336, authored 1678 by Magnus Westerlund and Colin Perkins. 1680 Thanks to Thomas Stach for the text in Section 9.3 1682 18. References 1684 18.1. Normative References 1686 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1687 Requirement Levels", BCP 14, RFC 2119, March 1997. 1689 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1690 A., Peterson, J., Sparks, R., Handley, M., and E. 1691 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1692 June 2002. 1694 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1695 Provisional Responses in Session Initiation Protocol 1696 (SIP)", RFC 3262, June 2002. 1698 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1699 with Session Description Protocol (SDP)", RFC 3264, June 1700 2002. 1702 [RFC3312] Camarillo, G., Marshall, W., and J. Rosenberg, 1703 "Integration of Resource Management and Session Initiation 1704 Protocol (SIP)", RFC 3312, October 2002. 1706 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1707 Jacobson, "RTP: A Transport Protocol for Real-Time 1708 Applications", STD 64, RFC 3550, July 2003. 1710 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1711 Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 1712 3556, July 2003. 1714 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1715 in Session Description Protocol (SDP)", RFC 3605, October 1716 2003. 1718 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1719 Initiation Protocol (SIP) Preconditions Framework", RFC 1720 4032, March 2005. 1722 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1723 Address Types (ANAT) Semantics for the Session Description 1724 Protocol (SDP) Grouping Framework", RFC 4091, June 2005. 1726 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1727 Description Protocol (SDP) Alternative Network Address 1728 Types (ANAT) Semantics in the Session Initiation Protocol 1729 (SIP)", RFC 4092, June 2005. 1731 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1732 Description Protocol", RFC 4566, July 2006. 1734 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1735 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1736 May 2008. 1738 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1739 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1741 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1742 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1743 October 2008. 1745 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1746 Connectivity Establishment (ICE) in the Session Initiation 1747 Protocol (SIP)", RFC 5768, April 2010. 1749 [RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., 1750 and K. Carlberg, "Explicit Congestion Notification (ECN) 1751 for RTP over UDP", RFC 6679, August 2012. 1753 [RFC7092] Kaplan, H. and V. Pascual, "A Taxonomy of Session 1754 Initiation Protocol (SIP) Back-to-Back User Agents", RFC 1755 7092, December 2013. 1757 [ICE-BIS] Keranen, A. and J. Rosenberg, "Interactive Connectivity 1758 Establishment (ICE): A Protocol for Network Address 1759 Translator (NAT) Traversal for Offer/Answer Protocols", 1760 draft-ietf-mmusic-rfc5245bis-04 (work in progress), March 1761 2015. 1763 18.2. Informative References 1765 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1766 Camarillo, "Best Current Practices for Third Party Call 1767 Control (3pcc) in the Session Initiation Protocol (SIP)", 1768 BCP 85, RFC 3725, April 2004. 1770 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1771 Tone Generation in the Session Initiation Protocol (SIP)", 1772 RFC 3960, December 2004. 1774 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1775 Congestion Control Protocol (DCCP)", RFC 4340, March 2006. 1777 [RFC5626] Jennings, C., Mahy, R., and F. Audet, "Managing Client- 1778 Initiated Connections in the Session Initiation Protocol 1779 (SIP)", RFC 5626, October 2009. 1781 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1782 "Connectivity Preconditions for Session Description 1783 Protocol (SDP) Media Streams", RFC 5898, July 2010. 1785 Appendix A. Examples 1787 For the example shown in Section 13 of [ICE-BIS] the resulting offer 1788 (message 5) encoded in SDP looks like: 1790 v=0 1791 o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP 1792 s= 1793 c=IN IP4 $NAT-PUB-1.IP 1794 t=0 0 1795 a=ice-pwd:asd88fgpdd777uzjYhagZg 1796 a=ice-ufrag:8hhY 1797 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1798 b=RS:0 1799 b=RR:0 1800 a=rtpmap:0 PCMU/8000 1801 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1802 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1803 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1805 The offer, with the variables replaced with their values, will look 1806 like (lines folded for clarity): 1808 v=0 1809 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 1810 s= 1811 c=IN IP4 192.0.2.3 1812 t=0 0 1813 a=ice-pwd:asd88fgpdd777uzjYhagZg 1814 a=ice-ufrag:8hhY 1815 m=audio 45664 RTP/AVP 0 1816 b=RS:0 1817 b=RR:0 1818 a=rtpmap:0 PCMU/8000 1819 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 1820 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 1821 10.0.1.1 rport 8998 1823 The resulting answer looks like: 1825 v=0 1826 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1827 s= 1828 c=IN IP4 $R-PUB-1.IP 1829 t=0 0 1830 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1831 a=ice-ufrag:9uB6 1832 m=audio $R-PUB-1.PORT RTP/AVP 0 1833 b=RS:0 1834 b=RR:0 1835 a=rtpmap:0 PCMU/8000 1836 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1837 With the variables filled in: 1839 v=0 1840 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1841 s= 1842 c=IN IP4 192.0.2.1 1843 t=0 0 1844 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1845 a=ice-ufrag:9uB6 1846 m=audio 3478 RTP/AVP 0 1847 b=RS:0 1848 b=RR:0 1849 a=rtpmap:0 PCMU/8000 1850 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1852 Appendix B. The remote-candidates Attribute 1854 The a=remote-candidates attribute exists to eliminate a race 1855 condition between the updated offer and the response to the STUN 1856 Binding request that moved a candidate into the Valid list. This 1857 race condition is shown in Figure 1. On receipt of message 4, agent 1858 L adds a candidate pair to the valid list. If there was only a 1859 single media stream with a single component, agent L could now send 1860 an updated offer. However, the check from agent R has not yet 1861 generated a response, and agent R receives the updated offer (message 1862 7) before getting the response (message 9). Thus, it does not yet 1863 know that this particular pair is valid. To eliminate this 1864 condition, the actual candidates at R that were selected by the 1865 offerer (the remote candidates) are included in the offer itself, and 1866 the answerer delays its answer until those pairs validate. 1868 Agent A Network Agent B 1869 |(1) Offer | | 1870 |------------------------------------------>| 1871 |(2) Answer | | 1872 |<------------------------------------------| 1873 |(3) STUN Req. | | 1874 |------------------------------------------>| 1875 |(4) STUN Res. | | 1876 |<------------------------------------------| 1877 |(5) STUN Req. | | 1878 |<------------------------------------------| 1879 |(6) STUN Res. | | 1880 |-------------------->| | 1881 | |Lost | 1882 |(7) Offer | | 1883 |------------------------------------------>| 1884 |(8) STUN Req. | | 1885 |<------------------------------------------| 1886 |(9) STUN Res. | | 1887 |------------------------------------------>| 1888 |(10) Answer | | 1889 |<------------------------------------------| 1891 Figure 1: Race Condition Flow 1893 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1895 When ICE runs between two peers, one agent acts as controlled, and 1896 the other as controlling. Rules are defined as a function of 1897 implementation type and offerer/answerer to determine who is 1898 controlling and who is controlled. However, the specification 1899 mentions that, in some cases, both sides might believe they are 1900 controlling, or both sides might believe they are controlled. How 1901 can this happen? 1903 The condition when both agents believe they are controlled shows up 1904 in third party call control cases. Consider the following flow: 1906 A Controller B 1907 |(1) INV() | | 1908 |<-------------| | 1909 |(2) 200(SDP1) | | 1910 |------------->| | 1911 | |(3) INV() | 1912 | |------------->| 1913 | |(4) 200(SDP2) | 1914 | |<-------------| 1915 |(5) ACK(SDP2) | | 1916 |<-------------| | 1917 | |(6) ACK(SDP1) | 1918 | |------------->| 1920 Figure 2: Role Conflict Flow 1922 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1923 it works better than flow III since it produces fewer messages. In 1924 this flow, the controller sends an offerless INVITE to agent A, which 1925 responds with its offer, SDP1. The agent then sends an offerless 1926 INVITE to agent B, which it responds to with its offer, SDP2. The 1927 controller then uses the offer from each agent to generate the 1928 answers. When this flow is used, ICE will run between agents A and 1929 B, but both will believe they are in the controlling role. With the 1930 role conflict resolution procedures, this flow will function properly 1931 when ICE is used. 1933 At this time, there are no documented flows that can result in the 1934 case where both agents believe they are controlled. However, the 1935 conflict resolution procedures allow for this case, should a flow 1936 arise that would fit into this category. 1938 Appendix D. Why Send an Updated Offer? 1940 Section 11.1 describes rules for sending media. Both agents can send 1941 media once ICE checks complete, without waiting for an updated offer. 1942 Indeed, the only purpose of the updated offer is to "correct" the SDP 1943 so that the default destination for media matches where media is 1944 being sent based on ICE procedures (which will be the highest- 1945 priority nominated candidate pair). 1947 This begs the question -- why is the updated offer/answer exchange 1948 needed at all? Indeed, in a pure offer/answer environment, it would 1949 not be. The offerer and answerer will agree on the candidates to use 1950 through ICE, and then can begin using them. As far as the agents 1951 themselves are concerned, the updated offer/answer provides no new 1952 information. However, in practice, numerous components along the 1953 signaling path look at the SDP information. These include entities 1954 performing off-path QoS reservations, NAT traversal components such 1955 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1956 that passively monitor the network. For these tools to continue to 1957 function without change, the core property of SDP -- that the 1958 existing, pre-ICE definitions of the addresses used for media -- the 1959 m and c lines and the rtcp attribute -- must be retained. For this 1960 reason, an updated offer must be sent. 1962 Authors' Addresses 1964 Marc Petit-Huguenin 1965 Impedance Mismatch 1967 Email: marc@petit-huguenin.org 1969 Ari Keranen 1970 Ericsson 1971 Jorvas 02420 1972 Finland 1974 Email: ari.keranen@ericsson.com