idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-16.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 2 instances of too long lines in the document, the longest one being 12 characters in excess of 72. == There are 4 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? -- The draft header indicates that this document obsoletes RFC5245, but the abstract doesn't seem to mention this, which it should. 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 (November 23, 2017) is 2346 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) == Outdated reference: A later version (-20) exists of draft-ietf-ice-rfc5245bis-00 ** 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) ** Obsolete normative reference: RFC 6336 (Obsoleted by RFC 8839) ** Downref: Normative reference to an Informational RFC: RFC 7092 ** Downref: Normative reference to an Informational RFC: RFC 7656 Summary: 10 errors (**), 0 flaws (~~), 5 warnings (==), 3 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 Obsoletes: 5245 (if approved) A. Keranen 5 Intended status: Standards Track Ericsson 6 Expires: May 27, 2018 S. Nandakumar 7 Cisco Systems 8 November 23, 2017 10 Session Description Protocol (SDP) Offer/Answer procedures for 11 Interactive Connectivity Establishment (ICE) 12 draft-ietf-mmusic-ice-sip-sdp-16 14 Abstract 16 This document describes Session Description Protocol (SDP) Offer/ 17 Answer procedures for carrying out Interactive Connectivity 18 Establishment (ICE) between the agents. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on May 27, 2018. 37 Copyright Notice 39 Copyright (c) 2017 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 This document may contain material from IETF Documents or IETF 53 Contributions published or made publicly available before November 54 10, 2008. The person(s) controlling the copyright in some of this 55 material may not have granted the IETF Trust the right to allow 56 modifications of such material outside the IETF Standards Process. 57 Without obtaining an adequate license from the person(s) controlling 58 the copyright in such materials, this document may not be modified 59 outside the IETF Standards Process, and derivative works of it may 60 not be created outside the IETF Standards Process, except to format 61 it for publication as an RFC or to translate it into languages other 62 than English. 64 Table of Contents 66 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 67 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 68 3. ICE Candidate Exchange and Offer/Answer Mapping . . . . . . . 4 69 4. SDP Offer/Answer Procedures . . . . . . . . . . . . . . . . . 4 70 4.1. Initial Offer/Answer Exchange . . . . . . . . . . . . . . 4 71 4.1.1. Sending the Initial Offer . . . . . . . . . . . . . . 4 72 4.1.2. Receiving the Initial Offer . . . . . . . . . . . . . 7 73 4.1.3. Receipt of the Initial Answer . . . . . . . . . . . . 8 74 4.1.4. Performing Connectivity Checks . . . . . . . . . . . 9 75 4.1.5. Concluding ICE . . . . . . . . . . . . . . . . . . . 9 76 4.2. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . 10 77 4.2.1. Generating the Offer . . . . . . . . . . . . . . . . 10 78 4.2.2. Receiving the Offer and Generating an Answer . . . . 13 79 4.2.3. Receiving the Answer for a Subsequent Offer . . . . . 16 80 4.2.4. Updating the Check and Valid Lists . . . . . . . . . 17 81 5. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 82 5.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 18 83 5.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 21 84 5.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 21 85 5.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 22 86 5.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 22 87 5.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 23 88 6. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 23 89 7. Media Handling . . . . . . . . . . . . . . . . . . . . . . . 23 90 7.1. Sending Media . . . . . . . . . . . . . . . . . . . . . . 23 91 7.1.1. Procedures for All Implementations . . . . . . . . . 24 92 7.2. Receiving Media . . . . . . . . . . . . . . . . . . . . . 24 93 8. SIP Considerations . . . . . . . . . . . . . . . . . . . . . 24 94 8.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 24 95 8.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . . 25 96 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 . . . . . . . . . . . . . . . . . . . . 28 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 . . . . . . . . . . . . . . . . 31 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 . . . . . . . . . . . . . . . . . 38 125 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 38 126 Appendix B. The remote-candidates Attribute . . . . . . . . . . 40 127 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 41 128 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 42 129 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 131 1. Introduction 133 This document describes how Interactive Connectivity Establishment 134 (ICE) is used with Session Description Protocol (SDP) offer/answer 135 [RFC3264]. The ICE specification [ICE-BIS] describes procedures that 136 are common to all usages of ICE and this document gives the 137 additional details needed to use ICE with SDP offer/answer. 139 2. Terminology 141 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 142 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 143 "OPTIONAL" in this document are to be interpreted as described in RFC 144 2119 [RFC2119]. 146 Readers should be familiar with the terminology defined in [RFC3264], 147 in [RFC7656], in [ICE-BIS] and the following: 149 Default Destination/Candidate: The default destination for a 150 component of a media stream is the transport address that would be 151 used by an agent that is not ICE aware. A default candidate for a 152 component is one whose transport address matches the default 153 destination for that component. For the RTP component, the 154 default IP address is in the "c=" line of the SDP, and the port is 155 in the "m=" line. For the RTCP component, the address and port 156 are indicated using the "a=rtcp" attribute defined in [RFC3605], 157 if present; otherwise, the RTCP component address is same as the 158 address of the RTP component, and its port is one greater than the 159 port of the RTP component. 161 3. ICE Candidate Exchange and Offer/Answer Mapping 163 [ICE-BIS] defines ICE candidate exchange as the process for ICE 164 agents (Initiator and Responder) to exchange their candidate 165 information required for ICE processing at the agents. For the 166 purposes of this specification, the candidate exchange process 167 corresponds to the [RFC3264] Offer/Answer protocol and the 168 terminologies offerer and answerer correspond to the initiator and 169 responder terminologies from [ICE-BIS] respectively. 171 4. SDP Offer/Answer Procedures 173 4.1. Initial Offer/Answer Exchange 175 4.1.1. Sending the Initial Offer 177 The offerer shall follow the procedures defined in section 5 of 178 [ICE-BIS] to gather, prioritize and eliminate the redundant 179 candidates. It then chooses the default candidates and encodes them 180 in the SDP to be sent to its peer, the answerer. 182 4.1.1.1. Choosing Default Candidates 184 A candidate is said to be default if it would be the target of media 185 from a non-ICE peer; that target is called the DEFAULT DESTINATION. 186 An agent MUST choose a set of candidates, one for each component of 187 each in-use media stream, to be default. A media stream is in-use if 188 it does not have a port of zero (which is used in RFC 3264 to reject 189 a media stream). Consequently, a media stream is in-use even if it 190 is marked as a=inactive [RFC4566] or has a bandwidth value of zero. 192 An agent may choose any type of the candidate as the default, if the 193 chosen candidates increases the likelihood of success with the peer 194 that is being contacted if ICE is not being used. It is recommended 195 that, when multiple candidates are used, UDP based candidates SHOULD 196 be included wherever possible and default candidate SHOULD be chosen 197 from one of those UDP candidates. The proto value MUST match the 198 transport protocol associated with the default candidate. If UDP 199 transport is used for the default candidate, the 'proto' value MUST 200 include UDP and the 'proto' value MUST be TCP when the transport is 201 TCP for the default candidate. 203 Since it is RECOMMENDED that default candidates be chosen based on 204 the likelihood of those candidates to work with the peer that is 205 being contacted if ICE is not being used. Many factors may influence 206 such a decision in a given agent. In scenarios where the agent is 207 fully aware of its peer's location and can reach the peer directly, 208 choosing the host candidates as the default may well be sufficient. 209 If the network configuration under which the agents operates is 210 static and known beforehand, either the host or the server reflexives 211 candidates can serve as the default candidates (depending on if a 212 given agent is behind NAT and their reachability). If the agent is 213 completely unaware of the peer's location or no assumptions can be 214 made of network characteristics and the connectivity, the relayed 215 candidates might be the only option as the default candidate. Having 216 the decision of choosing the default candidate as a configurable 217 option in the implementations might provide agents the flexibility to 218 take into account the aforementioned criteria. Barring such 219 configuration flexibility, it is RECOMMENDED that the default 220 candidates be the relayed candidates (if relayed candidates are 221 available), server reflexive candidates (if server reflexive 222 candidates are available), and finally host candidates. 224 4.1.1.2. Encoding the SDP 226 The process of encoding the SDP is identical between full and lite 227 implementations. 229 The agent will include an "m=" line for each Source Stream [RFC7656] 230 it wishes to use. The ordering of source streams in the SDP is 231 relevant for ICE. ICE will perform its connectivity checks for the 232 first "m=" line first, and consequently media will be able to flow 233 for that stream first. Agents SHOULD place their most important 234 source stream, if there is one, first in the SDP. 236 There will be a candidate attribute for each candidate for a 237 particular source stream. Section 5 provides detailed rules for 238 constructing this attribute. 240 STUN connectivity checks between agents are authenticated using the 241 short-term credential mechanism defined for STUN [RFC5389]. This 242 mechanism relies on a username and password that are exchanged 243 through protocol machinery between the client and server. The 244 username fragment and password are exchanged in the ice-ufrag and 245 ice-pwd attributes, respectively. 247 If an agent is a lite implementation, it MUST include an "a=ice-lite" 248 session-level attribute in its SDP to indicate this. If an agent is 249 a full implementation, it MUST NOT include this attribute. 251 Section 10 of [ICE-BIS] defines a new ICE option, 'ice2'. This 252 option is used by ICE Agents to indicate their compliancy with 253 [ICE-BIS] specification as compared to the [RFC5245]. If the 254 Offering agent is a [ICE-BIS] compliant implementation, a session 255 level ICE option to indicate the same (via the "a=ice-options:ice2" 256 SDP line) MUST be included. 258 The default candidates are added to the SDP as the default 259 destination for media. For source streams based on RTP, this is done 260 by placing the IP address and port of the RTP candidate into the "c=" 261 and "m=" lines, respectively. If the agent is utilizing RTCP and if 262 RTCP candidate is present and is not equal to the same address and 263 the next higher port number of the RTP candidate, the agent MUST 264 encode the RTCP candidate using the a=rtcp attribute as defined in 265 [RFC3605]. If RTCP is not in use, the agent MUST signal that using 266 b=RS:0 and b=RR:0 as defined in [RFC3556] 268 The transport addresses that will be the default destination for 269 media when communicating with non-ICE peers MUST also be present as 270 candidates in one or more a=candidate lines. 272 ICE provides for extensibility by allowing an offer or answer to 273 contain a series of tokens that identify the ICE extensions used by 274 that agent. If an agent supports an ICE extension, it MUST include 275 the token defined for that extension in the ice-options attribute. 277 The following is an example SDP message that includes ICE attributes 278 (lines folded for readability): 280 v=0 281 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 282 s= 283 c=IN IP4 192.0.2.3 284 t=0 0 285 a=ice-options:ice2 286 a=ice-pwd:asd88fgpdd777uzjYhagZg 287 a=ice-ufrag:8hhY 288 m=audio 45664 RTP/AVP 0 289 b=RS:0 290 b=RR:0 291 a=rtpmap:0 PCMU/8000 292 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 293 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 294 10.0.1.1 rport 8998 296 Once an agent has sent its offer or its answer, that agent MUST be 297 prepared to receive both STUN and media packets on each candidate. 298 As discussed in section 12.1 of [ICE-BIS], media packets can be sent 299 to a candidate prior to its appearance as the default destination for 300 media in an offer or answer. 302 4.1.2. Receiving the Initial Offer 304 On receiving the offer, the answerer verifies the support for ICE 305 (section 5.4 of [ICE-BIS]), determines its role (section 6.1.1 of 306 [ICE-BIS]), gathers candidates (section 5 of [ICE-BIS]), encodes the 307 candidates in an SDP answer and sends it to its peer, the offerer. 308 The answerer shall then follow the steps defined in sections 6.1.3 309 and 6.1.4 of [ICE-BIS] to schedule the ICE connectivity checks. 311 The below sub-sections provide additional requirements associated 312 with the processing of the offerer's SDP pertaining to this 313 specification. 315 4.1.2.1. ICE Option "ice2" considerations 317 If the SDP offer contains a session level ICE option, "ice2" , and if 318 the answering ICE Agent is also an [ICE-BIS] compliant 319 implementation, then the generated SDP answer MUST include the 320 session level "a=ice-options:ice2" SDP line. 322 4.1.2.2. Choosing Default Candidates 324 The process for selecting default candidates at the answerer is 325 identical to the process followed by the offerer, as described in 326 Section 4.1.1.1 for full implementations in this specification and 327 section 5.2 of [ICE-BIS] for lite implementations. 329 4.1.2.3. ICE Mismatch 331 The agent will proceed with the ICE procedures defined in [ICE-BIS] 332 and this specification if, for each media stream in the SDP it 333 received, the default destination for each component of that media 334 stream appears in a candidate attribute. For example, in the case of 335 RTP, the IP address and port in the "c=" and "m=" lines, 336 respectively, appear in a candidate attribute and the value in the 337 rtcp attribute appears in a candidate attribute. 339 If this condition is not met, the agent MUST process the SDP based on 340 normal RFC 3264 procedures, without using any of the ICE mechanisms 341 described in the remainder of this specification with the following 342 exceptions: 344 1. The agent MUST follow the rules of section 11 of [ICE-BIS], which 345 describe keepalive procedures for all agents. 347 2. If the agent is not proceeding with ICE because there were 348 a=candidate attributes, but none that matched the default 349 destination of the media stream, the agent MUST include an a=ice- 350 mismatch attribute in its answer. 352 3. If the default candidates were relayed candidates learned through 353 a TURN server, the agent MUST create permissions in the TURN 354 server for the IP addresses learned from its peer in the SDP it 355 just received. If this is not done, initial packets in the media 356 stream from the peer may be lost. 358 4.1.2.4. Determining Role 360 In unusual cases, described in Appendix C, it is possible for both 361 agents to mistakenly believe they are controlled or controlling. To 362 resolve this, each agent MUST select a random number, called the tie- 363 breaker, uniformly distributed between 0 and (2**64) - 1 (that is, a 364 64-bit positive integer). This number is used in connectivity checks 365 to detect and repair this case, as described in section 7.1.3 of 366 [ICE-BIS]. 368 4.1.3. Receipt of the Initial Answer 370 On receiving the SDP answer, the offerer performs steps similar to 371 answerer's processing of the offer. The offerer verifies the 372 answerer's ICE support determines, its role, and processes the 373 answerer's candidates to schedule the connectivity checks (section 7 374 of [ICE-BIS]). 376 If the offerer had included the "ice2" ICE Option in the offer and 377 the SDP answer also includes a similar session level ICE option, then 378 the peers are [ICE-BIS] compliant implementations. On the other 379 hand, if the SDP Answer lacks such a ICE option, the offerer defaults 380 to the procedures that are backward compatible with the [RFC5245] 381 specification. 383 4.1.3.1. ICE Mismatch 385 The logic at the offerer is identical to that of the answerer as 386 described in section 5.4 of [ICE-BIS], with the exception that an 387 offerer would not ever generate a=ice-mismatch attributes in an SDP. 389 In some cases, the answer may omit a=candidate attributes for the 390 media streams, and instead include an a=ice-mismatch attribute for 391 one or more of the media streams in the SDP. This signals to the 392 offerer that the answerer supports ICE, but that ICE processing was 393 not used for the session because a signaling intermediary modified 394 the default destination for media components without modifying the 395 corresponding candidate attributes. See Section 11.2.2 for a 396 discussion of cases where this can happen. This specification 397 provides no guidance on how an agent should proceed in such a failure 398 case. 400 4.1.4. Performing Connectivity Checks 402 The possibility for role conflicts described in section 7.3.1.1 of 403 [ICE-BIS] applies to this usage and hence all full agents MUST 404 implement the role conflict repairing mechanism. Also both full and 405 lite agents MUST utilize the ICE-CONTROLLED and ICE-CONTROLLING 406 attributes as described in section 7.1.3 of [ICE-BIS]. 408 4.1.5. Concluding ICE 410 Once the state of each check list is Completed, If an agent is 411 controlling, it examines the highest-priority nominated candidate 412 pair for each component of each media stream. If any of those 413 candidate pairs differ from the default candidate pairs in the most 414 recent offer/answer exchange, the controlling agent MUST generate an 415 updated offer as described in Section 4.2. 417 However, If the support for 'ice2' ICE Option is in use, the highest- 418 priority nominated candidate is noted and sent in the subsequent 419 offer/answer exchange as the default candidate and no updated offer 420 is needed to fix the default candidate. 422 4.2. Subsequent Offer/Answer Exchanges 424 Either agent MAY generate a subsequent offer at any time allowed by 425 [RFC3264]. This section defines rules for construction of subsequent 426 offers and answers. 428 Should a subsequent offer fail, ICE processing continues as if the 429 subsequent offer had never been made. 431 4.2.1. Generating the Offer 433 4.2.1.1. Procedures for All Implementations 435 4.2.1.1.1. ICE Restarts 437 An agent MAY restart ICE processing for an existing media stream as 438 defined in section 9 of [ICE-BIS]. 440 The rules governing the ICE restart imply that setting the IP address 441 in the "c=" line to 0.0.0.0 will cause an ICE restart. Consequently, 442 ICE implementations MUST NOT utilize this mechanism for call hold, 443 and instead MUST use a=inactive and a=sendonly as described in 444 [RFC3264]. 446 To restart ICE, an agent MUST change both the ice-pwd and the ice- 447 ufrag for the media stream in an offer. Note that it is permissible 448 to use a session-level attribute in one offer, but to provide the 449 same ice-pwd or ice-ufrag as a media-level attribute in a subsequent 450 offer. This is not a change in password, just a change in its 451 representation, and does not cause an ICE restart. 453 An agent sets the rest of the fields in the SDP for this media stream 454 as it would in an initial offer of this media stream (see 455 Section 4.1.1.2). Consequently, the set of candidates MAY include 456 some, none, or all of the previous candidates for that stream and MAY 457 include a totally new set of candidates. 459 4.2.1.1.2. Removing a Media Stream 461 If an agent removes a media stream by setting its port to zero, it 462 MUST NOT include any candidate attributes for that media stream and 463 SHOULD NOT include any other ICE-related attributes defined in 464 Section 5 for that media stream. 466 4.2.1.1.3. Adding a Media Stream 468 If an agent wishes to add a new media stream, it sets the fields in 469 the SDP for this media stream as if this was an initial offer for 470 that media stream (see Section 4.1.1.2). This will cause ICE 471 processing to begin for this media stream. 473 4.2.1.2. Procedures for Full Implementations 475 This section describes additional procedures for full 476 implementations, covering existing media streams. 478 4.2.1.2.1. Existing Media Streams with ICE Running 480 If an agent generates an updated offer including a media stream that 481 was previously established, and for which ICE checks are in the 482 Running state, the agent follows the procedures defined here. 484 An agent MUST include candidate attributes for all local candidates 485 it had signaled previously for that media stream. The properties of 486 that candidate as signaled in SDP -- the priority, foundation, type, 487 and related transport address -- SHOULD remain the same. The IP 488 address, port, and transport protocol, which fundamentally identify 489 that candidate, MUST remain the same (if they change, it would be a 490 new candidate). The component ID MUST remain the same. The agent 491 MAY include additional candidates it did not offer previously (see 492 section 4.2.4.1.1), but which it has gathered since the last offer/ 493 answer exchange, including peer reflexive candidates. 495 The agent MAY change the default destination for media. As with 496 initial offers, there MUST be a set of candidate attributes in the 497 offer matching this default destination. 499 4.2.1.2.2. Existing Media Streams with ICE Completed 501 If an agent generates an updated offer including a media stream that 502 was previously established, and for which ICE checks are in the 503 Completed state, the agent follows the procedures defined here. 505 The default destination for media (i.e., the values of the IP 506 addresses and ports in the "m=" and "c=" lines used for that media 507 stream) MUST be the local candidate from the highest-priority 508 nominated pair in the valid list for each component. 510 The agent MUST include candidate attributes for candidates matching 511 the default destination for each component of the media stream, and 512 MUST NOT include any other candidates. 514 In addition, if the agent is controlling, it MUST include the 515 a=remote-candidates attribute for each media stream whose check list 516 is in the Completed state. The attribute contains the remote 517 candidates from the highest-priority nominated pair in the valid list 518 for each component of that media stream. It is needed to avoid a 519 race condition whereby the controlling agent chooses its pairs, but 520 the updated offer beats the connectivity checks to the controlled 521 agent, which doesn't even know these pairs are valid, let alone 522 selected. See Appendix B for elaboration on this race condition. 524 4.2.1.3. Procedures for Lite Implementations 526 4.2.1.3.1. Existing Media Streams with ICE Running 528 This section describes procedures for lite implementations for 529 existing streams for which ICE is running. 531 A lite implementation MUST include all of its candidates for each 532 component of each media stream in an a=candidate attribute in any 533 subsequent offer. These candidates are formed identically to the 534 procedures for initial offers, as described in section 5.2 of 535 [ICE-BIS]. 537 A lite implementation MUST NOT add additional host candidates in a 538 subsequent offer. If an agent needs to offer additional candidates, 539 it MUST restart ICE. 541 The username fragments, password, and implementation level MUST 542 remain the same as used previously. If an agent needs to change one 543 of these, it MUST restart ICE for that media stream. 545 4.2.1.3.2. Existing Media Streams with ICE Completed 547 If ICE has completed for a media stream, the default destination for 548 that media stream MUST be set to the remote candidate of the 549 candidate pair for that component in the valid list. For a lite 550 implementation, there is always just a single candidate pair in the 551 valid list for each component of a media stream. Additionally, the 552 agent MUST include a candidate attribute for each default 553 destination. 555 Additionally, if the agent is controlling (which only happens when 556 both agents are lite), the agent MUST include the a=remote-candidates 557 attribute for each media stream. The attribute contains the remote 558 candidates from the candidate pairs in the valid list (one pair for 559 each component of each media stream). 561 4.2.2. Receiving the Offer and Generating an Answer 563 4.2.2.1. Procedures for All Implementations 565 When receiving a subsequent offer within an existing session, an 566 agent MUST reapply the verification procedures in Section 4.1.2.3 567 without regard to the results of verification from any previous 568 offer/answer exchanges. Indeed, it is possible that a previous 569 offer/answer exchange resulted in ICE not being used, but it is used 570 as a consequence of a subsequent exchange. 572 4.2.2.1.1. Detecting ICE Restart 574 If the offer contained a change in the a=ice-ufrag or a=ice-pwd 575 attributes compared to the previous SDP from the peer, it indicates 576 that ICE is restarting for this media stream. If all media streams 577 are restarting, then ICE is restarting overall. 579 If ICE is restarting for a media stream: 581 o The agent MUST change the a=ice-ufrag and a=ice-pwd attributes in 582 the answer. 584 o The agent MAY change its implementation level in the answer. 586 An agent sets the rest of the fields in the SDP for this media stream 587 as it would in an initial answer to this media stream (see 588 Section 4.1.1.2). Consequently, the set of candidates MAY include 589 some, none, or all of the previous candidates for that stream and MAY 590 include a totally new set of candidates. 592 4.2.2.1.2. New Media Stream 594 If the offer contains a new media stream, the agent sets the fields 595 in the answer as if it had received an initial offer containing that 596 media stream (see Section 4.1.1.2). This will cause ICE processing 597 to begin for this media stream. 599 4.2.2.1.3. Removed Media Stream 601 If an offer contains a media stream whose port is zero, the agent 602 MUST NOT include any candidate attributes for that media stream in 603 its answer and SHOULD NOT include any other ICE-related attributes 604 defined in Section 5 for that media stream. 606 4.2.2.2. Procedures for Full Implementations 608 Unless the agent has detected an ICE restart from the offer, the 609 username fragments, password, and implementation level MUST remain 610 the same as used previously. If an agent needs to change one of 611 these it MUST restart ICE for that media stream by generating an 612 offer; ICE cannot be restarted in an answer. 614 Additional behaviors depend on the state of ICE processing for that 615 media stream. 617 4.2.2.2.1. Existing Media Streams with ICE Running and no remote- 618 candidates 620 If ICE is running for a media stream, and the offer for that media 621 stream lacked the remote-candidates attribute, the rules for 622 construction of the answer are identical to those for the offerer as 623 described in Section 4.2.1.2.1. 625 4.2.2.2.2. Existing Media Streams with ICE Completed and no remote- 626 candidates 628 If ICE is Completed for a media stream, and the offer for that media 629 stream lacked the remote-candidates attribute, the rules for 630 construction of the answer are identical to those for the offerer as 631 described in Section 4.2.1.2.2, except that the answerer MUST NOT 632 include the a=remote-candidates attribute in the answer. 634 4.2.2.2.3. Existing Media Streams and remote-candidates 636 A controlled agent will receive an offer with the a=remote-candidates 637 attribute for a media stream when its peer has concluded ICE 638 processing for that media stream. This attribute is present in the 639 offer to deal with a race condition between the receipt of the offer, 640 and the receipt of the Binding Response that tells the answerer the 641 candidate that will be selected by ICE. See Appendix B for an 642 explanation of this race condition. Consequently, processing of an 643 offer with this attribute depends on the winner of the race. 645 The agent forms a candidate pair for each component of the media 646 stream by: 648 o Setting the remote candidate equal to the offerer's default 649 destination for that component (e.g., the contents of the "m=" and 650 "c=" lines for RTP, and the a=rtcp attribute for RTCP) 652 o Setting the local candidate equal to the transport address for 653 that same component in the a=remote-candidates attribute in the 654 offer. 656 The agent then sees if each of these candidate pairs is present in 657 the valid list. If a particular pair is not in the valid list, the 658 check has "lost" the race. Call such a pair a "losing pair". 660 The agent finds all the pairs in the check list whose remote 661 candidates equal the remote candidate in the losing pair: 663 o If none of the pairs are In-Progress, and at least one is Failed, 664 it is most likely that a network failure, such as a network 665 partition or serious packet loss, has occurred. The agent SHOULD 666 generate an answer for this media stream as if the remote- 667 candidates attribute had not been present, and then restart ICE 668 for this stream. 670 o If at least one of the pairs is In-Progress, the agent SHOULD wait 671 for those checks to complete, and as each completes, redo the 672 processing in this section until there are no losing pairs. 674 Once there are no losing pairs, the agent can generate the answer. 675 It MUST set the default destination for media to the candidates in 676 the remote-candidates attribute from the offer (each of which will 677 now be the local candidate of a candidate pair in the valid list). 678 It MUST include a candidate attribute in the answer for each 679 candidate in the remote-candidates attribute in the offer. 681 4.2.2.3. Procedures for Lite Implementations 683 If the received offer contains the remote-candidates attribute for a 684 media stream, the agent forms a candidate pair for each component of 685 the media stream by: 687 o Setting the remote candidate equal to the offerer's default 688 destination for that component (e.g., the contents of the "m=" and 689 "c=" lines for RTP, and the a=rtcp attribute for RTCP). 691 o Setting the local candidate equal to the transport address for 692 that same component in the a=remote-candidates attribute in the 693 offer. 695 It then places those candidates into the Valid list for the media 696 stream. The state of ICE processing for that media stream is set to 697 Completed. 699 Furthermore, if the agent believed it was controlling, but the offer 700 contained the remote-candidates attribute, both agents believe they 701 are controlling. In this case, both would have sent updated offers 702 around the same time. However, the signaling protocol carrying the 703 offer/answer exchanges will have resolved this glare condition, so 704 that one agent is always the 'winner' by having its offer received 705 before its peer has sent an offer. The winner takes the role of 706 controlling, so that the loser (the answerer under consideration in 707 this section) MUST change its role to controlled. Consequently, if 708 the agent was going to send an updated offer since, based on the 709 rules in section 8.2 of [ICE-BIS], it was controlling, it no longer 710 needs to. 712 Besides the potential role change, change in the Valid list, and 713 state changes, the construction of the answer is performed 714 identically to the construction of an offer as described in 715 Section 4.2.1.3. 717 4.2.3. Receiving the Answer for a Subsequent Offer 719 Some deployments of ICE include e.g. SDP-Modifying Signaling-only 720 Back-to-Back User Agents (B2BUAs) [RFC7092] that modify the SDP body 721 during the subsequent offer/answer exchange. With the B2BUA being 722 ICE-unaware, a subsequent answer might be manipulated and might not 723 include ICE candidates although the initial answer did. 725 An example of a situation where such an "unexpected" answer might be 726 experienced appears when such a B2BUA introduces a media server 727 during call hold using 3rd party call-control procedures. Omitting 728 further details how this is done this could result in an answer being 729 received at the holding UA that was constructed by the B2BUA. With 730 the B2BUA being ICE-unaware, that answer would not include ICE 731 candidates. 733 Receiving an answer without ICE attributes in this situation might be 734 unexpected, but would not necessarily impair the user experience. 736 In addition to procedures for the expected answer, the following 737 section advices on how to recover from the unexpected situation. 739 4.2.3.1. Procedures for All Implementations 741 When receiving an answer within an existing session for a subsequent 742 offer as specified in Section 4.2.1.2.2, an agent MUST verify ICE 743 support as specified in Section 4.1.3.1. 745 If ICE support is indicated in the SDP answer and the offer was a 746 restart, the agent MUST perform ICE restart procedures as specified 747 in Section 4.2.4. If ICE support is no longer indicated in the SDP 748 answer, the agent MUST fall-back to [RFC3264] procedures and SHOULD 749 NOT drop the dialog just because of missing ICE support. If the 750 agent sends a new offer later on, it SHOULD perform an ICE restart as 751 specified in Section 4.2.1.1.1. 753 If ICE support is indicated in the SDP answer and ICE is running, the 754 agent MUST continue ICE procedures as specified in Section 4.2.4.1.4. 755 If ICE support is no longer indicated in the SDP answer, the agent 756 MUST abort the ongoing ICE processing and fall-back to [RFC3264] 757 procedures. The agent SHOULD NOT drop the dialog just because of 758 missing ICE support. If the agent sends a new offer later on, it 759 SHOULD perform an ICE restart as specified in Section 4.2.1.1.1. 761 If ICE support is indicated in the SDP answer and if ICE is completed 762 and the answer conforms to Section 4.2.2.2.3, the agent MUST remain 763 in the ICE Completed state. If ICE support is no longer indicated in 764 the SDP answer, the agent MUST fall-back to [RFC3264] procedures and 765 SHOULD NOT drop the dialog just because of this unexpected answer. 766 Once the agent sends a new offer later on it MUST perform an ICE 767 restart. 769 4.2.4. Updating the Check and Valid Lists 771 4.2.4.1. Procedures for Full Implementations 773 4.2.4.1.1. ICE Restarts 775 The agent MUST remember the highest-priority nominated pairs in the 776 Valid list for each component of the media stream, called the 777 previous selected pairs, prior to the restart. The agent will 778 continue to send media using these pairs, as described in 779 Section 7.1. Once these destinations are noted, the agent MUST flush 780 the valid and check lists, and then recompute the check list and its 781 states as described in section 6.1.2 of [ICE-BIS]. 783 4.2.4.1.2. New Media Stream 785 If the offer/answer exchange added a new media stream, the agent MUST 786 create a new check list for it (and an empty Valid list to start of 787 course), as described in section 6.1.2 of [ICE-BIS]. 789 4.2.4.1.3. Removed Media Stream 791 If the offer/answer exchange removed a media stream, or an answer 792 rejected an offered media stream, an agent MUST flush the Valid list 793 for that media stream. It MUST terminate any STUN transactions in 794 progress for that media stream. An agent MUST remove the check list 795 for that media stream and cancel any pending ordinary checks for it. 797 4.2.4.1.4. ICE Continuing for Existing Media Stream 799 The valid list is not affected by an updated offer/answer exchange 800 unless ICE is restarting. 802 If an agent is in the Running state for that media stream, the check 803 list is updated (the check list is irrelevant if the state is 804 completed). To do that, the agent recomputes the check list using 805 the procedures described in section 6.1.2 of [ICE-BIS]. If a pair on 806 the new check list was also on the previous check list, and its state 807 was Waiting, In-Progress, Succeeded, or Failed, its state is copied 808 over. Otherwise, its state is set to Frozen. 810 If none of the check lists are active (meaning that the pairs in each 811 check list are Frozen), the full-mode agent follows steps in 812 Section 6.1.2.6 of [ICE-BIS] to place appropriate candidates in the 813 Waiting state to further continue ICE processing. 815 4.2.4.2. Procedures for Lite Implementations 817 If ICE is restarting for a media stream, the agent MUST start a new 818 Valid list for that media stream. It MUST remember the pairs in the 819 previous Valid list for each component of the media stream, called 820 the previous selected pairs, and continue to send media there as 821 described in Section 7.1. The state of ICE processing for each media 822 stream MUST change to Running, and the state of ICE processing MUST 823 change to Running. 825 5. Grammar 827 This specification defines eight new SDP attributes -- the 828 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 829 ufrag", "ice-pwd", "ice-pacing", and "ice-options" attributes. This 830 section also provides non-normative examples of the attributes 831 defined. 833 The syntax for the attributes follow Augmented BNF as defined in 834 [RFC5234]. 836 5.1. "candidate" Attribute 838 The candidate attribute is a media-level attribute only. It contains 839 a transport address for a candidate that can be used for connectivity 840 checks. 842 candidate-attribute = "candidate" ":" foundation SP component-id SP 843 transport SP 844 priority SP 845 connection-address SP ;from RFC 4566 846 port ;port from RFC 4566 847 SP cand-type 848 [SP rel-addr] 849 [SP rel-port] 850 *(SP extension-att-name SP 851 extension-att-value) 853 foundation = 1*32ice-char 854 component-id = 1*5DIGIT 855 transport = "UDP" / transport-extension 856 transport-extension = token ; from RFC 3261 857 priority = 1*10DIGIT 858 cand-type = "typ" SP candidate-types 859 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 860 rel-addr = "raddr" SP connection-address 861 rel-port = "rport" SP port 862 extension-att-name = token 863 extension-att-value = *VCHAR 864 ice-char = ALPHA / DIGIT / "+" / "/" 866 This grammar encodes the primary information about a candidate: its 867 IP address, port and transport protocol, and its properties: the 868 foundation, component ID, priority, type, and related transport 869 address: 871 : is taken from RFC 4566 [RFC4566]. It is the 872 IP address of the candidate. When parsing this field, an agent 873 can differentiate an IPv4 address and an IPv6 address by presence 874 of a colon in its value -- the presence of a colon indicates IPv6. 875 An agent MUST ignore candidate lines that include candidates with 876 IP address versions that are not supported or recognized. An IP 877 address SHOULD be used, but an FQDN MAY be used in place of an IP 878 address. In that case, when receiving an offer or answer 879 containing an FQDN in an a=candidate attribute, the FQDN is looked 880 up in the DNS first using an AAAA record (assuming the agent 881 supports IPv6), and if no result is found or the agent only 882 supports IPv4, using an A record. The rules from section 6 of 883 [RFC6724] is followed by fixing the source address to be one from 884 the candidate pair to be matched against destination addresses 885 reported by FQDN, in cases where the DNS query returns more than 886 one IP address. 888 : is also taken from RFC 4566 [RFC4566]. It is the port of 889 the candidate. 891 : indicates the transport protocol for the candidate. 892 This specification only defines UDP. However, extensibility is 893 provided to allow for future transport protocols to be used with 894 ICE, such as the Datagram Congestion Control Protocol (DCCP) 895 [RFC4340]. 897 : is composed of 1 to 32 s. It is an 898 identifier that is equivalent for two candidates that are of the 899 same type, share the same base, and come from the same STUN 900 server. The foundation is used to optimize ICE performance in the 901 Frozen algorithm as described in section 6.1.2 of [ICE-BIS] 903 : is a positive integer between 1 and 256 that 904 identifies the specific component of the media stream for which 905 this is a candidate. It MUST start at 1 and MUST increment by 1 906 for each component of a particular candidate. For media streams 907 based on RTP, candidates for the actual RTP media MUST have a 908 component ID of 1, and candidates for RTCP MUST have a component 909 ID of 2. See section 14 in [ICE-BIS] for additional discussion on 910 extending ICE to new media streams. 912 : is a positive integer between 1 and (2**31 - 1). The 913 procedures for computing candidate's priority is described in 914 section 5.1.2 of [ICE-BIS]. 916 : encodes the type of candidate. This specification 917 defines the values "host", "srflx", "prflx", and "relay" for host, 918 server reflexive, peer reflexive, and relayed candidates, 919 respectively. The set of candidate types is extensible for the 920 future. 922 and : convey transport addresses related to the 923 candidate, useful for diagnostics and other purposes. 924 and MUST be present for server reflexive, peer 925 reflexive, and relayed candidates. If a candidate is server or 926 peer reflexive, and are equal to the base 927 for that server or peer reflexive candidate. If the candidate is 928 relayed, and are equal to the mapped address 929 in the Allocate response that provided the client with that 930 relayed candidate (see section Appendix B.3 of [ICE-BIS] for a 931 discussion of its purpose). If the candidate is a host candidate, 932 and MUST be omitted. 934 In some cases, e.g., for privacy reasons, an agent may not want to 935 reveal the related address and port. In this case the address 936 MUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 937 candidates) and the port to zero. 939 The candidate attribute can itself be extended. The grammar allows 940 for new name/value pairs to be added at the end of the attribute. An 941 implementation MUST ignore any name/value pairs it doesn't 942 understand. 944 Example: SDP line for UDP server reflexive candidate attribute for the RTP component 946 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ 947 srflx raddr 10.0.1.1 rport 8998 949 5.2. "remote-candidates" Attribute 951 The syntax of the "remote-candidates" attribute is defined using 952 Augmented BNF as defined in [RFC5234]. The remote-candidates 953 attribute is a media-level attribute only. 955 remote-candidate-att = "remote-candidates:" remote-candidate 956 0*(SP remote-candidate) 957 remote-candidate = component-ID SP connection-address SP port 959 The attribute contains a connection-address and port for each 960 component. The ordering of components is irrelevant. However, a 961 value MUST be present for each component of a media stream. This 962 attribute MUST be included in an offer by a controlling agent for a 963 media stream that is Completed, and MUST NOT be included in any other 964 case. 966 Example: Remote candidates SDP lines for the RTP and RTCP components: 968 a=remote-candidates:1 192.0.2.3 45664 969 a=remote-candidates:2 192.0.2.3 45665 971 5.3. "ice-lite" and "ice-mismatch" Attributes 973 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 974 which are flags, is: 976 ice-lite = "ice-lite" 977 ice-mismatch = "ice-mismatch" 979 "ice-lite" is a session-level attribute only, and indicates that an 980 agent is a lite implementation. "ice-mismatch" is a media-level 981 attribute only, and when present in an answer, indicates that the 982 offer arrived with a default destination for a media component that 983 didn't have a corresponding candidate attribute. 985 5.4. "ice-ufrag" and "ice-pwd" Attributes 987 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 988 and password used by ICE for message integrity. Their syntax is: 990 ice-pwd-att = "ice-pwd:" password 991 ice-ufrag-att = "ice-ufrag:" ufrag 992 password = 22*256ice-char 993 ufrag = 4*256ice-char 995 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 996 session-level or media-level. When present in both, the value in the 997 media-level takes precedence. Thus, the value at the session-level 998 is effectively a default that applies to all media streams, unless 999 overridden by a media-level value. Whether present at the session or 1000 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 1001 each media stream. If two media streams have identical ice-ufrag's, 1002 they MUST have identical ice-pwd's. 1004 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 1005 beginning of a session. The ice-ufrag attribute MUST contain at 1006 least 24 bits of randomness, and the ice-pwd attribute MUST contain 1007 at least 128 bits of randomness. This means that the ice-ufrag 1008 attribute will be at least 4 characters long, and the ice-pwd at 1009 least 22 characters long, since the grammar for these attributes 1010 allows for 6 bits of information per character. The attributes MAY 1011 be longer than 4 and 22 characters, respectively, of course, up to 1012 256 characters. The upper limit allows for buffer sizing in 1013 implementations. Its large upper limit allows for increased amounts 1014 of randomness to be added over time. For compatibility with the 512 1015 character limitation for the STUN username attribute value and for 1016 bandwidth conservation considerations, the ice-ufrag attribute MUST 1017 NOT be longer than 32 characters when sending, but an implementation 1018 MUST accept up to 256 characters when receiving. 1020 Example shows sample ice-ufrag and ice-pwd SDP lines: 1022 a=ice-pwd:asd88fgpdd777uzjYhagZg 1023 a=ice-ufrag:8hhY 1025 5.5. "ice-pacing" Attribute 1027 The "ice-pacing" attribute indicates the desired connectivity check 1028 pacing, in milliseconds, for this agent (see section 15 of 1029 [ICE-BIS]). The syntax is: 1031 ice-pacing-att = "ice-pacing:" pacing-value 1032 pacing-value = 1*10DIGIT 1033 Example shows ice-pacing value of 5 ms: 1035 a=ice-pacing:5 1037 5.6. "ice-options" Attribute 1039 The "ice-options" attribute is a session- and media-level attribute. 1040 It contains a series of tokens that identify the options supported by 1041 the agent. Its grammar is: 1043 ice-options = "ice-options:" ice-option-tag 1044 0*(SP ice-option-tag) 1045 ice-option-tag = 1*ice-char 1047 The existence of an ice-option in an offer indicates that a certain 1048 extension is supported by the agent and is willing to use it, if the 1049 peer agent also includes the same extension in the answer. There 1050 might be further extension specific negotiations needed between the 1051 agents that determine how the extensions gets used in a given 1052 session. The details of the negotiation procedures, if present, MUST 1053 be defined by the specification defining the extension. 1055 Example shows 'rtp+ecn' ice-option SDP line from <>: 1057 a=ice-options:rtp+ecn 1059 6. Keepalives 1061 All the ICE agents MUST follow the procedures defined in section 11 1062 of [ICE-BIS] for sending keepalives. The keepalives MUST be sent 1063 regardless of whether the media stream is currently inactive, 1064 sendonly, recvonly, or sendrecv, and regardless of the presence or 1065 value of the bandwidth attribute. An agent can determine that its 1066 peer supports ICE by the presence of a=candidate attributes for each 1067 media session. 1069 7. Media Handling 1071 7.1. Sending Media 1073 The selected pair for a component of a media stream might not equal 1074 the default pair for that same component from the most recent offer/ 1075 answer exchange. When this happens, the selected pair is used for 1076 media, not the default pair. When ICE first completes, if the 1077 selected pairs aren't a match for the default pairs, the controlling 1078 agent sends an updated offer/answer exchange to remedy this 1079 disparity. However, until that updated offer arrives, there will not 1080 be a match. Furthermore, in very unusual cases, the default 1081 candidates in the updated offer/answer will not be a match. 1083 7.1.1. Procedures for All Implementations 1085 Section 12.1.3 of [ICE-BIS] defines procedures for sending media 1086 common across Full and Lite implementations. 1088 7.2. Receiving Media 1090 See section 12.2 of [ICE-BIS] for procedures on receiving media. 1092 8. SIP Considerations 1094 Note that ICE is not intended for NAT traversal for SIP, which is 1095 assumed to be provided via another mechanism [RFC5626]. 1097 When ICE is used with SIP, forking may result in a single offer 1098 generating a multiplicity of answers. In that case, ICE proceeds 1099 completely in parallel and independently for each answer, treating 1100 the combination of its offer and each answer as an independent offer/ 1101 answer exchange, with its own set of local candidates, pairs, check 1102 lists, states, and so on. 1104 Once ICE processing has reached the Completed state for all peers for 1105 media streams using those candidates, the agent SHOULD wait an 1106 additional three seconds, and then it MAY cease responding to checks 1107 or generating triggered checks on that candidate. It MAY free the 1108 candidate at that time. Freeing of server reflexive candidates is 1109 never explicit; it happens by lack of a keepalive. The three-second 1110 delay handles cases when aggressive nomination is used, and the 1111 selected pairs can quickly change after ICE has completed. 1113 8.1. Latency Guidelines 1115 ICE requires a series of STUN-based connectivity checks to take place 1116 between endpoints. These checks start from the answerer on 1117 generation of its answer, and start from the offerer when it receives 1118 the answer. These checks can take time to complete, and as such, the 1119 selection of messages to use with offers and answers can affect 1120 perceived user latency. Two latency figures are of particular 1121 interest. These are the post-pickup delay and the post-dial delay. 1122 The post-pickup delay refers to the time between when a user "answers 1123 the phone" and when any speech they utter can be delivered to the 1124 caller. The post-dial delay refers to the time between when a user 1125 enters the destination address for the user and ringback begins as a 1126 consequence of having successfully started alerting the called user 1127 agent. 1129 Two cases can be considered -- one where the offer is present in the 1130 initial INVITE and one where it is in a response. 1132 8.1.1. Offer in INVITE 1134 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1135 gathering candidates prior to actually sending its initial INVITE. 1136 This can be started upon user interface cues that a call is pending, 1137 such as activity on a keypad or the phone going off-hook. 1139 On the receipt of the offer, the answerer SHOULD generate an answer 1140 in a provisional response once it has compelted candidate gathering. 1141 ICE requires that a provisional response with an SDP be transmitted 1142 reliably. This can be done through the existing Provisional Response 1143 Acknowledgment (PRACK) mechanism [RFC3262] or through an ICE specific 1144 optimization, wherein, the agent retransmits the provisional response 1145 with the exponential backoff timers described in [RFC3262]. Such 1146 retransmissions MUST cease on receipt of a STUN Binding request for 1147 one of the media streams signaled in that SDP or on transmission of 1148 the answer in a 2xx response. If no Binding request is received 1149 prior to the last retransmit, the agent does not consider the session 1150 terminated. For the ICE lite peers, the agent MUST cease 1151 retransmitting the 18x after sending it four times (ICE will actually 1152 work even if the peer never receives the 18x; however, experience has 1153 shown that sending it is important for middleboxes and firewall 1154 traversal). 1156 It should be noted that the ICE specific optimization is very 1157 specific to provisional response carrying answers that start ICE 1158 processing and it is not a general technique for 1xx reliability. 1159 Also such an optimization SHOULD NOT be used if both agents support 1160 PRACK. 1162 Despite the fact that the provisional response will be delivered 1163 reliably, the rules for when an agent can send an updated offer or 1164 answer do not change from those specified in [RFC3262]. 1165 Specifically, if the INVITE contained an offer, the same answer 1166 appears in all of the 1xx and in the 2xx response to the INVITE. 1167 Only after that 2xx has been sent can an updated offer/answer 1168 exchange occur. 1170 Alternatively, an agent MAY delay sending an answer until the 200 OK; 1171 however, this results in a poor user experience and is NOT 1172 RECOMMENDED. 1174 Once the answer has been sent, the agent SHOULD begin its 1175 connectivity checks. Once candidate pairs for each component of a 1176 media stream enter the valid list, the answerer can begin sending 1177 media on that media stream. 1179 However, prior to this point, any media that needs to be sent towards 1180 the caller (such as SIP early media [RFC3960]) MUST NOT be 1181 transmitted. For this reason, implementations SHOULD delay alerting 1182 the called party until candidates for each component of each media 1183 stream have entered the valid list. In the case of a PSTN gateway, 1184 this would mean that the setup message into the PSTN is delayed until 1185 this point. Doing this increases the post-dial delay, but has the 1186 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1187 called party hears the phone ring, picks up, but hears nothing and 1188 cannot be heard. This technique works without requiring support for, 1189 or usage of, preconditions [RFC3312]. It also has the benefit of 1190 guaranteeing that not a single packet of media will get clipped, so 1191 that post-pickup delay is zero. If an agent chooses to delay local 1192 alerting in this way, it SHOULD generate a 180 response once alerting 1193 begins. 1195 8.1.2. Offer in Response 1197 In addition to uses where the offer is in an INVITE, and the answer 1198 is in the provisional and/or 200 OK response, ICE works with cases 1199 where the offer appears in the response. In such cases, which are 1200 common in third party call control [RFC3725], ICE agents SHOULD 1201 generate their offers in a reliable provisional response (which MUST 1202 utilize [RFC3262]), and not alert the user on receipt of the INVITE. 1203 The answer will arrive in a PRACK. This allows for ICE processing to 1204 take place prior to alerting, so that there is no post-pickup delay, 1205 at the expense of increased call setup delays. Once ICE completes, 1206 the callee can alert the user and then generate a 200 OK when they 1207 answer. The 200 OK would contain no SDP, since the offer/answer 1208 exchange has completed. 1210 Alternatively, agents MAY place the offer in a 2xx instead (in which 1211 case the answer comes in the ACK). When this happens, the callee 1212 will alert the user on receipt of the INVITE, and the ICE exchanges 1213 will take place only after the user answers. This has the effect of 1214 reducing call setup delay, but can cause substantial post-pickup 1215 delays and media clipping. 1217 8.2. SIP Option Tags and Media Feature Tags 1219 [RFC5768] specifies a SIP option tag and media feature tag for usage 1220 with ICE. ICE implementations using SIP SHOULD support this 1221 specification, which uses a feature tag in registrations to 1222 facilitate interoperability through signaling intermediaries. 1224 8.3. Interactions with Forking 1226 ICE interacts very well with forking. Indeed, ICE fixes some of the 1227 problems associated with forking. Without ICE, when a call forks and 1228 the caller receives multiple incoming media streams, it cannot 1229 determine which media stream corresponds to which callee. 1231 With ICE, this problem is resolved. The connectivity checks which 1232 occur prior to transmission of media carry username fragments, which 1233 in turn are correlated to a specific callee. Subsequent media 1234 packets that arrive on the same candidate pair as the connectivity 1235 check will be associated with that same callee. Thus, the caller can 1236 perform this correlation as long as it has received an answer. 1238 8.4. Interactions with Preconditions 1240 Quality of Service (QoS) preconditions, which are defined in 1241 [RFC3312] and [RFC4032], apply only to the transport addresses listed 1242 as the default targets for media in an offer/answer. If ICE changes 1243 the transport address where media is received, this change is 1244 reflected in an updated offer that changes the default destination 1245 for media to match ICE's selection. As such, it appears like any 1246 other re-INVITE would, and is fully treated in RFCs 3312 and 4032, 1247 which apply without regard to the fact that the destination for media 1248 is changing due to ICE negotiations occurring "in the background". 1250 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1251 met until the checks have completed and selected the candidate pairs 1252 to be used for media. 1254 ICE also has (purposeful) interactions with connectivity 1255 preconditions [RFC5898]. Those interactions are described there. 1256 Note that the procedures described in Section 8.1 describe their own 1257 type of "preconditions", albeit with less functionality than those 1258 provided by the explicit preconditions in [RFC5898]. 1260 8.5. Interactions with Third Party Call Control 1262 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1263 I works without the controller supporting or being aware of ICE. 1264 Flow IV will work as long as the controller passes along the ICE 1265 attributes without alteration. Flow II is fundamentally incompatible 1266 with ICE; each agent will believe itself to be the answerer and thus 1267 never generate a re-INVITE. 1269 The flows for continued operation, as described in Section 7 of 1270 [RFC3725], require additional behavior of ICE implementations to 1271 support. In particular, if an agent receives a mid-dialog re-INVITE 1272 that contains no offer, it MUST restart ICE for each media stream and 1273 go through the process of gathering new candidates. Furthermore, 1274 that list of candidates SHOULD include the ones currently being used 1275 for media. 1277 9. Relationship with ANAT 1279 [RFC4091], the Alternative Network Address Types (ANAT) Semantics for 1280 the SDP grouping framework, and [RFC4092], its usage with SIP, define 1281 a mechanism for indicating that an agent can support both IPv4 and 1282 IPv6 for a media stream, and it does so by including two "m=" lines, 1283 one for v4 and one for v6. This is similar to ICE, which allows for 1284 an agent to indicate multiple transport addresses using the candidate 1285 attribute. However, ANAT relies on static selection to pick between 1286 choices, rather than a dynamic connectivity check used by ICE. 1288 It is RECOMMENDED that ICE be used in realizing the dual-stack use- 1289 cases in agents that support ICE. 1291 10. Setting Ta and RTO for RTP Media Streams 1293 During the gathering phase of ICE (section 5.1.1 [ICE-BIS]) and while 1294 ICE is performing connectivity checks (section 7 [ICE-BIS]), an agent 1295 sends STUN and TURN transactions. These transactions are paced at a 1296 rate of one every Ta milliseconds, and utilize a specific RTO. See 1297 Section 15 of [ICE-BIS] for details on how the values of Ta and RTO 1298 are computed with a real-time media stream of known maximum bandwidth 1299 to rate-control the ICE exchanges. 1301 11. Security Considerations 1303 11.1. Attacks on the Offer/Answer Exchanges 1305 An attacker that can modify or disrupt the offer/answer exchanges 1306 themselves can readily launch a variety of attacks with ICE. They 1307 could direct media to a target of a DoS attack, they could insert 1308 themselves into the media stream, and so on. These are similar to 1309 the general security considerations for offer/answer exchanges, and 1310 the security considerations in [RFC3264] apply. These require 1311 techniques for message integrity and encryption for offers and 1312 answers, which are satisfied by the TLS mechanism [RFC3261] when SIP 1313 is used. As such, the usage of TLS with ICE is RECOMMENDED. 1315 11.2. Insider Attacks 1317 In addition to attacks where the attacker is a third party trying to 1318 insert fake offers, answers, or STUN messages, there are several 1319 attacks possible with ICE when the attacker is an authenticated and 1320 valid participant in the ICE exchange. 1322 11.2.1. The Voice Hammer Attack 1324 The voice hammer attack is an amplification attack. In this attack, 1325 the attacker initiates sessions to other agents, and maliciously 1326 includes the IP address and port of a DoS target as the destination 1327 for media traffic signaled in the SDP. This causes substantial 1328 amplification; a single offer/answer exchange can create a continuing 1329 flood of media packets, possibly at high rates (consider video 1330 sources). This attack is not specific to ICE, but ICE can help 1331 provide remediation. 1333 Specifically, if ICE is used, the agent receiving the malicious SDP 1334 will first perform connectivity checks to the target of media before 1335 sending media there. If this target is a third-party host, the 1336 checks will not succeed, and media is never sent. 1338 Unfortunately, ICE doesn't help if it's not used, in which case an 1339 attacker could simply send the offer without the ICE parameters. 1340 However, in environments where the set of clients is known, and is 1341 limited to ones that support ICE, the server can reject any offers or 1342 answers that don't indicate ICE support. 1344 User Agents that are not willing to receive non-ICE answers MUST 1345 include an "ice" Option Tag in the Require Header Field in their 1346 offer. Clients that rejects non-ICE offers SHOULD use a 421 response 1347 code, together with an Option Tag "ice" in the Require Header Field 1348 in the response. 1350 11.2.2. Interactions with Application Layer Gateways and SIP 1352 Application Layer Gateways (ALGs) are functions present in a Network 1353 Address Translation (NAT) device that inspect the contents of packets 1354 and modify them, in order to facilitate NAT traversal for application 1355 protocols. Session Border Controllers (SBCs) are close cousins of 1356 ALGs, but are less transparent since they actually exist as 1357 application-layer SIP intermediaries. ICE has interactions with SBCs 1358 and ALGs. 1360 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1361 long as the ALG correctly modifies the SDP. A correct ALG 1362 implementation behaves as follows: 1364 o The ALG does not modify the "m=" and "c=" lines or the rtcp 1365 attribute if they contain external addresses. 1367 o If the "m=" and "c=" lines contain internal addresses, the 1368 modification depends on the state of the ALG: 1370 * If the ALG already has a binding established that maps an 1371 external port to an internal IP address and port matching the 1372 values in the "m=" and "c=" lines or rtcp attribute, the ALG 1373 uses that binding instead of creating a new one. 1375 * If the ALG does not already have a binding, it creates a new 1376 one and modifies the SDP, rewriting the "m=" and "c=" lines and 1377 rtcp attribute. 1379 Unfortunately, many ALGs are known to work poorly in these corner 1380 cases. ICE does not try to work around broken ALGs, as this is 1381 outside the scope of its functionality. ICE can help diagnose these 1382 conditions, which often show up as a mismatch between the set of 1383 candidates and the "m=" and "c=" lines and rtcp attributes. The ice- 1384 mismatch attribute is used for this purpose. 1386 ICE works best through ALGs when the signaling is run over TLS. This 1387 prevents the ALG from manipulating the SDP messages and interfering 1388 with ICE operation. Implementations that are expected to be deployed 1389 behind ALGs SHOULD provide for TLS transport of the SDP. 1391 If an SBC is SIP aware but not ICE aware, the result depends on the 1392 behavior of the SBC. If it is acting as a proper Back-to-Back User 1393 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1394 understand, including the ICE attributes. Consequently, the call 1395 will appear to both endpoints as if the other side doesn't support 1396 ICE. This will result in ICE being disabled, and media flowing 1397 through the SBC, if the SBC has requested it. If, however, the SBC 1398 passes the ICE attributes without modification, yet modifies the 1399 default destination for media (contained in the "m=" and "c=" lines 1400 and rtcp attribute), this will be detected as an ICE mismatch, and 1401 ICE processing is aborted for the call. It is outside of the scope 1402 of ICE for it to act as a tool for "working around" SBCs. If one is 1403 present, ICE will not be used and the SBC techniques take precedence. 1405 12. IANA Considerations 1407 12.1. SDP Attributes 1409 The original ICE specification defined seven new SDP attributes per 1410 the procedures of Section 8.2.4 of [RFC4566]. The registration 1411 information is reproduced here. 1413 12.1.1. candidate Attribute 1415 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1417 Attribute Name: candidate 1419 Long Form: candidate 1421 Type of Attribute: media-level 1423 Charset Considerations: The attribute is not subject to the charset 1424 attribute. 1426 Purpose: This attribute is used with Interactive Connectivity 1427 Establishment (ICE), and provides one of many possible candidate 1428 addresses for communication. These addresses are validated with 1429 an end-to-end connectivity check using Session Traversal Utilities 1430 for NAT (STUN). 1432 Appropriate Values: See Section 5 of RFC XXXX. 1434 12.1.2. remote-candidates Attribute 1436 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1438 Attribute Name: remote-candidates 1440 Long Form: remote-candidates 1442 Type of Attribute: media-level 1444 Charset Considerations: The attribute is not subject to the charset 1445 attribute. 1447 Purpose: This attribute is used with Interactive Connectivity 1448 Establishment (ICE), and provides the identity of the remote 1449 candidates that the offerer wishes the answerer to use in its 1450 answer. 1452 Appropriate Values: See Section 5 of RFC XXXX. 1454 12.1.3. ice-lite Attribute 1456 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1458 Attribute Name: ice-lite 1460 Long Form: ice-lite 1461 Type of Attribute: session-level 1463 Charset Considerations: The attribute is not subject to the charset 1464 attribute. 1466 Purpose: This attribute is used with Interactive Connectivity 1467 Establishment (ICE), and indicates that an agent has the minimum 1468 functionality required to support ICE inter-operation with a peer 1469 that has a full implementation. 1471 Appropriate Values: See Section 5 of RFC XXXX. 1473 12.1.4. ice-mismatch Attribute 1475 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1477 Attribute Name: ice-mismatch 1479 Long Form: ice-mismatch 1481 Type of Attribute: session-level 1483 Charset Considerations: The attribute is not subject to the charset 1484 attribute. 1486 Purpose: This attribute is used with Interactive Connectivity 1487 Establishment (ICE), and indicates that an agent is ICE capable, 1488 but did not proceed with ICE due to a mismatch of candidates with 1489 the default destination for media signaled in the SDP. 1491 Appropriate Values: See Section 5 of RFC XXXX. 1493 12.1.5. ice-pwd Attribute 1495 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1497 Attribute Name: ice-pwd 1499 Long Form: ice-pwd 1501 Type of Attribute: session- or media-level 1503 Charset Considerations: The attribute is not subject to the charset 1504 attribute. 1506 Purpose: This attribute is used with Interactive Connectivity 1507 Establishment (ICE), and provides the password used to protect 1508 STUN connectivity checks. 1510 Appropriate Values: See Section 5 of RFC XXXX. 1512 12.1.6. ice-ufrag Attribute 1514 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1516 Attribute Name: ice-ufrag 1518 Long Form: ice-ufrag 1520 Type of Attribute: session- or media-level 1522 Charset Considerations: The attribute is not subject to the charset 1523 attribute. 1525 Purpose: This attribute is used with Interactive Connectivity 1526 Establishment (ICE), and provides the fragments used to construct 1527 the username in STUN connectivity checks. 1529 Appropriate Values: See Section 5 of RFC XXXX. 1531 12.1.7. ice-pacing Attribute 1533 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1535 Attribute Name: ice-pacing 1537 Long Form: ice-pacing 1539 Type of Attribute: session-level 1541 Charset Considerations: The attribute is not subject to the charset 1542 attribute. 1544 Purpose: This attribute is used with Interactive Connectivity 1545 Establishment (ICE) to indicate desired connectivity check pacing 1546 values. 1548 Appropriate Values: See Section 5 of RFC XXXX. 1550 12.1.8. ice-options Attribute 1552 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1554 Attribute Name: ice-options 1556 Long Form: ice-options 1557 Type of Attribute: session- or media-level 1559 Charset Considerations: The attribute is not subject to the charset 1560 attribute. 1562 Purpose: This attribute is used with Interactive Connectivity 1563 Establishment (ICE), and indicates the ICE options or extensions 1564 used by the agent. 1566 Appropriate Values: See Section 5 of RFC XXXX. 1568 12.2. Interactive Connectivity Establishment (ICE) Options Registry 1570 IANA maintains a registry for ice-options identifiers under the 1571 Specification Required policy as defined in "Guidelines for Writing 1572 an IANA Considerations Section in RFCs" [RFC5226]. 1574 ICE options are of unlimited length according to the syntax in 1575 Section 5.6; however, they are RECOMMENDED to be no longer than 20 1576 characters. This is to reduce message sizes and allow for efficient 1577 parsing. 1579 In [RFC5245] ICE options could only be defined at the session level. 1580 ICE options can now also be defined at the media level. This can be 1581 used when aggregating between different ICE agents in the same 1582 endpoint, but future options may require to be defined at the media- 1583 level. To ensure compatibility with legacy implementation, the 1584 media-level ICE options MUST be aggregated into a session-level ICE 1585 option. Because aggregation rules depend on the specifics of each 1586 option, all new ICE options MUST also define in their specification 1587 how the media-level ICE option values are aggregated to generate the 1588 value of the session-level ICE option. 1590 [RFC6679] defines the "rtp+ecn" ICE option. The aggregation rule for 1591 this ICE option is that if all aggregated media using ICE contain a 1592 media-level "rtp+ecn" ICE option then an "rtp+ecn" ICE option MUST be 1593 inserted at the session-level. If one of the media does not contain 1594 the option, then it MUST NOT be inserted at the session-level. 1596 Section 10 of [ICE-BIS] defines "ice2" ICE option. Since "ice2" is a 1597 session level ICE option, no aggregation rules apply. 1599 A registration request MUST include the following information: 1601 o The ICE option identifier to be registered 1603 o Name, Email, and Address of a contact person for the registration 1604 o Organization or individuals having the change control 1606 o Short description of the ICE extension to which the option relates 1608 o Reference(s) to the specification defining the ICE option and the 1609 related extensions 1611 13. Acknowledgments 1613 A large part of the text in this document was taken from [RFC5245], 1614 authored by Jonathan Rosenberg. 1616 Some of the text in this document was taken from [RFC6336], authored 1617 by Magnus Westerlund and Colin Perkins. 1619 Thanks to Thomas Stach for the text in Section 4.2.3, Roman Shpount 1620 for suggesting RTCP candidate handling in Section 4.1.1.2 and Simon 1621 Perreault for advising on IPV6 address selection when candidate- 1622 address includes FQDN. 1624 Thanks to following experts for their reviews and constructive 1625 feedback: Christer Holmberg, Adam Roach and the MMUSIC WG. 1627 14. References 1629 14.1. Normative References 1631 [ICE-BIS] Keranen, A. and J. Rosenberg, "Interactive Connectivity 1632 Establishment (ICE): A Protocol for Network Address 1633 Translator (NAT) Traversal for Offer/Answer Protocols", 1634 draft-ietf-ice-rfc5245bis-00 (work in progress), March 1635 2015. 1637 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1638 Requirement Levels", BCP 14, RFC 2119, 1639 DOI 10.17487/RFC2119, March 1997, 1640 . 1642 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1643 A., Peterson, J., Sparks, R., Handley, M., and E. 1644 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1645 DOI 10.17487/RFC3261, June 2002, 1646 . 1648 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1649 Provisional Responses in Session Initiation Protocol 1650 (SIP)", RFC 3262, DOI 10.17487/RFC3262, June 2002, 1651 . 1653 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1654 with Session Description Protocol (SDP)", RFC 3264, 1655 DOI 10.17487/RFC3264, June 2002, 1656 . 1658 [RFC3312] Camarillo, G., Ed., Marshall, W., Ed., and J. Rosenberg, 1659 "Integration of Resource Management and Session Initiation 1660 Protocol (SIP)", RFC 3312, DOI 10.17487/RFC3312, October 1661 2002, . 1663 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1664 Modifiers for RTP Control Protocol (RTCP) Bandwidth", 1665 RFC 3556, DOI 10.17487/RFC3556, July 2003, 1666 . 1668 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1669 in Session Description Protocol (SDP)", RFC 3605, 1670 DOI 10.17487/RFC3605, October 2003, 1671 . 1673 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1674 Initiation Protocol (SIP) Preconditions Framework", 1675 RFC 4032, DOI 10.17487/RFC4032, March 2005, 1676 . 1678 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1679 Address Types (ANAT) Semantics for the Session Description 1680 Protocol (SDP) Grouping Framework", RFC 4091, June 2005, 1681 . 1683 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1684 Description Protocol (SDP) Alternative Network Address 1685 Types (ANAT) Semantics in the Session Initiation Protocol 1686 (SIP)", RFC 4092, June 2005, 1687 . 1689 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1690 Description Protocol", RFC 4566, DOI 10.17487/RFC4566, 1691 July 2006, . 1693 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1694 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1695 DOI 10.17487/RFC5226, May 2008, 1696 . 1698 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 1699 Specifications: ABNF", STD 68, RFC 5234, 1700 DOI 10.17487/RFC5234, January 2008, 1701 . 1703 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1704 (ICE): A Protocol for Network Address Translator (NAT) 1705 Traversal for Offer/Answer Protocols", RFC 5245, 1706 DOI 10.17487/RFC5245, April 2010, 1707 . 1709 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1710 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1711 DOI 10.17487/RFC5389, October 2008, 1712 . 1714 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1715 Connectivity Establishment (ICE) in the Session Initiation 1716 Protocol (SIP)", RFC 5768, DOI 10.17487/RFC5768, April 1717 2010, . 1719 [RFC6336] Westerlund, M. and C. Perkins, "IANA Registry for 1720 Interactive Connectivity Establishment (ICE) Options", 1721 RFC 6336, April 2010, 1722 . 1724 [RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., 1725 and K. Carlberg, "Explicit Congestion Notification (ECN) 1726 for RTP over UDP", RFC 6679, DOI 10.17487/RFC6679, August 1727 2012, . 1729 [RFC6724] Thaler, D., Draves, R., Matsumoto, A., and T. Chown, 1730 "Default Address Selection for Internet Protocol Version 6 1731 (IPv6)", RFC 6724, September 2012, 1732 . 1734 [RFC7092] Kaplan, H. and V. Pascual, "A Taxonomy of Session 1735 Initiation Protocol (SIP) Back-to-Back User Agents", 1736 RFC 7092, DOI 10.17487/RFC7092, December 2013, 1737 . 1739 [RFC7656] Lennox, J., Gross, K., Nandakumar, S., Salgueiro, G., and 1740 B. Burman, Ed., "A Taxonomy of Semantics and Mechanisms 1741 for Real-Time Transport Protocol (RTP) Sources", RFC 7656, 1742 DOI 10.17487/RFC7656, November 2015, 1743 . 1745 14.2. Informative References 1747 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1748 Camarillo, "Best Current Practices for Third Party Call 1749 Control (3pcc) in the Session Initiation Protocol (SIP)", 1750 BCP 85, RFC 3725, DOI 10.17487/RFC3725, April 2004, 1751 . 1753 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1754 Tone Generation in the Session Initiation Protocol (SIP)", 1755 RFC 3960, DOI 10.17487/RFC3960, December 2004, 1756 . 1758 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1759 Congestion Control Protocol (DCCP)", RFC 4340, 1760 DOI 10.17487/RFC4340, March 2006, 1761 . 1763 [RFC5626] Jennings, C., Ed., Mahy, R., Ed., and F. Audet, Ed., 1764 "Managing Client-Initiated Connections in the Session 1765 Initiation Protocol (SIP)", RFC 5626, 1766 DOI 10.17487/RFC5626, October 2009, 1767 . 1769 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1770 "Connectivity Preconditions for Session Description 1771 Protocol (SDP) Media Streams", RFC 5898, 1772 DOI 10.17487/RFC5898, July 2010, 1773 . 1775 Appendix A. Examples 1777 For the example shown in section 16 of [ICE-BIS] the resulting offer 1778 (message 5) encoded in SDP looks like: 1780 v=0 1781 o=jdoe 2890844526 2890842807 IN IP6 $L-PRIV-1.IP 1782 s= 1783 c=IN IP6 $NAT-PUB-1.IP 1784 t=0 0 1785 a=ice-pwd:asd88fgpdd777uzjYhagZg 1786 a=ice-ufrag:8hhY 1787 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1788 b=RS:0 1789 b=RR:0 1790 a=rtpmap:0 PCMU/8000 1791 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1792 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1793 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1795 The offer, with the variables replaced with their values, will look 1796 like (lines folded for clarity): 1798 v=0 1799 o=jdoe 2890844526 2890842807 IN IP6 fe80::6676:baff:fe9c:ee4a 1800 s= 1801 c=IN IP6 2001:420:c0e0:1005::61 1802 t=0 0 1803 a=ice-pwd:asd88fgpdd777uzjYhagZg 1804 a=ice-ufrag:8hhY 1805 m=audio 45664 RTP/AVP 0 1806 b=RS:0 1807 b=RR:0 1808 a=rtpmap:0 PCMU/8000 1809 a=candidate:1 1 UDP 2130706431 fe80::6676:baff:fe9c:ee4a 8998 typ host 1810 a=candidate:2 1 UDP 1694498815 2001:420:c0e0:1005::61 45664 typ srflx raddr 1811 fe80::6676:baff:fe9c:ee4a rport 8998 1813 The resulting answer looks like: 1815 v=0 1816 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1817 s= 1818 c=IN IP4 $R-PUB-1.IP 1819 t=0 0 1820 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1821 a=ice-ufrag:9uB6 1822 m=audio $R-PUB-1.PORT RTP/AVP 0 1823 b=RS:0 1824 b=RR:0 1825 a=rtpmap:0 PCMU/8000 1826 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1827 With the variables filled in: 1829 v=0 1830 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1831 s= 1832 c=IN IP4 192.0.2.1 1833 t=0 0 1834 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1835 a=ice-ufrag:9uB6 1836 m=audio 3478 RTP/AVP 0 1837 b=RS:0 1838 b=RR:0 1839 a=rtpmap:0 PCMU/8000 1840 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1842 Appendix B. The remote-candidates Attribute 1844 The a=remote-candidates attribute exists to eliminate a race 1845 condition between the updated offer and the response to the STUN 1846 Binding request that moved a candidate into the Valid list. This 1847 race condition is shown in Figure 1. On receipt of message 4, agent 1848 L adds a candidate pair to the valid list. If there was only a 1849 single media stream with a single component, agent L could now send 1850 an updated offer. However, the check from agent R has not yet 1851 generated a response, and agent R receives the updated offer (message 1852 7) before getting the response (message 9). Thus, it does not yet 1853 know that this particular pair is valid. To eliminate this 1854 condition, the actual candidates at R that were selected by the 1855 offerer (the remote candidates) are included in the offer itself, and 1856 the answerer delays its answer until those pairs validate. 1858 Agent L Network Agent R 1859 |(1) Offer | | 1860 |------------------------------------------>| 1861 |(2) Answer | | 1862 |<------------------------------------------| 1863 |(3) STUN Req. | | 1864 |------------------------------------------>| 1865 |(4) STUN Res. | | 1866 |<------------------------------------------| 1867 |(5) STUN Req. | | 1868 |<------------------------------------------| 1869 |(6) STUN Res. | | 1870 |-------------------->| | 1871 | |Lost | 1872 |(7) Offer | | 1873 |------------------------------------------>| 1874 |(8) STUN Req. | | 1875 |<------------------------------------------| 1876 |(9) STUN Res. | | 1877 |------------------------------------------>| 1878 |(10) Answer | | 1879 |<------------------------------------------| 1881 Figure 1: Race Condition Flow 1883 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1885 When ICE runs between two peers, one agent acts as controlled, and 1886 the other as controlling. Rules are defined as a function of 1887 implementation type and offerer/answerer to determine who is 1888 controlling and who is controlled. However, the specification 1889 mentions that, in some cases, both sides might believe they are 1890 controlling, or both sides might believe they are controlled. How 1891 can this happen? 1893 The condition when both agents believe they are controlled shows up 1894 in third party call control cases. Consider the following flow: 1896 A Controller B 1897 |(1) INV() | | 1898 |<-------------| | 1899 |(2) 200(SDP1) | | 1900 |------------->| | 1901 | |(3) INV() | 1902 | |------------->| 1903 | |(4) 200(SDP2) | 1904 | |<-------------| 1905 |(5) ACK(SDP2) | | 1906 |<-------------| | 1907 | |(6) ACK(SDP1) | 1908 | |------------->| 1910 Figure 2: Role Conflict Flow 1912 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1913 it works better than flow III since it produces fewer messages. In 1914 this flow, the controller sends an offerless INVITE to agent A, which 1915 responds with its offer, SDP1. The agent then sends an offerless 1916 INVITE to agent B, which it responds to with its offer, SDP2. The 1917 controller then uses the offer from each agent to generate the 1918 answers. When this flow is used, ICE will run between agents A and 1919 B, but both will believe they are in the controlling role. With the 1920 role conflict resolution procedures, this flow will function properly 1921 when ICE is used. 1923 At this time, there are no documented flows that can result in the 1924 case where both agents believe they are controlled. However, the 1925 conflict resolution procedures allow for this case, should a flow 1926 arise that would fit into this category. 1928 Appendix D. Why Send an Updated Offer? 1930 Section 11.1 describes rules for sending media. Both agents can send 1931 media once ICE checks complete, without waiting for an updated offer. 1932 Indeed, the only purpose of the updated offer is to "correct" the SDP 1933 so that the default destination for media matches where media is 1934 being sent based on ICE procedures (which will be the highest- 1935 priority nominated candidate pair). 1937 This begs the question -- why is the updated offer/answer exchange 1938 needed at all? Indeed, in a pure offer/answer environment, it would 1939 not be. The offerer and answerer will agree on the candidates to use 1940 through ICE, and then can begin using them. As far as the agents 1941 themselves are concerned, the updated offer/answer provides no new 1942 information. However, in practice, numerous components along the 1943 signaling path look at the SDP information. These include entities 1944 performing off-path QoS reservations, NAT traversal components such 1945 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1946 that passively monitor the network. For these tools to continue to 1947 function without change, the core property of SDP -- that the 1948 existing, pre-ICE definitions of the addresses used for media -- the 1949 "m=" and "c=" lines and the rtcp attribute -- must be retained. For 1950 this reason, an updated offer must be sent. 1952 Authors' Addresses 1954 Marc Petit-Huguenin 1955 Impedance Mismatch 1957 Email: marc@petit-huguenin.org 1959 Ari Keranen 1960 Ericsson 1961 Jorvas 02420 1962 Finland 1964 Email: ari.keranen@ericsson.com 1966 Suhas Nandakumar 1967 Cisco Systems 1968 707 Tasman Dr 1969 Milpitas, CA 95035 1970 USA 1972 Email: snandaku@cisco.com