idnits 2.17.1 draft-ietf-mmusic-ice-sip-sdp-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 6 instances of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 4, 2014) is 3577 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 4091 (Obsoleted by RFC 5245) ** Obsolete normative reference: RFC 4092 (Obsoleted by RFC 5245) ** Obsolete normative reference: RFC 4566 (Obsoleted by RFC 8866) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5389 (Obsoleted by RFC 8489) -- Unexpected draft version: The latest known version of draft-keranen-mmusic-rfc5245bis is -01, but you're referring to -02. Summary: 5 errors (**), 0 flaws (~~), 3 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 MMUSIC M. Petit-Huguenin 3 Internet-Draft Jive Communications 4 Intended status: Standards Track A. Keranen 5 Expires: January 5, 2015 Ericsson 6 July 4, 2014 8 Using Interactive Connectivity Establishment (ICE) with 9 Session Description Protocol (SDP) offer/answer and 10 Session Initiation Protocol (SIP) 11 draft-ietf-mmusic-ice-sip-sdp-03 13 Abstract 15 This document describes how Interactive Connectivity Establishment 16 (ICE) is used with Session Description Protocol (SDP) offer/answer 17 and Session Initiation Protocol (SIP). 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at http://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on January 5, 2015. 36 Copyright Notice 38 Copyright (c) 2014 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (http://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 This document may contain material from IETF Documents or IETF 52 Contributions published or made publicly available before November 53 10, 2008. The person(s) controlling the copyright in some of this 54 material may not have granted the IETF Trust the right to allow 55 modifications of such material outside the IETF Standards Process. 56 Without obtaining an adequate license from the person(s) controlling 57 the copyright in such materials, this document may not be modified 58 outside the IETF Standards Process, and derivative works of it may 59 not be created outside the IETF Standards Process, except to format 60 it for publication as an RFC or to translate it into languages other 61 than English. 63 Table of Contents 65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 66 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 67 3. Sending the Initial Offer . . . . . . . . . . . . . . . . . . 4 68 3.1. Choosing Default Candidates . . . . . . . . . . . . . . . 4 69 3.2. Encoding the SDP . . . . . . . . . . . . . . . . . . . . 5 70 4. Receiving the Initial Offer . . . . . . . . . . . . . . . . . 6 71 4.1. Choosing Default Candidates . . . . . . . . . . . . . . . 6 72 4.2. Verifying ICE Support . . . . . . . . . . . . . . . . . . 6 73 4.3. Determining Role . . . . . . . . . . . . . . . . . . . . 7 74 5. Receipt of the Initial Answer . . . . . . . . . . . . . . . . 7 75 5.1. Verifying ICE Support . . . . . . . . . . . . . . . . . . 7 76 6. Performing Connectivity Checks . . . . . . . . . . . . . . . 8 77 7. Concluding ICE . . . . . . . . . . . . . . . . . . . . . . . 8 78 7.1. Procedures for Full Implementations . . . . . . . . . . . 8 79 7.1.1. Updating states . . . . . . . . . . . . . . . . . . . 8 80 7.2. Freeing Candidates . . . . . . . . . . . . . . . . . . . 8 81 7.2.1. Full Implementation Procedures . . . . . . . . . . . 8 82 8. Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 83 8.1. "candidate" Attribute . . . . . . . . . . . . . . . . . . 9 84 8.2. "remote-candidates" Attribute . . . . . . . . . . . . . . 11 85 8.3. "ice-lite" and "ice-mismatch" Attributes . . . . . . . . 11 86 8.4. "ice-ufrag" and "ice-pwd" Attributes . . . . . . . . . . 12 87 8.5. "ice-pacing" Attribute . . . . . . . . . . . . . . . . . 12 88 8.6. "ice-options" Attribute . . . . . . . . . . . . . . . . . 13 89 9. Subsequent Offer/Answer Exchanges . . . . . . . . . . . . . . 13 90 9.1. Generating the Offer . . . . . . . . . . . . . . . . . . 13 91 9.1.1. Procedures for All Implementations . . . . . . . . . 13 92 9.1.2. Procedures for Full Implementations . . . . . . . . . 14 93 9.1.3. Procedures for Lite Implementations . . . . . . . . . 16 94 9.2. Receiving the Offer and Generating an Answer . . . . . . 17 95 9.2.1. Procedures for All Implementations . . . . . . . . . 17 96 9.2.2. Procedures for Full Implementations . . . . . . . . . 18 97 9.2.3. Procedures for Lite Implementations . . . . . . . . . 19 98 9.3. Updating the Check and Valid Lists . . . . . . . . . . . 20 99 9.3.1. Procedures for Full Implementations . . . . . . . . . 20 100 9.3.2. Procedures for Lite Implementations . . . . . . . . . 21 101 10. Keepalives . . . . . . . . . . . . . . . . . . . . . . . . . 21 102 11. Media Handling . . . . . . . . . . . . . . . . . . . . . . . 22 103 11.1. Sending Media . . . . . . . . . . . . . . . . . . . . . 22 104 11.1.1. Procedures for All Implementations . . . . . . . . . 22 105 11.2. Receiving Media . . . . . . . . . . . . . . . . . . . . 22 106 12. Usage with SIP . . . . . . . . . . . . . . . . . . . . . . . 23 107 12.1. Latency Guidelines . . . . . . . . . . . . . . . . . . . 23 108 12.1.1. Offer in INVITE . . . . . . . . . . . . . . . . . . 23 109 12.1.2. Offer in Response . . . . . . . . . . . . . . . . . 24 110 12.2. SIP Option Tags and Media Feature Tags . . . . . . . . . 25 111 12.3. Interactions with Forking . . . . . . . . . . . . . . . 25 112 12.4. Interactions with Preconditions . . . . . . . . . . . . 25 113 12.5. Interactions with Third Party Call Control . . . . . . . 26 114 13. Relationship with ANAT . . . . . . . . . . . . . . . . . . . 26 115 14. Setting Ta and RTO for RTP Media Streams . . . . . . . . . . 26 116 15. Security Considerations . . . . . . . . . . . . . . . . . . . 28 117 15.1. Attacks on the Offer/Answer Exchanges . . . . . . . . . 28 118 15.2. Insider Attacks . . . . . . . . . . . . . . . . . . . . 29 119 15.2.1. The Voice Hammer Attack . . . . . . . . . . . . . . 29 120 15.2.2. Interactions with Application Layer Gateways and SIP 29 121 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 30 122 16.1. SDP Attributes . . . . . . . . . . . . . . . . . . . . . 30 123 16.1.1. candidate Attribute . . . . . . . . . . . . . . . . 30 124 16.1.2. remote-candidates Attribute . . . . . . . . . . . . 31 125 16.1.3. ice-lite Attribute . . . . . . . . . . . . . . . . . 31 126 16.1.4. ice-mismatch Attribute . . . . . . . . . . . . . . . 32 127 16.1.5. ice-pwd Attribute . . . . . . . . . . . . . . . . . 32 128 16.1.6. ice-ufrag Attribute . . . . . . . . . . . . . . . . 33 129 16.1.7. ice-pacing Attribute . . . . . . . . . . . . . . . . 33 130 16.1.8. ice-options Attribute . . . . . . . . . . . . . . . 33 131 16.2. Interactive Connectivity Establishment (ICE) Options 132 Registry . . . . . . . . . . . . . . . . . . . . . . . . 34 133 17. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 35 134 18. References . . . . . . . . . . . . . . . . . . . . . . . . . 35 135 18.1. Normative References . . . . . . . . . . . . . . . . . . 35 136 18.2. Informative References . . . . . . . . . . . . . . . . . 36 137 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 37 138 Appendix B. The remote-candidates Attribute . . . . . . . . . . 39 139 Appendix C. Why Is the Conflict Resolution Mechanism Needed? . . 39 140 Appendix D. Why Send an Updated Offer? . . . . . . . . . . . . . 40 141 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 41 143 1. Introduction 145 This document describes how Interactive Connectivity Establishment 146 (ICE) is used with Session Description Protocol (SDP) offer/answer 147 and Session Initiation Protocol (SIP). The ICE specification 148 [ICE-BIS] describes procedures that are common to all usages of ICE 149 and this document gives the additional details needed to use ICE with 150 SIP and SDP offer/answer. 152 Note that ICE is not intended for NAT traversal for SIP, which is 153 assumed to be provided via another mechanism [RFC5626]. 155 2. Terminology 157 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 158 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 159 "OPTIONAL" in this document are to be interpreted as described in RFC 160 2119 [RFC2119]. 162 This document uses the terms defined in [ICE-BIS] and the following: 164 Default Destination/Candidate: The default destination for a 165 component of a media stream is the transport address that would be 166 used by an agent that is not ICE aware. A default candidate for a 167 component is one whose transport address matches the default 168 destination for that component. For the RTP component, the 169 default IP address is in the c line of the SDP, and the port is in 170 the m line. For the RTCP component, it is in the rtcp attribute 171 when present, and when not present, the IP address is in the c 172 line and 1 plus the port is in the m line. 174 3. Sending the Initial Offer 176 3.1. Choosing Default Candidates 178 A candidate is said to be default if it would be the target of media 179 from a non-ICE peer; that target is called the DEFAULT DESTINATION. 180 If the default candidates are not selected by the ICE algorithm when 181 communicating with an ICE-aware peer, an updated offer/answer will be 182 required after ICE processing completes in order to "fix up" the SDP 183 so that the default destination for media matches the candidates 184 selected by ICE. If ICE happens to select the default candidates, no 185 updated offer/answer is required. 187 An agent MUST choose a set of candidates, one for each component of 188 each in-use media stream, to be default. A media stream is in-use if 189 it does not have a port of zero (which is used in RFC 3264 to reject 190 a media stream). Consequently, a media stream is in-use even if it 191 is marked as a=inactive [RFC4566] or has a bandwidth value of zero. 193 It is RECOMMENDED that default candidates be chosen based on the 194 likelihood of those candidates to work with the peer that is being 195 contacted. It is RECOMMENDED that the default candidates are the 196 relayed candidates (if relayed candidates are available), server 197 reflexive candidates (if server reflexive candidates are available), 198 and finally host candidates. 200 3.2. Encoding the SDP 202 The process of encoding the SDP is identical between full and lite 203 implementations. 205 The agent will include an m line for each media stream it wishes to 206 use. The ordering of media streams in the SDP is relevant for ICE. 207 ICE will perform its connectivity checks for the first m line first, 208 and consequently media will be able to flow for that stream first. 209 Agents SHOULD place their most important media stream, if there is 210 one, first in the SDP. 212 There will be a candidate attribute for each candidate for a 213 particular media stream. Section 8 provides detailed rules for 214 constructing this attribute. 216 STUN connectivity checks between agents are authenticated using the 217 short-term credential mechanism defined for STUN [RFC5389]. This 218 mechanism relies on a username and password that are exchanged 219 through protocol machinery between the client and server. The 220 username fragment and password are exchanged in the ice-ufrag and 221 ice-pwd attributes, respectively. 223 If an agent is a lite implementation, it MUST include an "a=ice-lite" 224 session-level attribute in its SDP to indicate this. If an agent is 225 a full implementation, it MUST NOT include this attribute. 227 The default candidates are added to the SDP as the default 228 destination for media. For streams based on RTP, this is done by 229 placing the IP address and port of the RTP candidate into the c and m 230 lines, respectively. If the agent is utilizing RTCP, it MUST encode 231 the RTCP candidate using the a=rtcp attribute as defined in RFC 3605 232 [RFC3605]. If RTCP is not in use, the agent MUST signal that using 233 b=RS:0 and b=RR:0 as defined in RFC 3556 [RFC3556]. 235 The transport addresses that will be the default destination for 236 media when communicating with non-ICE peers MUST also be present as 237 candidates in one or more a=candidate lines. 239 ICE provides for extensibility by allowing an offer or answer to 240 contain a series of tokens that identify the ICE extensions used by 241 that agent. If an agent supports an ICE extension, it MUST include 242 the token defined for that extension in the ice-options attribute. 244 The following is an example SDP message that includes ICE attributes 245 (lines folded for readability): 247 v=0 248 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 249 s= 250 c=IN IP4 192.0.2.3 251 t=0 0 252 a=ice-pwd:asd88fgpdd777uzjYhagZg 253 a=ice-ufrag:8hhY 254 m=audio 45664 RTP/AVP 0 255 b=RS:0 256 b=RR:0 257 a=rtpmap:0 PCMU/8000 258 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 259 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 260 10.0.1.1 rport 8998 262 Once an agent has sent its offer or its answer, that agent MUST be 263 prepared to receive both STUN and media packets on each candidate. 264 As discussed in Section 10.1 of [ICE-BIS], media packets can be sent 265 to a candidate prior to its appearance as the default destination for 266 media in an offer or answer. 268 4. Receiving the Initial Offer 270 4.1. Choosing Default Candidates 272 The process for selecting default candidates at the answerer is 273 identical to the process followed by the offerer, as described in 274 Section 3.1 for full implementations and 4.2 of [ICE-BIS] for lite 275 implementations. 277 4.2. Verifying ICE Support 279 The agent will proceed with the ICE procedures defined in [ICE-BIS] 280 and this specification if, for each media stream in the SDP it 281 received, the default destination for each component of that media 282 stream appears in a candidate attribute. For example, in the case of 283 RTP, the IP address and port in the c and m lines, respectively, 284 appear in a candidate attribute and the value in the rtcp attribute 285 appears in a candidate attribute. 287 If this condition is not met, the agent MUST process the SDP based on 288 normal RFC 3264 procedures, without using any of the ICE mechanisms 289 described in the remainder of this specification with the following 290 exceptions: 292 1. The agent MUST follow the rules of section 9 of [ICE-BIS], which 293 describe keepalive procedures for all agents. 295 2. If the agent is not proceeding with ICE because there were 296 a=candidate attributes, but none that matched the default 297 destination of the media stream, the agent MUST include an a=ice- 298 mismatch attribute in its answer. 300 3. If the default candidates were relayed candidates learned through 301 a TURN server, the agent MUST create permissions in the TURN 302 server for the IP addresses learned from its peer in the SDP it 303 just received. If this is not done, initial packets in the media 304 stream from the peer may be lost. 306 4.3. Determining Role 308 In unusual cases, described in Appendix C, it is possible for both 309 agents to mistakenly believe they are controlled or controlling. To 310 resolve this, each agent MUST select a random number, called the tie- 311 breaker, uniformly distributed between 0 and (2**64) - 1 (that is, a 312 64-bit positive integer). This number is used in connectivity checks 313 to detect and repair this case, as described in Section 7.1.2.2 of 314 [ICE-BIS]. 316 5. Receipt of the Initial Answer 318 When ICE is used with SIP, forking may result in a single offer 319 generating a multiplicity of answers. In that case, ICE proceeds 320 completely in parallel and independently for each answer, treating 321 the combination of its offer and each answer as an independent offer/ 322 answer exchange, with its own set of pairs, check lists, states, and 323 so on. The only case in which processing of one pair impacts another 324 is freeing of candidates, discussed below in Section 7.2. 326 5.1. Verifying ICE Support 328 The logic at the offerer is identical to that of the answerer as 329 described in section 5.1 of [ICE-BIS], with the exception that an 330 offerer would not ever generate a=ice-mismatch attributes in an SDP. 332 In some cases, the answer may omit a=candidate attributes for the 333 media streams, and instead include an a=ice-mismatch attribute for 334 one or more of the media streams in the SDP. This signals to the 335 offerer that the answerer supports ICE, but that ICE processing was 336 not used for the session because a signaling intermediary modified 337 the default destination for media components without modifying the 338 corresponding candidate attributes. See Section 15.2.2 for a 339 discussion of cases where this can happen. This specification 340 provides no guidance on how an agent should proceed in such a failure 341 case. 343 6. Performing Connectivity Checks 345 The possibility for role conflicts described in Section 7.2.1.1 of 346 [ICE-BIS] applies to this usage and hence all full agents MUST 347 implement the role conflict repairing mechanism. Also both full and 348 lite agents MUST utilize the ICE-CONTROLLED and ICE-CONTROLLING 349 attributes as described in Section 7.1.2.2 of [ICE-BIS]. 351 7. Concluding ICE 353 Once all of the media streams are completed, the controlling endpoint 354 sends an updated offer if the candidates in the m and c lines for the 355 media stream (called the DEFAULT CANDIDATES) don't match ICE's 356 SELECTED CANDIDATES. 358 7.1. Procedures for Full Implementations 360 7.1.1. Updating states 362 Once the state of each check list is Completed, If an agent is 363 controlling, it examines the highest-priority nominated candidate 364 pair for each component of each media stream. If any of those 365 candidate pairs differ from the default candidate pairs in the most 366 recent offer/answer exchange, the controlling agent MUST generate an 367 updated offer as described in Section 9. 369 7.2. Freeing Candidates 371 7.2.1. Full Implementation Procedures 373 When ICE is used with SIP, and an offer is forked to multiple 374 recipients, ICE proceeds in parallel and independently with each 375 answerer, all using the same local candidates. Once ICE processing 376 has reached the Completed state for all peers for media streams using 377 those candidates, the agent SHOULD wait an additional three seconds, 378 and then it MAY cease responding to checks or generating triggered 379 checks on that candidate. It MAY free the candidate at that time. 380 Freeing of server reflexive candidates is never explicit; it happens 381 by lack of a keepalive. The three-second delay handles cases when 382 aggressive nomination is used, and the selected pairs can quickly 383 change after ICE has completed. 385 8. Grammar 387 This specification defines eight new SDP attributes -- the 388 "candidate", "remote-candidates", "ice-lite", "ice-mismatch", "ice- 389 ufrag", "ice-pwd", "ice-pacing", and "ice-options" attributes. 391 8.1. "candidate" Attribute 393 The candidate attribute is a media-level attribute only. It contains 394 a transport address for a candidate that can be used for connectivity 395 checks. 397 The syntax of this attribute is defined using Augmented BNF as 398 defined in [RFC5234]: 400 candidate-attribute = "candidate" ":" foundation SP component-id SP 401 transport SP 402 priority SP 403 connection-address SP ;from RFC 4566 404 port ;port from RFC 4566 405 SP cand-type 406 [SP rel-addr] 407 [SP rel-port] 408 *(SP extension-att-name SP 409 extension-att-value) 411 foundation = 1*32ice-char 412 component-id = 1*5DIGIT 413 transport = "UDP" / transport-extension 414 transport-extension = token ; from RFC 3261 415 priority = 1*10DIGIT 416 cand-type = "typ" SP candidate-types 417 candidate-types = "host" / "srflx" / "prflx" / "relay" / token 418 rel-addr = "raddr" SP connection-address 419 rel-port = "rport" SP port 420 extension-att-name = token 421 extension-att-value = *VCHAR 422 ice-char = ALPHA / DIGIT / "+" / "/" 424 This grammar encodes the primary information about a candidate: its 425 IP address, port and transport protocol, and its properties: the 426 foundation, component ID, priority, type, and related transport 427 address: 429 : is taken from RFC 4566 [RFC4566]. It is the 430 IP address of the candidate, allowing for IPv4 addresses, IPv6 431 addresses, and fully qualified domain names (FQDNs). When parsing 432 this field, an agent can differentiate an IPv4 address and an IPv6 433 address by presence of a colon in its value -- the presence of a 434 colon indicates IPv6. An agent MUST ignore candidate lines that 435 include candidates with IP address versions that are not supported 436 or recognized. An IP address SHOULD be used, but an FQDN MAY be 437 used in place of an IP address. In that case, when receiving an 438 offer or answer containing an FQDN in an a=candidate attribute, 439 the FQDN is looked up in the DNS first using an AAAA record 440 (assuming the agent supports IPv6), and if no result is found or 441 the agent only supports IPv4, using an A. If the DNS query 442 returns more than one IP address, one is chosen, and then used for 443 the remainder of ICE processing. 445 : is also taken from RFC 4566 [RFC4566]. It is the port of 446 the candidate. 448 : indicates the transport protocol for the candidate. 449 This specification only defines UDP. However, extensibility is 450 provided to allow for future transport protocols to be used with 451 ICE, such as TCP or the Datagram Congestion Control Protocol 452 (DCCP) [RFC4340]. 454 : is composed of 1 to 32 s. It is an 455 identifier that is equivalent for two candidates that are of the 456 same type, share the same base, and come from the same STUN 457 server. The foundation is used to optimize ICE performance in the 458 Frozen algorithm. 460 : is a positive integer between 1 and 256 that 461 identifies the specific component of the media stream for which 462 this is a candidate. It MUST start at 1 and MUST increment by 1 463 for each component of a particular candidate. For media streams 464 based on RTP, candidates for the actual RTP media MUST have a 465 component ID of 1, and candidates for RTCP MUST have a component 466 ID of 2. See section 11 in [ICE-BIS] for additional discussion on 467 extending ICE to new media streams. 469 : is a positive integer between 1 and (2**31 - 1). 471 : encodes the type of candidate. This specification 472 defines the values "host", "srflx", "prflx", and "relay" for host, 473 server reflexive, peer reflexive, and relayed candidates, 474 respectively. The set of candidate types is extensible for the 475 future. 477 and : convey transport addresses related to the 478 candidate, useful for diagnostics and other purposes. 479 and MUST be present for server reflexive, peer 480 reflexive, and relayed candidates. If a candidate is server or 481 peer reflexive, and are equal to the base 482 for that server or peer reflexive candidate. If the candidate is 483 relayed, and is equal to the mapped address 484 in the Allocate response that provided the client with that 485 relayed candidate (see section Appendix B.3 of [ICE-BIS] for a 486 discussion of its purpose). If the candidate is a host candidate, 487 and MUST be omitted. 489 In some cases, e.g., for privacy reasons, an agent may not want to 490 reveal the related address and port. In this case the address 491 MUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 492 candidates) and the port to zero. 494 The candidate attribute can itself be extended. The grammar allows 495 for new name/value pairs to be added at the end of the attribute. An 496 implementation MUST ignore any name/value pairs it doesn't 497 understand. 499 8.2. "remote-candidates" Attribute 501 The syntax of the "remote-candidates" attribute is defined using 502 Augmented BNF as defined in RFC 5234 [RFC5234]. The remote- 503 candidates attribute is a media-level attribute only. 505 remote-candidate-att = "remote-candidates" ":" remote-candidate 506 0*(SP remote-candidate) 507 remote-candidate = component-ID SP connection-address SP port 509 The attribute contains a connection-address and port for each 510 component. The ordering of components is irrelevant. However, a 511 value MUST be present for each component of a media stream. This 512 attribute MUST be included in an offer by a controlling agent for a 513 media stream that is Completed, and MUST NOT be included in any other 514 case. 516 8.3. "ice-lite" and "ice-mismatch" Attributes 518 The syntax of the "ice-lite" and "ice-mismatch" attributes, both of 519 which are flags, is: 521 ice-lite = "ice-lite" 522 ice-mismatch = "ice-mismatch" 523 "ice-lite" is a session-level attribute only, and indicates that an 524 agent is a lite implementation. "ice-mismatch" is a media-level 525 attribute only, and when present in an answer, indicates that the 526 offer arrived with a default destination for a media component that 527 didn't have a corresponding candidate attribute. 529 8.4. "ice-ufrag" and "ice-pwd" Attributes 531 The "ice-ufrag" and "ice-pwd" attributes convey the username fragment 532 and password used by ICE for message integrity. Their syntax is: 534 ice-pwd-att = "ice-pwd" ":" password 535 ice-ufrag-att = "ice-ufrag" ":" ufrag 536 password = 22*256ice-char 537 ufrag = 4*256ice-char 539 The "ice-pwd" and "ice-ufrag" attributes can appear at either the 540 session-level or media-level. When present in both, the value in the 541 media-level takes precedence. Thus, the value at the session-level 542 is effectively a default that applies to all media streams, unless 543 overridden by a media-level value. Whether present at the session or 544 media-level, there MUST be an ice-pwd and ice-ufrag attribute for 545 each media stream. If two media streams have identical ice-ufrag's, 546 they MUST have identical ice-pwd's. 548 The ice-ufrag and ice-pwd attributes MUST be chosen randomly at the 549 beginning of a session. The ice-ufrag attribute MUST contain at 550 least 24 bits of randomness, and the ice-pwd attribute MUST contain 551 at least 128 bits of randomness. This means that the ice-ufrag 552 attribute will be at least 4 characters long, and the ice-pwd at 553 least 22 characters long, since the grammar for these attributes 554 allows for 6 bits of randomness per character. The attributes MAY be 555 longer than 4 and 22 characters, respectively, of course, up to 256 556 characters. The upper limit allows for buffer sizing in 557 implementations. Its large upper limit allows for increased amounts 558 of randomness to be added over time. For compatibility with the 512 559 character limitation for the STUN username attribute value and for 560 bandwidth conservation considerations, the ice-ufrag attribute MUST 561 NOT be longer than 32 characters when sending, but an implementation 562 MUST accept up to 256 characters when receiving. 564 8.5. "ice-pacing" Attribute 566 The "ice-pacing" attribute indicates the desired connectivity check 567 pacing, in milliseconds, for this agent (see Section 12.2 of 568 [ICE-BIS]). The syntax is: 570 ice-pacing-att = "ice-pacing" ":" pacing-value 571 pacing-value = 1*10DIGIT 573 8.6. "ice-options" Attribute 575 The "ice-options" attribute is a session- and media-level attribute. 576 It contains a series of tokens that identify the options supported by 577 the agent. Its grammar is: 579 ice-options = "ice-options" ":" ice-option-tag 580 0*(SP ice-option-tag) 581 ice-option-tag = 1*ice-char 583 The existence of an ice-option can indicate that a certain extension 584 is supported by the agent and will be used or that the extension is 585 used only if the other agent is willing to use it too. In order to 586 avoid ambiguity, documents defining new options must indicate which 587 case applies to the defined extensions. 589 9. Subsequent Offer/Answer Exchanges 591 Either agent MAY generate a subsequent offer at any time allowed by 592 RFC 3264 [RFC3264]. The rules in Section 7 will cause the 593 controlling agent to send an updated offer at the conclusion of ICE 594 processing when ICE has selected different candidate pairs from the 595 default pairs. This section defines rules for construction of 596 subsequent offers and answers. 598 Should a subsequent offer be rejected, ICE processing continues as if 599 the subsequent offer had never been made. 601 9.1. Generating the Offer 603 9.1.1. Procedures for All Implementations 605 9.1.1.1. ICE Restarts 607 An agent MAY restart ICE processing for an existing media stream. An 608 ICE restart, as the name implies, will cause all previous states of 609 ICE processing to be flushed and checks to start anew. The only 610 difference between an ICE restart and a brand new media session is 611 that, during the restart, media can continue to be sent to the 612 previously validated pair. 614 An agent MUST restart ICE for a media stream if: 616 o The offer is being generated for the purposes of changing the 617 target of the media stream. In other words, if an agent wants to 618 generate an updated offer that, had ICE not been in use, would 619 result in a new value for the destination of a media component. 621 o An agent is changing its implementation level. This typically 622 only happens in third party call control use cases, where the 623 entity performing the signaling is not the entity receiving the 624 media, and it has changed the target of media mid-session to 625 another entity that has a different ICE implementation. 627 These rules imply that setting the IP address in the c line to 628 0.0.0.0 will cause an ICE restart. Consequently, ICE implementations 629 MUST NOT utilize this mechanism for call hold, and instead MUST use 630 a=inactive and a=sendonly as described in [RFC3264]. 632 To restart ICE, an agent MUST change both the ice-pwd and the ice- 633 ufrag for the media stream in an offer. Note that it is permissible 634 to use a session-level attribute in one offer, but to provide the 635 same ice-pwd or ice-ufrag as a media-level attribute in a subsequent 636 offer. This is not a change in password, just a change in its 637 representation, and does not cause an ICE restart. 639 An agent sets the rest of the fields in the SDP for this media stream 640 as it would in an initial offer of this media stream (see 641 Section 3.2). Consequently, the set of candidates MAY include some, 642 none, or all of the previous candidates for that stream and MAY 643 include a totally new set of candidates. 645 9.1.1.2. Removing a Media Stream 647 If an agent removes a media stream by setting its port to zero, it 648 MUST NOT include any candidate attributes for that media stream and 649 SHOULD NOT include any other ICE-related attributes defined in 650 Section 8 for that media stream. 652 9.1.1.3. Adding a Media Stream 654 If an agent wishes to add a new media stream, it sets the fields in 655 the SDP for this media stream as if this was an initial offer for 656 that media stream (see Section 3.2). This will cause ICE processing 657 to begin for this media stream. 659 9.1.2. Procedures for Full Implementations 661 This section describes additional procedures for full 662 implementations, covering existing media streams. 664 The username fragments, password, and implementation level MUST 665 remain the same as used previously. If an agent needs to change one 666 of these, it MUST restart ICE for that media stream. 668 Additional behavior depends on the state ICE processing for that 669 media stream. 671 9.1.2.1. Existing Media Streams with ICE Running 673 If an agent generates an updated offer including a media stream that 674 was previously established, and for which ICE checks are in the 675 Running state, the agent follows the procedures defined here. 677 An agent MUST include candidate attributes for all local candidates 678 it had signaled previously for that media stream. The properties of 679 that candidate as signaled in SDP -- the priority, foundation, type, 680 and related transport address -- SHOULD remain the same. The IP 681 address, port, and transport protocol, which fundamentally identify 682 that candidate, MUST remain the same (if they change, it would be a 683 new candidate). The component ID MUST remain the same. The agent 684 MAY include additional candidates it did not offer previously, but 685 which it has gathered since the last offer/answer exchange, including 686 peer reflexive candidates. 688 The agent MAY change the default destination for media. As with 689 initial offers, there MUST be a set of candidate attributes in the 690 offer matching this default destination. 692 9.1.2.2. Existing Media Streams with ICE Completed 694 If an agent generates an updated offer including a media stream that 695 was previously established, and for which ICE checks are in the 696 Completed state, the agent follows the procedures defined here. 698 The default destination for media (i.e., the values of the IP 699 addresses and ports in the m and c lines used for that media stream) 700 MUST be the local candidate from the highest-priority nominated pair 701 in the valid list for each component. This "fixes" the default 702 destination for media to equal the destination ICE has selected for 703 media. 705 The agent MUST include candidate attributes for candidates matching 706 the default destination for each component of the media stream, and 707 MUST NOT include any other candidates. 709 In addition, if the agent is controlling, it MUST include the 710 a=remote-candidates attribute for each media stream whose check list 711 is in the Completed state. The attribute contains the remote 712 candidates from the highest-priority nominated pair in the valid list 713 for each component of that media stream. It is needed to avoid a 714 race condition whereby the controlling agent chooses its pairs, but 715 the updated offer beats the connectivity checks to the controlled 716 agent, which doesn't even know these pairs are valid, let alone 717 selected. See Appendix B for elaboration on this race condition. 719 9.1.3. Procedures for Lite Implementations 721 9.1.3.1. Existing Media Streams with ICE Running 723 This section describes procedures for lite implementations for 724 existing streams for which ICE is running. 726 A lite implementation MUST include all of its candidates for each 727 component of each media stream in an a=candidate attribute in any 728 subsequent offer. These candidates are formed identically to the 729 procedures for initial offers, as described in section 4.2 of 730 [ICE-BIS]. 732 A lite implementation MUST NOT add additional host candidates in a 733 subsequent offer. If an agent needs to offer additional candidates, 734 it MUST restart ICE. 736 The username fragments, password, and implementation level MUST 737 remain the same as used previously. If an agent needs to change one 738 of these, it MUST restart ICE for that media stream. 740 9.1.3.2. Existing Media Streams with ICE Completed 742 If ICE has completed for a media stream, the default destination for 743 that media stream MUST be set to the remote candidate of the 744 candidate pair for that component in the valid list. For a lite 745 implementation, there is always just a single candidate pair in the 746 valid list for each component of a media stream. Additionally, the 747 agent MUST include a candidate attribute for each default 748 destination. 750 Additionally, if the agent is controlling (which only happens when 751 both agents are lite), the agent MUST include the a=remote-candidates 752 attribute for each media stream. The attribute contains the remote 753 candidates from the candidate pairs in the valid list (one pair for 754 each component of each media stream). 756 9.2. Receiving the Offer and Generating an Answer 758 9.2.1. Procedures for All Implementations 760 When receiving a subsequent offer within an existing session, an 761 agent MUST reapply the verification procedures in Section 4.2 without 762 regard to the results of verification from any previous offer/answer 763 exchanges. Indeed, it is possible that a previous offer/answer 764 exchange resulted in ICE not being used, but it is used as a 765 consequence of a subsequent exchange. 767 9.2.1.1. Detecting ICE Restart 769 If the offer contained a change in the a=ice-ufrag or a=ice-pwd 770 attributes compared to the previous SDP from the peer, it indicates 771 that ICE is restarting for this media stream. If all media streams 772 are restarting, then ICE is restarting overall. 774 If ICE is restarting for a media stream: 776 o The agent MUST change the a=ice-ufrag and a=ice-pwd attributes in 777 the answer. 779 o The agent MAY change its implementation level in the answer. 781 An agent sets the rest of the fields in the SDP for this media stream 782 as it would in an initial answer to this media stream (see 783 Section 3.2). Consequently, the set of candidates MAY include some, 784 none, or all of the previous candidates for that stream and MAY 785 include a totally new set of candidates. 787 9.2.1.2. New Media Stream 789 If the offer contains a new media stream, the agent sets the fields 790 in the answer as if it had received an initial offer containing that 791 media stream (see Section 3.2). This will cause ICE processing to 792 begin for this media stream. 794 9.2.1.3. Removed Media Stream 796 If an offer contains a media stream whose port is zero, the agent 797 MUST NOT include any candidate attributes for that media stream in 798 its answer and SHOULD NOT include any other ICE-related attributes 799 defined in Section 8 for that media stream. 801 9.2.2. Procedures for Full Implementations 803 Unless the agent has detected an ICE restart from the offer, the 804 username fragments, password, and implementation level MUST remain 805 the same as used previously. If an agent needs to change one of 806 these it MUST restart ICE for that media stream by generating an 807 offer; ICE cannot be restarted in an answer. 809 Additional behaviors depend on the state of ICE processing for that 810 media stream. 812 9.2.2.1. Existing Media Streams with ICE Running and no remote- 813 candidates 815 If ICE is running for a media stream, and the offer for that media 816 stream lacked the remote-candidates attribute, the rules for 817 construction of the answer are identical to those for the offerer as 818 described in Section 9.1.2.1. 820 9.2.2.2. Existing Media Streams with ICE Completed and no remote- 821 candidates 823 If ICE is Completed for a media stream, and the offer for that media 824 stream lacked the remote-candidates attribute, the rules for 825 construction of the answer are identical to those for the offerer as 826 described in Section 9.1.2.2, except that the answerer MUST NOT 827 include the a=remote-candidates attribute in the answer. 829 9.2.2.3. Existing Media Streams and remote-candidates 831 A controlled agent will receive an offer with the a=remote-candidates 832 attribute for a media stream when its peer has concluded ICE 833 processing for that media stream. This attribute is present in the 834 offer to deal with a race condition between the receipt of the offer, 835 and the receipt of the Binding response that tells the answerer the 836 candidate that will be selected by ICE. See Appendix B for an 837 explanation of this race condition. Consequently, processing of an 838 offer with this attribute depends on the winner of the race. 840 The agent forms a candidate pair for each component of the media 841 stream by: 843 o Setting the remote candidate equal to the offerer's default 844 destination for that component (e.g., the contents of the m and c 845 lines for RTP, and the a=rtcp attribute for RTCP) 847 o Setting the local candidate equal to the transport address for 848 that same component in the a=remote-candidates attribute in the 849 offer. 851 The agent then sees if each of these candidate pairs is present in 852 the valid list. If a particular pair is not in the valid list, the 853 check has "lost" the race. Call such a pair a "losing pair". 855 The agent finds all the pairs in the check list whose remote 856 candidates equal the remote candidate in the losing pair: 858 o If none of the pairs are In-Progress, and at least one is Failed, 859 it is most likely that a network failure, such as a network 860 partition or serious packet loss, has occurred. The agent SHOULD 861 generate an answer for this media stream as if the remote- 862 candidates attribute had not been present, and then restart ICE 863 for this stream. 865 o If at least one of the pairs is In-Progress, the agent SHOULD wait 866 for those checks to complete, and as each completes, redo the 867 processing in this section until there are no losing pairs. 869 Once there are no losing pairs, the agent can generate the answer. 870 It MUST set the default destination for media to the candidates in 871 the remote-candidates attribute from the offer (each of which will 872 now be the local candidate of a candidate pair in the valid list). 873 It MUST include a candidate attribute in the answer for each 874 candidate in the remote-candidates attribute in the offer. 876 9.2.3. Procedures for Lite Implementations 878 If the received offer contains the remote-candidates attribute for a 879 media stream, the agent forms a candidate pair for each component of 880 the media stream by: 882 o Setting the remote candidate equal to the offerer's default 883 destination for that component (e.g., the contents of the m and c 884 lines for RTP, and the a=rtcp attribute for RTCP). 886 o Setting the local candidate equal to the transport address for 887 that same component in the a=remote-candidates attribute in the 888 offer. 890 It then places those candidates into the Valid list for the media 891 stream. The state of ICE processing for that media stream is set to 892 Completed. 894 Furthermore, if the agent believed it was controlling, but the offer 895 contained the remote-candidates attribute, both agents believe they 896 are controlling. In this case, both would have sent updated offers 897 around the same time. However, the signaling protocol carrying the 898 offer/answer exchanges will have resolved this glare condition, so 899 that one agent is always the 'winner' by having its offer received 900 before its peer has sent an offer. The winner takes the role of 901 controlled, so that the loser (the answerer under consideration in 902 this section) MUST change its role to controlled. Consequently, if 903 the agent was going to send an updated offer since, based on the 904 rules in section 8.2 of [ICE-BIS], it was controlling, it no longer 905 needs to. 907 Besides the potential role change, change in the Valid list, and 908 state changes, the construction of the answer is performed 909 identically to the construction of an offer as described in 910 Section 9.1.3. 912 9.3. Updating the Check and Valid Lists 914 9.3.1. Procedures for Full Implementations 916 9.3.1.1. ICE Restarts 918 The agent MUST remember the highest-priority nominated pairs in the 919 Valid list for each component of the media stream, called the 920 previous selected pairs, prior to the restart. The agent will 921 continue to send media using these pairs, as described in 922 Section 11.1. Once these destinations are noted, the agent MUST 923 flush the valid and check lists, and then recompute the check list 924 and its states as described in section 6.3 of [ICE-BIS]. 926 9.3.1.2. New Media Stream 928 If the offer/answer exchange added a new media stream, the agent MUST 929 create a new check list for it (and an empty Valid list to start of 930 course), as described in section 6.3 of [ICE-BIS]. 932 9.3.1.3. Removed Media Stream 934 If the offer/answer exchange removed a media stream, or an answer 935 rejected an offered media stream, an agent MUST flush the Valid list 936 for that media stream. It MUST terminate any STUN transactions in 937 progress for that media stream. An agent MUST remove the check list 938 for that media stream and cancel any pending ordinary checks for it. 940 9.3.1.4. ICE Continuing for Existing Media Stream 942 The valid list is not affected by an updated offer/answer exchange 943 unless ICE is restarting. 945 If an agent is in the Running state for that media stream, the check 946 list is updated (the check list is irrelevant if the state is 947 completed). To do that, the agent recomputes the check list using 948 the procedures described in section 6.3 of [ICE-BIS]. If a pair on 949 the new check list was also on the previous check list, and its state 950 was Waiting, In-Progress, Succeeded, or Failed, its state is copied 951 over. Otherwise, its state is set to Frozen. 953 If none of the check lists are active (meaning that the pairs in each 954 check list are Frozen), the full-mode agent sets the first pair in 955 the check list for the first media stream to Waiting, and then sets 956 the state of all other pairs in that check list for the same 957 component ID and with the same foundation to Waiting as well. 959 Next, the agent goes through each check list, starting with the 960 highest-priority pair. If a pair has a state of Succeeded, and it 961 has a component ID of 1, then all Frozen pairs in the same check list 962 with the same foundation whose component IDs are not 1 have their 963 state set to Waiting. If, for a particular check list, there are 964 pairs for each component of that media stream in the Succeeded state, 965 the agent moves the state of all Frozen pairs for the first component 966 of all other media streams (and thus in different check lists) with 967 the same foundation to Waiting. 969 9.3.2. Procedures for Lite Implementations 971 If ICE is restarting for a media stream, the agent MUST start a new 972 Valid list for that media stream. It MUST remember the pairs in the 973 previous Valid list for each component of the media stream, called 974 the previous selected pairs, and continue to send media there as 975 described in Section 11.1. The state of ICE processing for each 976 media stream MUST change to Running, and the state of ICE processing 977 MUST change to Running. 979 10. Keepalives 981 The keepalives MUST be sent regardless of whether the media stream is 982 currently inactive, sendonly, recvonly, or sendrecv, and regardless 983 of the presence or value of the bandwidth attribute. An agent can 984 determine that its peer supports ICE by the presence of a=candidate 985 attributes for each media session. 987 11. Media Handling 989 11.1. Sending Media 991 Note that the selected pair for a component of a media stream may not 992 equal the default pair for that same component from the most recent 993 offer/answer exchange. When this happens, the selected pair is used 994 for media, not the default pair. When ICE first completes, if the 995 selected pairs aren't a match for the default pairs, the controlling 996 agent sends an updated offer/answer exchange to remedy this 997 disparity. However, until that updated offer arrives, there will not 998 be a match. Furthermore, in very unusual cases, the default 999 candidates in the updated offer/answer will not be a match. 1001 11.1.1. Procedures for All Implementations 1003 ICE has interactions with jitter buffer adaptation mechanisms. An 1004 RTP stream can begin using one candidate, and switch to another one, 1005 though this happens rarely with ICE. The newer candidate may result 1006 in RTP packets taking a different path through the network -- one 1007 with different delay characteristics. As discussed below, agents are 1008 encouraged to re-adjust jitter buffers when there are changes in 1009 source or destination address of media packets. Furthermore, many 1010 audio codecs use the marker bit to signal the beginning of a 1011 talkspurt, for the purposes of jitter buffer adaptation. For such 1012 codecs, it is RECOMMENDED that the sender set the marker bit 1013 [RFC3550] when an agent switches transmission of media from one 1014 candidate pair to another. 1016 11.2. Receiving Media 1018 ICE implementations MUST be prepared to receive media on each 1019 component on any candidates provided for that component in the most 1020 recent offer/answer exchange (in the case of RTP, this would include 1021 both RTP and RTCP if candidates were provided for both). 1023 It is RECOMMENDED that, when an agent receives an RTP packet with a 1024 new source or destination IP address for a particular media stream, 1025 that the agent re-adjust its jitter buffers. 1027 RFC 3550 [RFC3550] describes an algorithm in Section 8.2 for 1028 detecting synchronization source (SSRC) collisions and loops. These 1029 algorithms are based, in part, on seeing different source transport 1030 addresses with the same SSRC. However, when ICE is used, such 1031 changes will sometimes occur as the media streams switch between 1032 candidates. An agent will be able to determine that a media stream 1033 is from the same peer as a consequence of the STUN exchange that 1034 proceeds media transmission. Thus, if there is a change in source 1035 transport address, but the media packets come from the same peer 1036 agent, this SHOULD NOT be treated as an SSRC collision. 1038 12. Usage with SIP 1040 12.1. Latency Guidelines 1042 ICE requires a series of STUN-based connectivity checks to take place 1043 between endpoints. These checks start from the answerer on 1044 generation of its answer, and start from the offerer when it receives 1045 the answer. These checks can take time to complete, and as such, the 1046 selection of messages to use with offers and answers can affect 1047 perceived user latency. Two latency figures are of particular 1048 interest. These are the post-pickup delay and the post-dial delay. 1049 The post-pickup delay refers to the time between when a user "answers 1050 the phone" and when any speech they utter can be delivered to the 1051 caller. The post-dial delay refers to the time between when a user 1052 enters the destination address for the user and ringback begins as a 1053 consequence of having successfully started ringing the phone of the 1054 called party. 1056 Two cases can be considered -- one where the offer is present in the 1057 initial INVITE and one where it is in a response. 1059 12.1.1. Offer in INVITE 1061 To reduce post-dial delays, it is RECOMMENDED that the caller begin 1062 gathering candidates prior to actually sending its initial INVITE. 1063 This can be started upon user interface cues that a call is pending, 1064 such as activity on a keypad or the phone going off-hook. 1066 If an offer is received in an INVITE request, the answerer SHOULD 1067 begin to gather its candidates on receipt of the offer and then 1068 generate an answer in a provisional response once it has completed 1069 that process. ICE requires that a provisional response with an SDP 1070 be transmitted reliably. This can be done through the existing 1071 Provisional Response Acknowledgment (PRACK) mechanism [RFC3262] or 1072 through an optimization that is specific to ICE. With this 1073 optimization, provisional responses containing an SDP answer that 1074 begins ICE processing for one or more media streams can be sent 1075 reliably without RFC 3262. To do this, the agent retransmits the 1076 provisional response with the exponential backoff timers described in 1077 RFC 3262. Retransmits MUST cease on receipt of a STUN Binding 1078 request for one of the media streams signaled in that SDP (because 1079 receipt of a Binding request indicates the offerer has received the 1080 answer) or on transmission of the answer in a 2xx response. If the 1081 peer agent is lite, there will never be a STUN Binding request. In 1082 such a case, the agent MUST cease retransmitting the 18x after 1083 sending it four times (ICE will actually work even if the peer never 1084 receives the 18x; however, experience has shown that sending it is 1085 important for middleboxes and firewall traversal). If no Binding 1086 request is received prior to the last retransmit, the agent does not 1087 consider the session terminated. Despite the fact that the 1088 provisional response will be delivered reliably, the rules for when 1089 an agent can send an updated offer or answer do not change from those 1090 specified in RFC 3262. Specifically, if the INVITE contained an 1091 offer, the same answer appears in all of the 1xx and in the 2xx 1092 response to the INVITE. Only after that 2xx has been sent can an 1093 updated offer/answer exchange occur. This optimization SHOULD NOT be 1094 used if both agents support PRACK. Note that the optimization is 1095 very specific to provisional response carrying answers that start ICE 1096 processing; it is not a general technique for 1xx reliability. 1098 Alternatively, an agent MAY delay sending an answer until the 200 OK; 1099 however, this results in a poor user experience and is NOT 1100 RECOMMENDED. 1102 Once the answer has been sent, the agent SHOULD begin its 1103 connectivity checks. Once candidate pairs for each component of a 1104 media stream enter the valid list, the answerer can begin sending 1105 media on that media stream. 1107 However, prior to this point, any media that needs to be sent towards 1108 the caller (such as SIP early media [RFC3960]) MUST NOT be 1109 transmitted. For this reason, implementations SHOULD delay alerting 1110 the called party until candidates for each component of each media 1111 stream have entered the valid list. In the case of a PSTN gateway, 1112 this would mean that the setup message into the PSTN is delayed until 1113 this point. Doing this increases the post-dial delay, but has the 1114 effect of eliminating 'ghost rings'. Ghost rings are cases where the 1115 called party hears the phone ring, picks up, but hears nothing and 1116 cannot be heard. This technique works without requiring support for, 1117 or usage of, preconditions [RFC3312], since it's a localized 1118 decision. It also has the benefit of guaranteeing that not a single 1119 packet of media will get clipped, so that post-pickup delay is zero. 1120 If an agent chooses to delay local alerting in this way, it SHOULD 1121 generate a 180 response once alerting begins. 1123 12.1.2. Offer in Response 1125 In addition to uses where the offer is in an INVITE, and the answer 1126 is in the provisional and/or 200 OK response, ICE works with cases 1127 where the offer appears in the response. In such cases, which are 1128 common in third party call control [RFC3725], ICE agents SHOULD 1129 generate their offers in a reliable provisional response (which MUST 1130 utilize RFC 3262), and not alert the user on receipt of the INVITE. 1132 The answer will arrive in a PRACK. This allows for ICE processing to 1133 take place prior to alerting, so that there is no post-pickup delay, 1134 at the expense of increased call setup delays. Once ICE completes, 1135 the callee can alert the user and then generate a 200 OK when they 1136 answer. The 200 OK would contain no SDP, since the offer/answer 1137 exchange has completed. 1139 Alternatively, agents MAY place the offer in a 2xx instead (in which 1140 case the answer comes in the ACK). When this happens, the callee 1141 will alert the user on receipt of the INVITE, and the ICE exchanges 1142 will take place only after the user answers. This has the effect of 1143 reducing call setup delay, but can cause substantial post-pickup 1144 delays and media clipping. 1146 12.2. SIP Option Tags and Media Feature Tags 1148 [RFC5768] specifies a SIP option tag and media feature tag for usage 1149 with ICE. ICE implementations using SIP SHOULD support this 1150 specification, which uses a feature tag in registrations to 1151 facilitate interoperability through signaling intermediaries. 1153 12.3. Interactions with Forking 1155 ICE interacts very well with forking. Indeed, ICE fixes some of the 1156 problems associated with forking. Without ICE, when a call forks and 1157 the caller receives multiple incoming media streams, it cannot 1158 determine which media stream corresponds to which callee. 1160 With ICE, this problem is resolved. The connectivity checks which 1161 occur prior to transmission of media carry username fragments, which 1162 in turn are correlated to a specific callee. Subsequent media 1163 packets that arrive on the same candidate pair as the connectivity 1164 check will be associated with that same callee. Thus, the caller can 1165 perform this correlation as long as it has received an answer. 1167 12.4. Interactions with Preconditions 1169 Quality of Service (QoS) preconditions, which are defined in RFC 3312 1170 [RFC3312] and RFC 4032 [RFC4032], apply only to the transport 1171 addresses listed as the default targets for media in an offer/answer. 1172 If ICE changes the transport address where media is received, this 1173 change is reflected in an updated offer that changes the default 1174 destination for media to match ICE's selection. As such, it appears 1175 like any other re-INVITE would, and is fully treated in RFCs 3312 and 1176 4032, which apply without regard to the fact that the destination for 1177 media is changing due to ICE negotiations occurring "in the 1178 background". 1180 Indeed, an agent SHOULD NOT indicate that QoS preconditions have been 1181 met until the checks have completed and selected the candidate pairs 1182 to be used for media. 1184 ICE also has (purposeful) interactions with connectivity 1185 preconditions [RFC5898]. Those interactions are described there. 1186 Note that the procedures described in Section 12.1 describe their own 1187 type of "preconditions", albeit with less functionality than those 1188 provided by the explicit preconditions in [RFC5898]. 1190 12.5. Interactions with Third Party Call Control 1192 ICE works with Flows I, III, and IV as described in [RFC3725]. Flow 1193 I works without the controller supporting or being aware of ICE. 1194 Flow IV will work as long as the controller passes along the ICE 1195 attributes without alteration. Flow II is fundamentally incompatible 1196 with ICE; each agent will believe itself to be the answerer and thus 1197 never generate a re-INVITE. 1199 The flows for continued operation, as described in Section 7 of RFC 1200 3725, require additional behavior of ICE implementations to support. 1201 In particular, if an agent receives a mid-dialog re-INVITE that 1202 contains no offer, it MUST restart ICE for each media stream and go 1203 through the process of gathering new candidates. Furthermore, that 1204 list of candidates SHOULD include the ones currently being used for 1205 media. 1207 13. Relationship with ANAT 1209 RFC 4091 [RFC4091], the Alternative Network Address Types (ANAT) 1210 Semantics for the SDP grouping framework, and RFC 4092 [RFC4092], its 1211 usage with SIP, define a mechanism for indicating that an agent can 1212 support both IPv4 and IPv6 for a media stream, and it does so by 1213 including two m lines, one for v4 and one for v6. This is similar to 1214 ICE, which allows for an agent to indicate multiple transport 1215 addresses using the candidate attribute. However, ANAT relies on 1216 static selection to pick between choices, rather than a dynamic 1217 connectivity check used by ICE. 1219 This specification deprecates RFC 4091 and RFC 4092. Instead, agents 1220 wishing to support dual-stack will utilize ICE. 1222 14. Setting Ta and RTO for RTP Media Streams 1224 During the gathering phase of ICE (section 4.1.1 [ICE-BIS]) and while 1225 ICE is performing connectivity checks (section 7 [ICE-BIS]), an agent 1226 sends STUN and TURN transactions. These transactions are paced at a 1227 rate of one every Ta milliseconds, and utilize a specific RTO. This 1228 section describes how the values of Ta and RTO are computed with a 1229 real-time media stream (such as RTP). When ICE is used for a stream 1230 with a known maximum bandwidth, the following computation MAY be 1231 followed to rate-control the ICE exchanges. 1233 The values of RTO and Ta change during the lifetime of ICE 1234 processing. One set of values applies during the gathering phase, 1235 and the other, for connectivity checks. 1237 The value of Ta SHOULD be configurable, and SHOULD have a default of: 1239 For each media stream i: 1240 Ta_i = (stun_packet_size / rtp_packet_size) * rtp_ptime 1242 1 1243 Ta = MAX (20ms, ------------------- ) 1244 k 1245 ---- 1246 \ 1 1247 > ------ 1248 / Ta_i 1249 ---- 1250 i=1 1252 where k is the number of media streams. During the gathering phase, 1253 Ta is computed based on the number of media streams the agent has 1254 indicated in its offer or answer, and the RTP packet size and RTP 1255 ptime are those of the most preferred codec for each media stream. 1256 Once an offer and answer have been exchanged, the agent recomputes Ta 1257 to pace the connectivity checks. In that case, the value of Ta is 1258 based on the number of media streams that will actually be used in 1259 the session, and the RTP packet size and RTP ptime are those of the 1260 most preferred codec with which the agent will send. 1262 In addition, the retransmission timer for the STUN transactions, RTO, 1263 defined in [RFC5389], SHOULD be configurable and during the gathering 1264 phase, SHOULD have a default of: 1266 RTO = MAX (100ms, Ta * (number of pairs)) 1268 where the number of pairs refers to the number of pairs of candidates 1269 with STUN or TURN servers. 1271 For connectivity checks, RTO SHOULD be configurable and SHOULD have a 1272 default of: 1274 RTO = MAX (100ms, Ta*N * (Num-Waiting + Num-In-Progress)) 1275 where Num-Waiting is the number of checks in the check list in the 1276 Waiting state, and Num-In-Progress is the number of checks in the In- 1277 Progress state. Note that the RTO will be different for each 1278 transaction as the number of checks in the Waiting and In-Progress 1279 states change. 1281 These formulas are aimed at causing STUN transactions to be paced at 1282 the same rate as media. This ensures that ICE will work properly 1283 under the same network conditions needed to support the media as 1284 well. See section B.1 of [ICE-BIS] for additional discussion and 1285 motivations. Because of this pacing, it will take a certain amount 1286 of time to obtain all of the server reflexive and relayed candidates. 1287 Implementations should be aware of the time required to do this, and 1288 if the application requires a time budget, limit the number of 1289 candidates that are gathered. 1291 The formulas result in a behavior whereby an agent will send its 1292 first packet for every single connectivity check before performing a 1293 retransmit. This can be seen in the formulas for the RTO (which 1294 represents the retransmit interval). Those formulas scale with N, 1295 the number of checks to be performed. As a result of this, ICE 1296 maintains a nicely constant rate, but becomes more sensitive to 1297 packet loss. The loss of the first single packet for any 1298 connectivity check is likely to cause that pair to take a long time 1299 to be validated, and instead, a lower-priority check (but one for 1300 which there was no packet loss) is much more likely to complete 1301 first. This results in ICE performing sub-optimally, choosing lower- 1302 priority pairs over higher-priority pairs. Implementors should be 1303 aware of this consequence, but still should utilize the timer values 1304 described here. 1306 15. Security Considerations 1308 15.1. Attacks on the Offer/Answer Exchanges 1310 An attacker that can modify or disrupt the offer/answer exchanges 1311 themselves can readily launch a variety of attacks with ICE. They 1312 could direct media to a target of a DoS attack, they could insert 1313 themselves into the media stream, and so on. These are similar to 1314 the general security considerations for offer/answer exchanges, and 1315 the security considerations in RFC 3264 [RFC3264] apply. These 1316 require techniques for message integrity and encryption for offers 1317 and answers, which are satisfied by the SIPS mechanism [RFC3261] when 1318 SIP is used. As such, the usage of SIPS with ICE is RECOMMENDED. 1320 15.2. Insider Attacks 1322 In addition to attacks where the attacker is a third party trying to 1323 insert fake offers, answers, or stun messages, there are several 1324 attacks possible with ICE when the attacker is an authenticated and 1325 valid participant in the ICE exchange. 1327 15.2.1. The Voice Hammer Attack 1329 The voice hammer attack is an amplification attack. In this attack, 1330 the attacker initiates sessions to other agents, and maliciously 1331 includes the IP address and port of a DoS target as the destination 1332 for media traffic signaled in the SDP. This causes substantial 1333 amplification; a single offer/answer exchange can create a continuing 1334 flood of media packets, possibly at high rates (consider video 1335 sources). This attack is not specific to ICE, but ICE can help 1336 provide remediation. 1338 Specifically, if ICE is used, the agent receiving the malicious SDP 1339 will first perform connectivity checks to the target of media before 1340 sending media there. If this target is a third-party host, the 1341 checks will not succeed, and media is never sent. 1343 Unfortunately, ICE doesn't help if its not used, in which case an 1344 attacker could simply send the offer without the ICE parameters. 1345 However, in environments where the set of clients is known, and is 1346 limited to ones that support ICE, the server can reject any offers or 1347 answers that don't indicate ICE support. 1349 15.2.2. Interactions with Application Layer Gateways and SIP 1351 Application Layer Gateways (ALGs) are functions present in a NAT 1352 device that inspect the contents of packets and modify them, in order 1353 to facilitate NAT traversal for application protocols. Session 1354 Border Controllers (SBCs) are close cousins of ALGs, but are less 1355 transparent since they actually exist as application layer SIP 1356 intermediaries. ICE has interactions with SBCs and ALGs. 1358 If an ALG is SIP aware but not ICE aware, ICE will work through it as 1359 long as the ALG correctly modifies the SDP. A correct ALG 1360 implementation behaves as follows: 1362 o The ALG does not modify the m and c lines or the rtcp attribute if 1363 they contain external addresses. 1365 o If the m and c lines contain internal addresses, the modification 1366 depends on the state of the ALG: 1368 If the ALG already has a binding established that maps an 1369 external port to an internal IP address and port matching the 1370 values in the m and c lines or rtcp attribute, the ALG uses 1371 that binding instead of creating a new one. 1373 If the ALG does not already have a binding, it creates a new 1374 one and modifies the SDP, rewriting the m and c lines and rtcp 1375 attribute. 1377 Unfortunately, many ALGs are known to work poorly in these corner 1378 cases. ICE does not try to work around broken ALGs, as this is 1379 outside the scope of its functionality. ICE can help diagnose these 1380 conditions, which often show up as a mismatch between the set of 1381 candidates and the m and c lines and rtcp attributes. The ice- 1382 mismatch attribute is used for this purpose. 1384 ICE works best through ALGs when the signaling is run over TLS. This 1385 prevents the ALG from manipulating the SDP messages and interfering 1386 with ICE operation. Implementations that are expected to be deployed 1387 behind ALGs SHOULD provide for TLS transport of the SDP. 1389 If an SBC is SIP aware but not ICE aware, the result depends on the 1390 behavior of the SBC. If it is acting as a proper Back-to-Back User 1391 Agent (B2BUA), the SBC will remove any SDP attributes it doesn't 1392 understand, including the ICE attributes. Consequently, the call 1393 will appear to both endpoints as if the other side doesn't support 1394 ICE. This will result in ICE being disabled, and media flowing 1395 through the SBC, if the SBC has requested it. If, however, the SBC 1396 passes the ICE attributes without modification, yet modifies the 1397 default destination for media (contained in the m and c lines and 1398 rtcp attribute), this will be detected as an ICE mismatch, and ICE 1399 processing is aborted for the call. It is outside of the scope of 1400 ICE for it to act as a tool for "working around" SBCs. If one is 1401 present, ICE will not be used and the SBC techniques take precedence. 1403 16. IANA Considerations 1405 16.1. SDP Attributes 1407 Original ICE specification defined seven new SDP attributes per the 1408 procedures of Section 8.2.4 of [RFC4566]. The registration 1409 information is reproduced here. 1411 16.1.1. candidate Attribute 1413 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1415 Attribute Name: candidate 1416 Long Form: candidate 1418 Type of Attribute: media-level 1420 Charset Considerations: The attribute is not subject to the charset 1421 attribute. 1423 Purpose: This attribute is used with Interactive Connectivity 1424 Establishment (ICE), and provides one of many possible candidate 1425 addresses for communication. These addresses are validated with 1426 an end-to-end connectivity check using Session Traversal Utilities 1427 for NAT (STUN). 1429 Appropriate Values: See Section 8 of RFC XXXX. 1431 16.1.2. remote-candidates Attribute 1433 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1435 Attribute Name: remote-candidates 1437 Long Form: remote-candidates 1439 Type of Attribute: media-level 1441 Charset Considerations: The attribute is not subject to the charset 1442 attribute. 1444 Purpose: This attribute is used with Interactive Connectivity 1445 Establishment (ICE), and provides the identity of the remote 1446 candidates that the offerer wishes the answerer to use in its 1447 answer. 1449 Appropriate Values: See Section 8 of RFC XXXX. 1451 16.1.3. ice-lite Attribute 1453 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1455 Attribute Name: ice-lite 1457 Long Form: ice-lite 1459 Type of Attribute: session-level 1461 Charset Considerations: The attribute is not subject to the charset 1462 attribute. 1464 Purpose: This attribute is used with Interactive Connectivity 1465 Establishment (ICE), and indicates that an agent has the minimum 1466 functionality required to support ICE inter-operation with a peer 1467 that has a full implementation. 1469 Appropriate Values: See Section 8 of RFC XXXX. 1471 16.1.4. ice-mismatch Attribute 1473 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1475 Attribute Name: ice-mismatch 1477 Long Form: ice-mismatch 1479 Type of Attribute: session-level 1481 Charset Considerations: The attribute is not subject to the charset 1482 attribute. 1484 Purpose: This attribute is used with Interactive Connectivity 1485 Establishment (ICE), and indicates that an agent is ICE capable, 1486 but did not proceed with ICE due to a mismatch of candidates with 1487 the default destination for media signaled in the SDP. 1489 Appropriate Values: See Section 8 of RFC XXXX. 1491 16.1.5. ice-pwd Attribute 1493 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1495 Attribute Name: ice-pwd 1497 Long Form: ice-pwd 1499 Type of Attribute: session- or media-level 1501 Charset Considerations: The attribute is not subject to the charset 1502 attribute. 1504 Purpose: This attribute is used with Interactive Connectivity 1505 Establishment (ICE), and provides the password used to protect 1506 STUN connectivity checks. 1508 Appropriate Values: See Section 8 of RFC XXXX. 1510 16.1.6. ice-ufrag Attribute 1512 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1514 Attribute Name: ice-ufrag 1516 Long Form: ice-ufrag 1518 Type of Attribute: session- or media-level 1520 Charset Considerations: The attribute is not subject to the charset 1521 attribute. 1523 Purpose: This attribute is used with Interactive Connectivity 1524 Establishment (ICE), and provides the fragments used to construct 1525 the username in STUN connectivity checks. 1527 Appropriate Values: See Section 8 of RFC XXXX. 1529 16.1.7. ice-pacing Attribute 1531 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1533 Attribute Name: ice-pacing 1535 Long Form: ice-pacing 1537 Type of Attribute: session-level 1539 Charset Considerations: The attribute is not subject to the charset 1540 attribute. 1542 Purpose: This attribute is used with Interactive Connectivity 1543 Establishment (ICE) to indicate desired connectivity check pacing 1544 values. 1546 Appropriate Values: See Section 8 of RFC XXXX. 1548 16.1.8. ice-options Attribute 1550 Contact Name: Jonathan Rosenberg, jdrosen@jdrosen.net. 1552 Attribute Name: ice-options 1554 Long Form: ice-options 1556 Type of Attribute: session- or media-level 1557 Charset Considerations: The attribute is not subject to the charset 1558 attribute. 1560 Purpose: This attribute is used with Interactive Connectivity 1561 Establishment (ICE), and indicates the ICE options or extensions 1562 used by the agent. 1564 Appropriate Values: See Section 8 of RFC XXXX. 1566 16.2. Interactive Connectivity Establishment (ICE) Options Registry 1568 IANA maintains a registry for ice-options identifiers under the 1569 Specification Required policy as defined in "Guidelines for Writing 1570 an IANA Considerations Section in RFCs" [RFC5226]. 1572 ICE options are of unlimited length according to the syntax in 1573 Section 8.6; however, they are RECOMMENDED to be no longer than 20 1574 characters. This is to reduce message sizes and allow for efficient 1575 parsing. 1577 In RFC 5245 ICE options could only be defined at the session level. 1578 ICE options can now also be defined at the media level. This can be 1579 used when aggregating between different ICE agents in the same 1580 endpoint, but future options may require to be defined at the media- 1581 level. To ensure compatibility with legacy implementation, the 1582 media-level ICE options MUST be aggregated into a session-level ICE 1583 option. Because aggregation rules depend on the specifics of each 1584 option, all new ICE options MUST also define in their specification 1585 how the media-level ICE option values are aggregated to generate the 1586 value of the session-level ICE option. 1588 The only ICE option defined at the time of publication is "rtp+ecn" 1589 [RFC6679]. The aggregation rule for this ICE options is that if all 1590 aggregated media using ICE contain a media-level "rtp+ecn" ICE option 1591 then an "rtp+ecn" ICE option MUST be inserted at the session-level. 1592 If one of the media does not contain the option, then it MUST NOT be 1593 inserted at the session-level. 1595 A registration request MUST include the following information: 1597 o The ICE option identifier to be registered 1599 o Name, Email, and Address of a contact person for the registration 1601 o Organization or individuals having the change control 1603 o Short description of the ICE extension to which the option relates 1604 o Reference(s) to the specification defining the ICE option and the 1605 related extensions 1607 17. Acknowledgments 1609 A large part of the text in this document was taken from RFC 5245, 1610 authored by Jonathan Rosenberg. 1612 Some of the text in this document was taken from RFC 6336, authored 1613 by Magnus Westerlund and Colin Perkins. 1615 18. References 1617 18.1. Normative References 1619 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1620 Requirement Levels", BCP 14, RFC 2119, March 1997. 1622 [RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, 1623 A., Peterson, J., Sparks, R., Handley, M., and E. 1624 Schooler, "SIP: Session Initiation Protocol", RFC 3261, 1625 June 2002. 1627 [RFC3262] Rosenberg, J. and H. Schulzrinne, "Reliability of 1628 Provisional Responses in Session Initiation Protocol 1629 (SIP)", RFC 3262, June 2002. 1631 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 1632 with Session Description Protocol (SDP)", RFC 3264, June 1633 2002. 1635 [RFC3312] Camarillo, G., Marshall, W., and J. Rosenberg, 1636 "Integration of Resource Management and Session Initiation 1637 Protocol (SIP)", RFC 3312, October 2002. 1639 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1640 Jacobson, "RTP: A Transport Protocol for Real-Time 1641 Applications", STD 64, RFC 3550, July 2003. 1643 [RFC3556] Casner, S., "Session Description Protocol (SDP) Bandwidth 1644 Modifiers for RTP Control Protocol (RTCP) Bandwidth", RFC 1645 3556, July 2003. 1647 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1648 in Session Description Protocol (SDP)", RFC 3605, October 1649 2003. 1651 [RFC4032] Camarillo, G. and P. Kyzivat, "Update to the Session 1652 Initiation Protocol (SIP) Preconditions Framework", RFC 1653 4032, March 2005. 1655 [RFC4091] Camarillo, G. and J. Rosenberg, "The Alternative Network 1656 Address Types (ANAT) Semantics for the Session Description 1657 Protocol (SDP) Grouping Framework", RFC 4091, June 2005. 1659 [RFC4092] Camarillo, G. and J. Rosenberg, "Usage of the Session 1660 Description Protocol (SDP) Alternative Network Address 1661 Types (ANAT) Semantics in the Session Initiation Protocol 1662 (SIP)", RFC 4092, June 2005. 1664 [RFC4566] Handley, M., Jacobson, V., and C. Perkins, "SDP: Session 1665 Description Protocol", RFC 4566, July 2006. 1667 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1668 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1669 May 2008. 1671 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 1672 Specifications: ABNF", STD 68, RFC 5234, January 2008. 1674 [RFC5389] Rosenberg, J., Mahy, R., Matthews, P., and D. Wing, 1675 "Session Traversal Utilities for NAT (STUN)", RFC 5389, 1676 October 2008. 1678 [RFC5768] Rosenberg, J., "Indicating Support for Interactive 1679 Connectivity Establishment (ICE) in the Session Initiation 1680 Protocol (SIP)", RFC 5768, April 2010. 1682 [RFC6679] Westerlund, M., Johansson, I., Perkins, C., O'Hanlon, P., 1683 and K. Carlberg, "Explicit Congestion Notification (ECN) 1684 for RTP over UDP", RFC 6679, August 2012. 1686 [ICE-BIS] Keranen, A. and J. Rosenberg, "Interactive Connectivity 1687 Establishment (ICE): A Protocol for Network Address 1688 Translator (NAT) Traversal for Offer/Answer Protocols", 1689 draft-keranen-mmusic-rfc5245bis-02 (work in progress), 1690 July 2014. 1692 18.2. Informative References 1694 [RFC3725] Rosenberg, J., Peterson, J., Schulzrinne, H., and G. 1695 Camarillo, "Best Current Practices for Third Party Call 1696 Control (3pcc) in the Session Initiation Protocol (SIP)", 1697 BCP 85, RFC 3725, April 2004. 1699 [RFC3960] Camarillo, G. and H. Schulzrinne, "Early Media and Ringing 1700 Tone Generation in the Session Initiation Protocol (SIP)", 1701 RFC 3960, December 2004. 1703 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1704 Congestion Control Protocol (DCCP)", RFC 4340, March 2006. 1706 [RFC5626] Jennings, C., Mahy, R., and F. Audet, "Managing Client- 1707 Initiated Connections in the Session Initiation Protocol 1708 (SIP)", RFC 5626, October 2009. 1710 [RFC5898] Andreasen, F., Camarillo, G., Oran, D., and D. Wing, 1711 "Connectivity Preconditions for Session Description 1712 Protocol (SDP) Media Streams", RFC 5898, July 2010. 1714 Appendix A. Examples 1716 For the example shown in Section 13 of [ICE-BIS] the resulting offer 1717 (message 5) encoded in SDP looks like: 1719 v=0 1720 o=jdoe 2890844526 2890842807 IN IP4 $L-PRIV-1.IP 1721 s= 1722 c=IN IP4 $NAT-PUB-1.IP 1723 t=0 0 1724 a=ice-pwd:asd88fgpdd777uzjYhagZg 1725 a=ice-ufrag:8hhY 1726 m=audio $NAT-PUB-1.PORT RTP/AVP 0 1727 b=RS:0 1728 b=RR:0 1729 a=rtpmap:0 PCMU/8000 1730 a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ host 1731 a=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ 1732 srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT 1734 The offer, with the variables replaced with their values, will look 1735 like (lines folded for clarity): 1737 v=0 1738 o=jdoe 2890844526 2890842807 IN IP4 10.0.1.1 1739 s= 1740 c=IN IP4 192.0.2.3 1741 t=0 0 1742 a=ice-pwd:asd88fgpdd777uzjYhagZg 1743 a=ice-ufrag:8hhY 1744 m=audio 45664 RTP/AVP 0 1745 b=RS:0 1746 b=RR:0 1747 a=rtpmap:0 PCMU/8000 1748 a=candidate:1 1 UDP 2130706431 10.0.1.1 8998 typ host 1749 a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 1750 10.0.1.1 rport 8998 1752 The resulting answer looks like: 1754 v=0 1755 o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IP 1756 s= 1757 c=IN IP4 $R-PUB-1.IP 1758 t=0 0 1759 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1760 a=ice-ufrag:9uB6 1761 m=audio $R-PUB-1.PORT RTP/AVP 0 1762 b=RS:0 1763 b=RR:0 1764 a=rtpmap:0 PCMU/8000 1765 a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host 1767 With the variables filled in: 1769 v=0 1770 o=bob 2808844564 2808844564 IN IP4 192.0.2.1 1771 s= 1772 c=IN IP4 192.0.2.1 1773 t=0 0 1774 a=ice-pwd:YH75Fviy6338Vbrhrlp8Yh 1775 a=ice-ufrag:9uB6 1776 m=audio 3478 RTP/AVP 0 1777 b=RS:0 1778 b=RR:0 1779 a=rtpmap:0 PCMU/8000 1780 a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host 1782 Appendix B. The remote-candidates Attribute 1784 The a=remote-candidates attribute exists to eliminate a race 1785 condition between the updated offer and the response to the STUN 1786 Binding request that moved a candidate into the Valid list. This 1787 race condition is shown in Figure 1. On receipt of message 4, agent 1788 L adds a candidate pair to the valid list. If there was only a 1789 single media stream with a single component, agent L could now send 1790 an updated offer. However, the check from agent R has not yet 1791 generated a response, and agent R receives the updated offer (message 1792 7) before getting the response (message 9). Thus, it does not yet 1793 know that this particular pair is valid. To eliminate this 1794 condition, the actual candidates at R that were selected by the 1795 offerer (the remote candidates) are included in the offer itself, and 1796 the answerer delays its answer until those pairs validate. 1798 Agent A Network Agent B 1799 |(1) Offer | | 1800 |------------------------------------------>| 1801 |(2) Answer | | 1802 |<------------------------------------------| 1803 |(3) STUN Req. | | 1804 |------------------------------------------>| 1805 |(4) STUN Res. | | 1806 |<------------------------------------------| 1807 |(5) STUN Req. | | 1808 |<------------------------------------------| 1809 |(6) STUN Res. | | 1810 |-------------------->| | 1811 | |Lost | 1812 |(7) Offer | | 1813 |------------------------------------------>| 1814 |(8) STUN Req. | | 1815 |<------------------------------------------| 1816 |(9) STUN Res. | | 1817 |------------------------------------------>| 1818 |(10) Answer | | 1819 |<------------------------------------------| 1821 Figure 1: Race Condition Flow 1823 Appendix C. Why Is the Conflict Resolution Mechanism Needed? 1825 When ICE runs between two peers, one agent acts as controlled, and 1826 the other as controlling. Rules are defined as a function of 1827 implementation type and offerer/answerer to determine who is 1828 controlling and who is controlled. However, the specification 1829 mentions that, in some cases, both sides might believe they are 1830 controlling, or both sides might believe they are controlled. How 1831 can this happen? 1833 The condition when both agents believe they are controlled shows up 1834 in third party call control cases. Consider the following flow: 1836 A Controller B 1837 |(1) INV() | | 1838 |<-------------| | 1839 |(2) 200(SDP1) | | 1840 |------------->| | 1841 | |(3) INV() | 1842 | |------------->| 1843 | |(4) 200(SDP2) | 1844 | |<-------------| 1845 |(5) ACK(SDP2) | | 1846 |<-------------| | 1847 | |(6) ACK(SDP1) | 1848 | |------------->| 1850 Figure 2: Role Conflict Flow 1852 This flow is a variation on flow III of RFC 3725 [RFC3725]. In fact, 1853 it works better than flow III since it produces fewer messages. In 1854 this flow, the controller sends an offerless INVITE to agent A, which 1855 responds with its offer, SDP1. The agent then sends an offerless 1856 INVITE to agent B, which it responds to with its offer, SDP2. The 1857 controller then uses the offer from each agent to generate the 1858 answers. When this flow is used, ICE will run between agents A and 1859 B, but both will believe they are in the controlling role. With the 1860 role conflict resolution procedures, this flow will function properly 1861 when ICE is used. 1863 At this time, there are no documented flows that can result in the 1864 case where both agents believe they are controlled. However, the 1865 conflict resolution procedures allow for this case, should a flow 1866 arise that would fit into this category. 1868 Appendix D. Why Send an Updated Offer? 1870 Section 11.1 describes rules for sending media. Both agents can send 1871 media once ICE checks complete, without waiting for an updated offer. 1872 Indeed, the only purpose of the updated offer is to "correct" the SDP 1873 so that the default destination for media matches where media is 1874 being sent based on ICE procedures (which will be the highest- 1875 priority nominated candidate pair). 1877 This begs the question -- why is the updated offer/answer exchange 1878 needed at all? Indeed, in a pure offer/answer environment, it would 1879 not be. The offerer and answerer will agree on the candidates to use 1880 through ICE, and then can begin using them. As far as the agents 1881 themselves are concerned, the updated offer/answer provides no new 1882 information. However, in practice, numerous components along the 1883 signaling path look at the SDP information. These include entities 1884 performing off-path QoS reservations, NAT traversal components such 1885 as ALGs and Session Border Controllers (SBCs), and diagnostic tools 1886 that passively monitor the network. For these tools to continue to 1887 function without change, the core property of SDP -- that the 1888 existing, pre-ICE definitions of the addresses used for media -- the 1889 m and c lines and the rtcp attribute -- must be retained. For this 1890 reason, an updated offer must be sent. 1892 Authors' Addresses 1894 Marc Petit-Huguenin 1895 Jive Communications 1896 1275 West 1600 North, Suite 100 1897 Orem, UT 84057 1898 USA 1900 Email: marcph@getjive.com 1902 Ari Keranen 1903 Ericsson 1904 Jorvas 02420 1905 Finland 1907 Email: ari.keranen@ericsson.com