idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-36.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 : ---------------------------------------------------------------------------- No issues found here. 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 (June 6, 2019) is 1784 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 6336 (Obsoleted by RFC 8839) -- Obsolete informational reference (is this intentional?): RFC 4091 (Obsoleted by RFC 5245) -- Obsolete informational reference (is this intentional?): RFC 4092 (Obsoleted by RFC 5245) -- Obsolete informational reference (is this intentional?): RFC 5245 (Obsoleted by RFC 8445, RFC 8839) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 4 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) S. Nandakumar 5 Intended status: Standards Track Cisco Systems 6 Expires: December 8, 2019 A. Keranen 7 Ericsson 8 June 6, 2019 10 Session Description Protocol (SDP) Offer/Answer procedures for 11 Interactive Connectivity Establishment (ICE) 12 draft-ietf-mmusic-ice-sip-sdp-36 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 This document obsoletes RFC 5245. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on December 8, 2019. 39 Copyright Notice 41 Copyright (c) 2019 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (https://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 This document may contain material from IETF Documents or IETF 55 Contributions published or made publicly available before November 56 10, 2008. The person(s) controlling the copyright in some of this 57 material may not have granted the IETF Trust the right to allow 58 modifications of such material outside the IETF Standards Process. 59 Without obtaining an adequate license from the person(s) controlling 60 the copyright in such materials, this document may not be modified 61 outside the IETF Standards Process, and derivative works of it may 62 not be created outside the IETF Standards Process, except to format 63 it for publication as an RFC or to translate it into languages other 64 than English. 66 Table of Contents 68 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 69 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 70 3. SDP Offer/Answer Procedures . . . . . . . . . . . . . . . . . 4 71 3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 4 72 3.2. Generic Procedures . . . . . . . . . . . . . . . . . . . 4 73 3.2.1. Encoding . . . . . . . . . . . . . . . . . . . . . . 4 74 3.2.2. RTP/RTCP Considerations . . . . . . . . . . . . . . . 6 75 3.2.3. Determining Role . . . . . . . . . . . . . . . . . . 6 76 3.2.4. STUN Considerations . . . . . . . . . . . . . . . . . 6 77 3.2.5. Verifying ICE Support Procedures . . . . . . . . . . 6 78 3.2.6. SDP Example . . . . . . . . . . . . . . . . . . . . . 7 79 3.3. Initial Offer/Answer Exchange . . . . . . . . . . . . . . 8 80 3.3.1. Sending the Initial Offer . . . . . . . . . . . . . . 8 81 3.3.2. Sending the Initial Answer . . . . . . . . . . . . . 8 82 3.3.3. Receiving the Initial Answer . . . . . . . . . . . . 9 83 3.3.4. Concluding ICE . . . . . . . . . . . . . . . . . . . 10 84 3.4. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . 10 85 3.4.1. Sending Subsequent Offer . . . . . . . . . . . . . . 11 86 3.4.2. Sending Subsequent Answer . . . . . . . . . . . . . . 13 87 3.4.3. Receiving Answer for a Subsequent Offer . . . . . . . 15 88 4. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 89 4.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 17 90 4.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 19 91 4.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 20 92 4.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 20 93 4.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 21 94 4.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 21 95 5. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 22 96 6. SIP Considerations . . . . . . . . . . . . . . . . . . . . . 22 97 6.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 22 98 6.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . . 23 99 6.1.2. Offer in Response . . . . . . . . . . . . . . . . . . 24 100 6.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 24 101 6.3. Interactions with Forking . . . . . . . . . . . . . . . . 24 102 6.4. Interactions with Preconditions . . . . . . . . . . . . . 25 103 6.5. Interactions with Third Party Call Control . . . . . . . 25 104 7. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 26 105 8. Security Considerations . . . . . . . . . . . . . . . . . . . 26 106 8.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . . 26 107 8.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . . 26 108 8.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . . 26 109 8.2.2. Interactions with Application Layer Gateways and SIP 27 110 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 28 111 9.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 28 112 9.1.1. candidate Attribute . . . . . . . . . . . . . . . . . 28 113 9.1.2. remote-candidates Attribute . . . . . . . . . . . . . 29 114 9.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 29 115 9.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 30 116 9.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . . 30 117 9.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . . 31 118 9.1.7. ice-options Attribute . . . . . . . . . . . . . . . . 31 119 9.1.8. ice-pacing Attribute . . . . . . . . . . . . . . . . 32 120 9.2. Interactive Connectivity Establishment (ICE) Options 121 Registry . . . . . . . . . . . . . . . . . . . . . . . . 32 122 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 33 123 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 124 11.1. Normative References . . . . . . . . . . . . . . . . . . 33 125 11.2. Informative References . . . . . . . . . . . . . . . . . 35 126 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 36 127 Appendix B. The remote-candidates Attribute . . . . . . . . . . 37 128 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 38 129 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 39 130 Appendix E. Contributors . . . . . . . . . . . . . . . . . . . . 40 131 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 40 133 1. Introduction 135 This document describes how Interactive Connectivity Establishment 136 (ICE) is used with Session Description Protocol (SDP) offer/answer 137 [RFC3264]. The ICE specification [RFC8445] describes procedures that 138 are common to all usages of ICE and this document gives the 139 additional details needed to use ICE with SDP offer/answer. 141 This document obsoletes RFC 5245. 143 2. Terminology 145 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 146 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 147 "OPTIONAL" in this document are to be interpreted as described in 148 [RFC8174]. 150 Readers should be familiar with the terminology defined in [RFC3264], 151 in [RFC8445] and the following: 153 Default Destination/Candidate: The default destination for a 154 component of a data stream is the transport address that would be 155 used by an agent that is not ICE aware. A default candidate for a 156 component is one whose transport address matches the default 157 destination for that component. For the RTP component, the 158 default connection address is in the "c=" line of the SDP, and the 159 port and transport protocol are in the "m=" line. For the RTCP 160 component, the address and port are indicated using the "a=rtcp" 161 attribute defined in [RFC3605], if present; otherwise, the RTCP 162 component address is the same as the address of the RTP component, 163 and its port is one greater than the port of the RTP component. 165 3. SDP Offer/Answer Procedures 167 3.1. Introduction 169 [RFC8445] defines ICE candidate exchange as the process for ICE 170 agents (Initiator and Responder) to exchange their candidate 171 information required for ICE processing at the agents. For the 172 purposes of this specification, the candidate exchange process 173 corresponds to the [RFC3264] Offer/Answer protocol and the terms 174 "offerer" and "answerer" correspond to the initiator and responder 175 roles from [RFC8445] respectively. 177 Once the initiating agent has gathered, pruned, and prioritized its 178 set of candidates [RFC8445], the candidate exchange with the peer 179 agent begins. 181 3.2. Generic Procedures 183 3.2.1. Encoding 185 Section 4 provides detailed rules for constructing various SDP 186 attributes defined in this specification. 188 3.2.1.1. Data Streams 190 Each data stream [RFC8445] is represented by an SDP media description 191 ("m=" section). 193 3.2.1.2. Candidates 195 Within an "m=" section, each candidate (including the default 196 candidate) associated with the data stream is represented by an SDP 197 candidate attribute. 199 Prior to nomination, the "c=" line associated with an "m=" section 200 contains the connection address of the default candidate, while the 201 "m=" line contains the port and transport protocol of the default 202 candidate for that "m=" section. 204 After nomination, the "c=" line for a given "m=" section contains the 205 connection address of the nominated candidate (the local candidate of 206 the nominated candidate pair) and the "m=" line contains the port and 207 transport protocol corresponding to the nominated candidate for that 208 "m=" section. 210 3.2.1.3. Username and Password 212 The ICE username is represented by an SDP ice-ufrag attribute and the 213 ICE password is represented by an SDP ice-pwd attribute. 215 3.2.1.4. Lite Implementations 217 An ICE lite implementation [RFC8445] MUST include an SDP ice-lite 218 attribute. A full implementation MUST NOT include that attribute. 220 3.2.1.5. ICE Extensions 222 An agent uses the SDP ice-options attribute to indicate support of 223 ICE extensions. 225 An agent compliant to this specification MUST include an SDP ice- 226 options attribute with an "ice2" attribute value. If an agent 227 receives an SDP offer or answer with ICE attributes but without the 228 "ice2" ice-options attribute value, the agent assumes that the peer 229 is compliant to [RFC5245]. 231 3.2.1.6. Inactive and Disabled Data Streams 233 If an "m=" section is marked as inactive [RFC4566], or has a 234 bandwidth value of zero [RFC4566], the agent MUST still include ICE- 235 related SDP attributes. 237 If the port value associated with an "m=" section is set to zero 238 (implying a disabled stream) as defined in section 8.2 of [RFC3264], 239 the agent SHOULD NOT include ICE-related SDP candidate attributes in 240 that "m=" section, unless an SDP extension specifying otherwise is 241 used. 243 3.2.2. RTP/RTCP Considerations 245 If an agent utilizes both RTP and RTCP, and separate ports are used 246 for RTP and RTCP, the agent MUST include SDP candidate attributes for 247 both the RTP and RTCP components and SDP rtcp attribute SHOULD be 248 included in the "m=" section, as described in [RFC3605] 250 In the cases where the port number for the RTCP is one higher than 251 the RTP port and the RTCP component address is the same as the 252 address of the RTP component, the SDP rtcp attribute MAY be omitted. 254 If the agent does not utilize RTCP, it indicates that by including 255 b=RS:0 and b=RR:0 SDP attributes, as described in [RFC3556]. 257 3.2.3. Determining Role 259 The offerer acts as the Initiating agent. The answerer acts as the 260 Responding agent. The ICE roles (controlling and controlled) are 261 determined using the procedures in [RFC8445]. 263 3.2.4. STUN Considerations 265 Once an agent has provided its local candidates to its peer in an SDP 266 offer or answer, the agent MUST be prepared to receive STUN 267 connectivity check Binding requests on those candidates. 269 3.2.5. Verifying ICE Support Procedures 271 The agents will proceed with the ICE procedures defined in [RFC8445] 272 and this specification if, for each data stream in the SDP it 273 received, the default destination for each component of that data 274 stream appears in a candidate attribute. For example, in the case of 275 RTP, the connection address, port, and transport protocol in the "c=" 276 and "m=" lines, respectively, appear in a candidate attribute and the 277 value in the rtcp attribute appears in a candidate attribute. 279 This specification provides no guidance on how an agent should 280 proceed in the cases where the above condition is not met with the 281 few exceptions noted below: 283 1. The presence of certain application layer gateways MAY modify the 284 transport address information as described in Section 8.2.2. The 285 behavior of the responding agent in such a situation is 286 implementation dependent. Informally, the responding agent MAY 287 consider the mismatched transport address information as a 288 plausible new candidate learnt from the peer and continue its ICE 289 processing with that transport address included. Alternatively, 290 the responding agent MAY include an "a=ice-mismatch" attribute in 291 its answer for such data streams. If an agent chooses to include 292 an "a=ice-mismatch" attribute in its answer for a data stream, 293 then it MUST also omit "a=candidate" attributes, MUST terminate 294 the usage of ICE procedures and [RFC3264] procedures MUST be used 295 instead for this data stream. 297 2. The transport address from the peer for the default destination 298 correspond to IPv4/IPv6 address values "0.0.0.0"/"::" and port 299 value of "9". This MUST NOT be considered as a ICE failure by 300 the peer agent and the ICE processing MUST continue as usual. 302 3. In some cases, the controlling/initiator agent may receive the 303 SDP answer that may omit "a=candidate" attributes for the data 304 stream, and instead include a media level "a=ice-mismatch" 305 attribute. This signals to the offerer that the answerer 306 supports ICE, but that ICE processing was not used for this data 307 stream. In this case, ICE processing MUST be terminated for this 308 data stream and [RFC3264] procedures MUST be followed instead. 310 4. The transport address from the peer for the default destination 311 is an FQDN. Regardless of the procedures used to resolve FQDN or 312 the resolution result, this MUST NOT be considered as a ICE 313 failure by the peer agent and the ICE processing MUST continue as 314 usual. 316 3.2.6. SDP Example 318 The following is an example SDP message that includes ICE attributes 319 (lines folded for readability): 321 v=0 322 o=jdoe 2890844526 2890842807 IN IP4 203.0.113.141 323 s= 324 c=IN IP4 192.0.2.3 325 t=0 0 326 a=ice-options:ice2 327 a=ice-pwd:asd88fgpdd777uzjYhagZg 328 a=ice-ufrag:8hhY 329 m=audio 45664 RTP/AVP 0 330 b=RS:0 331 b=RR:0 332 a=rtpmap:0 PCMU/8000 333 a=candidate:1 1 UDP 2130706431 203.0.113.141 8998 typ host 334 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 335 203.0.113.141 rport 8998 337 3.3. Initial Offer/Answer Exchange 339 3.3.1. Sending the Initial Offer 341 When an offerer generates the initial offer, in each "m=" section it 342 MUST include SDP candidate attributes for each available candidate 343 associated with the "m=" section. In addition, the offerer MUST 344 include an SDP ice-ufrag and an SDP ice-pwd attribute in the offer. 346 It is valid for an offer "m=" line to include no SDP candidate 347 attributes and with default destination corresponding to the IP 348 address values "0.0.0.0"/"::" and port value of "9". This implies 349 that the offering agent is only going to use peer reflexive 350 candidates or that additional candidates would be provided in 351 subsequent signaling messages. 353 Note: Within the scope of this document, "Initial Offer" refers to 354 the first SDP offer that is sent in order to negotiate usage of 355 ICE. It might, or might not, be the initial SDP offer of the SDP 356 session. 358 Note: The procedures in this document only consider "m=" sections 359 associated with data streams where ICE is used. 361 3.3.2. Sending the Initial Answer 363 When an answerer receives an initial offer that indicates that the 364 offerer supports ICE, and if the answerer accepts the offer and the 365 usage of ICE, in each "m=" section within the answer, it MUST include 366 SDP candidate attributes for each available candidate associated with 367 the "m=" section. In addition, the answerer MUST include an SDP ice- 368 ufrag and an SDP ice-pwd attribute in the answer. 370 In each "m=" line, the answerer MUST use the same transport protocol 371 as was used in the offer "m=" line. If none of the candidates in the 372 "m=" line in the answer use the same transport protocol as indicated 373 in the offer "m=" line, then, in order to avoid ICE mismatch, the 374 default destination MUST be set to IP address values "0.0.0.0"/"::" 375 and port value of "9". 377 It is also valid for an answer "m=" line to include no SDP candidate 378 attributes and with default destination corresponding to the IP 379 address values "0.0.0.0"/"::" and port value of "9". This implies 380 that the answering agent is only going to use peer reflexive 381 candidates or that additional candidates would be provided in 382 subsequent signaling messages. 384 Once the answerer has sent the answer, it can start performing 385 connectivity checks towards the peer candidates that were provided in 386 the offer. 388 If the offer does not indicate support of ICE, the answerer MUST NOT 389 accept the usage of ICE. If the answerer still accepts the offer, 390 the answerer MUST NOT include any ICE-related SDP attributes in the 391 answer. Instead the answerer will generate the answer according to 392 normal offer/answer procedures [RFC3264]. 394 If the answerer detects a possibility of an ICE mismatch, procedures 395 described in (Section 3.2.5) are followed. 397 Note: [draft-holmberg-ice-pac] provides guidance on finding working 398 candidate pairs and thus preventing premature declaration of ICE 399 failure in certain scenarios such as, if the peer has not provided 400 any candidates, or if all provided candidates have failed or have 401 been discarded. 403 3.3.3. Receiving the Initial Answer 405 When an offerer receives an initial answer that indicates that the 406 answerer supports ICE, it can start performing connectivity checks 407 towards the peer candidates that were provided in the answer. 409 If the answer does not indicate that the answerer supports ICE, or if 410 the answerer included "a=ice-mismatch" attributes for all the active 411 data streams in the answer, the offerer MUST terminate the usage of 412 ICE for the entire session and [RFC3264] procedures MUST be followed 413 instead. 415 On the other hand, if the answer indicates support for ICE but 416 includes "a=ice-mismatch" in certain active data streams, then the 417 offerer MUST terminate the usage of ICE procedures and [RFC3264] 418 procedures MUST be used instead for only these data streams. Also, 419 ICE procedures MUST be used for data streams where an "a=ice- 420 mismatch" attribute was not included. 422 If the offerer detects an ICE mismatch for one or more data streams 423 in the answer, as described in Section 3.2.5, the offerer MUST 424 terminate the usage of ICE for the entire session. The subsequent 425 actions taken by the offerer are implementation dependent and are out 426 of the scope of this specification. 428 Note: [draft-holmberg-ice-pac] provides guidance on finding working 429 candidate pairs and thus preventing premature declaration of ICE 430 failure in certain scenarios such as, if the peer has not provided 431 any candidates, or if all provided candidates have failed or have 432 been discarded. 434 3.3.4. Concluding ICE 436 Once the state of each check list is Completed, and if the agent is 437 the controlling agent, it nominates a candidate pair [RFC8445] and 438 checks for each data stream whether the nominated pair matches the 439 default candidate pair. If there are one or more data streams don't 440 match, and the peer did not indicate support for the 'ice2' ice- 441 option, the controlling agent MUST generate a subsequent offer 442 (Section 3.4.1), in which the connection address, port and transport 443 protocol in the "c=" and "m=" lines associated with each data stream 444 match the corresponding local information of the nominated pair for 445 that data stream. 447 However, if the support for 'ice2' ice-option is in use, the 448 nominated candidate is noted and sent in the subsequent offer/answer 449 exchange as the default candidate and no updated offer is needed to 450 fix the default candidate. 452 Also as described in [RFC8445], once the controlling agent has 453 nominated a candidate pair for a data stream, the agent MUST NOT 454 nominate another pair for that data stream during the lifetime of the 455 ICE session (i.e. until ICE is restarted). 457 3.4. Subsequent Offer/Answer Exchanges 459 Either agent MAY generate a subsequent offer at any time allowed by 460 [RFC3264]. This section defines rules for construction of subsequent 461 offers and answers. 463 Should a subsequent offer fail, ICE processing continues as if the 464 subsequent offer had never been made. 466 3.4.1. Sending Subsequent Offer 468 3.4.1.1. Procedures for All Implementations 470 3.4.1.1.1. ICE Restarts 472 An agent MAY restart ICE processing for an existing data stream 473 [RFC8445]. 475 The rules governing the ICE restart imply that setting the connection 476 address in the "c=" line to 0.0.0.0 (for IPv4)/ :: (for IPv6) will 477 cause an ICE restart. Consequently, ICE implementations MUST NOT 478 utilize this mechanism for call hold, and instead MUST use 479 "a=inactive" and "a=sendonly" as described in [RFC3264]. 481 To restart ICE, an agent MUST change both the ice-pwd and the ice- 482 ufrag for the data stream in an offer. However, it is permissible to 483 use a session-level attribute in one offer, but to provide the same 484 ice-pwd or ice-ufrag as a media-level attribute in a subsequent 485 offer. This MUST NOT be considered as ICE restart. 487 An agent sets the rest of the ICE-related fields in the SDP for this 488 data stream as it would in an initial offer of this data stream (see 489 Section 3.2.1). Consequently, the set of candidates MAY include 490 some, none, or all of the previous candidates for that data stream 491 and MAY include a totally new set of candidates. 493 3.4.1.1.2. Removing a Data Stream 495 If an agent removes a data stream by setting its port to zero, it 496 MUST NOT include any candidate attributes for that data stream and 497 SHOULD NOT include any other ICE-related attributes defined in 498 Section 4 for that data stream. 500 3.4.1.1.3. Adding a Data Stream 502 If an agent wishes to add a new data stream, it sets the fields in 503 the SDP for this data stream as if this were an initial offer for 504 that data stream (see Section 3.2.1). This will cause ICE processing 505 to begin for this data stream. 507 3.4.1.2. Procedures for Full Implementations 509 This section describes additional procedures for full 510 implementations, covering existing data streams. 512 3.4.1.2.1. Before Nomination 514 When an offerer sends a subsequent offer; in each "m=" section for 515 which a candidate pair has not yet been nominated, the offer MUST 516 include the same set of ICE-related information that the offerer 517 included in the previous offer or answer. The agent MAY include 518 additional candidates it did not offer previously, but which it has 519 gathered since the last offer/answer exchange, including peer 520 reflexive candidates. 522 The agent MAY change the default destination for media. As with 523 initial offers, there MUST be a set of candidate attributes in the 524 offer matching this default destination. 526 3.4.1.2.2. After Nomination 528 Once a candidate pair has been nominated for a data stream, the 529 connection address, port and transport protocol in each "c=" and "m=" 530 line associated with that data stream MUST match the data associated 531 with the nominated pair for that data stream. In addition, the 532 offerer only includes SDP candidates representing the local 533 candidates of the nominated candidate pair. The offerer MUST NOT 534 include any other SDP candidate attributes in the subsequent offer. 536 In addition, if the agent is controlling, it MUST include the 537 "a=remote-candidates" attribute for each data stream whose check list 538 is in the completed state. The attribute contains the remote 539 candidates corresponding to the nominated pair in the valid list for 540 each component of that data stream. It is needed to avoid a race 541 condition whereby the controlling agent chooses its pairs, but the 542 updated offer beats the connectivity checks to the controlled agent, 543 which doesn't even know these pairs are valid, let alone selected. 544 See Appendix B for elaboration on this race condition. 546 3.4.1.3. Procedures for Lite Implementations 548 If the ICE state is "running", a lite implementation MUST include all 549 of its candidates for each component of each data stream in 550 "a=candidate" attributes in any subsequent offer. The candidates are 551 formed identically to the procedures for initial offers. 553 A lite implementation MUST NOT add additional host candidates in a 554 subsequent offer. If an agent needs to offer additional candidates, 555 it MUST restart ICE. Similarly, the username fragments and passwords 556 MUST remain the same as used previously. If an agent needs to change 557 one of these, it MUST restart ICE for that data stream. 559 If ICE has completed for a data stream and if the agent is 560 controlled, the default destination for that data stream MUST be set 561 to the remote candidate of the candidate pair for that component in 562 the valid list. For a lite implementation, there is always just a 563 single candidate pair in the valid list for each component of a data 564 stream. Additionally, the agent MUST include a candidate attribute 565 for each default destination. 567 If ICE state is completed and if the agent is controlling (which only 568 happens when both agents are lite), the agent MUST include the 569 "a=remote-candidates" attribute for each data stream. The attribute 570 contains the remote candidates from the candidate pairs in the valid 571 list (one pair for each component of each data stream). 573 3.4.2. Sending Subsequent Answer 575 If ICE is Completed for a data stream, and the offer for that data 576 stream lacked the "a=remote-candidates" attribute, the rules for 577 construction of the answer are identical to those for the offerer, 578 except that the answerer MUST NOT include the "a=remote-candidates" 579 attribute in the answer. 581 A controlled agent will receive an offer with the "a=remote- 582 candidates" attribute for a data stream when its peer has concluded 583 ICE processing for that data stream. This attribute is present in 584 the offer to deal with a race condition between the receipt of the 585 offer, and the receipt of the Binding Response that tells the 586 answerer the candidate that will be selected by ICE. See Appendix B 587 for an explanation of this race condition. Consequently, processing 588 of an offer with this attribute depends on the winner of the race. 590 The agent forms a candidate pair for each component of the data 591 stream by: 593 o Setting the remote candidate equal to the offerer's default 594 destination for that component (i.e. the contents of the "m=" and 595 "c=" lines for RTP, and the "a=rtcp" attribute for RTCP) 597 o Setting the local candidate equal to the transport address for 598 that same component in the "a=remote-candidates" attribute in the 599 offer. 601 The agent then sees if each of these candidate pairs is present in 602 the valid list. If a particular pair is not in the valid list, the 603 check has "lost" the race. Call such a pair a "losing pair". 605 The agent finds all the pairs in the check list whose remote 606 candidates equal the remote candidate in the losing pair: 608 o If none of the pairs are In-Progress, and at least one is Failed, 609 it is most likely that a network failure, such as a network 610 partition or serious packet loss, has occurred. The agent SHOULD 611 generate an answer for this data stream as if the remote- 612 candidates attribute had not been present, and then restart ICE 613 for this stream. 615 o If at least one of the pairs is In-Progress, the agent SHOULD wait 616 for those checks to complete, and as each completes, redo the 617 processing in this section until there are no losing pairs. 619 Once there are no losing pairs, the agent can generate the answer. 620 It MUST set the default destination for media to the candidates in 621 the remote-candidates attribute from the offer (each of which will 622 now be the local candidate of a candidate pair in the valid list). 623 It MUST include a candidate attribute in the answer for each 624 candidate in the remote-candidates attribute in the offer. 626 3.4.2.1. ICE Restart 628 If the offerer in a subsequent offer requested an ICE restart for a 629 data stream, and if the answerer accepts the offer, the answerer 630 follows the procedures for generating an initial answer. 632 For a given data stream, the answerer MAY include the same candidates 633 that were used in the previous ICE session, but it MUST change the 634 SDP ice-pwd and ice-ufrag attribute values. 636 3.4.2.2. Lite Implementation specific procedures 638 If the received offer contains the remote-candidates attribute for a 639 data stream, the agent forms a candidate pair for each component of 640 the data stream by: 642 o Setting the remote candidate equal to the offerer's default 643 destination for that component (i.e., the contents of the "m=" and 644 "c=" lines for RTP, and the "a=rtcp" attribute for RTCP). 646 o Setting the local candidate equal to the transport address for 647 that same component in the "a=remote-candidates" attribute in the 648 offer. 650 The state of ICE processing for that data stream is set to Completed. 652 Furthermore, if the agent believed it was controlling, but the offer 653 contained the "a=remote-candidates" attribute, both agents believe 654 they are controlling. In this case, both would have sent updated 655 offers around the same time. 657 However, the signaling protocol carrying the offer/answer exchanges 658 will have resolved this glare condition, so that one agent is always 659 the 'winner' by having its offer received before its peer has sent an 660 offer. The winner takes the role of controlling, so that the loser 661 (the answerer under consideration in this section) MUST change its 662 role to controlled. 664 Consequently, if the agent was going to send an updated offer since, 665 based on the rules in section 8.2 of [RFC8445], it was controlling, 666 it no longer needs to. 668 Besides the potential role change, change in the Valid list, and 669 state changes, the construction of the answer is performed 670 identically to the construction of an offer. 672 3.4.3. Receiving Answer for a Subsequent Offer 674 3.4.3.1. Procedures for Full Implementations 676 There may be certain situations where the offerer receives an SDP 677 answer that lacks ICE candidates although the initial answer included 678 them. One example of such an "unexpected" answer might be happen 679 when an ICE-unaware Back-to-Back User Agent (B2BUA) introduces a 680 media server during call hold using 3rd party call-control procedures 681 [RFC3725]. Omitting further details how this is done, this could 682 result in an answer being received at the holding UA that was 683 constructed by the B2BUA. With the B2BUA being ICE-unaware, that 684 answer would not include ICE candidates. 686 Receiving an answer without ICE attributes in this situation might be 687 unexpected, but would not necessarily impair the user experience. 689 When the offerer receives an answer indicating support for ICE, the 690 offer performs one of the following actions: 692 o If the offer was a restart, the agent MUST perform ICE restart 693 procedures as specified in Section 3.4.3.1.1 695 o If the offer/answer exchange removed a data stream, or an answer 696 rejected an offered data stream, an agent MUST flush the Valid 697 list for that data stream. It MUST also terminate any STUN 698 transactions in progress for that data stream. 700 o If the offer/answer exchange added a new data stream, the agent 701 MUST create a new check list for it (and an empty Valid list to 702 start of course) which in turn triggers the candidate processing 703 procedures [RFC8445]. 705 o If ICE state is running for a given data stream, the agent 706 recomputes the check list. If a pair on the new check list was 707 also on the previous check list, its state is copied over. 708 Otherwise, its state is set to Frozen. If none of the check lists 709 are active (meaning that the pairs in each check list are Frozen), 710 appropriate procedures in [RFC8445] are performed to move 711 candidate(s) to the Waiting state to further continue ICE 712 processing. 714 o If ICE state is completed and the SDP answer conforms to 715 Section 3.4.2, the agent MUST remain in the ICE completed state. 717 However, if the ICE support is no longer indicated in the SDP answer, 718 the agent MUST fall-back to [RFC3264] procedures and SHOULD NOT drop 719 the dialog because of the missing ICE support or unexpected answer. 720 Once the agent sends a new offer later on, it MUST perform an ICE 721 restart. 723 3.4.3.1.1. ICE Restarts 725 The agent MUST remember the nominated pair in the Valid list for each 726 component of the data stream, called the "previous selected pair", 727 prior to the restart. The agent will continue to send media using 728 this pair, as described in section 12 of [RFC8445]. Once these 729 destinations are noted, the agent MUST flush the valid and check 730 lists, and then recompute the check list and its states, thus 731 triggering the candidate processing procedures [RFC8445] 733 3.4.3.2. Procedures for Lite Implementations 735 If ICE is restarting for a data stream, the agent MUST start a new 736 Valid list for that data stream. It MUST remember the nominated pair 737 in the previous Valid list for each component of the data stream, 738 called the "previous selected pairs", and continue to send media 739 there as described in section 12 of [RFC8445]. The state of ICE 740 processing for each data stream MUST change to Running, and the state 741 of ICE processing MUST change to Running 743 4. Grammar 745 This specification defines eight new SDP attributes -- the 746 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 747 ufrag", "ice-pwd", "ice-pacing", and "ice-options" attributes. 749 This section also provides non-normative examples of the attributes 750 defined. 752 The syntax for the attributes follow Augmented BNF as defined in 753 [RFC5234]. 755 4.1. "candidate" Attribute 757 The candidate attribute is a media-level attribute only. It contains 758 a transport address for a candidate that can be used for connectivity 759 checks. 761 candidate-attribute = "candidate" ":" foundation SP component-id SP 762 transport SP 763 priority SP 764 connection-address SP ;from RFC 4566 765 port ;port from RFC 4566 766 SP cand-type 767 [SP rel-addr] 768 [SP rel-port] 769 *(SP extension-att-name SP 770 extension-att-value) 772 foundation = 1*32ice-char 773 component-id = 1*5DIGIT 774 transport = "UDP" / transport-extension 775 transport-extension = token ; from RFC 3261 776 priority = 1*10DIGIT 777 cand-type = "typ" SP candidate-types 778 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 779 rel-addr = "raddr" SP connection-address 780 rel-port = "rport" SP port 781 extension-att-name = token 782 extension-att-value = *VCHAR 783 ice-char = ALPHA / DIGIT / "+" / "/" 785 This grammar encodes the primary information about a candidate: its 786 IP address, port and transport protocol, and its properties: the 787 foundation, component ID, priority, type, and related transport 788 address: 790 : is taken from RFC 4566 [RFC4566]. It is the 791 IP address of the candidate, allowing for IPv4 addresses, IPv6 792 addresses, and fully qualified domain names (FQDNs). When parsing 793 this field, an agent can differentiate an IPv4 address and an IPv6 794 address by presence of a colon in its value - the presence of a 795 colon indicates IPv6. An agent generating local candidates MUST 796 NOT use FQDN addresses. An agent processing remote candidates 797 MUST ignore candidate lines that include candidates with FQDN or 798 IP address versions that are not supported or recognized. The 799 procedures for generation and handling of FQDN candidates, as well 800 as, how agents indicate support for such procedures, need to be 801 specified in an extension specification. 803 : is also taken from RFC 4566 [RFC4566]. It is the port of 804 the candidate. 806 : indicates the transport protocol for the candidate. 807 This specification only defines UDP. However, extensibility is 808 provided to allow for future transport protocols to be used with 809 ICE by extending the sub-registry "ICE Transport Protocols" under 810 "Interactive Connectivity Establishment (ICE)" registry. 812 : is composed of 1 to 32 s. It is an 813 identifier that is equivalent for two candidates that are of the 814 same type, share the same base, and come from the same STUN 815 server. The foundation is used to optimize ICE performance in the 816 Frozen algorithm as described in [RFC8445] 818 : is a positive integer between 1 and 256 (inclusive) 819 that identifies the specific component of the data stream for 820 which this is a candidate. It MUST start at 1 and MUST increment 821 by 1 for each component of a particular candidate. For data 822 streams based on RTP, candidates for the actual RTP media MUST 823 have a component ID of 1, and candidates for RTCP MUST have a 824 component ID of 2. See section 13 in [RFC8445] for additional 825 discussion on extending ICE to new data streams. 827 : is a positive integer between 1 and (2**31 - 1) 828 inclusive. The procedures for computing candidate's priority is 829 described in section 5.1.2 of [RFC8445]. 831 : encodes the type of candidate. This specification 832 defines the values "host", "srflx", "prflx", and "relay" for host, 833 server reflexive, peer reflexive, and relayed candidates, 834 respectively. Specifications for new candidate types MUST define 835 how, if at all, various steps in the ICE processing differ from 836 the ones defined by this specification. 838 and : convey transport addresses related to the 839 candidate, useful for diagnostics and other purposes. 840 and MUST be present for server reflexive, peer 841 reflexive, and relayed candidates. If a candidate is server or 842 peer reflexive, and are equal to the base 843 for that server or peer reflexive candidate. If the candidate is 844 relayed, and are equal to the mapped address 845 in the Allocate response that provided the client with that 846 relayed candidate (see Appendix B.3 of [RFC8445] for a discussion 847 of its purpose). If the candidate is a host candidate, 848 and MUST be omitted. 850 In some cases, e.g., for privacy reasons, an agent may not want to 851 reveal the related address and port. In this case the address 852 MUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 853 candidates) and the port to zero. 855 The candidate attribute can itself be extended. The grammar allows 856 for new name/value pairs to be added at the end of the attribute. 857 Such extensions MUST be made through IETF Review or IESG Approval 858 [RFC8126] and the assignments MUST contain the specific extension and 859 a reference to the document defining the usage of the extension. 861 An implementation MUST ignore any name/value pairs it doesn't 862 understand. 864 Example: SDP line for UDP server reflexive candidate attribute for 865 the RTP component 867 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 868 203.0.113.141 rport 8998 870 4.2. "remote-candidates" Attribute 872 The syntax of the "remote-candidates" attribute is defined using 873 Augmented BNF as defined in [RFC5234]. The remote-candidates 874 attribute is a media-level attribute only. 876 remote-candidate-att = "remote-candidates:" remote-candidate 877 0*(SP remote-candidate) 878 remote-candidate = component-ID SP connection-address SP port 880 The attribute contains a connection-address and port for each 881 component. The ordering of components is irrelevant. However, a 882 value MUST be present for each component of a data stream. This 883 attribute MUST be included in an offer by a controlling agent for a 884 data stream that is Completed, and MUST NOT be included in any other 885 case. 887 Example: Remote candidates SDP lines for the RTP and RTCP components: 889 a=remote-candidates:1 192.0.2.3 45664 890 a=remote-candidates:2 192.0.2.3 45665 892 4.3. "ice-lite" and "ice-mismatch" Attributes 894 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 895 which are flags, is: 897 ice-lite = "ice-lite" 898 ice-mismatch = "ice-mismatch" 900 "ice-lite" is a session-level attribute only, and indicates that an 901 agent is a lite implementation. "ice-mismatch" is a media-level 902 attribute and only reported in the answer. It indicates that the 903 offer arrived with a default destination for a media component that 904 didn't have a corresponding candidate attribute. Inclusion of 905 "a=ice-mismatch" attribute for a given data stream implies that even 906 though both agents support ICE, ICE procedures MUST NOT be used for 907 this data stream and [RFC3264] procedures MUST be used instead. 909 4.4. "ice-ufrag" and "ice-pwd" Attributes 911 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 912 and password used by ICE for message integrity. Their syntax is: 914 ice-pwd-att = "ice-pwd:" password 915 ice-ufrag-att = "ice-ufrag:" ufrag 916 password = 22*256ice-char 917 ufrag = 4*256ice-char 919 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 920 session-level or media-level. When present in both, the value in the 921 media-level takes precedence. Thus, the value at the session-level 922 is effectively a default that applies to all data streams, unless 923 overridden by a media-level value. Whether present at the session or 924 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 925 each data stream. If two data streams have identical ice-ufrag's, 926 they MUST have identical ice-pwd's. 928 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 929 beginning of a session (the same applies when ICE is restarting for 930 an agent). 932 [RFC8445] requires the ice-ufrag attribute to contain at least 24 933 bits of randomness, and the ice-pwd attribute to contain at least 128 934 bits of randomness. This means that the ice-ufrag attribute will be 935 at least 4 characters long, and the ice-pwd at least 22 characters 936 long, since the grammar for these attributes allows for 6 bits of 937 information per character. The attributes MAY be longer than 4 and 938 22 characters, respectively, of course, up to 256 characters. The 939 upper limit allows for buffer sizing in implementations. Its large 940 upper limit allows for increased amounts of randomness to be added 941 over time. For compatibility with the 512 character limitation for 942 the STUN username attribute value and for bandwidth conservation 943 considerations, the ice-ufrag attribute MUST NOT be longer than 32 944 characters when sending, but an implementation MUST accept up to 256 945 characters when receiving. 947 Example shows sample ice-ufrag and ice-pwd SDP lines: 949 a=ice-pwd:asd88fgpdd777uzjYhagZg 950 a=ice-ufrag:8hhY 952 4.5. "ice-pacing" Attribute 954 The "ice-pacing" is a session level attribute that indicates the 955 desired connectivity check pacing, in milliseconds, for this agent 956 (see section 14 of [RFC8445]). The syntax is: 958 ice-pacing-att = "ice-pacing:" pacing-value 959 pacing-value = 1*10DIGIT 961 Following the procedures defined in [RFC8445], a default value of 962 50ms is used for an agent when the ice-pacing attribute is omitted in 963 the offer or the answer. 965 The same rule applies for ice-pacing attribute values lower than 966 50ms. This mandates that, if an agent includes the ice-pacing 967 attribute, its value MUST be greater than 50ms or else a value of 968 50ms is considered by default for that agent. 970 Also the larger of the ice-pacing attribute values between the offer 971 and the answer (determined either by the one provided in the ice- 972 pacing attribute or by picking the default value) MUST be considered 973 for a given ICE session. 975 4.6. "ice-options" Attribute 977 The "ice-options" attribute is a session- and media-level attribute. 978 It contains a series of tokens that identify the options supported by 979 the agent. Its grammar is: 981 ice-options = "ice-options:" ice-option-tag 982 0*(SP ice-option-tag) 983 ice-option-tag = 1*ice-char 985 The existence of an ice-option in an offer indicates that a certain 986 extension is supported by the agent and it is willing to use it, if 987 the peer agent also includes the same extension in the answer. There 988 might be further extension specific negotiation needed between the 989 agents that determine how the extension gets used in a given session. 990 The details of the negotiation procedures, if present, MUST be 991 defined by the specification defining the extension (see 992 Section 9.2). 994 Example shows 'rtp+ecn' ice-option SDP line from [RFC6679]: 996 a=ice-options:rtp+ecn 998 5. Keepalives 1000 All the ICE agents MUST follow the procedures defined in section 11 1001 of [RFC8445] for sending keepalives. The keepalives MUST be sent 1002 regardless of whether the data stream is currently inactive, 1003 sendonly, recvonly, or sendrecv, and regardless of the presence or 1004 value of the bandwidth attribute. An agent can determine that its 1005 peer supports ICE by the presence of "a=candidate" attributes for 1006 each media session. 1008 6. SIP Considerations 1010 Note that ICE is not intended for NAT traversal for SIP, which is 1011 assumed to be provided via another mechanism [RFC5626]. 1013 When ICE is used with SIP, forking may result in a single offer 1014 generating a multiplicity of answers. In that case, ICE proceeds 1015 completely in parallel and independently for each answer, treating 1016 the combination of its offer and each answer as an independent offer/ 1017 answer exchange, with its own set of local candidates, pairs, check 1018 lists, states, and so on. 1020 Once ICE processing has reached the Completed state for all peers for 1021 media streams using those candidates, the agent SHOULD wait an 1022 additional three seconds, and then it MAY cease responding to checks 1023 or generating triggered checks on that candidate. It MAY free the 1024 candidate at that time. Freeing of server reflexive candidates is 1025 never explicit; it happens by lack of a keepalive. The three-second 1026 delay handles cases when aggressive nomination is used, and the 1027 selected pairs can quickly change after ICE has completed. 1029 6.1. Latency Guidelines 1031 ICE requires a series of STUN-based connectivity checks to take place 1032 between endpoints. These checks start from the answerer on 1033 generation of its answer, and start from the offerer when it receives 1034 the answer. These checks can take time to complete, and as such, the 1035 selection of messages to use with offers and answers can affect 1036 perceived user latency. Two latency figures are of particular 1037 interest. These are the post-pickup delay and the post-dial delay. 1038 The post-pickup delay refers to the time between when a user "answers 1039 the phone" and when any speech they utter can be delivered to the 1040 caller. The post-dial delay refers to the time between when a user 1041 enters the destination address for the user and ringback begins as a 1042 consequence of having successfully started alerting the called user 1043 agent. 1045 Two cases can be considered -- one where the offer is present in the 1046 initial INVITE and one where it is in a response. 1048 6.1.1. Offer in INVITE 1050 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1051 gathering candidates prior to actually sending its initial INVITE, so 1052 that the candidates can be provided in the INVITE. This can be 1053 started upon user interface cues that a call is pending, such as 1054 activity on a keypad or the phone going off-hook. 1056 On the receipt of the offer, the answerer SHOULD generate an answer 1057 in a provisional response as soon as it has completed gathering the 1058 candidates. ICE requires that a provisional response with an SDP be 1059 transmitted reliably. This can be done through the existing 1060 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1061 through an ICE specific optimization, wherein, the agent retransmits 1062 the provisional response with the exponential backoff timers 1063 described in [RFC3262]. Such retransmissions MUST cease on receipt 1064 of a STUN Binding request with transport address matching candidate 1065 address for one of the data streams signaled in that SDP or on 1066 transmission of the answer in a 2xx response. If no Binding request 1067 is received prior to the last retransmit, the agent does not consider 1068 the session terminated. For the ICE lite peers, the agent MUST cease 1069 retransmitting the 18x after sending it four times since there will 1070 be no Binding request sent and the number four is arbitrarily chosen 1071 to limit the number of 18x retransmits (poor man's version of 1072 [RFC3262] basically). (ICE will actually work even if the peer never 1073 receives the 18x; however, experience has shown that sending it is 1074 important for middleboxes and firewall traversal). 1076 Once the answer has been sent, the agent SHOULD begin its 1077 connectivity checks. Once candidate pairs for each component of a 1078 data stream enter the valid list, the answerer can begin sending 1079 media on that data stream. 1081 However, prior to this point, any media that needs to be sent towards 1082 the caller (such as SIP early media [RFC3960]) MUST NOT be 1083 transmitted. For this reason, implementations SHOULD delay alerting 1084 the called party until candidates for each component of each data 1085 stream have entered the valid list. In the case of a PSTN gateway, 1086 this would mean that the setup message into the PSTN is delayed until 1087 this point. Doing this increases the post-dial delay, but has the 1088 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1089 called party hears the phone ring, picks up, but hears nothing and 1090 cannot be heard. This technique works without requiring support for, 1091 or usage of, preconditions [RFC3312]. It also has the benefit of 1092 guaranteeing that not a single packet of media will get clipped, so 1093 that post-pickup delay is zero. If an agent chooses to delay local 1094 alerting in this way, it SHOULD generate a 180 response once alerting 1095 begins. 1097 6.1.2. Offer in Response 1099 In addition to uses where the offer is in an INVITE, and the answer 1100 is in the provisional and/or 200 OK response, ICE works with cases 1101 where the offer appears in the response. In such cases, which are 1102 common in third party call control [RFC3725], ICE agents SHOULD 1103 generate their offers in a reliable provisional response (which MUST 1104 utilize [RFC3262]), and not alert the user on receipt of the INVITE. 1105 The answer will arrive in a PRACK. This allows for ICE processing to 1106 take place prior to alerting, so that there is no post-pickup delay, 1107 at the expense of increased call setup delays. Once ICE completes, 1108 the callee can alert the user and then generate a 200 OK when they 1109 answer. The 200 OK would contain no SDP, since the offer/answer 1110 exchange has completed. 1112 Alternatively, agents MAY place the offer in a 2xx instead (in which 1113 case the answer comes in the ACK). When this happens, the callee 1114 will alert the user on receipt of the INVITE, and the ICE exchanges 1115 will take place only after the user answers. This has the effect of 1116 reducing call setup delay, but can cause substantial post-pickup 1117 delays and media clipping. 1119 6.2. SIP Option Tags and Media Feature Tags 1121 [RFC5768] specifies a SIP option tag and media feature tag for usage 1122 with ICE. ICE implementations using SIP SHOULD support this 1123 specification, which uses a feature tag in registrations to 1124 facilitate interoperability through signaling intermediaries. 1126 6.3. Interactions with Forking 1128 ICE interacts very well with forking. Indeed, ICE fixes some of the 1129 problems associated with forking. Without ICE, when a call forks and 1130 the caller receives multiple incoming data streams, it cannot 1131 determine which data stream corresponds to which callee. 1133 With ICE, this problem is resolved. The connectivity checks which 1134 occur prior to transmission of media carry username fragments, which 1135 in turn are correlated to a specific callee. Subsequent media 1136 packets that arrive on the same candidate pair as the connectivity 1137 check will be associated with that same callee. Thus, the caller can 1138 perform this correlation as long as it has received an answer. 1140 6.4. Interactions with Preconditions 1142 Quality of Service (QoS) preconditions, which are defined in 1143 [RFC3312] and [RFC4032], apply only to the transport addresses listed 1144 as the default targets for media in an offer/answer. If ICE changes 1145 the transport address where media is received, this change is 1146 reflected in an updated offer that changes the default destination 1147 for media to match ICE's selection. As such, it appears like any 1148 other re-INVITE would, and is fully treated in RFCs 3312 and 4032, 1149 which apply without regard to the fact that the destination for media 1150 is changing due to ICE negotiations occurring "in the background". 1152 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1153 met until the checks have completed and selected the candidate pairs 1154 to be used for media. 1156 ICE also has (purposeful) interactions with connectivity 1157 preconditions [RFC5898]. Those interactions are described there. 1158 Note that the procedures described in Section 6.1 describe their own 1159 type of "preconditions", albeit with less functionality than those 1160 provided by the explicit preconditions in [RFC5898]. 1162 6.5. Interactions with Third Party Call Control 1164 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1165 I works without the controller supporting or being aware of ICE. 1166 Flow IV will work as long as the controller passes along the ICE 1167 attributes without alteration. Flow II is fundamentally incompatible 1168 with ICE; each agent will believe itself to be the answerer and thus 1169 never generate a re-INVITE. 1171 The flows for continued operation, as described in Section 7 of 1172 [RFC3725], require additional behavior of ICE implementations to 1173 support. In particular, if an agent receives a mid-dialog re-INVITE 1174 that contains no offer, it MUST restart ICE for each data stream and 1175 go through the process of gathering new candidates. Furthermore, 1176 that list of candidates SHOULD include the ones currently being used 1177 for media. 1179 7. Relationship with ANAT 1181 [RFC4091], the Alternative Network Address Types (ANAT) Semantics for 1182 the SDP grouping framework, and [RFC4092], its usage with SIP, define 1183 a mechanism for indicating that an agent can support both IPv4 and 1184 IPv6 for a data stream, and it does so by including two "m=" lines, 1185 one for v4 and one for v6. This is similar to ICE, which allows for 1186 an agent to indicate multiple transport addresses using the candidate 1187 attribute. However, ANAT relies on static selection to pick between 1188 choices, rather than a dynamic connectivity check used by ICE. 1190 It is RECOMMENDED that ICE be used in realizing the dual-stack use- 1191 cases in agents that support ICE. 1193 8. Security Considerations 1195 8.1. Attacks on the Offer/Answer Exchanges 1197 An attacker that can modify or disrupt the offer/answer exchanges 1198 themselves can readily launch a variety of attacks with ICE. They 1199 could direct media to a target of a DoS attack, they could insert 1200 themselves into the data stream, and so on. These are similar to the 1201 general security considerations for offer/answer exchanges, and the 1202 security considerations in [RFC3264] apply. These require techniques 1203 for message integrity and encryption for offers and answers, which 1204 are satisfied by the TLS mechanism [RFC3261] when SIP is used. As 1205 such, the usage of TLS with ICE is RECOMMENDED. 1207 8.2. Insider Attacks 1209 In addition to attacks where the attacker is a third party trying to 1210 insert fake offers, answers, or STUN messages, there are several 1211 attacks possible with ICE when the attacker is an authenticated and 1212 valid participant in the ICE exchange. 1214 8.2.1. The Voice Hammer Attack 1216 The voice hammer attack is an amplification attack. In this attack, 1217 the attacker initiates sessions to other agents, and maliciously 1218 includes the connection address and port of a DoS target as the 1219 destination for media traffic signaled in the SDP. This causes 1220 substantial amplification; a single offer/answer exchange can create 1221 a continuing flood of media packets, possibly at high rates (consider 1222 video sources). This attack is not specific to ICE, but ICE can help 1223 provide remediation. 1225 Specifically, if ICE is used, the agent receiving the malicious SDP 1226 will first perform connectivity checks to the target of media before 1227 sending media there. If this target is a third-party host, the 1228 checks will not succeed, and media is never sent. 1230 Unfortunately, ICE doesn't help if it's not used, in which case an 1231 attacker could simply send the offer without the ICE parameters. 1232 However, in environments where the set of clients is known, and is 1233 limited to ones that support ICE, the server can reject any offers or 1234 answers that don't indicate ICE support. 1236 SIP User Agents (UA) [RFC3261] that are not willing to receive non- 1237 ICE answers MUST include an "ice" Option Tag [RFC5768] in the SIP 1238 Require Header Field in their offer. UAs that reject non-ICE offers 1239 will generally use a 421 response code, together with an Option Tag 1240 "ice" in the Require Header Field in the response. 1242 8.2.2. Interactions with Application Layer Gateways and SIP 1244 Application Layer Gateways (ALGs) are functions present in a Network 1245 Address Translation (NAT) device that inspect the contents of packets 1246 and modify them, in order to facilitate NAT traversal for application 1247 protocols. Session Border Controllers (SBCs) are close cousins of 1248 ALGs, but are less transparent since they actually exist as 1249 application-layer SIP intermediaries. ICE has interactions with SBCs 1250 and ALGs. 1252 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1253 long as the ALG correctly modifies the SDP. A correct ALG 1254 implementation behaves as follows: 1256 o The ALG does not modify the "m=" and "c=" lines or the rtcp 1257 attribute if they contain external addresses. 1259 o If the "m=" and "c=" lines contain internal addresses, the 1260 modification depends on the state of the ALG: 1262 * If the ALG already has a binding established that maps an 1263 external port to an internal connection address and port 1264 matching the values in the "m=" and "c=" lines or rtcp 1265 attribute, the ALG uses that binding instead of creating a new 1266 one. 1268 * If the ALG does not already have a binding, it creates a new 1269 one and modifies the SDP, rewriting the "m=" and "c=" lines and 1270 rtcp attribute. 1272 Unfortunately, many ALGs are known to work poorly in these corner 1273 cases. ICE does not try to work around broken ALGs, as this is 1274 outside the scope of its functionality. ICE can help diagnose these 1275 conditions, which often show up as a mismatch between the set of 1276 candidates and the "m=" and "c=" lines and rtcp attributes. The ice- 1277 mismatch attribute is used for this purpose. 1279 ICE works best through ALGs when the signaling is run over TLS. This 1280 prevents the ALG from manipulating the SDP messages and interfering 1281 with ICE operation. Implementations that are expected to be deployed 1282 behind ALGs SHOULD provide for TLS transport of the SDP. 1284 If an SBC is SIP aware but not ICE aware, the result depends on the 1285 behavior of the SBC. If it is acting as a proper Back-to-Back User 1286 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1287 understand, including the ICE attributes. Consequently, the call 1288 will appear to both endpoints as if the other side doesn't support 1289 ICE. This will result in ICE being disabled, and media flowing 1290 through the SBC, if the SBC has requested it. If, however, the SBC 1291 passes the ICE attributes without modification, yet modifies the 1292 default destination for media (contained in the "m=" and "c=" lines 1293 and rtcp attribute), this will be detected as an ICE mismatch, and 1294 ICE processing is aborted for the call. It is outside of the scope 1295 of ICE for it to act as a tool for "working around" SBCs. If one is 1296 present, ICE will not be used and the SBC techniques take precedence. 1298 9. IANA Considerations 1300 9.1. SDP Attributes 1302 The original ICE specification defined seven new SDP attributes per 1303 the procedures of Section 8.2.4 of [RFC4566]. The registration 1304 information from the original specification is included here with 1305 modifications to include Mux Category and also defines a new SDP 1306 attribute 'ice-pacing'. 1308 9.1.1. candidate Attribute 1310 Attribute Name: candidate 1312 Type of Attribute: media-level 1314 Subject to charset: No 1316 Purpose: This attribute is used with Interactive Connectivity 1317 Establishment (ICE), and provides one of many possible candidate 1318 addresses for communication. These addresses are validated with 1319 an end-to-end connectivity check using Session Traversal Utilities 1320 for NAT (STUN). 1322 Appropriate Values: See Section 4 of RFC XXXX. 1324 Contact Name: IESG 1326 Contact Email: esg@ietf.org 1328 Reference: RFCXXXX 1330 Mux Category: TRANSPORT 1332 9.1.2. remote-candidates Attribute 1334 Attribute Name: remote-candidates 1336 Type of Attribute: media-level 1338 Subject to charset: No 1340 Purpose: This attribute is used with Interactive Connectivity 1341 Establishment (ICE), and provides the identity of the remote 1342 candidates that the offerer wishes the answerer to use in its 1343 answer. 1345 Appropriate Values: See Section 4 of RFC XXXX. 1347 Contact Name: IESG 1349 Contact Email: iesg@ietf.org 1351 Reference: RFCXXXX 1353 Mux Category: TRANSPORT 1355 9.1.3. ice-lite Attribute 1357 Attribute Name: ice-lite 1359 Type of Attribute: session-level 1361 Subject to charset: No 1363 Purpose: This attribute is used with Interactive Connectivity 1364 Establishment (ICE), and indicates that an agent has the minimum 1365 functionality required to support ICE inter-operation with a peer 1366 that has a full implementation. 1368 Appropriate Values: See Section 4 of RFC XXXX. 1370 Contact Name: IESG 1371 Contact Email: iesg@ietf.org 1373 Reference: RFCXXXX 1375 Mux Category: NORMAL 1377 9.1.4. ice-mismatch Attribute 1379 Attribute Name: ice-mismatch 1381 Type of Attribute: media-level 1383 Subject to charset: No 1385 Purpose: This attribute is used with Interactive Connectivity 1386 Establishment (ICE), and indicates that an agent is ICE capable, 1387 but did not proceed with ICE due to a mismatch of candidates with 1388 the default destination for media signaled in the SDP. 1390 Appropriate Values: See Section 4 of RFC XXXX. 1392 Contact Name: IESG 1394 Contact e-mail: iesg@ietf.org 1396 Reference: RFCXXXX 1398 Mux Category: NORMAL 1400 9.1.5. ice-pwd Attribute 1402 Attribute Name: ice-pwd 1404 Type of Attribute: session- or media-level 1406 Subject to charset: No 1408 Purpose: This attribute is used with Interactive Connectivity 1409 Establishment (ICE), and provides the password used to protect 1410 STUN connectivity checks. 1412 Appropriate Values: See Section 4 of RFC XXXX. 1414 Contact Name: IESG 1416 Contact e-mail: iesg@ietf.org 1418 Reference: RFCXXXX 1419 Mux Category: TRANSPORT 1421 9.1.6. ice-ufrag Attribute 1423 Attribute Name: ice-ufrag 1425 Type of Attribute: session- or media-level 1427 Subject to charset: No 1429 Purpose: This attribute is used with Interactive Connectivity 1430 Establishment (ICE), and provides the fragments used to construct 1431 the username in STUN connectivity checks. 1433 Appropriate Values: See Section 4 of RFC XXXX. 1435 Contact Name: IESG 1437 Contact e-mail: iesg@ietf.org 1439 Reference: RFCXXXX 1441 Mux Category: TRANSPORT 1443 9.1.7. ice-options Attribute 1445 Attribute Name: ice-options 1447 Long Form: ice-options 1449 Type of Attribute: session-level 1451 Subject to charset: No 1453 Purpose: This attribute is used with Interactive Connectivity 1454 Establishment (ICE), and indicates the ICE options or extensions 1455 used by the agent. 1457 Appropriate Values: See Section 4 of RFC XXXX. 1459 Contact Name: IESG 1461 Contact e-mail: iesg@ietf.org 1463 Reference: RFCXXXX 1465 Mux Category: NORMAL 1467 9.1.8. ice-pacing Attribute 1469 This specification also defines a new SDP attribute, "ice-pacing" 1470 according to the following data: 1472 Attribute Name: ice-pacing 1474 Type of Attribute: session-level 1476 Subject to charset: No 1478 Purpose: This attribute is used with Interactive Connectivity 1479 Establishment (ICE) to indicate desired connectivity check pacing 1480 values. 1482 Appropriate Values: See Section 4 of RFC XXXX. 1484 Contact Name: IESG 1486 Contact e-mail: iesg@ietf.org 1488 Reference: RFCXXXX 1490 Mux Category: NORMAL 1492 9.2. Interactive Connectivity Establishment (ICE) Options Registry 1494 IANA maintains a registry for ice-options identifiers under the 1495 Specification Required policy as defined in "Guidelines for Writing 1496 an IANA Considerations Section in RFCs" [RFC8126]. 1498 ICE options are of unlimited length according to the syntax in 1499 Section 4.6; however, they are RECOMMENDED to be no longer than 20 1500 characters. This is to reduce message sizes and allow for efficient 1501 parsing. ICE options are defined at the session level. 1503 A registration request MUST include the following information: 1505 o The ICE option identifier to be registered 1507 o Name, Email, and Address of a contact person for the registration 1509 o Organization or individuals having the change control 1511 o Short description of the ICE extension to which the option relates 1513 o Reference(s) to the specification defining the ICE option and the 1514 related extensions 1516 10. Acknowledgments 1518 A large part of the text in this document was taken from [RFC5245], 1519 authored by Jonathan Rosenberg. 1521 Some of the text in this document was taken from [RFC6336], authored 1522 by Magnus Westerlund and Colin Perkins. 1524 Many thanks to Christer Holmberg for providing text suggestions in 1525 Section 3 that aligns with [RFC8445] 1527 Thanks to Thomas Stach for text help, Roman Shpount for suggesting 1528 RTCP candidate handling and Simon Perreault for advising on IPV6 1529 address selection when candidate-address includes FQDN. 1531 Many thanks to Flemming Andreasen for shepherd review feedback. 1533 Thanks to following experts for their reviews and constructive 1534 feedback: Christer Holmberg, Adam Roach, Peter Saint-Andre and the 1535 MMUSIC WG. 1537 11. References 1539 11.1. Normative References 1541 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1542 A., Peterson, J., Sparks, R., Handley, M., and E. 1543 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1544 DOI 10.17487/RFC3261, June 2002, 1545 . 1547 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1548 Provisional Responses in Session Initiation Protocol 1549 (SIP)", RFC 3262, DOI 10.17487/RFC3262, June 2002, 1550 . 1552 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1553 with Session Description Protocol (SDP)", RFC 3264, 1554 DOI 10.17487/RFC3264, June 2002, 1555 . 1557 [RFC3312] Camarillo, G., Ed., Marshall, W., Ed., and J. Rosenberg, 1558 "Integration of Resource Management and Session Initiation 1559 Protocol (SIP)", RFC 3312, DOI 10.17487/RFC3312, October 1560 2002, . 1562 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1563 Modifiers for RTP Control Protocol (RTCP) Bandwidth", 1564 RFC 3556, DOI 10.17487/RFC3556, July 2003, 1565 . 1567 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1568 in Session Description Protocol (SDP)", RFC 3605, 1569 DOI 10.17487/RFC3605, October 2003, 1570 . 1572 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1573 Initiation Protocol (SIP) Preconditions Framework", 1574 RFC 4032, DOI 10.17487/RFC4032, March 2005, 1575 . 1577 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1578 Description Protocol", RFC 4566, DOI 10.17487/RFC4566, 1579 July 2006, . 1581 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 1582 Specifications: ABNF", STD 68, RFC 5234, 1583 DOI 10.17487/RFC5234, January 2008, 1584 . 1586 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1587 Connectivity Establishment (ICE) in the Session Initiation 1588 Protocol (SIP)", RFC 5768, DOI 10.17487/RFC5768, April 1589 2010, . 1591 [RFC6336] Westerlund, M. and C. Perkins, "IANA Registry for 1592 Interactive Connectivity Establishment (ICE) Options", 1593 RFC 6336, April 2010, 1594 . 1596 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 1597 Writing an IANA Considerations Section in RFCs", BCP 26, 1598 RFC 8126, DOI 10.17487/RFC8126, June 2017, 1599 . 1601 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1602 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1603 May 2017, . 1605 [RFC8445] Keranen, A., Holmberg, C., and J. Rosenberg, "Interactive 1606 Connectivity Establishment (ICE): A Protocol for Network 1607 Address Translator (NAT) Traversal", RFC 8445, 1608 DOI 10.17487/RFC8445, July 2018, 1609 . 1611 11.2. Informative References 1613 [draft-holmberg-ice-pac] 1614 Holmberg, C. and J. Uberti, "Interactive Connectivity 1615 Establishment Patiently Awaiting Connectivity (ICE PAC)", 1616 draft-holmberg-ice-pac-01 (work in progress), March 2019, 1617 . 1620 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1621 Camarillo, "Best Current Practices for Third Party Call 1622 Control (3pcc) in the Session Initiation Protocol (SIP)", 1623 BCP 85, RFC 3725, DOI 10.17487/RFC3725, April 2004, 1624 . 1626 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1627 Tone Generation in the Session Initiation Protocol (SIP)", 1628 RFC 3960, DOI 10.17487/RFC3960, December 2004, 1629 . 1631 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1632 Address Types (ANAT) Semantics for the Session Description 1633 Protocol (SDP) Grouping Framework", RFC 4091, June 2005, 1634 . 1636 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1637 Description Protocol (SDP) Alternative Network Address 1638 Types (ANAT) Semantics in the Session Initiation Protocol 1639 (SIP)", RFC 4092, June 2005, 1640 . 1642 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1643 (ICE): A Protocol for Network Address Translator (NAT) 1644 Traversal for Offer/Answer Protocols", RFC 5245, 1645 DOI 10.17487/RFC5245, April 2010, 1646 . 1648 [RFC5626] Jennings, C., Ed., Mahy, R., Ed., and F. Audet, Ed., 1649 "Managing Client-Initiated Connections in the Session 1650 Initiation Protocol (SIP)", RFC 5626, 1651 DOI 10.17487/RFC5626, October 2009, 1652 . 1654 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1655 "Connectivity Preconditions for Session Description 1656 Protocol (SDP) Media Streams", RFC 5898, 1657 DOI 10.17487/RFC5898, July 2010, 1658 . 1660 [RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., 1661 and K. Carlberg, "Explicit Congestion Notification (ECN) 1662 for RTP over UDP", RFC 6679, August 2012, 1663 . 1665 Appendix A. Examples 1667 For the example shown in section 15 of [RFC8445] the resulting offer 1668 (message 5) encoded in SDP looks like: 1670 v=0 1671 o=jdoe 2890844526 2890842807 IN IP6 $L-PRIV-1.IP 1672 s= 1673 c=IN IP6 $NAT-PUB-1.IP 1674 t=0 0 1675 a=ice-pwd:asd88fgpdd777uzjYhagZg 1676 a=ice-ufrag:8hhY 1677 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1678 b=RS:0 1679 b=RR:0 1680 a=rtpmap:0 PCMU/8000 1681 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1682 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1683 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1685 The offer, with the variables replaced with their values, will look 1686 like (lines folded for clarity): 1688 v=0 1689 o=jdoe 2890844526 2890842807 IN IP6 fe80::6676:baff:fe9c:ee4a 1690 s= 1691 c=IN IP6 2001:DB8:8101:3a55:4858:a2a9:22ff:99b9 1692 t=0 0 1693 a=ice-pwd:asd88fgpdd777uzjYhagZg 1694 a=ice-ufrag:8hhY 1695 m=audio 45664 RTP/AVP 0 1696 b=RS:0 1697 b=RR:0 1698 a=rtpmap:0 PCMU/8000 1699 a=candidate:1 1 UDP 2130706431 fe80::6676:baff:fe9c:ee4a 8998 typ host 1700 a=candidate:2 1 UDP 1694498815 2001:DB8:8101:3a55:4858:a2a9:22ff:99b9 1701 45664 typ srflx raddr fe80::6676:baff:fe9c:ee4a rport 8998 1703 The resulting answer looks like: 1705 v=0 1706 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1707 s= 1708 c=IN IP4 $R-PUB-1.IP 1709 t=0 0 1710 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1711 a=ice-ufrag:9uB6 1712 m=audio $R-PUB-1.PORT RTP/AVP 0 1713 b=RS:0 1714 b=RR:0 1715 a=rtpmap:0 PCMU/8000 1716 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1718 With the variables filled in: 1720 v=0 1721 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1722 s= 1723 c=IN IP4 192.0.2.1 1724 t=0 0 1725 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1726 a=ice-ufrag:9uB6 1727 m=audio 3478 RTP/AVP 0 1728 b=RS:0 1729 b=RR:0 1730 a=rtpmap:0 PCMU/8000 1731 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1733 Appendix B. The remote-candidates Attribute 1735 The "a=remote-candidates" attribute exists to eliminate a race 1736 condition between the updated offer and the response to the STUN 1737 Binding request that moved a candidate into the Valid list. This 1738 race condition is shown in Figure 1. On receipt of message 4, agent 1739 L adds a candidate pair to the valid list. If there was only a 1740 single data stream with a single component, agent L could now send an 1741 updated offer. However, the check from agent R has not yet generated 1742 a response, and agent R receives the updated offer (message 7) before 1743 getting the response (message 9). Thus, it does not yet know that 1744 this particular pair is valid. To eliminate this condition, the 1745 actual candidates at R that were selected by the offerer (the remote 1746 candidates) are included in the offer itself, and the answerer delays 1747 its answer until those pairs validate. 1749 Agent L Network Agent R 1750 |(1) Offer | | 1751 |------------------------------------------>| 1752 |(2) Answer | | 1753 |<------------------------------------------| 1754 |(3) STUN Req. | | 1755 |------------------------------------------>| 1756 |(4) STUN Res. | | 1757 |<------------------------------------------| 1758 |(5) STUN Req. | | 1759 |<------------------------------------------| 1760 |(6) STUN Res. | | 1761 |-------------------->| | 1762 | |Lost | 1763 |(7) Offer | | 1764 |------------------------------------------>| 1765 |(8) STUN Req. | | 1766 |<------------------------------------------| 1767 |(9) STUN Res. | | 1768 |------------------------------------------>| 1769 |(10) Answer | | 1770 |<------------------------------------------| 1772 Figure 1: Race Condition Flow 1774 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1776 When ICE runs between two peers, one agent acts as controlled, and 1777 the other as controlling. Rules are defined as a function of 1778 implementation type and offerer/answerer to determine who is 1779 controlling and who is controlled. However, the specification 1780 mentions that, in some cases, both sides might believe they are 1781 controlling, or both sides might believe they are controlled. How 1782 can this happen? 1784 The condition when both agents believe they are controlled shows up 1785 in third party call control cases. Consider the following flow: 1787 A Controller B 1788 |(1) INV() | | 1789 |<-------------| | 1790 |(2) 200(SDP1) | | 1791 |------------->| | 1792 | |(3) INV() | 1793 | |------------->| 1794 | |(4) 200(SDP2) | 1795 | |<-------------| 1796 |(5) ACK(SDP2) | | 1797 |<-------------| | 1798 | |(6) ACK(SDP1) | 1799 | |------------->| 1801 Figure 2: Role Conflict Flow 1803 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1804 it works better than flow III since it produces fewer messages. In 1805 this flow, the controller sends an offerless INVITE to agent A, which 1806 responds with its offer, SDP1. The agent then sends an offerless 1807 INVITE to agent B, which it responds to with its offer, SDP2. The 1808 controller then uses the offer from each agent to generate the 1809 answers. When this flow is used, ICE will run between agents A and 1810 B, but both will believe they are in the controlling role. With the 1811 role conflict resolution procedures, this flow will function properly 1812 when ICE is used. 1814 At this time, there are no documented flows that can result in the 1815 case where both agents believe they are controlled. However, the 1816 conflict resolution procedures allow for this case, should a flow 1817 arise that would fit into this category. 1819 Appendix D. Why Send an Updated Offer? 1821 Section 11.1 describes rules for sending media. Both agents can send 1822 media once ICE checks complete, without waiting for an updated offer. 1823 Indeed, the only purpose of the updated offer is to "correct" the SDP 1824 so that the default destination for media matches where media is 1825 being sent based on ICE procedures (which will be the highest- 1826 priority nominated candidate pair). 1828 This raises the question -- why is the updated offer/answer exchange 1829 needed at all? Indeed, in a pure offer/answer environment, it would 1830 not be. The offerer and answerer will agree on the candidates to use 1831 through ICE, and then can begin using them. As far as the agents 1832 themselves are concerned, the updated offer/answer provides no new 1833 information. However, in practice, numerous components along the 1834 signaling path look at the SDP information. These include entities 1835 performing off-path QoS reservations, NAT traversal components such 1836 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1837 that passively monitor the network. For these tools to continue to 1838 function without change, the core property of SDP -- that the 1839 existing, pre-ICE definitions of the addresses used for media -- the 1840 "m=" and "c=" lines and the rtcp attribute -- must be retained. For 1841 this reason, an updated offer must be sent. 1843 Appendix E. Contributors 1845 Following experts have contributed textual and structural 1846 improvements for this work 1848 1. Christer Holmberg 1850 * Ericsson 1852 * Email: christer.holmberg@ericsson.com 1854 2. Roman Shpount 1856 * TurboBridge 1858 * rshpount@turbobridge.com 1860 3. Thomas Stach 1862 * thomass.stach@gmail.com 1864 Authors' Addresses 1866 Marc Petit-Huguenin 1867 Impedance Mismatch 1869 Email: marc@petit-huguenin.org 1871 Suhas Nandakumar 1872 Cisco Systems 1873 707 Tasman Dr 1874 Milpitas, CA 95035 1875 USA 1877 Email: snandaku@cisco.com 1878 Ari Keranen 1879 Ericsson 1880 Jorvas 02420 1881 Finland 1883 Email: ari.keranen@ericsson.com