idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-26.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 3 instances of too long lines in the document, the longest one being 12 characters in excess of 72. == There are 3 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. == There are 1 instance of lines with non-RFC3849-compliant IPv6 addresses in the document. If these are example addresses, they should be changed. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? -- 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 == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: 2. The transport address from the peer for the default destination correspond to IP address values "0.0.0.0"/"::" and port value of "9". This MUST not be considered as a ICE failure by the peer agent and the ICE processing MUST continue as usual. == 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 (May 17, 2019) is 1805 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) -- Looks like a reference, but probably isn't: '1' on line 1642 -- Looks like a reference, but probably isn't: '2' on line 1644 -- Looks like a reference, but probably isn't: '3' on line 1646 -- Looks like a reference, but probably isn't: '4' on line 1648 -- Looks like a reference, but probably isn't: '5' on line 1650 -- Looks like a reference, but probably isn't: '6' on line 1652 -- Looks like a reference, but probably isn't: '7' on line 1654 -- Looks like a reference, but probably isn't: '8' on line 1656 -- Looks like a reference, but probably isn't: '9' on line 1851 -- Looks like a reference, but probably isn't: '10' on line 1857 -- Looks like a reference, but probably isn't: '11' on line 1861 ** 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 6336 (Obsoleted by RFC 8839) -- Obsolete informational reference (is this intentional?): RFC 5245 (Obsoleted by RFC 8445, RFC 8839) Summary: 6 errors (**), 0 flaws (~~), 5 warnings (==), 15 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: November 18, 2019 A. Keranen 7 Ericsson 8 May 17, 2019 10 Session Description Protocol (SDP) Offer/Answer procedures for 11 Interactive Connectivity Establishment (ICE) 12 draft-ietf-mmusic-ice-sip-sdp-26 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 https://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 November 18, 2019. 37 Copyright Notice 39 Copyright (c) 2019 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 (https://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. SDP Offer/Answer Procedures . . . . . . . . . . . . . . . . . 4 69 3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 4 70 3.2. Generic Procedures . . . . . . . . . . . . . . . . . . . 4 71 3.2.1. Encoding . . . . . . . . . . . . . . . . . . . . . . 4 72 3.2.2. RTP/RTCP Considerations . . . . . . . . . . . . . . . 6 73 3.2.3. Determining Role . . . . . . . . . . . . . . . . . . 6 74 3.2.4. STUN Considerations . . . . . . . . . . . . . . . . . 6 75 3.2.5. Verifying ICE Support Procedures . . . . . . . . . . 6 76 3.2.6. SDP Example . . . . . . . . . . . . . . . . . . . . . 7 77 3.3. Initial Offer/Answer Exchange . . . . . . . . . . . . . . 7 78 3.3.1. Sending the Initial Offer . . . . . . . . . . . . . . 7 79 3.3.2. Sending the Initial Answer . . . . . . . . . . . . . 8 80 3.3.3. Receiving the Initial Answer . . . . . . . . . . . . 9 81 3.3.4. Concluding ICE . . . . . . . . . . . . . . . . . . . 9 82 3.4. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . 10 83 3.4.1. Sending Subsequent Offer . . . . . . . . . . . . . . 10 84 3.4.2. Sending Subsequent Answer . . . . . . . . . . . . . . 12 85 3.4.3. Receiving Answer for a Subsequent Offer . . . . . . . 14 86 4. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 87 4.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 16 88 4.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 18 89 4.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 19 90 4.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 19 91 4.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 20 92 4.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 21 93 5. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 21 94 6. SIP Considerations . . . . . . . . . . . . . . . . . . . . . 21 95 6.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 22 96 6.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . . 22 97 6.1.2. Offer in Response . . . . . . . . . . . . . . . . . . 23 98 6.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 24 99 6.3. Interactions with Forking . . . . . . . . . . . . . . . . 24 100 6.4. Interactions with Preconditions . . . . . . . . . . . . . 24 101 6.5. Interactions with Third Party Call Control . . . . . . . 24 102 7. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 25 103 8. Security Considerations . . . . . . . . . . . . . . . . . . . 25 104 8.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . . 25 105 8.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . . 25 106 8.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . . 26 107 8.2.2. Interactions with Application Layer Gateways and SIP 26 108 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 109 9.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 27 110 9.1.1. candidate Attribute . . . . . . . . . . . . . . . . . 28 111 9.1.2. remote-candidates Attribute . . . . . . . . . . . . . 28 112 9.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 29 113 9.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 29 114 9.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . . 30 115 9.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . . 30 116 9.1.7. ice-options Attribute . . . . . . . . . . . . . . . . 31 117 9.1.8. ice-pacing Attribute . . . . . . . . . . . . . . . . 31 118 9.2. Interactive Connectivity Establishment (ICE) Options 119 Registry . . . . . . . . . . . . . . . . . . . . . . . . 32 120 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 32 121 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 122 11.1. Normative References . . . . . . . . . . . . . . . . . . 33 123 11.2. Informative References . . . . . . . . . . . . . . . . . 34 124 11.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 35 125 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 36 126 Appendix B. The remote-candidates Attribute . . . . . . . . . . 38 127 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 38 128 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 39 129 Appendix E. Contributors . . . . . . . . . . . . . . . . . . . . 40 130 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 40 132 1. Introduction 134 This document describes how Interactive Connectivity Establishment 135 (ICE) is used with Session Description Protocol (SDP) offer/answer 136 [RFC3264]. The ICE specification [RFC8445] describes procedures that 137 are common to all usages of ICE and this document gives the 138 additional details needed to use ICE with SDP offer/answer. 140 2. Terminology 142 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 143 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 144 "OPTIONAL" in this document are to be interpreted as described in RFC 145 2119 [RFC2119]. 147 Readers should be familiar with the terminology defined in [RFC3264], 148 in [RFC8445] and the following: 150 Default Destination/Candidate: The default destination for a 151 component of a data stream is the transport address that would be 152 used by an agent that is not ICE aware. A default candidate for a 153 component is one whose transport address matches the default 154 destination for that component. For the RTP component, the 155 default IP address is in the "c=" line of the SDP, and the port is 156 in the "m=" line. For the RTCP component, the address and port 157 are indicated using the "a=rtcp" attribute defined in [RFC3605], 158 if present; otherwise, the RTCP component address is same as the 159 address of the RTP component, and its port is one greater than the 160 port of the RTP component. 162 3. SDP Offer/Answer Procedures 164 3.1. Introduction 166 [RFC8445] defines ICE candidate exchange as the process for ICE 167 agents (Initiator and Responder) to exchange their candidate 168 information required for ICE processing at the agents. For the 169 purposes of this specification, the candidate exchange process 170 corresponds to the [RFC3264] Offer/Answer protocol and the 171 terminologies offerer and answerer correspond to the initiator and 172 responder terminologies from [RFC8445] respectively. 174 Once the initiating agent has gathered, pruned and prioritized its 175 set of candidates [RFC8445], the candidate exchange with the peer 176 agent begins. 178 3.2. Generic Procedures 180 3.2.1. Encoding 182 Section 4 provides detailed rules for constructing various SDP 183 attributes defined in this specification. 185 3.2.1.1. Data Streams 187 Each data stream [RFC8445] is represented by an SDP media description 188 ("m=" section). 190 3.2.1.2. Candidates 192 With in a "m=" section, each candidate (including the default 193 candidate) associated with the data stream is represented by an SDP 194 candidate attribute. 196 Prior to nomination, the "c=" line associated with an "m=" section 197 contains the IP address of the default candidate, while the "m=" line 198 contains the port and transport of the default candidate for that 199 "m=" section. 201 After nomination, the "c=" line for a given "m=" section contains the 202 IP address of the nominated candidate (the local candidate of the 203 nominated candidate pair) and the "m=" line contains the port and 204 transport corresponding to the nominated candidate for that "m=" 205 section. 207 3.2.1.3. Username and Password 209 The ICE username is represented by an SDP ice-ufrag attribute and the 210 ICE password is represented by an SDP ice-pwd attribute. 212 3.2.1.4. Lite Implementations 214 An ICE lite implementation [RFC8445] MUST include an SDP ice-lite 215 attribute. A full implementation MUST NOT include that attribute. 217 3.2.1.5. ICE Extensions 219 An agent uses the SDP ice-options attribute to indicate support of 220 ICE extensions. 222 An agent compliant to this specification MUST include an SDP ice- 223 options attribute with an "ice2" attribute value. If an agent 224 receives an SDP offer or answer with ICE attributes but without the 225 "ice2" ice-options attribute value, the agent assumes that the peer 226 is compliant to [RFC5245]. 228 3.2.1.6. Inactive and Disabled Data Streams 230 If an "m=" section is marked as inactive [RFC4566], or has a 231 bandwidth value of zero [RFC4566], the agent MUST still include ICE 232 related SDP attributes. 234 If the port value associated with an "m=" section is set to zero 235 (implying a disabled stream) as defined in section 8.2 of [RFC3264], 236 the agent SHOULD NOT include ICE related SDP candidate attributes in 237 that "m=" section, unless an SDP extension specifying otherwise is 238 used. 240 3.2.2. RTP/RTCP Considerations 242 If an agent utilizes both RTP and RTCP, and separate ports are used 243 for RTP and RTCP, the agent MUST include SDP candidate attributes for 244 both the RTP and RTCP components and SDP rtcp attribute SHOULD be 245 included in the "m=" section, as described in [RFC3605] 247 In the cases where the port number for the RTCP is one higher than 248 the RTP port and RTCP component address is same as the address of the 249 RTP component, the SDP rtcp attribute MAY be omitted. 251 If the agent does not utilize RTCP, it indicates that by including 252 b=RS:0 and b=RR:0 SDP attributes, as described in [RFC3556]. 254 3.2.3. Determining Role 256 The offerer acts as the Initiating agent. The answerer acts as the 257 Responding agent. The ICE roles (controlling and controlled) are 258 determined using the procedures in [RFC8445]. 260 3.2.4. STUN Considerations 262 Once an agent has provided its local candidates to its peer in an SDP 263 offer or answer, the agent MUST be prepared to receive STUN 264 connectivity check Binding requests on those candidates. 266 3.2.5. Verifying ICE Support Procedures 268 The agents will proceed with the ICE procedures defined in [RFC8445] 269 and this specification if, for each data stream in the SDP it 270 received, the default destination for each component of that data 271 stream appears in a candidate attribute. For example, in the case of 272 RTP, the IP address and port in the "c=" and "m=" lines, 273 respectively, appear in a candidate attribute and the value in the 274 rtcp attribute appears in a candidate attribute. 276 If this condition is not met, the agents MUST process the SDP based 277 on normal [RFC3264] procedures, without using any of the ICE 278 mechanisms described in the remainder of this specification with the 279 few exceptions noted below: 281 1. The presence of certain application layer gateways MAY modify the 282 transport address information as described in Section 8.2.2. The 283 behavior of the responding agent in such a situation is 284 implementation defined. Informally, the responding agent MAY 285 consider the mismatched transport address information as a 286 plausible new candidate learnt from the peer and continue its ICE 287 processing with that transport address included. Alternatively, 288 the responding agent MAY include an "a=ice-mismatch" attribute in 289 its answer and MAY also omit a=candidate attributes for such data 290 streams. 292 2. The transport address from the peer for the default destination 293 correspond to IP address values "0.0.0.0"/"::" and port value of 294 "9". This MUST not be considered as a ICE failure by the peer 295 agent and the ICE processing MUST continue as usual. 297 Also to note, this specification provides no guidance on how an 298 controlling/initiator agent should proceed in scenarios where the the 299 SDP answer includes "a=ice-mismatch" from the peer. 301 3.2.6. SDP Example 303 The following is an example SDP message that includes ICE attributes 304 (lines folded for readability): 306 v=0 307 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 308 s= 309 c=IN IP4 192.0.2.3 310 t=0 0 311 a=ice-options:ice2 312 a=ice-pwd:asd88fgpdd777uzjYhagZg 313 a=ice-ufrag:8hhY 314 m=audio 45664 RTP/AVP 0 315 b=RS:0 316 b=RR:0 317 a=rtpmap:0 PCMU/8000 318 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 319 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 320 10.0.1.1 rport 8998 322 3.3. Initial Offer/Answer Exchange 324 3.3.1. Sending the Initial Offer 326 When an offerer generates the initial offer, in each "m=" section it 327 MUST include SDP candidate attributes for each available candidate 328 associated with the "m=" section. In addition, the offerer MUST 329 include an SDP ice-ufrag and an SDP ice-pwd attribute in the offer. 331 It is valid for an offer "m=" line to include no SDP candidate 332 attributes and with default destination corresponding to the IP 333 address values "0.0.0.0"/"::" and port value of "9". This implies 334 that offering agent is only going to use peer reflexive candidates or 335 that additional candidates would be provided in subsequent signaling 336 messages. 338 Note: Within the scope of this document, "Initial Offer" refers to 339 the first SDP offer that is sent in order to negotiate usage of 340 ICE. It might, or might not, be the initial SDP offer of the SDP 341 session. 343 Note: The procedures in this document only consider "m=" sections 344 associated with data streams where ICE is used. 346 3.3.2. Sending the Initial Answer 348 When an answerer receives an initial offer that indicates that the 349 offerer supports ICE, and if the answerer accepts the offer and the 350 usage of ICE, in each "m=" section within the answer, it MUST include 351 SDP candidate attributes for each available candidate associated with 352 the "m=" section. In addition, the answerer MUST include an SDP ice- 353 ufrag and an SDP ice-pwd attribute in the answer. 355 In each "m=" line, the answerer MUST use the same transport protocol 356 as was used in the offer "m=" line. If none of the candidates in the 357 "m=" line in the answer use the same transport protocol as indicated 358 in the offer "m=" line, then, in order to avoid ICE mismatch, the 359 default destination MUST be set to IP address values "0.0.0.0"/"::" 360 and port value of "9". 362 It is also valid for an answer "m=" line to include no SDP candidate 363 attributes and with default destination corresponding to the IP 364 address values "0.0.0.0"/"::" and port value of "9". This implies 365 that answering agent is only going to use peer reflexive candidates 366 or that additional candidates would be provided in subsequent 367 signaling messages. 369 Once the answerer has sent the answer, it can start performing 370 connectivity checks towards the peer candidates that were provided in 371 the offer. 373 In certain scenarios when either no candidates were provided in the 374 offer or all the provided candidates were discarded (say, due to 375 unsupported address type or FQDN name resolution failure), the 376 answerer MUST NOT consider this as immediate ICE processing failure 377 but instead MUST wait for the peer reflexive candidates to arrive to 378 carryout the connectivity checks or eventually time out on the 379 connectivity checks (see [draft-holmberg-ice-pac]). 381 If the offer does not indicate support of ICE, the answerer MUST NOT 382 accept the usage of ICE. If the answerer still accepts the offer, 383 the answerer MUST NOT include any ICE related SDP attributes in the 384 answer. Instead the answerer will generate the answer according to 385 normal offer/answer procedures [RFC3264]. 387 If the answerer detects a possibility of the ICE mismatch, procedures 388 described in (Section 3.2.5) are followed. 390 3.3.3. Receiving the Initial Answer 392 When an offerer receives an initial answer that indicates that the 393 answerer supports ICE, it can start performing connectivity checks 394 towards the peer candidates that were provided in the answer. 396 In certain scenarios when either no candidates were provided in the 397 answer or all the provided candidates were discarded (say, due to 398 unsupported address type or FQDN name resolution failure), the 399 offerer MUST NOT consider this as immediate ICE processing failure 400 but instead MUST wait for the peer reflexive candidates to arrive to 401 carryout the connectivity checks or eventually time out on the 402 connectivity checks (see [draft-holmberg-ice-pac]). 404 If the answer does not indicate that the answerer supports ICE, or if 405 the offerer detects an ICE mismatch in the answer, the offerer MUST 406 terminate the usage of ICE. The subsequent actions taken by the 407 offerer are implementation dependent and are out of the scope of this 408 specification. 410 3.3.4. Concluding ICE 412 Once the state of each check list is Completed, and if the agent is 413 the controlling agent, it nominates a candidate pair [RFC8445] and 414 checks for each data stream whether the nominated pair matches the 415 default candidate pair. If there are one or more data streams with a 416 match, and the peer did not indicate support for the 'ice2' ice- 417 option, the controlling agent MUST generate a subsequent offer 418 (Section 3.4.1), in which the IP address, port and transport in the 419 "c=" and "m=" lines associated with each data stream match the 420 corresponding local information of the nominated pair for that data 421 stream. 423 However, If the support for 'ice2' ice-option is in use, the 424 nominated candidate is noted and sent in the subsequent offer/answer 425 exchange as the default candidate and no updated offer is needed to 426 fix the default candidate. 428 Also as described in [RFC8445], once the controlling agent has 429 nominated a candidate pair for a data stream, the agent MUST NOT 430 nominate another pair for that data stream during the lifetime of the 431 ICE session (i.e. until ICE is restarted). 433 3.4. Subsequent Offer/Answer Exchanges 435 Either agent MAY generate a subsequent offer at any time allowed by 436 [RFC3264]. This section defines rules for construction of subsequent 437 offers and answers. 439 Should a subsequent offer fail, ICE processing continues as if the 440 subsequent offer had never been made. 442 3.4.1. Sending Subsequent Offer 444 3.4.1.1. Procedures for All Implementations 446 3.4.1.1.1. ICE Restarts 448 An agent MAY restart ICE processing for an existing data stream 449 [RFC8445]. 451 The rules governing the ICE restart imply that setting the IP address 452 in the "c=" line to 0.0.0.0 (for IPv4)/ :: (for IPv6) will cause an 453 ICE restart. Consequently, ICE implementations MUST NOT utilize this 454 mechanism for call hold, and instead MUST use a=inactive and 455 a=sendonly as described in [RFC3264]. 457 To restart ICE, an agent MUST change both the ice-pwd and the ice- 458 ufrag for the data stream in an offer. However, it is permissible to 459 use a session-level attribute in one offer, but to provide the same 460 ice-pwd or ice-ufrag as a media-level attribute in a subsequent 461 offer. This MUST NOT be considered as ICE restart. 463 An agent sets the rest of the ice related fields in the SDP for this 464 data stream as it would in an initial offer of this data stream (see 465 Section 3.2.1). Consequently, the set of candidates MAY include 466 some, none, or all of the previous candidates for that data stream 467 and MAY include a totally new set of candidates. 469 3.4.1.1.2. Removing a Data Stream 471 If an agent removes a data stream by setting its port to zero, it 472 MUST NOT include any candidate attributes for that data stream and 473 SHOULD NOT include any other ICE-related attributes defined in 474 Section 4 for that data stream. 476 3.4.1.1.3. Adding a Data Stream 478 If an agent wishes to add a new data stream, it sets the fields in 479 the SDP for this data stream as if this was an initial offer for that 480 data stream (see Section 3.2.1). This will cause ICE processing to 481 begin for this data stream. 483 3.4.1.2. Procedures for Full Implementations 485 This section describes additional procedures for full 486 implementations, covering existing data streams. 488 3.4.1.2.1. Before Nomination 490 When an offerer sends a subsequent offer; in each "m=" section for 491 which a candidate pair has not yet been nominated, the offer MUST 492 include the same set of ICE-related information that the offerer 493 included in the previous offer or answer. The agent MAY include 494 additional candidates it did not offer previously, but which it has 495 gathered since the last offer/ answer exchange, including peer 496 reflexive candidates. 498 The agent MAY change the default destination for media. As with 499 initial offers, there MUST be a set of candidate attributes in the 500 offer matching this default destination. 502 3.4.1.2.2. After Nomination 504 Once a candidate pair has been nominated for a data stream, the IP 505 address, port and transport in each "c=" and "m=" line associated 506 with that data stream MUST match the data associated with the 507 nominated pair for that data stream. In addition, the offerer only 508 includes SDP candidates representing the local candidates of the 509 nominated candidate pair. The offerer MUST NOT include any other SDP 510 candidate attributes in the subsequent offer. 512 In addition, if the agent is controlling, it MUST include the 513 a=remote-candidates attribute for each data stream whose check list 514 is in the completed state. The attribute contains the remote 515 candidates corresponding to the nominated pair in the valid list for 516 each component of that data stream. It is needed to avoid a race 517 condition whereby the controlling agent chooses its pairs, but the 518 updated offer beats the connectivity checks to the controlled agent, 519 which doesn't even know these pairs are valid, let alone selected. 520 See Appendix B for elaboration on this race condition. 522 3.4.1.3. Procedures for Lite Implementations 524 If the ICE state is running, a lite implementation MUST include all 525 of its candidates for each component of each data stream in 526 a=candidate attribute in any subsequent offer. The candidates are 527 formed identical to the procedures for initial offers. 529 A lite implementation MUST NOT add additional host candidates in a 530 subsequent offer. If an agent needs to offer additional candidates, 531 it MUST restart ICE. Similarly, the username fragments or passwords 532 MUST remain the same as used previously. If an agent needs to change 533 one of these, it MUST restart ICE for that media stream. 535 If ICE has completed for a data stream and if the agent is 536 controlled, the default destination for that data stream MUST be set 537 to the remote candidate of the candidate pair for that component in 538 the valid list. For a lite implementation, there is always just a 539 single candidate pair in the valid list for each component of a data 540 stream. Additionally, the agent MUST include a candidate attribute 541 for each default destination. 543 If ICE state is completed and if the agent is controlling (which only 544 happens when both agents are lite), the agent MUST include the 545 a=remote-candidates attribute for each data stream. The attribute 546 contains the remote candidates from the candidate pairs in the valid 547 list (one pair for each component of each data stream). 549 3.4.2. Sending Subsequent Answer 551 If ICE is Completed for a data stream, and the offer for that data 552 stream lacked the a=remote-candidates attribute, the rules for 553 construction of the answer are identical to those for the offerer, 554 except that the answerer MUST NOT include the a=remote-candidates 555 attribute in the answer. 557 A controlled agent will receive an offer with the a=remote-candidates 558 attribute for a data stream when its peer has concluded ICE 559 processing for that data stream. This attribute is present in the 560 offer to deal with a race condition between the receipt of the offer, 561 and the receipt of the Binding Response that tells the answerer the 562 candidate that will be selected by ICE. See Appendix B for an 563 explanation of this race condition. Consequently, processing of an 564 offer with this attribute depends on the winner of the race. 566 The agent forms a candidate pair for each component of the data 567 stream by: 569 o Setting the remote candidate equal to the offerer's default 570 destination for that component (i.e. the contents of the "m=" and 571 "c=" lines for RTP, and the a=rtcp attribute for RTCP) 573 o Setting the local candidate equal to the transport address for 574 that same component in the a=remote-candidates attribute in the 575 offer. 577 The agent then sees if each of these candidate pairs is present in 578 the valid list. If a particular pair is not in the valid list, the 579 check has "lost" the race. Call such a pair a "losing pair". 581 The agent finds all the pairs in the check list whose remote 582 candidates equal the remote candidate in the losing pair: 584 o If none of the pairs are In-Progress, and at least one is Failed, 585 it is most likely that a network failure, such as a network 586 partition or serious packet loss, has occurred. The agent SHOULD 587 generate an answer for this data stream as if the remote- 588 candidates attribute had not been present, and then restart ICE 589 for this stream. 591 o If at least one of the pairs is In-Progress, the agent SHOULD wait 592 for those checks to complete, and as each completes, redo the 593 processing in this section until there are no losing pairs. 595 Once there are no losing pairs, the agent can generate the answer. 596 It MUST set the default destination for media to the candidates in 597 the remote-candidates attribute from the offer (each of which will 598 now be the local candidate of a candidate pair in the valid list). 599 It MUST include a candidate attribute in the answer for each 600 candidate in the remote-candidates attribute in the offer. 602 3.4.2.1. ICE Restart 604 If the offerer in a subsequent offer requested an ICE restart for a 605 data stream, and if the answerer accepts the offer, the answerer 606 follows the procedures for generating an initial answer. 608 For a given data stream, the answerer MAY include the same candidates 609 that were used in the previous ICE session, but it MUST change the 610 SDP ice-pwd and ice-ufrag attribute values. 612 3.4.2.2. Lite Implementation specific procedures 614 If the received offer contains the remote-candidates attribute for a 615 data stream, the agent forms a candidate pair for each component of 616 the data stream by: 618 o Setting the remote candidate equal to the offerer's default 619 destination for that component (i.e., the contents of the "m=" and 620 "c=" lines for RTP, and the a=rtcp attribute for RTCP). 622 o Setting the local candidate equal to the transport address for 623 that same component in the a=remote-candidates attribute in the 624 offer. 626 The state of ICE processing for that data stream is set to Completed. 628 Furthermore, if the agent believed it was controlling, but the offer 629 contained the a=remote-candidates attribute, both agents believe they 630 are controlling. In this case, both would have sent updated offers 631 around the same time. 633 However, the signaling protocol carrying the offer/answer exchanges 634 will have resolved this glare condition, so that one agent is always 635 the 'winner' by having its offer received before its peer has sent an 636 offer. The winner takes the role of controlling, so that the loser 637 (the answerer under consideration in this section) MUST change its 638 role to controlled. 640 Consequently, if the agent was going to send an updated offer since, 641 based on the rules in section 8.2 of [RFC8445], it was controlling, 642 it no longer needs to. 644 Besides the potential role change, change in the Valid list, and 645 state changes, the construction of the answer is performed 646 identically to the construction of an offer. 648 3.4.3. Receiving Answer for a Subsequent Offer 650 3.4.3.1. Procedures for Full Implementations 652 There may be certain situations where the offerer receives an SDP 653 answer that lacks ICE candidates although the initial answer did. 654 One example of such an "unexpected" answer might be happen when an 655 ICE-unaware B2BUA introduces a media server during call hold using 656 3rd party call-control procedures. Omitting further details how this 657 is done, this could result in an answer being received at the holding 658 UA that was constructed by the B2BUA. With the B2BUA being ICE- 659 unaware, that answer would not include ICE candidates. 661 Receiving an answer without ICE attributes in this situation might be 662 unexpected, but would not necessarily impair the user experience. 664 When the offerer receives an answer indicating support for ICE, the 665 offer performs on of the following actions: 667 o If the offer was a restart, the agent MUST perform ICE restart 668 procedures as specified in Section 3.4.3.1.1 670 o If the offer/answer exchange removed a data stream, or an answer 671 rejected an offered data stream, an agent MUST flush the Valid 672 list for that data stream. It MUST also terminate any STUN 673 transactions in progress for that data stream. 675 o If the offer/answer exchange added a new data stream, the agent 676 MUST create a new check list for it (and an empty Valid list to 677 start of course) which in turn triggers the candidate processing 678 procedures [RFC8445]. 680 o If ICE state is running for a given data stream, the agent 681 recomputes the check list. If a pair on the new check list was 682 also on the previous check list, and its state is not Frozen, its 683 state is copied over. Otherwise, its state is set to Frozen. If 684 none of the check lists are active (meaning that the pairs in each 685 check list are Frozen), appropriate procedures in [RFC8445] are 686 performed to move candidate(s) to the Waiting state to further 687 continue ICE processing. 689 o If ICE state is completed and the SDP answer conforms to 690 Section 3.4.2, the agent MUST reman in the ICE completed state. 692 However, if the ICE support is no longer indicated in the SDP answer, 693 the agent MUST fall-back to [RFC3264] procedures and SHOULD NOT drop 694 the dialog because of the missing ICE support or unexpected answer. 695 Once the agent sends a new offer later on, it MUST perform an ICE 696 restart. 698 3.4.3.1.1. ICE Restarts 700 The agent MUST remember the nominated pair in the Valid list for each 701 component of the data stream, called the previous selected pair prior 702 to the restart. The agent will continue to send media using this 703 pair, as described in section 12 of [RFC8445]. Once these 704 destinations are noted, the agent MUST flush the valid and check 705 lists, and then recompute the check list and its states, thus 706 triggering the candidate processing procedures [RFC8445] 708 3.4.3.2. Procedures for Lite Implementations 710 If ICE is restarting for a data stream, the agent MUST start a new 711 Valid list for that data stream. It MUST remember the nominated pair 712 in the previous Valid list for each component of the data stream, 713 called the previous selected pairs, and continue to send media there 714 as described in section 12 of [RFC8445]. The state of ICE processing 715 for each data stream MUST change to Running, and the state of ICE 716 processing MUST change to Running 718 4. Grammar 720 This specification defines eight new SDP attributes -- the 721 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 722 ufrag", "ice-pwd", "ice-pacing", and "ice-options" attributes. 724 This section also provides non-normative examples of the attributes 725 defined. 727 The syntax for the attributes follow Augmented BNF as defined in 728 [RFC5234]. 730 4.1. "candidate" Attribute 732 The candidate attribute is a media-level attribute only. It contains 733 a transport address for a candidate that can be used for connectivity 734 checks. 736 candidate-attribute = "candidate" ":" foundation SP component-id SP 737 transport SP 738 priority SP 739 connection-address SP ;from RFC 4566 740 port ;port from RFC 4566 741 SP cand-type 742 [SP rel-addr] 743 [SP rel-port] 744 *(SP extension-att-name SP 745 extension-att-value) 747 foundation = 1*32ice-char 748 component-id = 1*5DIGIT 749 transport = "UDP" / transport-extension 750 transport-extension = token ; from RFC 3261 751 priority = 1*10DIGIT 752 cand-type = "typ" SP candidate-types 753 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 754 rel-addr = "raddr" SP connection-address 755 rel-port = "rport" SP port 756 extension-att-name = token 757 extension-att-value = *VCHAR 758 ice-char = ALPHA / DIGIT / "+" / "/" 760 This grammar encodes the primary information about a candidate: its 761 IP address, port and transport protocol, and its properties: the 762 foundation, component ID, priority, type, and related transport 763 address: 765 : is taken from RFC 4566 [RFC4566]. It is the 766 IP address of the candidate. When parsing this field, an agent 767 can differentiate an IPv4 address and an IPv6 address by presence 768 of a colon in its value -- the presence of a colon indicates IPv6. 769 An agent MUST ignore candidate lines that include candidates with 770 IP address versions that are not supported or recognized. An IP 771 address SHOULD be used, but an FQDN MAY be used in place of an IP 772 address. In that case, when receiving an offer or answer 773 containing an FQDN in an a=candidate attribute, the FQDN is looked 774 up in the DNS first using an AAAA record (assuming the agent 775 supports IPv6), and if no result is found or the agent only 776 supports IPv4, using an A record. If a FQDN returns multiple IP 777 addresses an agent MUST only use one of them throughout the 778 duration of the ICE session. Since an agent does not know whether 779 the peer listens to the chosen IP address and port, it is 780 RECOMMENDED to not use FQDNs that will resolve into multiple IP 781 addresses. 783 : is also taken from RFC 4566 [RFC4566]. It is the port of 784 the candidate. 786 : indicates the transport protocol for the candidate. 787 This specification only defines UDP. However, extensibility is 788 provided to allow for future transport protocols to be used with 789 ICE by extending the sub-registry "ICE Transport Protocols" under 790 "Interactive Connectivity Establishment (ICE)" registry. 792 : is composed of 1 to 32 s. It is an 793 identifier that is equivalent for two candidates that are of the 794 same type, share the same base, and come from the same STUN 795 server. The foundation is used to optimize ICE performance in the 796 Frozen algorithm as described in [RFC8445] 798 : is a positive integer between 1 and 256 (inclusive) 799 that identifies the specific component of the dta stream for which 800 this is a candidate. It MUST start at 1 and MUST increment by 1 801 for each component of a particular candidate. For data streams 802 based on RTP, candidates for the actual RTP media MUST have a 803 component ID of 1, and candidates for RTCP MUST have a component 804 ID of 2. See section 13 in [RFC8445] for additional discussion on 805 extending ICE to new data streams. 807 : is a positive integer between 1 and (2**31 - 1) 808 inclusive. The procedures for computing candidate's priority is 809 described in section 5.1.2 of [RFC8445]. 811 : encodes the type of candidate. This specification 812 defines the values "host", "srflx", "prflx", and "relay" for host, 813 server reflexive, peer reflexive, and relayed candidates, 814 respectively. Specifications for new candidate types MUST define 815 how, if at all, various steps in the ICE processing differ from 816 the ones defined by this specification. 818 and : convey transport addresses related to the 819 candidate, useful for diagnostics and other purposes. 820 and MUST be present for server reflexive, peer 821 reflexive, and relayed candidates. If a candidate is server or 822 peer reflexive, and are equal to the base 823 for that server or peer reflexive candidate. If the candidate is 824 relayed, and are equal to the mapped address 825 in the Allocate response that provided the client with that 826 relayed candidate (see Appendix B.3 of [RFC8445] for a discussion 827 of its purpose). If the candidate is a host candidate, 828 and MUST be omitted. 830 In some cases, e.g., for privacy reasons, an agent may not want to 831 reveal the related address and port. In this case the address 832 MUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 833 candidates) and the port to zero. 835 The candidate attribute can itself be extended. The grammar allows 836 for new name/value pairs to be added at the end of the attribute. 837 Such extensions MUST be made through IETF Review or IESG Approval 838 [RFC5226] and the assignments MUST contain the specific extension and 839 a reference to the document defining the usage of the extension 841 An implementation MUST ignore any name/value pairs it doesn't 842 understand. 844 Example: SDP line for UDP server reflexive candidate attribute for the RTP component 846 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 10.0.1.1 rport 8998 848 4.2. "remote-candidates" Attribute 850 The syntax of the "remote-candidates" attribute is defined using 851 Augmented BNF as defined in [RFC5234]. The remote-candidates 852 attribute is a media-level attribute only. 854 remote-candidate-att = "remote-candidates:" remote-candidate 855 0*(SP remote-candidate) 856 remote-candidate = component-ID SP connection-address SP port 857 The attribute contains a connection-address and port for each 858 component. The ordering of components is irrelevant. However, a 859 value MUST be present for each component of a data stream. This 860 attribute MUST be included in an offer by a controlling agent for a 861 data stream that is Completed, and MUST NOT be included in any other 862 case. 864 Example: Remote candidates SDP lines for the RTP and RTCP components: 866 a=remote-candidates:1 192.0.2.3 45664 867 a=remote-candidates:2 192.0.2.3 45665 869 4.3. "ice-lite" and "ice-mismatch" Attributes 871 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 872 which are flags, is: 874 ice-lite = "ice-lite" 875 ice-mismatch = "ice-mismatch" 877 "ice-lite" is a session-level attribute only, and indicates that an 878 agent is a lite implementation. "ice-mismatch" is a media-level 879 attribute only, and when present in an answer, indicates that the 880 offer arrived with a default destination for a media component that 881 didn't have a corresponding candidate attribute. 883 4.4. "ice-ufrag" and "ice-pwd" Attributes 885 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 886 and password used by ICE for message integrity. Their syntax is: 888 ice-pwd-att = "ice-pwd:" password 889 ice-ufrag-att = "ice-ufrag:" ufrag 890 password = 22*256ice-char 891 ufrag = 4*256ice-char 893 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 894 session-level or media-level. When present in both, the value in the 895 media-level takes precedence. Thus, the value at the session-level 896 is effectively a default that applies to all data streams, unless 897 overridden by a media-level value. Whether present at the session or 898 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 899 each data stream. If two data streams have identical ice-ufrag's, 900 they MUST have identical ice-pwd's. 902 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 903 beginning of a session (the same applies when ICE is restarting for 904 an agent). 906 The ice-ufrag attribute MUST contain at least 24 bits of randomness, 907 and the ice-pwd attribute MUST contain at least 128 bits of 908 randomness. This means that the ice-ufrag attribute will be at least 909 4 characters long, and the ice-pwd at least 22 characters long, since 910 the grammar for these attributes allows for 6 bits of information per 911 character. The attributes MAY be longer than 4 and 22 characters, 912 respectively, of course, up to 256 characters. The upper limit 913 allows for buffer sizing in implementations. Its large upper limit 914 allows for increased amounts of randomness to be added over time. 915 For compatibility with the 512 character limitation for the STUN 916 username attribute value and for bandwidth conservation 917 considerations, the ice-ufrag attribute MUST NOT be longer than 32 918 characters when sending, but an implementation MUST accept up to 256 919 characters when receiving. 921 Example shows sample ice-ufrag and ice-pwd SDP lines: 923 a=ice-pwd:asd88fgpdd777uzjYhagZg 924 a=ice-ufrag:8hhY 926 4.5. "ice-pacing" Attribute 928 The "ice-pacing" is a session level attribute that indicates the 929 desired connectivity check pacing, in milliseconds, for this agent 930 (see section 14 of [RFC8445]). The syntax is: 932 ice-pacing-att = "ice-pacing:" pacing-value 933 pacing-value = 1*10DIGIT 935 Following the procedures defined in [RFC8445], a default value of 936 50ms is used for an agent when ice-pacing attribute is omitted in the 937 offer or the answer. 939 The same rule applies for ice-pacing attribute values lower than 940 50ms. This mandates that, if an agent includes the ice-pacing 941 attribute, its value MUST be greater than 50ms or else a value of 942 50ms is considered by default for that agent. 944 Also the larger of the ice-pacing attribute values between the offer 945 and the answer (determined either by the one provided in the ice- 946 pacing attribute or by picking the default value) MUST be considered 947 for a given ICE session. 949 Example shows ice-pacing value of 5 ms: 951 a=ice-pacing:5 953 4.6. "ice-options" Attribute 955 The "ice-options" attribute is a session- and media-level attribute. 956 It contains a series of tokens that identify the options supported by 957 the agent. Its grammar is: 959 ice-options = "ice-options:" ice-option-tag 960 0*(SP ice-option-tag) 961 ice-option-tag = 1*ice-char 963 The existence of an ice-option in an offer indicates that a certain 964 extension is supported by the agent and is willing to use it, if the 965 peer agent also includes the same extension in the answer. There 966 might be further extension specific negotiation needed between the 967 agents that determine how the extensions gets used in a given 968 session. The details of the negotiation procedures, if present, MUST 969 be defined by the specification defining the extension (see 970 Section 9.2). 972 Example shows 'rtp+ecn' ice-option SDP line from <>: 974 a=ice-options:rtp+ecn 976 5. Keepalives 978 All the ICE agents MUST follow the procedures defined in section 11 979 of [RFC8445] for sending keepalives. The keepalives MUST be sent 980 regardless of whether the data stream is currently inactive, 981 sendonly, recvonly, or sendrecv, and regardless of the presence or 982 value of the bandwidth attribute. An agent can determine that its 983 peer supports ICE by the presence of a=candidate attributes for each 984 media session. 986 6. SIP Considerations 988 Note that ICE is not intended for NAT traversal for SIP, which is 989 assumed to be provided via another mechanism [RFC5626]. 991 When ICE is used with SIP, forking may result in a single offer 992 generating a multiplicity of answers. In that case, ICE proceeds 993 completely in parallel and independently for each answer, treating 994 the combination of its offer and each answer as an independent offer/ 995 answer exchange, with its own set of local candidates, pairs, check 996 lists, states, and so on. 998 Once ICE processing has reached the Completed state for all peers for 999 media streams using those candidates, the agent SHOULD wait an 1000 additional three seconds, and then it MAY cease responding to checks 1001 or generating triggered checks on that candidate. It MAY free the 1002 candidate at that time. Freeing of server reflexive candidates is 1003 never explicit; it happens by lack of a keepalive. The three-second 1004 delay handles cases when aggressive nomination is used, and the 1005 selected pairs can quickly change after ICE has completed. 1007 6.1. Latency Guidelines 1009 ICE requires a series of STUN-based connectivity checks to take place 1010 between endpoints. These checks start from the answerer on 1011 generation of its answer, and start from the offerer when it receives 1012 the answer. These checks can take time to complete, and as such, the 1013 selection of messages to use with offers and answers can affect 1014 perceived user latency. Two latency figures are of particular 1015 interest. These are the post-pickup delay and the post-dial delay. 1016 The post-pickup delay refers to the time between when a user "answers 1017 the phone" and when any speech they utter can be delivered to the 1018 caller. The post-dial delay refers to the time between when a user 1019 enters the destination address for the user and ringback begins as a 1020 consequence of having successfully started alerting the called user 1021 agent. 1023 Two cases can be considered -- one where the offer is present in the 1024 initial INVITE and one where it is in a response. 1026 6.1.1. Offer in INVITE 1028 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1029 gathering candidates prior to actually sending its initial INVITE, so 1030 that the candidates can be provided in the INVITE. This can be 1031 started upon user interface cues that a call is pending, such as 1032 activity on a keypad or the phone going off-hook. 1034 On the receipt of the offer, the answerer SHOULD generate an answer 1035 in a provisional response as soon as it has completed gathering the 1036 candidates. ICE requires that a provisional response with an SDP be 1037 transmitted reliably. This can be done through the existing 1038 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1039 through an ICE specific optimization, wherein, the agent retransmits 1040 the provisional response with the exponential backoff timers 1041 described in [RFC3262]. Such retransmissions MUST cease on receipt 1042 of a STUN Binding request with transport address matching candidate 1043 address for one of the data streams signaled in that SDP or on 1044 transmission of the answer in a 2xx response. If no Binding request 1045 is received prior to the last retransmit, the agent does not consider 1046 the session terminated. For the ICE lite peers , the agent MUST 1047 cease retransmitting the 18x after sending it four times since there 1048 will be no Binding request sent and the number four is arbitrarily 1049 chosen to limit the number of 18x retransmits ('poor man's version of 1050 [RFC3262]' basically). (ICE will actually work even if the peer 1051 never receives the 18x; however, experience has shown that sending it 1052 is important for middleboxes and firewall traversal). 1054 Once the answer has been sent, the agent SHOULD begin its 1055 connectivity checks. Once candidate pairs for each component of a 1056 data stream enter the valid list, the answerer can begin sending 1057 media on that data stream. 1059 However, prior to this point, any media that needs to be sent towards 1060 the caller (such as SIP early media [RFC3960]) MUST NOT be 1061 transmitted. For this reason, implementations SHOULD delay alerting 1062 the called party until candidates for each component of each data 1063 stream have entered the valid list. In the case of a PSTN gateway, 1064 this would mean that the setup message into the PSTN is delayed until 1065 this point. Doing this increases the post-dial delay, but has the 1066 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1067 called party hears the phone ring, picks up, but hears nothing and 1068 cannot be heard. This technique works without requiring support for, 1069 or usage of, preconditions [RFC3312]. It also has the benefit of 1070 guaranteeing that not a single packet of media will get clipped, so 1071 that post-pickup delay is zero. If an agent chooses to delay local 1072 alerting in this way, it SHOULD generate a 180 response once alerting 1073 begins. 1075 6.1.2. Offer in Response 1077 In addition to uses where the offer is in an INVITE, and the answer 1078 is in the provisional and/or 200 OK response, ICE works with cases 1079 where the offer appears in the response. In such cases, which are 1080 common in third party call control [RFC3725], ICE agents SHOULD 1081 generate their offers in a reliable provisional response (which MUST 1082 utilize [RFC3262]), and not alert the user on receipt of the INVITE. 1083 The answer will arrive in a PRACK. This allows for ICE processing to 1084 take place prior to alerting, so that there is no post-pickup delay, 1085 at the expense of increased call setup delays. Once ICE completes, 1086 the callee can alert the user and then generate a 200 OK when they 1087 answer. The 200 OK would contain no SDP, since the offer/answer 1088 exchange has completed. 1090 Alternatively, agents MAY place the offer in a 2xx instead (in which 1091 case the answer comes in the ACK). When this happens, the callee 1092 will alert the user on receipt of the INVITE, and the ICE exchanges 1093 will take place only after the user answers. This has the effect of 1094 reducing call setup delay, but can cause substantial post-pickup 1095 delays and media clipping. 1097 6.2. SIP Option Tags and Media Feature Tags 1099 [RFC5768] specifies a SIP option tag and media feature tag for usage 1100 with ICE. ICE implementations using SIP SHOULD support this 1101 specification, which uses a feature tag in registrations to 1102 facilitate interoperability through signaling intermediaries. 1104 6.3. Interactions with Forking 1106 ICE interacts very well with forking. Indeed, ICE fixes some of the 1107 problems associated with forking. Without ICE, when a call forks and 1108 the caller receives multiple incoming data streams, it cannot 1109 determine which data stream corresponds to which callee. 1111 With ICE, this problem is resolved. The connectivity checks which 1112 occur prior to transmission of media carry username fragments, which 1113 in turn are correlated to a specific callee. Subsequent media 1114 packets that arrive on the same candidate pair as the connectivity 1115 check will be associated with that same callee. Thus, the caller can 1116 perform this correlation as long as it has received an answer. 1118 6.4. Interactions with Preconditions 1120 Quality of Service (QoS) preconditions, which are defined in 1121 [RFC3312] and [RFC4032], apply only to the transport addresses listed 1122 as the default targets for media in an offer/answer. If ICE changes 1123 the transport address where media is received, this change is 1124 reflected in an updated offer that changes the default destination 1125 for media to match ICE's selection. As such, it appears like any 1126 other re-INVITE would, and is fully treated in RFCs 3312 and 4032, 1127 which apply without regard to the fact that the destination for media 1128 is changing due to ICE negotiations occurring "in the background". 1130 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1131 met until the checks have completed and selected the candidate pairs 1132 to be used for media. 1134 ICE also has (purposeful) interactions with connectivity 1135 preconditions [RFC5898]. Those interactions are described there. 1136 Note that the procedures described in Section 6.1 describe their own 1137 type of "preconditions", albeit with less functionality than those 1138 provided by the explicit preconditions in [RFC5898]. 1140 6.5. Interactions with Third Party Call Control 1142 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1143 I works without the controller supporting or being aware of ICE. 1144 Flow IV will work as long as the controller passes along the ICE 1145 attributes without alteration. Flow II is fundamentally incompatible 1146 with ICE; each agent will believe itself to be the answerer and thus 1147 never generate a re-INVITE. 1149 The flows for continued operation, as described in Section 7 of 1150 [RFC3725], require additional behavior of ICE implementations to 1151 support. In particular, if an agent receives a mid-dialog re-INVITE 1152 that contains no offer, it MUST restart ICE for each data stream and 1153 go through the process of gathering new candidates. Furthermore, 1154 that list of candidates SHOULD include the ones currently being used 1155 for media. 1157 7. Relationship with ANAT 1159 [RFC4091], the Alternative Network Address Types (ANAT) Semantics for 1160 the SDP grouping framework, and [RFC4092], its usage with SIP, define 1161 a mechanism for indicating that an agent can support both IPv4 and 1162 IPv6 for a data stream, and it does so by including two "m=" lines, 1163 one for v4 and one for v6. This is similar to ICE, which allows for 1164 an agent to indicate multiple transport addresses using the candidate 1165 attribute. However, ANAT relies on static selection to pick between 1166 choices, rather than a dynamic connectivity check used by ICE. 1168 It is RECOMMENDED that ICE be used in realizing the dual-stack use- 1169 cases in agents that support ICE. 1171 8. Security Considerations 1173 8.1. Attacks on the Offer/Answer Exchanges 1175 An attacker that can modify or disrupt the offer/answer exchanges 1176 themselves can readily launch a variety of attacks with ICE. They 1177 could direct media to a target of a DoS attack, they could insert 1178 themselves into the data stream, and so on. These are similar to the 1179 general security considerations for offer/answer exchanges, and the 1180 security considerations in [RFC3264] apply. These require techniques 1181 for message integrity and encryption for offers and answers, which 1182 are satisfied by the TLS mechanism [RFC3261] when SIP is used. As 1183 such, the usage of TLS with ICE is RECOMMENDED. 1185 8.2. Insider Attacks 1187 In addition to attacks where the attacker is a third party trying to 1188 insert fake offers, answers, or STUN messages, there are several 1189 attacks possible with ICE when the attacker is an authenticated and 1190 valid participant in the ICE exchange. 1192 8.2.1. The Voice Hammer Attack 1194 The voice hammer attack is an amplification attack. In this attack, 1195 the attacker initiates sessions to other agents, and maliciously 1196 includes the IP address and port of a DoS target as the destination 1197 for media traffic signaled in the SDP. This causes substantial 1198 amplification; a single offer/answer exchange can create a continuing 1199 flood of media packets, possibly at high rates (consider video 1200 sources). This attack is not specific to ICE, but ICE can help 1201 provide remediation. 1203 Specifically, if ICE is used, the agent receiving the malicious SDP 1204 will first perform connectivity checks to the target of media before 1205 sending media there. If this target is a third-party host, the 1206 checks will not succeed, and media is never sent. 1208 Unfortunately, ICE doesn't help if it's not used, in which case an 1209 attacker could simply send the offer without the ICE parameters. 1210 However, in environments where the set of clients is known, and is 1211 limited to ones that support ICE, the server can reject any offers or 1212 answers that don't indicate ICE support. 1214 SIP User Agents (UA) [RFC3261] that are not willing to receive non- 1215 ICE answers MUST include an "ice" Option Tag in the SIP Require 1216 Header Field in their offer. UAs that rejects non-ICE offers SHOULD 1217 use a 421 response code, together with an Option Tag "ice" in the 1218 Require Header Field in the response. 1220 8.2.2. Interactions with Application Layer Gateways and SIP 1222 Application Layer Gateways (ALGs) are functions present in a Network 1223 Address Translation (NAT) device that inspect the contents of packets 1224 and modify them, in order to facilitate NAT traversal for application 1225 protocols. Session Border Controllers (SBCs) are close cousins of 1226 ALGs, but are less transparent since they actually exist as 1227 application-layer SIP intermediaries. ICE has interactions with SBCs 1228 and ALGs. 1230 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1231 long as the ALG correctly modifies the SDP. A correct ALG 1232 implementation behaves as follows: 1234 o The ALG does not modify the "m=" and "c=" lines or the rtcp 1235 attribute if they contain external addresses. 1237 o If the "m=" and "c=" lines contain internal addresses, the 1238 modification depends on the state of the ALG: 1240 * If the ALG already has a binding established that maps an 1241 external port to an internal IP address and port matching the 1242 values in the "m=" and "c=" lines or rtcp attribute, the ALG 1243 uses that binding instead of creating a new one. 1245 * If the ALG does not already have a binding, it creates a new 1246 one and modifies the SDP, rewriting the "m=" and "c=" lines and 1247 rtcp attribute. 1249 Unfortunately, many ALGs are known to work poorly in these corner 1250 cases. ICE does not try to work around broken ALGs, as this is 1251 outside the scope of its functionality. ICE can help diagnose these 1252 conditions, which often show up as a mismatch between the set of 1253 candidates and the "m=" and "c=" lines and rtcp attributes. The ice- 1254 mismatch attribute is used for this purpose. 1256 ICE works best through ALGs when the signaling is run over TLS. This 1257 prevents the ALG from manipulating the SDP messages and interfering 1258 with ICE operation. Implementations that are expected to be deployed 1259 behind ALGs SHOULD provide for TLS transport of the SDP. 1261 If an SBC is SIP aware but not ICE aware, the result depends on the 1262 behavior of the SBC. If it is acting as a proper Back-to-Back User 1263 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1264 understand, including the ICE attributes. Consequently, the call 1265 will appear to both endpoints as if the other side doesn't support 1266 ICE. This will result in ICE being disabled, and media flowing 1267 through the SBC, if the SBC has requested it. If, however, the SBC 1268 passes the ICE attributes without modification, yet modifies the 1269 default destination for media (contained in the "m=" and "c=" lines 1270 and rtcp attribute), this will be detected as an ICE mismatch, and 1271 ICE processing is aborted for the call. It is outside of the scope 1272 of ICE for it to act as a tool for "working around" SBCs. If one is 1273 present, ICE will not be used and the SBC techniques take precedence. 1275 9. IANA Considerations 1277 9.1. SDP Attributes 1279 The original ICE specification defined seven new SDP attributes per 1280 the procedures of Section 8.2.4 of [RFC4566]. The registration 1281 information from the original specification is included here with 1282 modifications to include Mux Category and also defines a new SDP 1283 attribute 'ice-pacing'. 1285 9.1.1. candidate Attribute 1287 Attribute Name: candidate 1289 Type of Attribute: media-level 1291 Subject to charset: No 1293 Purpose: This attribute is used with Interactive Connectivity 1294 Establishment (ICE), and provides one of many possible candidate 1295 addresses for communication. These addresses are validated with 1296 an end-to-end connectivity check using Session Traversal Utilities 1297 for NAT (STUN). 1299 Appropriate Values: See Section 4 of RFC XXXX. 1301 Contact Name: IESG 1303 Contact e-mail: iesg@ietf.org [1] 1305 Reference: RFCXXXX 1307 Mux Category: TRANSPORT 1309 9.1.2. remote-candidates Attribute 1311 Attribute Name: remote-candidates 1313 Type of Attribute: media-level 1315 Subject to charset: No 1317 Purpose: This attribute is used with Interactive Connectivity 1318 Establishment (ICE), and provides the identity of the remote 1319 candidates that the offerer wishes the answerer to use in its 1320 answer. 1322 Appropriate Values: See Section 4 of RFC XXXX. 1324 Contact Name: IESG 1326 Contact e-mail: iesg@ietf.org [2] 1328 Reference: RFCXXXX 1330 Mux Category: TRANSPORT 1332 9.1.3. ice-lite Attribute 1334 Attribute Name: ice-lite 1336 Type of Attribute: session-level 1338 Subject to charset: No 1340 Purpose: This attribute is used with Interactive Connectivity 1341 Establishment (ICE), and indicates that an agent has the minimum 1342 functionality required to support ICE inter-operation with a peer 1343 that has a full implementation. 1345 Appropriate Values: See Section 4 of RFC XXXX. 1347 Contact Name: IESG 1349 Contact e-mail: iesg@ietf.org [3] 1351 Reference: RFCXXXX 1353 Mux Category: NORMAL 1355 9.1.4. ice-mismatch Attribute 1357 Attribute Name: ice-mismatch 1359 Type of Attribute: media-level 1361 Subject to charset: No 1363 Purpose: This attribute is used with Interactive Connectivity 1364 Establishment (ICE), and indicates that an agent is ICE capable, 1365 but did not proceed with ICE due to a mismatch of candidates with 1366 the default destination for media signaled in the SDP. 1368 Appropriate Values: See Section 4 of RFC XXXX. 1370 Contact Name: IESG 1372 Contact e-mail: iesg@ietf.org [4] 1374 Reference: RFCXXXX 1376 Mux Category: NORMAL 1378 9.1.5. ice-pwd Attribute 1380 Attribute Name: ice-pwd 1382 Type of Attribute: session- or media-level 1384 Subject to charset: No 1386 Purpose: This attribute is used with Interactive Connectivity 1387 Establishment (ICE), and provides the password used to protect 1388 STUN connectivity checks. 1390 Appropriate Values: See Section 4 of RFC XXXX. 1392 Contact Name: IESG 1394 Contact e-mail: iesg@ietf.org [5] 1396 Reference: RFCXXXX 1398 Mux Category: TRANSPORT 1400 9.1.6. ice-ufrag Attribute 1402 Attribute Name: ice-ufrag 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 fragments used to construct 1410 the username in STUN connectivity checks. 1412 Appropriate Values: See Section 4 of RFC XXXX. 1414 Contact Name: IESG 1416 Contact e-mail: iesg@ietf.org [6] 1418 Reference: RFCXXXX 1420 Mux Category: TRANSPORT 1422 9.1.7. ice-options Attribute 1424 Attribute Name: ice-options 1426 Long Form: ice-options 1428 Type of Attribute: session-level 1430 Subject to charset: No 1432 Purpose: This attribute is used with Interactive Connectivity 1433 Establishment (ICE), and indicates the ICE options or extensions 1434 used by the agent. 1436 Appropriate Values: See Section 4 of RFC XXXX. 1438 Contact Name: IESG 1440 Contact e-mail: iesg@ietf.org [7] 1442 Reference: RFCXXXX 1444 Mux Category: NORMAL 1446 9.1.8. ice-pacing Attribute 1448 This specification also defines a new SDP attribute, "ice-pacing" 1449 according to the following data: 1451 Attribute Name: ice-pacing 1453 Type of Attribute: session-level 1455 Subject to charset: No 1457 Purpose: This attribute is used with Interactive Connectivity 1458 Establishment (ICE) to indicate desired connectivity check pacing 1459 values. 1461 Appropriate Values: See Section 4 of RFC XXXX. 1463 Contact Name: IESG 1465 Contact e-mail: iesg@ietf.org [8] 1467 Reference: RFCXXXX 1469 Mux Category: NORMAL 1471 9.2. Interactive Connectivity Establishment (ICE) Options Registry 1473 IANA maintains a registry for ice-options identifiers under the 1474 Specification Required policy as defined in "Guidelines for Writing 1475 an IANA Considerations Section in RFCs" [RFC5226]. 1477 ICE options are of unlimited length according to the syntax in 1478 Section 4.6; however, they are RECOMMENDED to be no longer than 20 1479 characters. This is to reduce message sizes and allow for efficient 1480 parsing. ICE options are defined at the session leve.. 1482 A registration request MUST include the following information: 1484 o The ICE option identifier to be registered 1486 o Name, Email, and Address of a contact person for the registration 1488 o Organization or individuals having the change control 1490 o Short description of the ICE extension to which the option relates 1492 o Reference(s) to the specification defining the ICE option and the 1493 related extensions 1495 10. Acknowledgments 1497 A large part of the text in this document was taken from [RFC5245], 1498 authored by Jonathan Rosenberg. 1500 Some of the text in this document was taken from [RFC6336], authored 1501 by Magnus Westerlund and Colin Perkins. 1503 Many thanks to Christer Holmberg for providing text suggestions in 1504 Section 3 that aligns with [RFC8445] 1506 Thanks to Thomas Stach for text help, Roman Shpount for suggesting 1507 RTCP candidate handling and Simon Perreault for advising on IPV6 1508 address selection when candidate-address includes FQDN. 1510 Many thanks to Flemming Andreasen for shepherd review feedback. 1512 Thanks to following experts for their reviews and constructive 1513 feedback: Christer Holmberg, Adam Roach, Peter Saint-Andre and the 1514 MMUSIC WG. 1516 11. References 1518 11.1. Normative References 1520 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1521 Requirement Levels", BCP 14, RFC 2119, 1522 DOI 10.17487/RFC2119, March 1997, 1523 . 1525 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1526 A., Peterson, J., Sparks, R., Handley, M., and E. 1527 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1528 DOI 10.17487/RFC3261, June 2002, 1529 . 1531 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1532 Provisional Responses in Session Initiation Protocol 1533 (SIP)", RFC 3262, DOI 10.17487/RFC3262, June 2002, 1534 . 1536 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1537 with Session Description Protocol (SDP)", RFC 3264, 1538 DOI 10.17487/RFC3264, June 2002, 1539 . 1541 [RFC3312] Camarillo, G., Ed., Marshall, W., Ed., and J. Rosenberg, 1542 "Integration of Resource Management and Session Initiation 1543 Protocol (SIP)", RFC 3312, DOI 10.17487/RFC3312, October 1544 2002, . 1546 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1547 Modifiers for RTP Control Protocol (RTCP) Bandwidth", 1548 RFC 3556, DOI 10.17487/RFC3556, July 2003, 1549 . 1551 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1552 in Session Description Protocol (SDP)", RFC 3605, 1553 DOI 10.17487/RFC3605, October 2003, 1554 . 1556 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1557 Initiation Protocol (SIP) Preconditions Framework", 1558 RFC 4032, DOI 10.17487/RFC4032, March 2005, 1559 . 1561 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1562 Address Types (ANAT) Semantics for the Session Description 1563 Protocol (SDP) Grouping Framework", RFC 4091, June 2005, 1564 . 1566 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1567 Description Protocol (SDP) Alternative Network Address 1568 Types (ANAT) Semantics in the Session Initiation Protocol 1569 (SIP)", RFC 4092, June 2005, 1570 . 1572 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1573 Description Protocol", RFC 4566, DOI 10.17487/RFC4566, 1574 July 2006, . 1576 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1577 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1578 DOI 10.17487/RFC5226, May 2008, 1579 . 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 [RFC8445] Keranen, A., Holmberg, C., and J. Rosenberg, "Interactive 1597 Connectivity Establishment (ICE): A Protocol for Network 1598 Address Translator (NAT) Traversal", RFC 8445, 1599 DOI 10.17487/RFC8445, July 2018, 1600 . 1602 11.2. Informative References 1604 [draft-holmberg-ice-pac] 1605 Holmberg, C. and J. Uberti, "Interactive Connectivity 1606 Establishment Patiently Awaiting Connectivity (ICE PAC)", 1607 draft-holmberg-ice-pac-01 (work in progress), March 2019, 1608 . 1611 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1612 Camarillo, "Best Current Practices for Third Party Call 1613 Control (3pcc) in the Session Initiation Protocol (SIP)", 1614 BCP 85, RFC 3725, DOI 10.17487/RFC3725, April 2004, 1615 . 1617 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1618 Tone Generation in the Session Initiation Protocol (SIP)", 1619 RFC 3960, DOI 10.17487/RFC3960, December 2004, 1620 . 1622 [RFC5245] Rosenberg, J., "Interactive Connectivity Establishment 1623 (ICE): A Protocol for Network Address Translator (NAT) 1624 Traversal for Offer/Answer Protocols", RFC 5245, 1625 DOI 10.17487/RFC5245, April 2010, 1626 . 1628 [RFC5626] Jennings, C., Ed., Mahy, R., Ed., and F. Audet, Ed., 1629 "Managing Client-Initiated Connections in the Session 1630 Initiation Protocol (SIP)", RFC 5626, 1631 DOI 10.17487/RFC5626, October 2009, 1632 . 1634 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1635 "Connectivity Preconditions for Session Description 1636 Protocol (SDP) Media Streams", RFC 5898, 1637 DOI 10.17487/RFC5898, July 2010, 1638 . 1640 11.3. URIs 1642 [1] mailto:iesg@ietf.org 1644 [2] mailto:iesg@ietf.org 1646 [3] mailto:iesg@ietf.org 1648 [4] mailto:iesg@ietf.org 1650 [5] mailto:iesg@ietf.org 1652 [6] mailto:iesg@ietf.org 1654 [7] mailto:iesg@ietf.org 1656 [8] mailto:iesg@ietf.org 1658 [9] mailto:christer.holmberg@ericsson.com 1660 [10] mailto:rshpount@turbobridge.com 1662 [11] mailto:thomass.stach@gmail.com 1664 Appendix A. Examples 1666 For the example shown in section 15 of [RFC8445] the resulting offer 1667 (message 5) encoded in SDP looks like: 1669 v=0 1670 o=jdoe 2890844526 2890842807 IN IP6 $L-PRIV-1.IP 1671 s= 1672 c=IN IP6 $NAT-PUB-1.IP 1673 t=0 0 1674 a=ice-pwd:asd88fgpdd777uzjYhagZg 1675 a=ice-ufrag:8hhY 1676 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1677 b=RS:0 1678 b=RR:0 1679 a=rtpmap:0 PCMU/8000 1680 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1681 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1682 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1684 The offer, with the variables replaced with their values, will look 1685 like (lines folded for clarity): 1687 v=0 1688 o=jdoe 2890844526 2890842807 IN IP6 fe80::6676:baff:fe9c:ee4a 1689 s= 1690 c=IN IP6 2001:420:c0e0:1005::61 1691 t=0 0 1692 a=ice-pwd:asd88fgpdd777uzjYhagZg 1693 a=ice-ufrag:8hhY 1694 m=audio 45664 RTP/AVP 0 1695 b=RS:0 1696 b=RR:0 1697 a=rtpmap:0 PCMU/8000 1698 a=candidate:1 1 UDP 2130706431 fe80::6676:baff:fe9c:ee4a 8998 typ host 1699 a=candidate:2 1 UDP 1694498815 2001:420:c0e0:1005::61 45664 typ srflx raddr 1700 fe80::6676:baff:fe9c:ee4a rport 8998 1702 The resulting answer looks like: 1704 v=0 1705 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1706 s= 1707 c=IN IP4 $R-PUB-1.IP 1708 t=0 0 1709 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1710 a=ice-ufrag:9uB6 1711 m=audio $R-PUB-1.PORT RTP/AVP 0 1712 b=RS:0 1713 b=RR:0 1714 a=rtpmap:0 PCMU/8000 1715 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1717 With the variables filled in: 1719 v=0 1720 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1721 s= 1722 c=IN IP4 192.0.2.1 1723 t=0 0 1724 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1725 a=ice-ufrag:9uB6 1726 m=audio 3478 RTP/AVP 0 1727 b=RS:0 1728 b=RR:0 1729 a=rtpmap:0 PCMU/8000 1730 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1732 Appendix B. The remote-candidates Attribute 1734 The a=remote-candidates attribute exists to eliminate a race 1735 condition between the updated offer and the response to the STUN 1736 Binding request that moved a candidate into the Valid list. This 1737 race condition is shown in Figure 1. On receipt of message 4, agent 1738 L adds a candidate pair to the valid list. If there was only a 1739 single data stream with a single component, agent L could now send an 1740 updated offer. However, the check from agent R has not yet generated 1741 a response, and agent R receives the updated offer (message 7) before 1742 getting the response (message 9). Thus, it does not yet know that 1743 this particular pair is valid. To eliminate this condition, the 1744 actual candidates at R that were selected by the offerer (the remote 1745 candidates) are included in the offer itself, and the answerer delays 1746 its answer until those pairs validate. 1748 Agent L Network Agent R 1749 |(1) Offer | | 1750 |------------------------------------------>| 1751 |(2) Answer | | 1752 |<------------------------------------------| 1753 |(3) STUN Req. | | 1754 |------------------------------------------>| 1755 |(4) STUN Res. | | 1756 |<------------------------------------------| 1757 |(5) STUN Req. | | 1758 |<------------------------------------------| 1759 |(6) STUN Res. | | 1760 |-------------------->| | 1761 | |Lost | 1762 |(7) Offer | | 1763 |------------------------------------------>| 1764 |(8) STUN Req. | | 1765 |<------------------------------------------| 1766 |(9) STUN Res. | | 1767 |------------------------------------------>| 1768 |(10) Answer | | 1769 |<------------------------------------------| 1771 Figure 1: Race Condition Flow 1773 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1775 When ICE runs between two peers, one agent acts as controlled, and 1776 the other as controlling. Rules are defined as a function of 1777 implementation type and offerer/answerer to determine who is 1778 controlling and who is controlled. However, the specification 1779 mentions that, in some cases, both sides might believe they are 1780 controlling, or both sides might believe they are controlled. How 1781 can this happen? 1783 The condition when both agents believe they are controlled shows up 1784 in third party call control cases. Consider the following flow: 1786 A Controller B 1787 |(1) INV() | | 1788 |<-------------| | 1789 |(2) 200(SDP1) | | 1790 |------------->| | 1791 | |(3) INV() | 1792 | |------------->| 1793 | |(4) 200(SDP2) | 1794 | |<-------------| 1795 |(5) ACK(SDP2) | | 1796 |<-------------| | 1797 | |(6) ACK(SDP1) | 1798 | |------------->| 1800 Figure 2: Role Conflict Flow 1802 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1803 it works better than flow III since it produces fewer messages. In 1804 this flow, the controller sends an offerless INVITE to agent A, which 1805 responds with its offer, SDP1. The agent then sends an offerless 1806 INVITE to agent B, which it responds to with its offer, SDP2. The 1807 controller then uses the offer from each agent to generate the 1808 answers. When this flow is used, ICE will run between agents A and 1809 B, but both will believe they are in the controlling role. With the 1810 role conflict resolution procedures, this flow will function properly 1811 when ICE is used. 1813 At this time, there are no documented flows that can result in the 1814 case where both agents believe they are controlled. However, the 1815 conflict resolution procedures allow for this case, should a flow 1816 arise that would fit into this category. 1818 Appendix D. Why Send an Updated Offer? 1820 Section 11.1 describes rules for sending media. Both agents can send 1821 media once ICE checks complete, without waiting for an updated offer. 1822 Indeed, the only purpose of the updated offer is to "correct" the SDP 1823 so that the default destination for media matches where media is 1824 being sent based on ICE procedures (which will be the highest- 1825 priority nominated candidate pair). 1827 This begs the question -- why is the updated offer/answer exchange 1828 needed at all? Indeed, in a pure offer/answer environment, it would 1829 not be. The offerer and answerer will agree on the candidates to use 1830 through ICE, and then can begin using them. As far as the agents 1831 themselves are concerned, the updated offer/answer provides no new 1832 information. However, in practice, numerous components along the 1833 signaling path look at the SDP information. These include entities 1834 performing off-path QoS reservations, NAT traversal components such 1835 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1836 that passively monitor the network. For these tools to continue to 1837 function without change, the core property of SDP -- that the 1838 existing, pre-ICE definitions of the addresses used for media -- the 1839 "m=" and "c=" lines and the rtcp attribute -- must be retained. For 1840 this reason, an updated offer must be sent. 1842 Appendix E. Contributors 1844 Following experts have contributed textual and structural 1845 improvements for this work 1847 1. Christer Holmberg 1849 * Ericsson 1851 * Email: christer.holmberg@ericsson.com [9] 1853 2. Roman Shpount 1855 * TurboBridge 1857 * rshpount@turbobridge.com [10] 1859 3. Thomas Stach 1861 * thomass.stach@gmail.com [11] 1863 Authors' Addresses 1865 Marc Petit-Huguenin 1866 Impedance Mismatch 1868 Email: marc@petit-huguenin.org 1869 Suhas Nandakumar 1870 Cisco Systems 1871 707 Tasman Dr 1872 Milpitas, CA 95035 1873 USA 1875 Email: snandaku@cisco.com 1877 Ari Keranen 1878 Ericsson 1879 Jorvas 02420 1880 Finland 1882 Email: ari.keranen@ericsson.com