idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-11.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 is 1 instance of too long lines in the document, the longest one being 3 characters in excess of 72. == There are 3 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. == There are 1 instance of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. -- 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 (January 20, 2017) is 2651 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC3550' is defined on line 1646, but no explicit reference was found in the text ** Obsolete normative reference: RFC 4091 (Obsoleted by RFC 5245) ** Obsolete normative reference: RFC 4092 (Obsoleted by RFC 5245) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5245 (Obsoleted by RFC 8445, RFC 8839) ** Obsolete normative reference: RFC 5389 (Obsoleted by RFC 8489) ** Downref: Normative reference to an Informational RFC: RFC 7092 == Outdated reference: A later version (-20) exists of draft-ietf-ice-rfc5245bis-00 Summary: 8 errors (**), 0 flaws (~~), 6 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: July 24, 2017 Ericsson 6 S. Nandakumar 7 Cisco Systems 8 January 20, 2017 10 Using Interactive Connectivity Establishment (ICE) with 11 Session Description Protocol (SDP) offer/answer and Session Initiation 12 Protocol (SIP) 13 draft-ietf-mmusic-ice-sip-sdp-11 15 Abstract 17 This document describes how Interactive Connectivity Establishment 18 (ICE) is used with Session Description Protocol (SDP) offer/answer 19 and Session Initiation Protocol (SIP). 21 Status of This Memo 23 This Internet-Draft is submitted in full conformance with the 24 provisions of BCP 78 and BCP 79. 26 Internet-Drafts are working documents of the Internet Engineering 27 Task Force (IETF). Note that other groups may also distribute 28 working documents as Internet-Drafts. The list of current Internet- 29 Drafts is at http://datatracker.ietf.org/drafts/current/. 31 Internet-Drafts are draft documents valid for a maximum of six months 32 and may be updated, replaced, or obsoleted by other documents at any 33 time. It is inappropriate to use Internet-Drafts as reference 34 material or to cite them other than as "work in progress." 36 This Internet-Draft will expire on July 24, 2017. 38 Copyright Notice 40 Copyright (c) 2017 IETF Trust and the persons identified as the 41 document authors. All rights reserved. 43 This document is subject to BCP 78 and the IETF Trust's Legal 44 Provisions Relating to IETF Documents 45 (http://trustee.ietf.org/license-info) in effect on the date of 46 publication of this document. Please review these documents 47 carefully, as they describe your rights and restrictions with respect 48 to this document. Code Components extracted from this document must 49 include Simplified BSD License text as described in Section 4.e of 50 the Trust Legal Provisions and are provided without warranty as 51 described in the Simplified BSD License. 53 This document may contain material from IETF Documents or IETF 54 Contributions published or made publicly available before November 55 10, 2008. The person(s) controlling the copyright in some of this 56 material may not have granted the IETF Trust the right to allow 57 modifications of such material outside the IETF Standards Process. 58 Without obtaining an adequate license from the person(s) controlling 59 the copyright in such materials, this document may not be modified 60 outside the IETF Standards Process, and derivative works of it may 61 not be created outside the IETF Standards Process, except to format 62 it for publication as an RFC or to translate it into languages other 63 than English. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 68 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 3. ICE Candidate Exchange and Offer/Answer Mapping . . . . . . . 4 70 4. SDP Offer/Answer Procedures . . . . . . . . . . . . . . . . . 4 71 4.1. Initial Offer/Answer Exchange . . . . . . . . . . . . . . 4 72 4.1.1. Sending the Initial Offer . . . . . . . . . . . . . . 4 73 4.1.2. Receiving the Initial Offer . . . . . . . . . . . . . 7 74 4.1.3. Receipt of the Initial Answer . . . . . . . . . . . . 8 75 4.1.4. Performing Connectivity Checks . . . . . . . . . . . 9 76 4.1.5. Concluding ICE . . . . . . . . . . . . . . . . . . . 9 77 4.2. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . 10 78 4.2.1. Generating the Offer . . . . . . . . . . . . . . . . 10 79 4.2.2. Receiving the Offer and Generating an Answer . . . . 13 80 4.2.3. Receiving the Answer for a Subsequent Offer . . . . . 16 81 4.2.4. Updating the Check and Valid Lists . . . . . . . . . 17 82 5. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 83 5.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 19 84 5.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 22 85 5.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 22 86 5.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 22 87 5.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 23 88 5.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 23 89 6. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 24 90 7. Media Handling . . . . . . . . . . . . . . . . . . . . . . . 24 91 7.1. Sending Media . . . . . . . . . . . . . . . . . . . . . . 24 92 7.1.1. Procedures for All Implementations . . . . . . . . . 24 93 7.2. Receiving Media . . . . . . . . . . . . . . . . . . . . . 24 94 8. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . 24 95 8.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 24 96 8.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . . 25 97 8.1.2. Offer in Response . . . . . . . . . . . . . . . . . . 26 98 8.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 26 99 8.3. Interactions with Forking . . . . . . . . . . . . . . . . 27 100 8.4. Interactions with Preconditions . . . . . . . . . . . . . 27 101 8.5. Interactions with Third Party Call Control . . . . . . . 27 102 9. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 28 103 10. Setting Ta and RTO for RTP Media Streams . . . . . . . . . . 28 104 11. Security Considerations . . . . . . . . . . . . . . . . . . . 28 105 11.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . 28 106 11.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . 29 107 11.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . 29 108 11.2.2. Interactions with Application Layer Gateways and SIP 29 109 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 110 12.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 30 111 12.1.1. candidate Attribute . . . . . . . . . . . . . . . . 30 112 12.1.2. remote-candidates Attribute . . . . . . . . . . . . 31 113 12.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 31 114 12.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 32 115 12.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . 32 116 12.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . 33 117 12.1.7. ice-pacing Attribute . . . . . . . . . . . . . . . . 33 118 12.1.8. ice-options Attribute . . . . . . . . . . . . . . . 33 119 12.2. Interactive Connectivity Establishment (ICE) Options 120 Registry . . . . . . . . . . . . . . . . . . . . . . . . 34 121 13. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 35 122 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 123 14.1. Normative References . . . . . . . . . . . . . . . . . . 35 124 14.2. Informative References . . . . . . . . . . . . . . . . . 37 125 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 38 126 Appendix B. The remote-candidates Attribute . . . . . . . . . . 40 127 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 40 128 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 41 129 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 42 131 1. Introduction 133 This document describes how Interactive Connectivity Establishment 134 (ICE) is used with Session Description Protocol (SDP) offer/answer 135 [RFC3264] and Session Initiation Protocol (SIP). The ICE 136 specification [ICE-BIS] describes procedures that are common to all 137 usages of ICE and this document gives the additional details needed 138 to use ICE with SDP offer/answer and SIP. 140 Note that ICE is not intended for NAT traversal for SIP, which is 141 assumed to be provided via another mechanism [RFC5626]. 143 2. Terminology 145 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 146 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 147 "OPTIONAL" in this document are to be interpreted as described in RFC 148 2119 [RFC2119]. 150 Readers should be familiar with the terminology defined in [RFC3264], 151 in [ICE-BIS] and the following: 153 Default Destination/Candidate: The default destination for a 154 component of a media stream is the transport address that would be 155 used by an agent that is not ICE aware. A default candidate for a 156 component is one whose transport address matches the default 157 destination for that component. For the RTP component, the 158 default IP address is in the "c=" line of the SDP, and the port is 159 in the "m=" line.For the RTCP component, it is in the rtcp 160 attribute when present, and when not present, the IP address is in 161 the "c=" line and 1 plus the port is in the "m=" line. 163 3. ICE Candidate Exchange and Offer/Answer Mapping 165 [ICE-BIS] defines ICE candidate exchange as the process for ICE 166 agents (Initiator and Responder) to exchange their candidate 167 information required for ICE processing at the agents. For the 168 purposes of this specification, the candidate exchange process 169 corresponds to the [RFC3264] Offer/Answer protocol and the 170 terminologies offerer and answerer correspond to the initiator and 171 responder terminologies from the [ICE-BIS] respectively. 173 4. SDP Offer/Answer Procedures 175 4.1. Initial Offer/Answer Exchange 177 4.1.1. Sending the Initial Offer 179 The offerer shall follow the procedures defined in section 4 of 180 [ICE-BIS] to gather, prioritize and eliminate the redundant 181 candidates. It then chooses the default candidates and encodes them 182 in the SDP to be sent to its peer, the answerer. 184 4.1.1.1. Choosing Default Candidates 186 A candidate is said to be default if it would be the target of media 187 from a non-ICE peer; that target is called the DEFAULT DESTINATION. 188 If the default candidates are not selected by the ICE algorithm when 189 communicating with an ICE-aware peer, an updated offer/answer will be 190 required after ICE processing completes in order to "fix up" the SDP 191 so that the default destination for media matches the candidates 192 selected by ICE. If ICE happens to select the default candidates, no 193 updated offer/answer is required. 195 An agent MUST choose a set of candidates, one for each component of 196 each in-use media stream, to be default. A media stream is in-use if 197 it does not have a port of zero (which is used in RFC 3264 to reject 198 a media stream). Consequently, a media stream is in-use even if it 199 is marked as a=inactive [RFC4566] or has a bandwidth value of zero. 201 It is RECOMMENDED that default candidates be chosen based on the 202 likelihood of those candidates to work with the peer that is being 203 contacted if ICE is not being used. It is RECOMMENDED that the 204 default candidates are the relayed candidates (if relayed candidates 205 are available), server reflexive candidates (if server reflexive 206 candidates are available), and finally host candidates. 208 4.1.1.2. Encoding the SDP 210 The process of encoding the SDP is identical between full and lite 211 implementations. 213 The agent will include an "m=" line for each media stream it wishes 214 to use. The ordering of media streams in the SDP is relevant for 215 ICE. ICE will perform its connectivity checks for the first "m=" 216 line first, and consequently media will be able to flow for that 217 stream first. Agents SHOULD place their most important media stream, 218 if there is one, first in the SDP. 220 There will be a candidate attribute for each candidate for a 221 particular media stream. Section 5 provides detailed rules for 222 constructing this attribute. 224 STUN connectivity checks between agents are authenticated using the 225 short-term credential mechanism defined for STUN [RFC5389]. This 226 mechanism relies on a username and password that are exchanged 227 through protocol machinery between the client and server. The 228 username fragment and password are exchanged in the ice-ufrag and 229 ice-pwd attributes, respectively. 231 If an agent is a lite implementation, it MUST include an "a=ice-lite" 232 session-level attribute in its SDP to indicate this. If an agent is 233 a full implementation, it MUST NOT include this attribute. 235 Section 7 of [ICE-BIS] defines a new ICE option, 'ice2'. This option 236 is used by ICE Agents to indicate their compliancy with [ICE-BIS] 237 specification as compared to the [RFC5245]. If the Offering agent is 238 a [ICE-BIS] compliant implementation, a session level ICE option to 239 indicate the same (via the "a=ice-options:ice2" SDP line) MUST be 240 included. 242 The default candidates are added to the SDP as the default 243 destination for media. For streams based on RTP, this is done by 244 placing the IP address and port of the RTP candidate into the "c=" 245 and "m=" lines, respectively. If the agent is utilizing RTCP and if 246 RTCP candidate is present and is not equal to the same address and 247 the next higher port number of the RTP candidate, the agent MUST 248 encode the RTCP candidate using the a=rtcp attribute as defined in 249 [RFC3605]. If RTCP is not in use, the agent MUST signal that using 250 b=RS:0 and b=RR:0 as defined in [RFC3556] 252 The transport addresses that will be the default destination for 253 media when communicating with non-ICE peers MUST also be present as 254 candidates in one or more a=candidate lines. 256 ICE provides for extensibility by allowing an offer or answer to 257 contain a series of tokens that identify the ICE extensions used by 258 that agent. If an agent supports an ICE extension, it MUST include 259 the token defined for that extension in the ice-options attribute. 261 The following is an example SDP message that includes ICE attributes 262 (lines folded for readability): 264 v=0 265 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 266 s= 267 c=IN IP4 192.0.2.3 268 t=0 0 269 a=ice-options:ice2 270 a=ice-pwd:asd88fgpdd777uzjYhagZg 271 a=ice-ufrag:8hhY 272 m=audio 45664 RTP/AVP 0 273 b=RS:0 274 b=RR:0 275 a=rtpmap:0 PCMU/8000 276 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 277 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 278 10.0.1.1 rport 8998 280 Once an agent has sent its offer or its answer, that agent MUST be 281 prepared to receive both STUN and media packets on each candidate. 282 As discussed in section 9.1 of [ICE-BIS], media packets can be sent 283 to a candidate prior to its appearance as the default destination for 284 media in an offer or answer. 286 4.1.2. Receiving the Initial Offer 288 On receiving the offer, the answerer verifies the support for ICE 289 (section 5.1.1 of [ICE-BIS]), determines its role (section 5.1.2 of 290 [ICE-BIS]), gathers candidates (section 4 of [ICE-BIS]), encodes the 291 candidates in an SDP answer and sends it to its peer, the offerer. 292 The answerer shall then follow the steps defined in sections 5.1.3 293 and 5.1.4 of [ICE-BIS] to schedule the ICE connectivity checks. 295 The below sub-sections provide additional requirements associated 296 with the processing of the offerer's SDP pertaining to this 297 specification. 299 4.1.2.1. ICE Option "ice2" considerations 301 If the SDP offer contains a session level ICE option, "ice2" , and if 302 the answering ICE Agent is also an [ICE-BIS] compliant 303 implementation, then the generated SDP answer MUST include the 304 session level "a=ice-options:ice2" SDP line. 306 4.1.2.2. Choosing Default Candidates 308 The process for selecting default candidates at the answerer is 309 identical to the process followed by the offerer, as described in 310 Section 4.1.1.1 for full implementations in this specification and 311 section 4.2 of [ICE-BIS] for lite implementations. 313 4.1.2.3. Verifying ICE Support 315 The agent will proceed with the ICE procedures defined in [ICE-BIS] 316 and this specification if, for each media stream in the SDP it 317 received, the default destination for each component of that media 318 stream appears in a candidate attribute. For example, in the case of 319 RTP, the IP address and port in the "c=" and "m=" lines, 320 respectively, appear in a candidate attribute and the value in the 321 rtcp attribute appears in a candidate attribute. 323 If this condition is not met, the agent MUST process the SDP based on 324 normal RFC 3264 procedures, without using any of the ICE mechanisms 325 described in the remainder of this specification with the following 326 exceptions: 328 1. The agent MUST follow the rules of section 8 of [ICE-BIS], which 329 describe keepalive procedures for all agents. 331 2. If the agent is not proceeding with ICE because there were 332 a=candidate attributes, but none that matched the default 333 destination of the media stream, the agent MUST include an a=ice- 334 mismatch attribute in its answer. 336 3. If the default candidates were relayed candidates learned through 337 a TURN server, the agent MUST create permissions in the TURN 338 server for the IP addresses learned from its peer in the SDP it 339 just received. If this is not done, initial packets in the media 340 stream from the peer may be lost. 342 4.1.2.4. Determining Role 344 In unusual cases, described in Appendix C, it is possible for both 345 agents to mistakenly believe they are controlled or controlling. To 346 resolve this, each agent MUST select a random number, called the tie- 347 breaker, uniformly distributed between 0 and (2**64) - 1 (that is, a 348 64-bit positive integer). This number is used in connectivity checks 349 to detect and repair this case, as described in section 6.1.2.3 of 350 [ICE-BIS]. 352 4.1.3. Receipt of the Initial Answer 354 When ICE is used with SIP, forking may result in a single offer 355 generating a multiplicity of answers. In that case, ICE proceeds 356 completely in parallel and independently for each answer, treating 357 the combination of its offer and each answer as an independent offer/ 358 answer exchange, with its own set of pairs, check lists, states, and 359 so on. The only case in which processing of one pair impacts another 360 is freeing of candidates, discussed below in Section 4.1.5.2. 362 On receiving the SDP answer , the offerer performs steps similar to 363 answerer's processing of the offer. The offerer verifies the 364 answerer's ICE support, determines its role and processes the 365 answerer's candidates to schedule the connectivity checks (section 6 366 of [ICE-BIS]). 368 If the offerer had included the "ice2" ICE Option in the offer and 369 the SDP answer also includes a similar session level ICE option, then 370 the peers are [ICE-BIS] complaint implementations. On the other 371 hand, if the SDP Answer lacks such a ICE option, the offerer defaults 372 to the procedures that are backward compatible with the [RFC5245] 373 specification. 375 4.1.3.1. Verifying ICE Support 377 The logic at the offerer is identical to that of the answerer as 378 described in section 5.1.1 of [ICE-BIS], with the exception that an 379 offerer would not ever generate a=ice-mismatch attributes in an SDP. 381 In some cases, the answer may omit a=candidate attributes for the 382 media streams, and instead include an a=ice-mismatch attribute for 383 one or more of the media streams in the SDP. This signals to the 384 offerer that the answerer supports ICE, but that ICE processing was 385 not used for the session because a signaling intermediary modified 386 the default destination for media components without modifying the 387 corresponding candidate attributes. See Section 11.2.2 for a 388 discussion of cases where this can happen. This specification 389 provides no guidance on how an agent should proceed in such a failure 390 case. 392 4.1.4. Performing Connectivity Checks 394 The possibility for role conflicts described in section 6.1.3.1.1 of 395 [ICE-BIS] applies to this usage and hence all full agents MUST 396 implement the role conflict repairing mechanism. Also both full and 397 lite agents MUST utilize the ICE-CONTROLLED and ICE-CONTROLLING 398 attributes as described in section 6.1.2.3 of [ICE-BIS]. 400 4.1.5. Concluding ICE 402 Once all of the media streams are completed, the controlling endpoint 403 sends an updated offer if the transport destination in the "m=" and 404 "c=" lines for the media stream (called the DEFAULT CANDIDATES) don't 405 match ICE's selected candidates. 407 4.1.5.1. Procedures for Full Implementations 409 4.1.5.1.1. Updating states 411 Once the state of each check list is Completed, If an agent is 412 controlling, it examines the highest-priority nominated candidate 413 pair for each component of each media stream. If any of those 414 candidate pairs differ from the default candidate pairs in the most 415 recent offer/answer exchange, the controlling agent MUST generate an 416 updated offer as described in Section 4.2. 418 4.1.5.2. Freeing Candidates 420 4.1.5.2.1. Full Implementation Procedures 422 When ICE is used with SIP, and an offer is forked to multiple 423 recipients, ICE proceeds in parallel and independently with each 424 answerer, all using the same local candidates. Once ICE processing 425 has reached the Completed state for all peers for media streams using 426 those candidates, the agent SHOULD wait an additional three seconds, 427 and then it MAY cease responding to checks or generating triggered 428 checks on that candidate. It MAY free the candidate at that time. 430 Freeing of server reflexive candidates is never explicit; it happens 431 by lack of a keepalive. The three-second delay handles cases when 432 aggressive nomination is used, and the selected pairs can quickly 433 change after ICE has completed. 435 4.2. Subsequent Offer/Answer Exchanges 437 Either agent MAY generate a subsequent offer at any time allowed by 438 [RFC3264]. The rules in Section 4.1.5 will cause the controlling 439 agent to send an updated offer at the conclusion of ICE processing 440 when ICE has selected different candidate pairs from the default 441 pairs. This section defines rules for construction of subsequent 442 offers and answers. 444 Should a subsequent offer be rejected, ICE processing continues as if 445 the subsequent offer had never been made. 447 4.2.1. Generating the Offer 449 4.2.1.1. Procedures for All Implementations 451 4.2.1.1.1. ICE Restarts 453 An agent MAY restart ICE processing for an existing media stream as 454 defined in section 6.3 of [ICE-BIS]. 456 The rules govering the ICE restart imply that setting the IP address 457 in the "c=" line to 0.0.0.0 will cause an ICE restart. Consequently, 458 ICE implementations MUST NOT utilize this mechanism for call hold, 459 and instead MUST use a=inactive and a=sendonly as described in 460 [RFC3264]. 462 To restart ICE, an agent MUST change both the ice-pwd and the ice- 463 ufrag for the media stream in an offer. Note that it is permissible 464 to use a session-level attribute in one offer, but to provide the 465 same ice-pwd or ice-ufrag as a media-level attribute in a subsequent 466 offer. This is not a change in password, just a change in its 467 representation, and does not cause an ICE restart. 469 An agent sets the rest of the fields in the SDP for this media stream 470 as it would in an initial offer of this media stream (see 471 Section 4.1.1.2). Consequently, the set of candidates MAY include 472 some, none, or all of the previous candidates for that stream and MAY 473 include a totally new set of candidates. 475 4.2.1.1.2. Removing a Media Stream 477 If an agent removes a media stream by setting its port to zero, it 478 MUST NOT include any candidate attributes for that media stream and 479 SHOULD NOT include any other ICE-related attributes defined in 480 Section 5 for that media stream. 482 4.2.1.1.3. Adding a Media Stream 484 If an agent wishes to add a new media stream, it sets the fields in 485 the SDP for this media stream as if this was an initial offer for 486 that media stream (see Section 4.1.1.2). This will cause ICE 487 processing to begin for this media stream. 489 4.2.1.2. Procedures for Full Implementations 491 This section describes additional procedures for full 492 implementations, covering existing media streams. 494 The username fragments, password, and implementation level MUST 495 remain the same as used previously. If an agent needs to change one 496 of these, it MUST restart ICE for that media stream. 498 Additional behavior depends on the state ICE processing for that 499 media stream. 501 4.2.1.2.1. Existing Media Streams with ICE Running 503 If an agent generates an updated offer including a media stream that 504 was previously established, and for which ICE checks are in the 505 Running state, the agent follows the procedures defined here. 507 An agent MUST include candidate attributes for all local candidates 508 it had signaled previously for that media stream. The properties of 509 that candidate as signaled in SDP -- the priority, foundation, type, 510 and related transport address -- SHOULD remain the same. The IP 511 address, port, and transport protocol, which fundamentally identify 512 that candidate, MUST remain the same (if they change, it would be a 513 new candidate). The component ID MUST remain the same. The agent 514 MAY include additional candidates it did not offer previously, but 515 which it has gathered since the last offer/answer exchange, including 516 peer reflexive candidates. 518 The agent MAY change the default destination for media. As with 519 initial offers, there MUST be a set of candidate attributes in the 520 offer matching this default destination. 522 4.2.1.2.2. Existing Media Streams with ICE Completed 524 If an agent generates an updated offer including a media stream that 525 was previously established, and for which ICE checks are in the 526 Completed state, the agent follows the procedures defined here. 528 The default destination for media (i.e., the values of the IP 529 addresses and ports in the "m=" and "c=" lines used for that media 530 stream) MUST be the local candidate from the highest-priority 531 nominated pair in the valid list for each component. This "fixes" 532 the default destination for media to equal the destination ICE has 533 selected for media. 535 The agent MUST include candidate attributes for candidates matching 536 the default destination for each component of the media stream, and 537 MUST NOT include any other candidates. 539 In addition, if the agent is controlling, it MUST include the 540 a=remote-candidates attribute for each media stream whose check list 541 is in the Completed state. The attribute contains the remote 542 candidates from the highest-priority nominated pair in the valid list 543 for each component of that media stream. It is needed to avoid a 544 race condition whereby the controlling agent chooses its pairs, but 545 the updated offer beats the connectivity checks to the controlled 546 agent, which doesn't even know these pairs are valid, let alone 547 selected. See Appendix B for elaboration on this race condition. 549 4.2.1.3. Procedures for Lite Implementations 551 4.2.1.3.1. Existing Media Streams with ICE Running 553 This section describes procedures for lite implementations for 554 existing streams for which ICE is running. 556 A lite implementation MUST include all of its candidates for each 557 component of each media stream in an a=candidate attribute in any 558 subsequent offer. These candidates are formed identically to the 559 procedures for initial offers, as described in section 4.2 of 560 [ICE-BIS]. 562 A lite implementation MUST NOT add additional host candidates in a 563 subsequent offer. If an agent needs to offer additional candidates, 564 it MUST restart ICE. 566 The username fragments, password, and implementation level MUST 567 remain the same as used previously. If an agent needs to change one 568 of these, it MUST restart ICE for that media stream. 570 4.2.1.3.2. Existing Media Streams with ICE Completed 572 If ICE has completed for a media stream, the default destination for 573 that media stream MUST be set to the remote candidate of the 574 candidate pair for that component in the valid list. For a lite 575 implementation, there is always just a single candidate pair in the 576 valid list for each component of a media stream. Additionally, the 577 agent MUST include a candidate attribute for each default 578 destination. 580 Additionally, if the agent is controlling (which only happens when 581 both agents are lite), the agent MUST include the a=remote-candidates 582 attribute for each media stream. The attribute contains the remote 583 candidates from the candidate pairs in the valid list (one pair for 584 each component of each media stream). 586 4.2.2. Receiving the Offer and Generating an Answer 588 4.2.2.1. Procedures for All Implementations 590 When receiving a subsequent offer within an existing session, an 591 agent MUST reapply the verification procedures in Section 4.1.2.3 592 without regard to the results of verification from any previous 593 offer/answer exchanges. Indeed, it is possible that a previous 594 offer/answer exchange resulted in ICE not being used, but it is used 595 as a consequence of a subsequent exchange. 597 4.2.2.1.1. Detecting ICE Restart 599 If the offer contained a change in the a=ice-ufrag or a=ice-pwd 600 attributes compared to the previous SDP from the peer, it indicates 601 that ICE is restarting for this media stream. If all media streams 602 are restarting, then ICE is restarting overall. 604 If ICE is restarting for a media stream: 606 o The agent MUST change the a=ice-ufrag and a=ice-pwd attributes in 607 the answer. 609 o The agent MAY change its implementation level in the answer. 611 An agent sets the rest of the fields in the SDP for this media stream 612 as it would in an initial answer to this media stream (see 613 Section 4.1.1.2). Consequently, the set of candidates MAY include 614 some, none, or all of the previous candidates for that stream and MAY 615 include a totally new set of candidates. 617 4.2.2.1.2. New Media Stream 619 If the offer contains a new media stream, the agent sets the fields 620 in the answer as if it had received an initial offer containing that 621 media stream (see Section 4.1.1.2). This will cause ICE processing 622 to begin for this media stream. 624 4.2.2.1.3. Removed Media Stream 626 If an offer contains a media stream whose port is zero, the agent 627 MUST NOT include any candidate attributes for that media stream in 628 its answer and SHOULD NOT include any other ICE-related attributes 629 defined in Section 5 for that media stream. 631 4.2.2.2. Procedures for Full Implementations 633 Unless the agent has detected an ICE restart from the offer, the 634 username fragments, password, and implementation level MUST remain 635 the same as used previously. If an agent needs to change one of 636 these it MUST restart ICE for that media stream by generating an 637 offer; ICE cannot be restarted in an answer. 639 Additional behaviors depend on the state of ICE processing for that 640 media stream. 642 4.2.2.2.1. Existing Media Streams with ICE Running and no remote- 643 candidates 645 If ICE is running for a media stream, and the offer for that media 646 stream lacked the remote-candidates attribute, the rules for 647 construction of the answer are identical to those for the offerer as 648 described in Section 4.2.1.2.1. 650 4.2.2.2.2. Existing Media Streams with ICE Completed and no remote- 651 candidates 653 If ICE is Completed for a media stream, and the offer for that media 654 stream lacked the remote-candidates attribute, the rules for 655 construction of the answer are identical to those for the offerer as 656 described in Section 4.2.1.2.2, except that the answerer MUST NOT 657 include the a=remote-candidates attribute in the answer. 659 4.2.2.2.3. Existing Media Streams and remote-candidates 661 A controlled agent will receive an offer with the a=remote-candidates 662 attribute for a media stream when its peer has concluded ICE 663 processing for that media stream. This attribute is present in the 664 offer to deal with a race condition between the receipt of the offer, 665 and the receipt of the Binding Response that tells the answerer the 666 candidate that will be selected by ICE. See Appendix B for an 667 explanation of this race condition. Consequently, processing of an 668 offer with this attribute depends on the winner of the race. 670 The agent forms a candidate pair for each component of the media 671 stream by: 673 o Setting the remote candidate equal to the offerer's default 674 destination for that component (e.g., the contents of the "m=" and 675 "c=" lines for RTP, and the a=rtcp attribute for RTCP) 677 o Setting the local candidate equal to the transport address for 678 that same component in the a=remote-candidates attribute in the 679 offer. 681 The agent then sees if each of these candidate pairs is present in 682 the valid list. If a particular pair is not in the valid list, the 683 check has "lost" the race. Call such a pair a "losing pair". 685 The agent finds all the pairs in the check list whose remote 686 candidates equal the remote candidate in the losing pair: 688 o If none of the pairs are In-Progress, and at least one is Failed, 689 it is most likely that a network failure, such as a network 690 partition or serious packet loss, has occurred. The agent SHOULD 691 generate an answer for this media stream as if the remote- 692 candidates attribute had not been present, and then restart ICE 693 for this stream. 695 o If at least one of the pairs is In-Progress, the agent SHOULD wait 696 for those checks to complete, and as each completes, redo the 697 processing in this section until there are no losing pairs. 699 Once there are no losing pairs, the agent can generate the answer. 700 It MUST set the default destination for media to the candidates in 701 the remote-candidates attribute from the offer (each of which will 702 now be the local candidate of a candidate pair in the valid list). 703 It MUST include a candidate attribute in the answer for each 704 candidate in the remote-candidates attribute in the offer. 706 4.2.2.3. Procedures for Lite Implementations 708 If the received offer contains the remote-candidates attribute for a 709 media stream, the agent forms a candidate pair for each component of 710 the media stream by: 712 o Setting the remote candidate equal to the offerer's default 713 destination for that component (e.g., the contents of the "m=" and 714 "c=" lines for RTP, and the a=rtcp attribute for RTCP). 716 o Setting the local candidate equal to the transport address for 717 that same component in the a=remote-candidates attribute in the 718 offer. 720 It then places those candidates into the Valid list for the media 721 stream. The state of ICE processing for that media stream is set to 722 Completed. 724 Furthermore, if the agent believed it was controlling, but the offer 725 contained the remote-candidates attribute, both agents believe they 726 are controlling. In this case, both would have sent updated offers 727 around the same time. However, the signaling protocol carrying the 728 offer/answer exchanges will have resolved this glare condition, so 729 that one agent is always the 'winner' by having its offer received 730 before its peer has sent an offer. The winner takes the role of 731 controlling, so that the loser (the answerer under consideration in 732 this section) MUST change its role to controlled. Consequently, if 733 the agent was going to send an updated offer since, based on the 734 rules in section 6.2 of [ICE-BIS], it was controlling, it no longer 735 needs to. 737 Besides the potential role change, change in the Valid list, and 738 state changes, the construction of the answer is performed i 739 dentically to the construction of an offer as described in 740 Section 4.2.1.3. 742 4.2.3. Receiving the Answer for a Subsequent Offer 744 Some deployments of ICE include e.g. SDP-Modifying Signaling-only 745 Back-to-Back User Agents (B2BUAs) [RFC7092] that modify the SDP body 746 during the subsequent offer/answer exchange. With the B2BUA being 747 ICE-unaware a subsequent answer might be manipulated and might not 748 include ICE candidates although the initial answer did. 750 An example of a situation where such an "unexpected" answer might be 751 experienced appears when such a B2BUA introduces a media server 752 during call hold using 3rd party call-control procedures. Omitting 753 further details how this is done this could result in an answer being 754 received at the holding UA that was constructed by the B2BUA. With 755 the B2BUA being ICE-unaware that answer would not include ICE 756 candidates. 758 Receiving an answer without ICE attributes in this situation might be 759 unexpected, but would not necessarily impair the user experience. 761 In addition to procedures for the expected answer, the following 762 sections advice on how to recover from the unexpected situation. 764 4.2.3.1. Procedures for All Implementations 766 When receiving an answer within an existing session for a subsequent 767 offer as specified in Section 4.2.1.2.2, an agent MUST verify ICE 768 support as specified in Section 4.1.3.1. 770 4.2.3.1.1. ICE Restarts 772 If ICE support is indicated in the SDP answer, the agent MUST perform 773 ICE restart procedures as specified in Section 4.2.4. 775 If ICE support is no longer indicated in the SDP answer, the agent 776 MUST fall-back to RFC 3264 procedures and SHOULD NOT drop the dialog 777 just because of missing ICE support. If the agent sends a new offer 778 later on it SHOULD perform an ICE restart as specified in 779 Section 4.2.1.1.1. 781 4.2.3.1.2. Existing Media Streams with ICE Running 783 If ICE support is indicated in the SDP answer, the agent MUST 784 continue ICE procedures as specified in Section 4.2.4.1.4. 786 If ICE support is no longer indicated in the SDP answer, the agent 787 MUST abort the ongoing ICE processing and fall-back to RFC 3264 788 procedures. The agent SHOULD NOT drop the dialog just because of 789 missing ICE support. If the agent sends a new offer later on, it 790 SHOULD perform an ICE restart as specified in Section 4.2.1.1.1. 792 4.2.3.1.3. Existing Media Streams with ICE Completed 794 If ICE support is indicated in the SDP answer and if the answer 795 conforms to Section 4.2.2.2.3, the agent MUST remain in the ICE 796 Completed state. 798 If ICE support is no longer indicated in the SDP answer, the agent 799 MUST fall-back to RFC 3264 procedures and SHOULD NOT drop the dialog 800 just because of this unexpected answer. Once the agent sends a new 801 offer later on it MUST perform an ICE restart. 803 4.2.4. Updating the Check and Valid Lists 804 4.2.4.1. Procedures for Full Implementations 806 4.2.4.1.1. ICE Restarts 808 The agent MUST remember the highest-priority nominated pairs in the 809 Valid list for each component of the media stream, called the 810 previous selected pairs, prior to the restart. The agent will 811 continue to send media using these pairs, as described in 812 Section 7.1. Once these destinations are noted, the agent MUST flush 813 the valid and check lists, and then recompute the check list and its 814 states as described in section 5.1.3 of [ICE-BIS]. 816 4.2.4.1.2. New Media Stream 818 If the offer/answer exchange added a new media stream, the agent MUST 819 create a new check list for it (and an empty Valid list to start of 820 course), as described in section 5.1.3 of [ICE-BIS]. 822 4.2.4.1.3. Removed Media Stream 824 If the offer/answer exchange removed a media stream, or an answer 825 rejected an offered media stream, an agent MUST flush the Valid list 826 for that media stream. It MUST terminate any STUN transactions in 827 progress for that media stream. An agent MUST remove the check list 828 for that media stream and cancel any pending ordinary checks for it. 830 4.2.4.1.4. ICE Continuing for Existing Media Stream 832 The valid list is not affected by an updated offer/answer exchange 833 unless ICE is restarting. 835 If an agent is in the Running state for that media stream, the check 836 list is updated (the check list is irrelevant if the state is 837 completed). To do that, the agent recomputes the check list using 838 the procedures described in section 5.1.3 of [ICE-BIS]. If a pair on 839 the new check list was also on the previous check list, and its state 840 was Waiting, In-Progress, Succeeded, or Failed, its state is copied 841 over. Otherwise, its state is set to Frozen. 843 If none of the check lists are active (meaning that the pairs in each 844 check list are Frozen), the full-mode agent sets the first pair in 845 the check list for the first media stream to Waiting, and then sets 846 the state of all other pairs in that check list for the same 847 component ID and with the same foundation to Waiting as well. 849 Next, the agent goes through each check list, starting with the 850 highest-priority pair. If a pair has a state of Succeeded, and it 851 has a component ID of 1, then all Frozen pairs in the same check list 852 with the same foundation whose component IDs are not 1 have their 853 state set to Waiting. If, for a particular check list, there are 854 pairs for each component of that media stream in the Succeeded state, 855 the agent moves the state of all Frozen pairs for the first component 856 of all other media streams (and thus in different check lists) with 857 the same foundation to Waiting. 859 4.2.4.2. Procedures for Lite Implementations 861 If ICE is restarting for a media stream, the agent MUST start a new 862 Valid list for that media stream. It MUST remember the pairs in the 863 previous Valid list for each component of the media stream, called 864 the previous selected pairs, and continue to send media there as 865 described in Section 7.1. The state of ICE processing for each media 866 stream MUST change to Running, and the state of ICE processing MUST 867 change to Running. 869 5. Grammar 871 This specification defines eight new SDP attributes -- the 872 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 873 ufrag", "ice-pwd", "ice-pacing", and "ice-options" attributes. 875 5.1. "candidate" Attribute 877 The candidate attribute is a media-level attribute only. It contains 878 a transport address for a candidate that can be used for connectivity 879 checks. 881 The syntax of this attribute is defined using Augmented BNF as 882 defined in [RFC5234]: 884 candidate-attribute = "candidate" ":" foundation SP component-id SP 885 transport SP 886 priority SP 887 connection-address SP ;from RFC 4566 888 port ;port from RFC 4566 889 SP cand-type 890 [SP rel-addr] 891 [SP rel-port] 892 *(SP extension-att-name SP 893 extension-att-value) 895 foundation = 1*32ice-char 896 component-id = 1*5DIGIT 897 transport = "UDP" / transport-extension 898 transport-extension = token ; from RFC 3261 899 priority = 1*10DIGIT 900 cand-type = "typ" SP candidate-types 901 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 902 rel-addr = "raddr" SP connection-address 903 rel-port = "rport" SP port 904 extension-att-name = token 905 extension-att-value = *VCHAR 906 ice-char = ALPHA / DIGIT / "+" / "/" 908 This grammar encodes the primary information about a candidate: its 909 IP address, port and transport protocol, and its properties: the 910 foundation, component ID, priority, type, and related transport 911 address: 913 : is taken from RFC 4566 [RFC4566]. It is the 914 IP address of the candidate, allowing for IPv4 addresses, IPv6 915 addresses, and fully qualified domain names (FQDNs). When parsing 916 this field, an agent can differentiate an IPv4 address and an IPv6 917 address by presence of a colon in its value -- the presence of a 918 colon indicates IPv6. An agent MUST ignore candidate lines that 919 include candidates with IP address versions that are not supported 920 or recognized. An IP address SHOULD be used, but an FQDN MAY be 921 used in place of an IP address. In that case, when receiving an 922 offer or answer containing an FQDN in an a=candidate attribute, 923 the FQDN is looked up in the DNS first using an AAAA record 924 (assuming the agent supports IPv6), and if no result is found or 925 the agent only supports IPv4, using an A. If the DNS query 926 returns more than one IP address, one is chosen, and then used for 927 the remainder of ICE processing. 929 : is also taken from RFC 4566 [RFC4566]. It is the port of 930 the candidate. 932 : indicates the transport protocol for the candidate. 933 This specification only defines UDP. However, extensibility is 934 provided to allow for future transport protocols to be used with 935 ICE, such as TCP or the Datagram Congestion Control Protocol 936 (DCCP) [RFC4340]. 938 : is composed of 1 to 32 s. It is an 939 identifier that is equivalent for two candidates that are of the 940 same type, share the same base, and come from the same STUN 941 server. The foundation is used to optimize ICE performance in the 942 Frozen algorithm. 944 : is a positive integer between 1 and 256 that 945 identifies the specific component of the media stream for which 946 this is a candidate. It MUST start at 1 and MUST increment by 1 947 for each component of a particular candidate. For media streams 948 based on RTP, candidates for the actual RTP media MUST have a 949 component ID of 1, and candidates for RTCP MUST have a component 950 ID of 2. See section 10 in [ICE-BIS] for additional discussion on 951 extending ICE to new media streams. 953 : is a positive integer between 1 and (2**31 - 1). 955 : encodes the type of candidate. This specification 956 defines the values "host", "srflx", "prflx", and "relay" for host, 957 server reflexive, peer reflexive, and relayed candidates, 958 respectively. The set of candidate types is extensible for the 959 future. 961 and : convey transport addresses related to the 962 candidate, useful for diagnostics and other purposes. 963 and MUST be present for server reflexive, peer 964 reflexive, and relayed candidates. If a candidate is server or 965 peer reflexive, and are equal to the base 966 for that server or peer reflexive candidate. If the candidate is 967 relayed, and is equal to the mapped address 968 in the Allocate response that provided the client with that 969 relayed candidate (see section Appendix B.3 of [ICE-BIS] for a 970 discussion of its purpose). If the candidate is a host candidate, 971 and MUST be omitted. 973 In some cases, e.g., for privacy reasons, an agent may not want to 974 reveal the related address and port. In this case the address 975 MUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 976 candidates) and the port to zero. 978 The candidate attribute can itself be extended. The grammar allows 979 for new name/value pairs to be added at the end of the attribute. An 980 implementation MUST ignore any name/value pairs it doesn't 981 understand. 983 5.2. "remote-candidates" Attribute 985 The syntax of the "remote-candidates" attribute is defined using 986 Augmented BNF as defined in RFC 5234 [RFC5234]. The remote- 987 candidates attribute is a media-level attribute only. 989 remote-candidate-att = "remote-candidates" ":" remote-candidate 990 0*(SP remote-candidate) 991 remote-candidate = component-ID SP connection-address SP port 993 The attribute contains a connection-address and port for each 994 component. The ordering of components is irrelevant. However, a 995 value MUST be present for each component of a media stream. This 996 attribute MUST be included in an offer by a controlling agent for a 997 media stream that is Completed, and MUST NOT be included in any other 998 case. 1000 5.3. "ice-lite" and "ice-mismatch" Attributes 1002 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 1003 which are flags, is: 1005 ice-lite = "ice-lite" 1006 ice-mismatch = "ice-mismatch" 1008 "ice-lite" is a session-level attribute only, and indicates that an 1009 agent is a lite implementation. "ice-mismatch" is a media-level 1010 attribute only, and when present in an answer, indicates that the 1011 offer arrived with a default destination for a media component that 1012 didn't have a corresponding candidate attribute. 1014 5.4. "ice-ufrag" and "ice-pwd" Attributes 1016 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 1017 and password used by ICE for message integrity. Their syntax is: 1019 ice-pwd-att = "ice-pwd" ":" password 1020 ice-ufrag-att = "ice-ufrag" ":" ufrag 1021 password = 22*256ice-char 1022 ufrag = 4*256ice-char 1024 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 1025 session-level or media-level. When present in both, the value in the 1026 media-level takes precedence. Thus, the value at the session-level 1027 is effectively a default that applies to all media streams, unless 1028 overridden by a media-level value. Whether present at the session or 1029 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 1030 each media stream. If two media streams have identical ice-ufrag's, 1031 they MUST have identical ice-pwd's. 1033 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 1034 beginning of a session. The ice-ufrag attribute MUST contain at 1035 least 24 bits of randomness, and the ice-pwd attribute MUST contain 1036 at least 128 bits of randomness. This means that the ice-ufrag 1037 attribute will be at least 4 characters long, and the ice-pwd at 1038 least 22 characters long, since the grammar for these attributes 1039 allows for 6 bits of randomness per character. The attributes MAY be 1040 longer than 4 and 22 characters, respectively, of course, up to 256 1041 characters. The upper limit allows for buffer sizing in 1042 implementations. Its large upper limit allows for increased amounts 1043 of randomness to be added over time. For compatibility with the 512 1044 character limitation for the STUN username attribute value and for 1045 bandwidth conservation considerations, the ice-ufrag attribute MUST 1046 NOT be longer than 32 characters when sending, but an implementation 1047 MUST accept up to 256 characters when receiving. 1049 5.5. "ice-pacing" Attribute 1051 The "ice-pacing" attribute indicates the desired connectivity check 1052 pacing, in milliseconds, for this agent (see section 11 of 1053 [ICE-BIS]). The syntax is: 1055 ice-pacing-att = "ice-pacing" ":" pacing-value 1056 pacing-value = 1*10DIGIT 1058 5.6. "ice-options" Attribute 1060 The "ice-options" attribute is a session- and media-level attribute. 1061 It contains a series of tokens that identify the options supported by 1062 the agent. Its grammar is: 1064 ice-options = "ice-options" ":" ice-option-tag 1065 0*(SP ice-option-tag) 1066 ice-option-tag = 1*ice-char 1068 The existence of an ice-option can indicate that a certain extension 1069 is supported by the agent and will be used or that the extension is 1070 used only if the other agent is willing to use it too. In order to 1071 avoid ambiguity, documents defining new options must indicate which 1072 case applies to the defined extensions. 1074 6. Keepalives 1076 The procedures defined in section 8 of [ICE-BIS] MUST be followed. 1077 The keepalives MUST be sent regardless of whether the media stream is 1078 currently inactive, sendonly, recvonly, or sendrecv, and regardless 1079 of the presence or value of the bandwidth attribute. An agent can 1080 determine that its peer supports ICE by the presence of a=candidate 1081 attributes for each media session. 1083 7. Media Handling 1085 7.1. Sending Media 1087 Note that the selected pair for a component of a media stream may not 1088 equal the default pair for that same component from the most recent 1089 offer/answer exchange. When this happens, the selected pair is used 1090 for media, not the default pair. When ICE first completes, if the 1091 selected pairs aren't a match for the default pairs, the controlling 1092 agent sends an updated offer/answer exchange to remedy this 1093 disparity. However, until that updated offer arrives, there will not 1094 be a match. Furthermore, in very unusual cases, the default 1095 candidates in the updated offer/answer will not be a match. 1097 7.1.1. Procedures for All Implementations 1099 section 9.1.3 of [ICE-BIS] defines procedures for sending media 1100 common across Full and Lite implementations. 1102 7.2. Receiving Media 1104 See section 9.2 of [ICE-BIS] for procedures on receiving media. 1106 8. Usage with SIP 1108 8.1. Latency Guidelines 1110 ICE requires a series of STUN-based connectivity checks to take place 1111 between endpoints. These checks start from the answerer on 1112 generation of its answer, and start from the offerer when it receives 1113 the answer. These checks can take time to complete, and as such, the 1114 selection of messages to use with offers and answers can affect 1115 perceived user latency. Two latency figures are of particular 1116 interest. These are the post-pickup delay and the post-dial delay. 1117 The post-pickup delay refers to the time between when a user "answers 1118 the phone" and when any speech they utter can be delivered to the 1119 caller. The post-dial delay refers to the time between when a user 1120 enters the destination address for the user and ringback begins as a 1121 consequence of having successfully started ringing the phone of the 1122 called party. 1124 Two cases can be considered -- one where the offer is present in the 1125 initial INVITE and one where it is in a response. 1127 8.1.1. Offer in INVITE 1129 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1130 gathering candidates prior to actually sending its initial INVITE. 1131 This can be started upon user interface cues that a call is pending, 1132 such as activity on a keypad or the phone going off-hook. 1134 If an offer is received in an INVITE request, the answerer SHOULD 1135 begin to gather its candidates on receipt of the offer and then 1136 generate an answer in a provisional response once it has completed 1137 that process. ICE requires that a provisional response with an SDP 1138 be transmitted reliably. This can be done through the existing 1139 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1140 through an optimization that is specific to ICE. With this 1141 optimization, provisional responses containing an SDP answer that 1142 begins ICE processing for one or more media streams can be sent 1143 reliably without RFC 3262. To do this, the agent retransmits the 1144 provisional response with the exponential backoff timers described in 1145 RFC 3262. Retransmits MUST cease on receipt of a STUN Binding 1146 request for one of the media streams signaled in that SDP (because 1147 receipt of a Binding request indicates the offerer has received the 1148 answer) or on transmission of the answer in a 2xx response. If the 1149 peer agent is lite, there will never be a STUN Binding request. In 1150 such a case, the agent MUST cease retransmitting the 18x after 1151 sending it four times (ICE will actually work even if the peer never 1152 receives the 18x; however, experience has shown that sending it is 1153 important for middleboxes and firewall traversal). If no Binding 1154 request is received prior to the last retransmit, the agent does not 1155 consider the session terminated. Despite the fact that the 1156 provisional response will be delivered reliably, the rules for when 1157 an agent can send an updated offer or answer do not change from those 1158 specified in RFC 3262. Specifically, if the INVITE contained an 1159 offer, the same answer appears in all of the 1xx and in the 2xx 1160 response to the INVITE. Only after that 2xx has been sent can an 1161 updated offer/answer exchange occur. This optimization SHOULD NOT be 1162 used if both agents support PRACK. Note that the optimization is 1163 very specific to provisional response carrying answers that start ICE 1164 processing; it is not a general technique for 1xx reliability. 1166 Alternatively, an agent MAY delay sending an answer until the 200 OK; 1167 however, this results in a poor user experience and is NOT 1168 RECOMMENDED. 1170 Once the answer has been sent, the agent SHOULD begin its 1171 connectivity checks. Once candidate pairs for each component of a 1172 media stream enter the valid list, the answerer can begin sending 1173 media on that media stream. 1175 However, prior to this point, any media that needs to be sent towards 1176 the caller (such as SIP early media [RFC3960]) MUST NOT be 1177 transmitted. For this reason, implementations SHOULD delay alerting 1178 the called party until candidates for each component of each media 1179 stream have entered the valid list. In the case of a PSTN gateway, 1180 this would mean that the setup message into the PSTN is delayed until 1181 this point. Doing this increases the post-dial delay, but has the 1182 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1183 called party hears the phone ring, picks up, but hears nothing and 1184 cannot be heard. This technique works without requiring support for, 1185 or usage of, preconditions [RFC3312], since it's a localized 1186 decision. It also has the benefit of guaranteeing that not a single 1187 packet of media will get clipped, so that post-pickup delay is zero. 1188 If an agent chooses to delay local alerting in this way, it SHOULD 1189 generate a 180 response once alerting begins. 1191 8.1.2. Offer in Response 1193 In addition to uses where the offer is in an INVITE, and the answer 1194 is in the provisional and/or 200 OK response, ICE works with cases 1195 where the offer appears in the response. In such cases, which are 1196 common in third party call control [RFC3725], ICE agents SHOULD 1197 generate their offers in a reliable provisional response (which MUST 1198 utilize RFC 3262), and not alert the user on receipt of the INVITE. 1199 The answer will arrive in a PRACK. This allows for ICE processing to 1200 take place prior to alerting, so that there is no post-pickup delay, 1201 at the expense of increased call setup delays. Once ICE completes, 1202 the callee can alert the user and then generate a 200 OK when they 1203 answer. The 200 OK would contain no SDP, since the offer/answer 1204 exchange has completed. 1206 Alternatively, agents MAY place the offer in a 2xx instead (in which 1207 case the answer comes in the ACK). When this happens, the callee 1208 will alert the user on receipt of the INVITE, and the ICE exchanges 1209 will take place only after the user answers. This has the effect of 1210 reducing call setup delay, but can cause substantial post-pickup 1211 delays and media clipping. 1213 8.2. SIP Option Tags and Media Feature Tags 1215 [RFC5768] specifies a SIP option tag and media feature tag for usage 1216 with ICE. ICE implementations using SIP SHOULD support this 1217 specification, which uses a feature tag in registrations to 1218 facilitate interoperability through signaling intermediaries. 1220 8.3. Interactions with Forking 1222 ICE interacts very well with forking. Indeed, ICE fixes some of the 1223 problems associated with forking. Without ICE, when a call forks and 1224 the caller receives multiple incoming media streams, it cannot 1225 determine which media stream corresponds to which callee. 1227 With ICE, this problem is resolved. The connectivity checks which 1228 occur prior to transmission of media carry username fragments, which 1229 in turn are correlated to a specific callee. Subsequent media 1230 packets that arrive on the same candidate pair as the connectivity 1231 check will be associated with that same callee. Thus, the caller can 1232 perform this correlation as long as it has received an answer. 1234 8.4. Interactions with Preconditions 1236 Quality of Service (QoS) preconditions, which are defined in RFC 3312 1237 [RFC3312] and RFC 4032 [RFC4032], apply only to the transport 1238 addresses listed as the default targets for media in an offer/answer. 1239 If ICE changes the transport address where media is received, this 1240 change is reflected in an updated offer that changes the default 1241 destination for media to match ICE's selection. As such, it appears 1242 like any other re-INVITE would, and is fully treated in RFCs 3312 and 1243 4032, which apply without regard to the fact that the destination for 1244 media is changing due to ICE negotiations occurring "in the 1245 background". 1247 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1248 met until the checks have completed and selected the candidate pairs 1249 to be used for media. 1251 ICE also has (purposeful) interactions with connectivity 1252 preconditions [RFC5898]. Those interactions are described there. 1253 Note that the procedures described in Section 8.1 describe their own 1254 type of "preconditions", albeit with less functionality than those 1255 provided by the explicit preconditions in [RFC5898]. 1257 8.5. Interactions with Third Party Call Control 1259 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1260 I works without the controller supporting or being aware of ICE. 1261 Flow IV will work as long as the controller passes along the ICE 1262 attributes without alteration. Flow II is fundamentally incompatible 1263 with ICE; each agent will believe itself to be the answerer and thus 1264 never generate a re-INVITE. 1266 The flows for continued operation, as described in Section 7 of RFC 1267 3725, require additional behavior of ICE implementations to support. 1268 In particular, if an agent receives a mid-dialog re-INVITE that 1269 contains no offer, it MUST restart ICE for each media stream and go 1270 through the process of gathering new candidates. Furthermore, that 1271 list of candidates SHOULD include the ones currently being used for 1272 media. 1274 9. Relationship with ANAT 1276 RFC 4091 [RFC4091], the Alternative Network Address Types (ANAT) 1277 Semantics for the SDP grouping framework, and RFC 4092 [RFC4092], its 1278 usage with SIP, define a mechanism for indicating that an agent can 1279 support both IPv4 and IPv6 for a media stream, and it does so by 1280 including two "m=" lines, one for v4 and one for v6. This is similar 1281 to ICE, which allows for an agent to indicate multiple transport 1282 addresses using the candidate attribute. However, ANAT relies on 1283 static selection to pick between choices, rather than a dynamic 1284 connectivity check used by ICE. 1286 This specification deprecates RFC 4091 and RFC 4092. Instead, agents 1287 wishing to support dual-stack will utilize ICE. 1289 10. Setting Ta and RTO for RTP Media Streams 1291 During the gathering phase of ICE (section 4.1.1 [ICE-BIS]) and while 1292 ICE is performing connectivity checks (section 6 [ICE-BIS]), an agent 1293 sends STUN and TURN transactions. These transactions are paced at a 1294 rate of one every Ta milliseconds, and utilize a specific RTO. See 1295 Section 11 of [ICE-BIS] for details on how the values of Ta and RTO 1296 are computed with a real-time media stream of known maximum bandwidth 1297 to rate-control the ICE exchanges. 1299 11. Security Considerations 1301 11.1. Attacks on the Offer/Answer Exchanges 1303 An attacker that can modify or disrupt the offer/answer exchanges 1304 themselves can readily launch a variety of attacks with ICE. They 1305 could direct media to a target of a DoS attack, they could insert 1306 themselves into the media stream, and so on. These are similar to 1307 the general security considerations for offer/answer exchanges, and 1308 the security considerations in RFC 3264 [RFC3264] apply. These 1309 require techniques for message integrity and encryption for offers 1310 and answers, which are satisfied by the SIPS mechanism [RFC3261] when 1311 SIP is used. As such, the usage of SIPS with ICE is RECOMMENDED. 1313 11.2. Insider Attacks 1315 In addition to attacks where the attacker is a third party trying to 1316 insert fake offers, answers, or stun messages, there are several 1317 attacks possible with ICE when the attacker is an authenticated and 1318 valid participant in the ICE exchange. 1320 11.2.1. The Voice Hammer Attack 1322 The voice hammer attack is an amplification attack. In this attack, 1323 the attacker initiates sessions to other agents, and maliciously 1324 includes the IP address and port of a DoS target as the destination 1325 for media traffic signaled in the SDP. This causes substantial 1326 amplification; a single offer/answer exchange can create a continuing 1327 flood of media packets, possibly at high rates (consider video 1328 sources). This attack is not specific to ICE, but ICE can help 1329 provide remediation. 1331 Specifically, if ICE is used, the agent receiving the malicious SDP 1332 will first perform connectivity checks to the target of media before 1333 sending media there. If this target is a third-party host, the 1334 checks will not succeed, and media is never sent. 1336 Unfortunately, ICE doesn't help if its not used, in which case an 1337 attacker could simply send the offer without the ICE parameters. 1338 However, in environments where the set of clients is known, and is 1339 limited to ones that support ICE, the server can reject any offers or 1340 answers that don't indicate ICE support. 1342 11.2.2. Interactions with Application Layer Gateways and SIP 1344 Application Layer Gateways (ALGs) are functions present in a NAT 1345 device that inspect the contents of packets and modify them, in order 1346 to facilitate NAT traversal for application protocols. Session 1347 Border Controllers (SBCs) are close cousins of ALGs, but are less 1348 transparent since they actually exist as application layer SIP 1349 intermediaries. ICE has interactions with SBCs and ALGs. 1351 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1352 long as the ALG correctly modifies the SDP. A correct ALG 1353 implementation behaves as follows: 1355 o The ALG does not modify the "m=" and "c=" lines or the rtcp 1356 attribute if they contain external addresses. 1358 o If the "m=" and "c=" lines contain internal addresses, the 1359 modification depends on the state of the ALG: 1361 If the ALG already has a binding established that maps an 1362 external port to an internal IP address and port matching the 1363 values in the "m=" and "c=" lines or rtcp attribute, the ALG 1364 uses that binding instead of creating a new one. 1366 If the ALG does not already have a binding, it creates a new 1367 one and modifies the SDP, rewriting the "m=" and "c=" lines and 1368 rtcp attribute. 1370 Unfortunately, many ALGs are known to work poorly in these corner 1371 cases. ICE does not try to work around broken ALGs, as this is 1372 outside the scope of its functionality. ICE can help diagnose these 1373 conditions, which often show up as a mismatch between the set of 1374 candidates and the "m=" and "c=" lines and rtcp attributes. The ice- 1375 mismatch attribute is used for this purpose. 1377 ICE works best through ALGs when the signaling is run over TLS. This 1378 prevents the ALG from manipulating the SDP messages and interfering 1379 with ICE operation. Implementations that are expected to be deployed 1380 behind ALGs SHOULD provide for TLS transport of the SDP. 1382 If an SBC is SIP aware but not ICE aware, the result depends on the 1383 behavior of the SBC. If it is acting as a proper Back-to-Back User 1384 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1385 understand, including the ICE attributes. Consequently, the call 1386 will appear to both endpoints as if the other side doesn't support 1387 ICE. This will result in ICE being disabled, and media flowing 1388 through the SBC, if the SBC has requested it. If, however, the SBC 1389 passes the ICE attributes without modification, yet modifies the 1390 default destination for media (contained in the "m=" and "c=" lines 1391 and rtcp attribute), this will be detected as an ICE mismatch, and 1392 ICE processing is aborted for the call. It is outside of the scope 1393 of ICE for it to act as a tool for "working around" SBCs. If one is 1394 present, ICE will not be used and the SBC techniques take precedence. 1396 12. IANA Considerations 1398 12.1. SDP Attributes 1400 Original ICE specification defined seven new SDP attributes per the 1401 procedures of Section 8.2.4 of [RFC4566]. The registration 1402 information is reproduced here. 1404 12.1.1. candidate Attribute 1406 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1408 Attribute Name: candidate 1409 Long Form: candidate 1411 Type of Attribute: media-level 1413 Charset Considerations: The attribute is not subject to the charset 1414 attribute. 1416 Purpose: This attribute is used with Interactive Connectivity 1417 Establishment (ICE), and provides one of many possible candidate 1418 addresses for communication. These addresses are validated with 1419 an end-to-end connectivity check using Session Traversal Utilities 1420 for NAT (STUN). 1422 Appropriate Values: See Section 5 of RFC XXXX. 1424 12.1.2. remote-candidates Attribute 1426 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1428 Attribute Name: remote-candidates 1430 Long Form: remote-candidates 1432 Type of Attribute: media-level 1434 Charset Considerations: The attribute is not subject to the charset 1435 attribute. 1437 Purpose: This attribute is used with Interactive Connectivity 1438 Establishment (ICE), and provides the identity of the remote 1439 candidates that the offerer wishes the answerer to use in its 1440 answer. 1442 Appropriate Values: See Section 5 of RFC XXXX. 1444 12.1.3. ice-lite Attribute 1446 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1448 Attribute Name: ice-lite 1450 Long Form: ice-lite 1452 Type of Attribute: session-level 1454 Charset Considerations: The attribute is not subject to the charset 1455 attribute. 1457 Purpose: This attribute is used with Interactive Connectivity 1458 Establishment (ICE), and indicates that an agent has the minimum 1459 functionality required to support ICE inter-operation with a peer 1460 that has a full implementation. 1462 Appropriate Values: See Section 5 of RFC XXXX. 1464 12.1.4. ice-mismatch Attribute 1466 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1468 Attribute Name: ice-mismatch 1470 Long Form: ice-mismatch 1472 Type of Attribute: session-level 1474 Charset Considerations: The attribute is not subject to the charset 1475 attribute. 1477 Purpose: This attribute is used with Interactive Connectivity 1478 Establishment (ICE), and indicates that an agent is ICE capable, 1479 but did not proceed with ICE due to a mismatch of candidates with 1480 the default destination for media signaled in the SDP. 1482 Appropriate Values: See Section 5 of RFC XXXX. 1484 12.1.5. ice-pwd Attribute 1486 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1488 Attribute Name: ice-pwd 1490 Long Form: ice-pwd 1492 Type of Attribute: session- or media-level 1494 Charset Considerations: The attribute is not subject to the charset 1495 attribute. 1497 Purpose: This attribute is used with Interactive Connectivity 1498 Establishment (ICE), and provides the password used to protect 1499 STUN connectivity checks. 1501 Appropriate Values: See Section 5 of RFC XXXX. 1503 12.1.6. ice-ufrag Attribute 1505 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1507 Attribute Name: ice-ufrag 1509 Long Form: ice-ufrag 1511 Type of Attribute: session- or media-level 1513 Charset Considerations: The attribute is not subject to the charset 1514 attribute. 1516 Purpose: This attribute is used with Interactive Connectivity 1517 Establishment (ICE), and provides the fragments used to construct 1518 the username in STUN connectivity checks. 1520 Appropriate Values: See Section 5 of RFC XXXX. 1522 12.1.7. ice-pacing Attribute 1524 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1526 Attribute Name: ice-pacing 1528 Long Form: ice-pacing 1530 Type of Attribute: session-level 1532 Charset Considerations: The attribute is not subject to the charset 1533 attribute. 1535 Purpose: This attribute is used with Interactive Connectivity 1536 Establishment (ICE) to indicate desired connectivity check pacing 1537 values. 1539 Appropriate Values: See Section 5 of RFC XXXX. 1541 12.1.8. ice-options Attribute 1543 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1545 Attribute Name: ice-options 1547 Long Form: ice-options 1549 Type of Attribute: session- or media-level 1550 Charset Considerations: The attribute is not subject to the charset 1551 attribute. 1553 Purpose: This attribute is used with Interactive Connectivity 1554 Establishment (ICE), and indicates the ICE options or extensions 1555 used by the agent. 1557 Appropriate Values: See Section 5 of RFC XXXX. 1559 12.2. Interactive Connectivity Establishment (ICE) Options Registry 1561 IANA maintains a registry for ice-options identifiers under the 1562 Specification Required policy as defined in "Guidelines for Writing 1563 an IANA Considerations Section in RFCs" [RFC5226]. 1565 ICE options are of unlimited length according to the syntax in 1566 Section 5.6; however, they are RECOMMENDED to be no longer than 20 1567 characters. This is to reduce message sizes and allow for efficient 1568 parsing. 1570 In RFC 5245 ICE options could only be defined at the session level. 1571 ICE options can now also be defined at the media level. This can be 1572 used when aggregating between different ICE agents in the same 1573 endpoint, but future options may require to be defined at the media- 1574 level. To ensure compatibility with legacy implementation, the 1575 media-level ICE options MUST be aggregated into a session-level ICE 1576 option. Because aggregation rules depend on the specifics of each 1577 option, all new ICE options MUST also define in their specification 1578 how the media-level ICE option values are aggregated to generate the 1579 value of the session-level ICE option. 1581 [RFC6679] defines "rtp+ecn" ICE option. The aggregation rule for 1582 this ICE option is that if all aggregated media using ICE contain a 1583 media-level "rtp+ecn" ICE option then an "rtp+ecn" ICE option MUST be 1584 inserted at the session-level. If one of the media does not contain 1585 the option, then it MUST NOT be inserted at the session-level. 1587 Section 7 of [ICE-BIS] defines "ice2" ICE option. Since "ice2" is a 1588 session level ICE option, no aggregation rules apply. 1590 A registration request MUST include the following information: 1592 o The ICE option identifier to be registered 1594 o Name, Email, and Address of a contact person for the registration 1596 o Organization or individuals having the change control 1597 o Short description of the ICE extension to which the option relates 1599 o Reference(s) to the specification defining the ICE option and the 1600 related extensions 1602 13. Acknowledgments 1604 A large part of the text in this document was taken from RFC 5245, 1605 authored by Jonathan Rosenberg. 1607 Some of the text in this document was taken from RFC 6336, authored 1608 by Magnus Westerlund and Colin Perkins. 1610 Thanks to Thomas Stach for the text in Section 4.2.3 and Roman 1611 Shpount for suggesting RTCP candidate handling in Section 4.1.1.2 1613 Thanks to following experts for their review and constructive 1614 feedback: Christer Holmberg. 1616 14. References 1618 14.1. Normative References 1620 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1621 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 1622 RFC2119, March 1997, 1623 . 1625 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1626 A., Peterson, J., Sparks, R., Handley, M., and E. 1627 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1628 DOI 10.17487/RFC3261, June 2002, 1629 . 1631 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1632 Provisional Responses in Session Initiation Protocol 1633 (SIP)", RFC 3262, DOI 10.17487/RFC3262, June 2002, 1634 . 1636 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1637 with Session Description Protocol (SDP)", RFC 3264, DOI 1638 10.17487/RFC3264, June 2002, 1639 . 1641 [RFC3312] Camarillo, G., Ed., Marshall, W., Ed., and J. Rosenberg, 1642 "Integration of Resource Management and Session Initiation 1643 Protocol (SIP)", RFC 3312, DOI 10.17487/RFC3312, October 1644 2002, . 1646 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1647 Jacobson, "RTP: A Transport Protocol for Real-Time 1648 Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550, 1649 July 2003, . 1651 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1652 Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 1653 3556, DOI 10.17487/RFC3556, July 2003, 1654 . 1656 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1657 in Session Description Protocol (SDP)", RFC 3605, DOI 1658 10.17487/RFC3605, October 2003, 1659 . 1661 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1662 Initiation Protocol (SIP) Preconditions Framework", RFC 1663 4032, DOI 10.17487/RFC4032, March 2005, 1664 . 1666 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1667 Address Types (ANAT) Semantics for the Session Description 1668 Protocol (SDP) Grouping Framework", RFC 4091, DOI 1669 10.17487/RFC4091, June 2005, 1670 . 1672 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1673 Description Protocol (SDP) Alternative Network Address 1674 Types (ANAT) Semantics in the Session Initiation Protocol 1675 (SIP)", RFC 4092, DOI 10.17487/RFC4092, June 2005, 1676 . 1678 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1679 Description Protocol", RFC 4566, DOI 10.17487/RFC4566, 1680 July 2006, . 1682 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1683 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1684 DOI 10.17487/RFC5226, May 2008, 1685 . 1687 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 1688 Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/ 1689 RFC5234, January 2008, 1690 . 1692 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1693 (ICE): A Protocol for Network Address Translator (NAT) 1694 Traversal for Offer/Answer Protocols", RFC 5245, DOI 1695 10.17487/RFC5245, April 2010, 1696 . 1698 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1699 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1700 DOI 10.17487/RFC5389, October 2008, 1701 . 1703 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1704 Connectivity Establishment (ICE) in the Session Initiation 1705 Protocol (SIP)", RFC 5768, DOI 10.17487/RFC5768, April 1706 2010, . 1708 [RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., 1709 and K. Carlberg, "Explicit Congestion Notification (ECN) 1710 for RTP over UDP", RFC 6679, DOI 10.17487/RFC6679, August 1711 2012, . 1713 [RFC7092] Kaplan, H. and V. Pascual, "A Taxonomy of Session 1714 Initiation Protocol (SIP) Back-to-Back User Agents", RFC 1715 7092, DOI 10.17487/RFC7092, December 2013, 1716 . 1718 [ICE-BIS] Keranen, A. and J. Rosenberg, "Interactive Connectivity 1719 Establishment (ICE): A Protocol for Network Address 1720 Translator (NAT) Traversal for Offer/Answer Protocols", 1721 draft-ietf-ice-rfc5245bis-00 (work in progress), March 1722 2015. 1724 14.2. Informative References 1726 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1727 Camarillo, "Best Current Practices for Third Party Call 1728 Control (3pcc) in the Session Initiation Protocol (SIP)", 1729 BCP 85, RFC 3725, DOI 10.17487/RFC3725, April 2004, 1730 . 1732 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1733 Tone Generation in the Session Initiation Protocol (SIP)", 1734 RFC 3960, DOI 10.17487/RFC3960, December 2004, 1735 . 1737 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1738 Congestion Control Protocol (DCCP)", RFC 4340, DOI 1739 10.17487/RFC4340, March 2006, 1740 . 1742 [RFC5626] Jennings, C., Ed., Mahy, R., Ed., and F. Audet, Ed., 1743 "Managing Client-Initiated Connections in the Session 1744 Initiation Protocol (SIP)", RFC 5626, DOI 10.17487/ 1745 RFC5626, October 2009, 1746 . 1748 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1749 "Connectivity Preconditions for Session Description 1750 Protocol (SDP) Media Streams", RFC 5898, DOI 10.17487/ 1751 RFC5898, July 2010, 1752 . 1754 Appendix A. Examples 1756 For the example shown in section 12 of [ICE-BIS] the resulting offer 1757 (message 5) encoded in SDP looks like: 1759 v=0 1760 o=jdoe 2890844526 2890842807 IN IP6 $L-PRIV-1.IP 1761 s= 1762 c=IN IP6 $NAT-PUB-1.IP 1763 t=0 0 1764 a=ice-pwd:asd88fgpdd777uzjYhagZg 1765 a=ice-ufrag:8hhY 1766 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1767 b=RS:0 1768 b=RR:0 1769 a=rtpmap:0 PCMU/8000 1770 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1771 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1772 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1774 The offer, with the variables replaced with their values, will look 1775 like (lines folded for clarity): 1777 v=0 1778 o=jdoe 2890844526 2890842807 IN IP6 fe80::6676:baff:fe9c:ee4a 1779 s= 1780 c=IN IP6 2001:420:c0e0:1005::61 1781 t=0 0 1782 a=ice-pwd:asd88fgpdd777uzjYhagZg 1783 a=ice-ufrag:8hhY 1784 m=audio 45664 RTP/AVP 0 1785 b=RS:0 1786 b=RR:0 1787 a=rtpmap:0 PCMU/8000 1788 a=candidate:1 1 UDP 2130706431 fe80::6676:baff:fe9c:ee4a 8998 typ host 1789 a=candidate:2 1 UDP 1694498815 2001:420:c0e0:1005::61 45664 typ srflx raddr 1790 fe80::6676:baff:fe9c:ee4a rport 8998 1792 The resulting answer looks like: 1794 v=0 1795 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1796 s= 1797 c=IN IP4 $R-PUB-1.IP 1798 t=0 0 1799 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1800 a=ice-ufrag:9uB6 1801 m=audio $R-PUB-1.PORT RTP/AVP 0 1802 b=RS:0 1803 b=RR:0 1804 a=rtpmap:0 PCMU/8000 1805 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1807 With the variables filled in: 1809 v=0 1810 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1811 s= 1812 c=IN IP4 192.0.2.1 1813 t=0 0 1814 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1815 a=ice-ufrag:9uB6 1816 m=audio 3478 RTP/AVP 0 1817 b=RS:0 1818 b=RR:0 1819 a=rtpmap:0 PCMU/8000 1820 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1822 Appendix B. The remote-candidates Attribute 1824 The a=remote-candidates attribute exists to eliminate a race 1825 condition between the updated offer and the response to the STUN 1826 Binding request that moved a candidate into the Valid list. This 1827 race condition is shown in Figure 1. On receipt of message 4, agent 1828 L adds a candidate pair to the valid list. If there was only a 1829 single media stream with a single component, agent L could now send 1830 an updated offer. However, the check from agent R has not yet 1831 generated a response, and agent R receives the updated offer (message 1832 7) before getting the response (message 9). Thus, it does not yet 1833 know that this particular pair is valid. To eliminate this 1834 condition, the actual candidates at R that were selected by the 1835 offerer (the remote candidates) are included in the offer itself, and 1836 the answerer delays its answer until those pairs validate. 1838 Agent L Network Agent R 1839 |(1) Offer | | 1840 |------------------------------------------>| 1841 |(2) Answer | | 1842 |<------------------------------------------| 1843 |(3) STUN Req. | | 1844 |------------------------------------------>| 1845 |(4) STUN Res. | | 1846 |<------------------------------------------| 1847 |(5) STUN Req. | | 1848 |<------------------------------------------| 1849 |(6) STUN Res. | | 1850 |-------------------->| | 1851 | |Lost | 1852 |(7) Offer | | 1853 |------------------------------------------>| 1854 |(8) STUN Req. | | 1855 |<------------------------------------------| 1856 |(9) STUN Res. | | 1857 |------------------------------------------>| 1858 |(10) Answer | | 1859 |<------------------------------------------| 1861 Figure 1: Race Condition Flow 1863 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1865 When ICE runs between two peers, one agent acts as controlled, and 1866 the other as controlling. Rules are defined as a function of 1867 implementation type and offerer/answerer to determine who is 1868 controlling and who is controlled. However, the specification 1869 mentions that, in some cases, both sides might believe they are 1870 controlling, or both sides might believe they are controlled. How 1871 can this happen? 1873 The condition when both agents believe they are controlled shows up 1874 in third party call control cases. Consider the following flow: 1876 A Controller B 1877 |(1) INV() | | 1878 |<-------------| | 1879 |(2) 200(SDP1) | | 1880 |------------->| | 1881 | |(3) INV() | 1882 | |------------->| 1883 | |(4) 200(SDP2) | 1884 | |<-------------| 1885 |(5) ACK(SDP2) | | 1886 |<-------------| | 1887 | |(6) ACK(SDP1) | 1888 | |------------->| 1890 Figure 2: Role Conflict Flow 1892 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1893 it works better than flow III since it produces fewer messages. In 1894 this flow, the controller sends an offerless INVITE to agent A, which 1895 responds with its offer, SDP1. The agent then sends an offerless 1896 INVITE to agent B, which it responds to with its offer, SDP2. The 1897 controller then uses the offer from each agent to generate the 1898 answers. When this flow is used, ICE will run between agents A and 1899 B, but both will believe they are in the controlling role. With the 1900 role conflict resolution procedures, this flow will function properly 1901 when ICE is used. 1903 At this time, there are no documented flows that can result in the 1904 case where both agents believe they are controlled. However, the 1905 conflict resolution procedures allow for this case, should a flow 1906 arise that would fit into this category. 1908 Appendix D. Why Send an Updated Offer? 1910 Section 11.1 describes rules for sending media. Both agents can send 1911 media once ICE checks complete, without waiting for an updated offer. 1912 Indeed, the only purpose of the updated offer is to "correct" the SDP 1913 so that the default destination for media matches where media is 1914 being sent based on ICE procedures (which will be the highest- 1915 priority nominated candidate pair). 1917 This begs the question -- why is the updated offer/answer exchange 1918 needed at all? Indeed, in a pure offer/answer environment, it would 1919 not be. The offerer and answerer will agree on the candidates to use 1920 through ICE, and then can begin using them. As far as the agents 1921 themselves are concerned, the updated offer/answer provides no new 1922 information. However, in practice, numerous components along the 1923 signaling path look at the SDP information. These include entities 1924 performing off-path QoS reservations, NAT traversal components such 1925 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1926 that passively monitor the network. For these tools to continue to 1927 function without change, the core property of SDP -- that the 1928 existing, pre-ICE definitions of the addresses used for media -- the 1929 "m=" and "c=" lines and the rtcp attribute -- must be retained. For 1930 this reason, an updated offer must be sent. 1932 Authors' Addresses 1934 Marc Petit-Huguenin 1935 Impedance Mismatch 1937 Email: marc@petit-huguenin.org 1939 Ari Keranen 1940 Ericsson 1941 Jorvas 02420 1942 Finland 1944 Email: ari.keranen@ericsson.com 1946 Suhas Nandakumar 1947 Cisco Systems 1948 707 Tasman Dr 1949 Milpitas 95035 1950 USA 1952 Email: snandaku@cisco.com