RFC 8839 | ICE SDP Usage | January 2021 |
Petit-Huguenin, et al. | Standards Track | [Page] |
This document describes Session Description Protocol (SDP) Offer/Answerprocedures for carrying out Interactive Connectivity Establishment (ICE)between the agents.¶
This document obsoletes RFCs 5245 and 6336.¶
This is an Internet Standards Track document.¶
This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.¶
Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc8839.¶
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.¶
This document describes how Interactive Connectivity Establishment (ICE) isused with Session Description Protocol (SDP) offer/answer[RFC3264]. The ICE specification[RFC8445] describes procedures that are common toall usages of ICE, and this document gives the additional details needed touse ICE with SDP offer/answer.¶
This document obsoletes RFCs 5245 and 6336.¶
NOTE: Previously both the common ICE procedures, and the SDP offer/answerspecific details, were described in[RFC5245].[RFC8445] obsoleted[RFC5245], and the SDP offer/answer-specific detailswere removed from the document.Section 11describes the changes to the SDP offer/answer-specific details specified inthis document.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14[RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Readers should be familiar with the terminology defined in[RFC3264], in[RFC8445], and the following:¶
[RFC8445] defines ICE candidate exchange as the process for ICE agents (initiator and responder) to exchange their candidate information required for ICE processing at the agents. For the purposes of this specification, the candidate exchange process corresponds to the Offer/Answer protocol[RFC3264], and the terms "offerer" and "answerer" correspond to the initiator and responder roles from[RFC8445] respectively.¶
Once the initiating agent has gathered, pruned, and prioritized its set ofcandidates[RFC8445], the candidate exchangewith the peer agent begins.¶
Section 5 provides detailed rules for constructing various SDP attributes defined in this specification.¶
Each data stream[RFC8445] is represented byan SDP media description ("m=" section).¶
Within an "m=" section, each candidate (including the default candidate) associatedwith the data stream is represented by an SDP "candidate" attribute.¶
Prior to nomination, the "c=" line associated with an "m=" section containsthe connection address of the default candidate, while the "m=" line contains the portand transport protocol of the default candidate for that "m=" section.¶
After nomination, the "c=" line for a given "m=" section contains theconnection address of the nominated candidate (the local candidate of thenominated candidate pair), and the "m=" line contains the port andtransport protocol corresponding to the nominated candidate for that"m=" section.¶
The ICE username is represented by an SDP "ice-ufrag" attribute, and the ICEpassword is represented by an SDP "ice-pwd" attribute.¶
An ICE-lite implementation[RFC8445]MUST include an SDP "ice-lite" attribute.A full implementationMUST NOT include that attribute.¶
An agent uses the SDP "ice-options" attribute to indicate support of ICEextensions.¶
An agent compliant with this specificationMUST include an SDP "ice-options"attribute with an "ice2" attribute value[RFC8445]. If an agent receives an SDP offeror answer that indicates ICE support, but that does not contain an SDP "ice-options" attribute with an "ice2" attribute value,the agent can assume that the peer is compliant to[RFC5245].¶
If an "m=" section is marked as inactive[RFC4566], or has a bandwidthvalue of zero[RFC4566], the agentMUST still include ICE-related SDPattributes.¶
If the port value associated with an "m=" section is set to zero (implying adisabled stream) as defined inSection 8.2 of [RFC3264], the agentSHOULD NOTinclude ICE-related SDP "candidate" attributes in that "m=" section, unless anSDP extension specifying otherwise is used.¶
If an agent utilizes both RTP and RTCP, and separate portsare used for RTP and RTCP, the agentMUST include SDP "candidate"attributes for both the RTP and RTCP components.¶
The agent includes an SDP "rtcp" attribute following the proceduresin[RFC3605]. Hence, in the cases where the RTCPport value is one higher than the RTP port value and the RTCP componentaddress the same as the address of the RTP component, the SDP "rtcp" attributemight be omitted.¶
NOTE:[RFC5245] required that an agent always includes the SDP "rtcp" attribute, even if the RTCP port value was one higher than theRTP port value. This specification aligns the "rtcp" attribute procedureswith[RFC3605].¶
If the agent does not utilize RTCP, it indicates that by including "RS:0"and "RR:0" SDP attributes as described in[RFC3556].¶
The offerer acts as the initiating agent. The answerer acts as theresponding agent. The ICE roles (controlling and controlled) are determinedusing the procedures in[RFC8445].¶
Once an agent has provided its local candidates to its peer in an SDPoffer or answer, the agentMUST be prepared to receive STUN(Session Traversal Utilities for NAT,[RFC5389]) connectivitycheck Binding requests on those candidates.¶
An ICE agent indicates support of ICE by including at least the SDP "ice-pwd" and "ice-ufrag" attributes in an offer or answer. An ICE agent compliant with this specificationMUST also include an SDP "ice-options" attribute with an "ice2" attribute value.¶
The agents will proceed with the ICE procedures defined in[RFC8445] andthis specification if, for each data stream in the SDP it received, thedefault destination for each component of that data stream appears ina "candidate" attribute. For example, in the case of RTP, theconnection address, port, and transport protocol in the"c=" and "m=" lines, respectively, appear in a "candidate"attribute, and the value in the "rtcp" attribute appears in a "candidate"attribute.¶
This specification provides no guidance on how an agent should proceedin the cases where the above condition is not met with the fewexceptions noted below:¶
The following is an example SDP message that includes ICE attributes(lines folded for readability):¶
v=0o=jdoe 2890844526 2890842807 IN IP4 203.0.113.141s=c=IN IP4 192.0.2.3t=0 0a=ice-options:ice2a=ice-pacing:50a=ice-pwd:asd88fgpdd777uzjYhagZga=ice-ufrag:8hhYm=audio 45664 RTP/AVP 0b=RS:0b=RR:0a=rtpmap:0 PCMU/8000a=candidate:1 1 UDP 2130706431 203.0.113.141 8998 typ hosta=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr 203.0.113.141 rport 8998¶
When an offerer generates the initial offer, in each "m=" section itMUSTinclude SDP "candidate" attributes for each available candidate associatedwith the "m=" section. In addition, the offererMUST include an SDP "ice-ufrag"attribute, an SDP "ice-pwd" attribute, and an SDP "ice-options" attribute withan "ice2" attribute value in the offer. If the offerer is a full ICE implementation,itSHOULD include an "ice-pacing" attribute in the offer (if not included, thedefault value will apply). A lite ICE implementationMUST NOT include the "ice-pacing"attribute in the offer (as it will not perform connectivity checks).¶
It is valid for an offer "m=" line to include no SDP "candidate" attributesand have the default destination set to the IP address values"0.0.0.0"/"::" and the port value to "9". This implies that the offering agent is only going to use peer-reflexivecandidates or will provide additional candidates in subsequent signalingmessages.¶
When an answerer receives an initial offer indicatingthat the offerer supports ICE, and if the answerer acceptsthe offer and the usage of ICE, the answererMUST include in each "m=" section within the answer the SDP "candidate" attributes for each available candidate associated with the "m=" section.In addition, the answererMUST include an SDP "ice-ufrag"attribute, an SDP "ice-pwd" attribute, and an SDP "ice-options"attribute with an "ice2" attribute value in the answer. If theanswerer is a full ICE implementation, itSHOULD include an"ice-pacing" attribute in the answer (if not included, thedefault value will apply). A lite ICE implementationMUST NOTinclude the "ice-pacing" attribute in the answer (as it willnot perform connectivity checks).¶
In each "m=" line, the answererMUST use the same transportprotocol as was used in the offer "m=" line. If none ofthe candidates in the "m=" line in the answer uses the sametransport protocol as indicated in the offer "m=" line,then, in order to avoid ICE mismatch, the default destinationMUST be set to IP address values "0.0.0.0"/"::" andport value of "9".¶
It is also valid for an answer "m=" line to include no SDP"candidate" attributes and have the default destination setto the IP address values "0.0.0.0"/"::" and the port value to "9".This implies that the answering agent is only going to use peer-reflexive candidates or that additional candidates would beprovided in subsequent signaling messages.¶
Once the answerer has sent the answer, it can start performingconnectivity checks towards the peer candidates that were providedin the offer.¶
If the offer does not indicate support of ICE (Section 4.2.5), the answererMUST NOT accept the usage of ICE. If the answerer still acceptsthe offer, the answererMUST NOT include any ICE-related SDPattributes in the answer. Instead, the answerer will generatethe answer according to normal offer/answer procedures[RFC3264].¶
If the answerer detects a possibility of an ICE mismatch,procedures described inSection 4.2.5 are followed.¶
When an offerer receives an initial answer that indicatesthat the answerer supports ICE, it can start performingconnectivity checks towards the peer candidates that wereprovided in the answer.¶
If the answer does not indicate that the answerer supports ICE, or if theanswerer included "ice-mismatch" attributes for all the active data streamsin the answer, the offererMUST terminate the usage of ICE forthe entire session, and[RFC3264] proceduresMUST be followed instead.¶
On the other hand, if the answer indicates support forICE but includes "ice-mismatch" in certain active datastreams, then the offererMUST terminate the usage of ICEprocedures, and[RFC3264] proceduresMUST be used instead for only these data streams. Also, ICEproceduresMUST be used for data streams where an "ice-mismatch"attribute was not included.¶
If the offerer detects an ICE mismatch for one or more data streams in theanswer, as described inSection 4.2.5,the offererMUST terminate the usage of ICE for the entiresession. The subsequent actions taken by the offerer are implementationdependent and are out of the scope of this specification.¶
Once the agent has successfully nominated a pair[RFC8445], the state of the checklist associated with the pair is setto Completed. Once the state of each checklist is set to either Completed orFailed, for each Completed checklist, the agent checks whether the nominatedpair matches the default candidate pair. If there are one or more pairs thatdo not match, and the peer did not indicate support for the 'ice2' ice-option,the controlling agentMUST generate a subsequent offer in whichthe connection address, port, and transport protocol in the "c=" and "m="lines associated with each data stream match the corresponding localinformation of the nominated pair for that data stream (Section 4.4.1.2.2). If the peerdid indicate support for the 'ice2' ice-option, the controlling agent does notimmediately need to generate an updated offer in order to align a connectionaddress, port, and protocol with a nominated pair. However, later in thesession, whenever the controlling agent does send a subsequent offer, itMUST do the alignment as described above.¶
If there are one or more checklists with the state set to Failed, thecontrolling agentMUST generate a subsequent offer in order toremove the associated data streams by setting the port value of the datastreams to zero (Section 4.4.1.1.2), even if the peer did indicate support for the 'ice2'ice-option. If needed, such offer is used to align the connection address,port, and transport protocol, as described above.¶
As described in[RFC8445], once the controlling agent has nominateda candidate pair for a checklist, the agentMUST NOT nominate another pairfor that checklist during the lifetime of the ICE session (i.e., untilICE is restarted).¶
[RFC8863] provides a mechanism for allowing the ICE process to run long enough in order to find working candidate pairs, by waiting for potential peer-reflexive candidates, even though no candidate pairs were received from the peer or all current candidate pairs associated with a checklist have either failed or been discarded.¶
Either agentMAY generate a subsequent offer at any time allowed by[RFC3264]. This section defines rules for construction of subsequentoffers and answers.¶
Should a subsequent offer fail, ICE processing continues as if thesubsequent offer had never been made.¶
An agentMAY restart ICE processing for an existing data stream[RFC8445].¶
The rules governing the ICE restart imply that setting the connection addressin the "c=" line to "0.0.0.0" (for IPv4)/ "::" (for IPv6) will cause an ICE restart.Consequently, ICE implementationsMUST NOT utilize this mechanism for call hold,and insteadMUST use "inactive" and "sendonly" as described in[RFC3264].¶
To restart ICE, an agentMUST change both the "ice-pwd" and the "ice-ufrag" forthe data stream in an offer. However, it is permissible to use a session-levelattribute in one offer, but to provide the same "ice-pwd" or "ice-ufrag" as amedia-level attribute in a subsequent offer. ThisMUST NOT be consideredas ICE restart.¶
An agent sets the rest of the ICE-related fields in the SDP for this data stream as itwould in an initial offer of this data stream (Section 4.2.1).Consequently, the set of candidatesMAY include some, none, or all of theprevious candidates for that data stream andMAY include a totally new set ofcandidates. The agentMAY modify the attribute values of the SDP "ice-options" andSDP "ice-pacing" attributes, and itMAY change its role using the SDP "ice-lite" attribute.The agentMUST NOT modify the SDP "ice-options", "ice-pacing", and "ice-lite" attributes in asubsequent offer unless the offer is sent in order to request an ICE restart.¶
If an agent removes a data stream by setting its port to zero, itMUST NOTinclude any "candidate" attributes for that data stream andSHOULD NOT includeany other ICE-related attributes defined inSection 5 for that data stream.¶
If an agent wishes to add a new data stream, it sets the fields in the SDP forthis data stream as if this were an initial offer for that data stream(Section 4.2.1). This will cause ICE processing to begin for this data stream.¶
This section describes additional procedures for full implementations,covering existing data streams.¶
When an offerer sends a subsequent offer; in each "m=" section for which acandidate pair has not yet been nominated, the offerMUST include thesame set of ICE-related information that the offerer included in theprevious offer or answer. The agentMAY include additional candidatesit did not offer previously, but which it has gathered since the lastoffer/answer exchange, including peer-reflexive candidates.¶
The agentMAY change the default destination for media. As with initialoffers, thereMUST be a set of "candidate" attributes in the offer matchingthis default destination.¶
Once a candidate pair has been nominated for a data stream, the connection address,port, and transport protocol in each "c=" and "m=" line associated with that datastreamMUST match the data associated with the nominated pair for thatdata stream. In addition, the offerer only includes SDP "candidate" attributes(one per component) representing the local candidates of the nominated candidate pair. The offererMUST NOT include any other SDP "candidate" attributes in thesubsequent offer.¶
In addition, if the agent is controlling, itMUST include the"remote-candidates" attribute for each data stream whose checklistis in the Completed state. The attribute contains the remote candidatescorresponding to the nominated pair in the valid list for eachcomponent of that data stream. It is needed to avoid a race conditionwhereby the controlling agent chooses its pairs, but the updated offerbeats the connectivity checks to the controlled agent, which doesn'teven know these pairs are valid, let alone selected. SeeAppendix Bfor elaboration on this race condition.¶
If the ICE state is Running, a lite implementationMUST include all ofits candidates for each component of each data stream in "candidate"attributes in any subsequent offer. The candidates are formed identicallyto the procedures for initial offers.¶
A lite implementationMUST NOT add additional host candidates in asubsequent offer, andMUST NOT modify the username fragments andpasswords. If an agent needs to offer additional candidates, or to modify the username fragments and passwords, itMUST request an ICE restart (Section 4.4.1.1.1) for that data stream.¶
If ICE has completed for a data stream, and if the agent is controlled,the default destination for that data streamMUST be set to theremote candidate of the candidate pair for that component in the valid list.For a lite implementation, there is always just a single candidate pair inthe valid list for each component of a data stream. Additionally, the agentMUST include a "candidate" attribute for each default destination.¶
If the ICE state is Completed, and if the agent is controlling (which onlyhappens when both agents are lite), the agentMUST include the"remote-candidates" attribute for each data stream. The attributecontains the remote candidates from the candidate pairs in thevalid list (one pair for each component of each data stream).¶
If ICE is Completed for a data stream, and the offer for that datastream lacked the "remote-candidates" attribute, the rules forconstruction of the answer are identical to those for the offerer,except that the answererMUST NOT include the "remote-candidates"attribute in the answer.¶
A controlled agent will receive an offer with the "remote-candidates"attribute for a data stream when its peer has concluded ICE processingfor that data stream. This attribute is present in theoffer to deal with a race condition between the receipt of the offer,and the receipt of the Binding response that tells the answerer thecandidate that will be selected by ICE. SeeAppendix B for anexplanation of this race condition. Consequently, processing of anoffer with this attribute depends on the winner of the race.¶
The agent forms a candidate pair for each component of the data stream by:¶
The agent then sees if each of these candidate pairs is presentin the valid list. If a particular pair is not in the valid list,the check has "lost" the race. Call such a pair a "losing pair".¶
The agent finds all the pairs in the checklist whose remotecandidates equal the remote candidate in the losing pair:¶
Once there are no losing pairs, the agent can generate the answer.ItMUST set the default destination for media to the candidates inthe "remote-candidates" attribute from the offer (each of which willnow be the local candidate of a candidate pair in the valid list).ItMUST include a "candidate" attribute in the answer for eachcandidate in the "remote-candidates" attribute in the offer.¶
If the offerer in a subsequent offer requested an ICE restart (Section 4.4.1.1.1)for a data stream, and if the answerer accepts the offer, theanswerer follows the procedures for generating an initial answer.¶
For a given data stream, the answererMAY include the samecandidates that were used in the previous ICE session, butitMUST change the SDP "ice-pwd" and "ice-ufrag" attributevalues.¶
The answererMAY modify the attribute values of the SDP "ice-options" andSDP "ice-pacing" attributes, and itMAY change its role using the SDP "ice-lite" attribute.The answererMUST NOT modify the SDP "ice-options", "ice-pacing", and "ice-lite" attributes in asubsequent answer unless the answer is sent for an offer that was used to request an ICE restart(Section 4.4.1.1.1). If any of the SDP attributes have been modified ina subsequent offer that is not used to request an ICE restart, the answererMUST reject theoffer.¶
If the received offer contains the "remote-candidates" attribute for adata stream, the agent forms a candidate pair for each component of thedata stream by:¶
The state of the checklist associated with that data stream is set to Completed.¶
Furthermore, if the agent believed it was controlling, but the offer containedthe "remote-candidates" attribute, both agents believe they are controlling.In this case, both would have sent updated offers around the same time.¶
However, the signaling protocol carrying the offer/answer exchangeswill have resolved this glare condition, so that one agent is alwaysthe 'winner' by having its offer received before its peer has sentan offer. The winner takes the role of controlling, so that theloser (the answerer under consideration in this section)MUSTchange its role to controlled.¶
Consequently, if the agent was controlling based on the rules inSection 8.2 of [RFC8445] and was going to send an updated offer, it no longer needs to.¶
Besides the potential role change, change in the valid list, andstate changes, the construction of the answer is performed identicallyto the construction of an offer.¶
There may be certain situations where the offerer receivesan SDP answer that lacks ICE candidates although the initial answerincluded them. One example of such an "unexpected" answer might happen when an ICE-unaware Back-to-Back User Agent (B2BUA)introduces a media server during call hold using third partycall control procedures[RFC3725]. Omitting further details on how this is done, this couldresult in an answer that was constructed by the B2BUA being received at the holding UA. With the B2BUA beingICE-unaware, that answer would not include ICE candidates.¶
Receiving an answer without ICE attributes in this situation might beunexpected, but would not necessarily impair the user experience.¶
When the offerer receives an answer indicating support for ICE, theoffer performs one of the following actions:¶
However, if the ICE support is no longer indicated in the SDP answer,the agentMUST fall back to[RFC3264] procedures andSHOULD NOT drop the dialog because of the missing ICE support or unexpected answer.When the agent sends a new offer, itMUST perform an ICE restart.¶
The agentMUST remember the nominated pair in the valid list for eachcomponent of the data stream, called the "previous selected pair", priorto the restart. The agent will continue to send media using this pair,as described inSection 12 of [RFC8445]. Once these destinations arenoted, the agentMUST flush the valid lists and checklists, and then recomputethe checklist and its states, thus triggering the candidate processingprocedures[RFC8445].¶
If ICE is restarting for a data stream, the agentMUST create a newvalid list for that data stream. ItMUST remember the nominated pair in theprevious valid list for each component of the data stream, calledthe "previous selected pairs", and continue to send media there asdescribed inSection 12 of [RFC8445]. The state of eachchecklist for each data streamMUST change to Running, and the ICE stateMUST be set to Running.¶
This specification defines eight new SDP attributes -- the "candidate","remote-candidates", "ice-lite", "ice-mismatch", "ice-ufrag", "ice-pwd", "ice-pacing",and "ice-options" attributes.¶
This section also provides non-normative examples of the attributes defined.¶
The syntax for the attributes follow Augmented BNF as defined in[RFC5234].¶
The "candidate" attribute is a media-level attribute only.It contains a transport address for a candidate that can be used for connectivity checks.¶
candidate-attribute = "candidate" ":" foundation SP component-id SP transport SP priority SP connection-address SP ;from RFC 4566 port ;port from RFC 4566 SP cand-type [SP rel-addr] [SP rel-port] *(SP cand-extension)foundation = 1*32ice-charcomponent-id = 1*3DIGITtransport = "UDP" / transport-extensiontransport-extension = token ; from RFC 3261priority = 1*10DIGITcand-type = "typ" SP candidate-typescandidate-types = "host" / "srflx" / "prflx" / "relay" / tokenrel-addr = "raddr" SP connection-addressrel-port = "rport" SP portcand-extension = extension-att-name SP extension-att-valueextension-att-name = tokenextension-att-value = *VCHARice-char = ALPHA / DIGIT / "+" / "/"¶
This grammar encodes the primary information about a candidate: its IP address,port and transport protocol, and its properties: the foundation, component ID, priority,type, and related transport address:¶
The "candidate" attribute can itself be extended. The grammar allows for new name/value pairsto be added at the end of the attribute. Such extensionsMUST be made through IETF Review orIESG Approval[RFC8126], and the assignmentsMUST contain the specific extension and areference to the document defining the usage of the extension.¶
An implementationMUST ignore any name/value pairs it doesn't understand.¶
The following is an example SDP line for a UDP server-reflexive "candidate" attribute forthe RTP component:¶
a=candidate:2 1 UDP 1694498815 192.0.2.3 45664 typ srflx raddr203.0.113.141 rport 8998¶
The syntax of the "remote-candidates" attribute is defined using Augmented BNFas defined in[RFC5234].The "remote-candidates" attribute is a media-level attribute only.¶
remote-candidate-att = "remote-candidates:" remote-candidate 0*(SP remote-candidate)remote-candidate = component-id SP connection-address SP port¶
The attribute contains a connection-address and port for each component. The orderingof components is irrelevant. However, a valueMUST be present for each component of adata stream. This attributeMUST be included in an offer by a controlling agent fora data stream that is Completed, andMUST NOT be included in any other case.¶
The following is an example of "remote-candidates" SDP lines for the RTP and RTCP components:¶
a=remote-candidates:1 192.0.2.3 45664a=remote-candidates:2 192.0.2.3 45665¶
The syntax of the "ice-lite" and "ice-mismatch" attributes, both of which are flags, is:¶
ice-lite = "ice-lite"ice-mismatch = "ice-mismatch"¶
"ice-lite" is a session-level attribute only, and indicates that an agent is alite implementation. "ice-mismatch" is a media-level attribute and onlyreported in the answer. It indicates that the offer arrived with a defaultdestination for a media component that didn't have a corresponding "candidate"attribute. Inclusion of "ice-mismatch" attribute for a given data stream impliesthat even though both agents support ICE, ICE proceduresMUST NOT be used for this datastream, and[RFC3264] proceduresMUST be used instead.¶
The "ice-ufrag" and "ice-pwd" attributes convey the username fragment and password used by ICE for message integrity.Their syntax is:¶
ice-pwd-att = "ice-pwd:" passwordice-ufrag-att = "ice-ufrag:" ufragpassword = 22*256ice-charufrag = 4*256ice-char¶
The "ice-pwd" and "ice-ufrag" attributes can appear at either the session-levelor media-level. When present in both, the value in the media-level takes precedence.Thus, the value at the session-level is effectively a default that applies to alldata streams, unless overridden by a media-level value. Whether present at the sessionor media-level, thereMUST be an "ice-pwd" and "ice-ufrag" attribute for each data stream.If two data streams have identical "ice-ufrag"s, theyMUST have identical "ice-pwd"s.¶
The "ice-ufrag" and "ice-pwd" attributesMUST be chosen randomly at the beginning ofa session (the same applies when ICE is restarting for an agent).¶
[RFC8445] requires the "ice-ufrag" attribute to contain at least 24 bits ofrandomness, and the "ice-pwd" attribute to contain at least 128 bits ofrandomness. This means that the "ice-ufrag"attribute will be at least 4 characters long, and the "ice-pwd" at least 22 characters long,since the grammar for these attributes allows for 6 bits of information per character.The attributesMAY be longer than 4 and 22 characters, respectively, of course, up to256 characters. The upper limit allows for buffer sizing in implementations.Its large upper limit allows for increased amounts of randomness to be added over time.For compatibility with the 512-character limitation for the STUN username attribute valueand for bandwidth conservation considerations, the "ice-ufrag" attributeMUST NOT be longerthan 32 characters when sending, but an implementationMUST accept up to 256 characterswhen receiving.¶
The following example shows sample "ice-ufrag" and "ice-pwd" SDP lines:¶
a=ice-pwd:asd88fgpdd777uzjYhagZga=ice-ufrag:8hhY¶
The "ice-pacing" is a session-level attribute that indicates the desired connectivity-check pacing (Ta interval), in milliseconds, that the sender wishes to use. SeeSection 14.2 of [RFC8445] for more information regarding selecting a pacing value.The syntax is:¶
ice-pacing-att = "ice-pacing:" pacing-valuepacing-value = 1*10DIGIT¶
If absent in an offer or answer, the default value of the attribute is 50 ms,which is the recommended value specified in[RFC8445].¶
As defined in[RFC8445], regardless of the Ta valuechosen for each agent, the combination of all transactions from all agents (if a givenimplementation runs several concurrent agents) will not be sent more often thanonce every 5 ms.¶
As defined in[RFC8445], once both agents have indicated the pacing value they want to use, both agents will use the larger of the indicated values.¶
The following example shows an "ice-pacing" SDP line with value '50':¶
a=ice-pacing:50¶
The "ice-options" attribute is a session-level and media-level attribute.It contains a series of tokens that identify the options supported by the agent.Its grammar is:¶
ice-options = "ice-options:" ice-option-tag *(SP ice-option-tag)ice-option-tag = 1*ice-char¶
The existence of an "ice-options" in an offer indicates that a certain extensionis supported by the agent, and it is willing to use it if the peer agent also includesthe same extension in the answer. There might be further extension-specificnegotiation needed between the agents that determine how the extension gets usedin a given session. The details of the negotiation procedures, if present,MUST bedefined by the specification defining the extension (Section 10.2).¶
The following example shows an "ice-options" SDP line with 'ice2' and 'rtp+ecn'[RFC6679] values.¶
a=ice-options:ice2 rtp+ecn¶
All the ICE agentsMUST follow the procedures defined inSection 11 of [RFC8445]for sending keepalives. As defined in[RFC8445],the keepalives will be sent regardless of whether the data stream is currently inactive, sendonly, recvonly, or sendrecv, and regardlessof the presence or value of the bandwidth attribute. An agent can determine that itspeer supports ICE by the presence of "candidate" attributes for each media session.¶
Note that ICE is not intended for NAT traversal for SIP signaling, which is assumed to beprovided via another mechanism[RFC5626].¶
When ICE is used with SIP, forking may result in a single offer generating amultiplicity of answers. In that case, ICE proceeds completely in parallel andindependently for each answer, treating the combination of its offer andeach answer as an independent offer/answer exchange, with its own set of localcandidates, pairs, checklists, states, and so on.¶
ICE requires a series of STUN-based connectivity checks to take place betweenendpoints. These checks start from the answerer on generation of its answer,and start from the offerer when it receives the answer.These checks can take time to complete, and as such, the selection ofmessages to use with offers and answers can affect perceived user latency.Two latency figures are of particular interest. These are the post-pickup delayand the post-dial delay. The post-pickup delay refers to the time between whena user "answers the phone" and when any speech they utter can be delivered tothe caller. The post-dial delay refers to the time between when a user entersthe destination address for the user and ringback begins as a consequence ofhaving successfully started alerting the called user agent.¶
Two cases can be considered -- one where the offer is present in the initialINVITE and one where it is in a response.¶
To reduce post-dial delays, it isRECOMMENDED that the caller begin gatheringcandidates prior to actually sending its initial INVITE, so that the candidatescan be provided in the INVITE. This can be started uponuser interface cues that a call is pending, such as activity on a keypad orthe phone going off-hook.¶
On the receipt of the offer, the answererSHOULD generate an answer in aprovisional response as soon as it has completed gatheringthe candidates. ICE requires that a provisional response with an SDP betransmitted reliably. This can be done through the existingProvisional Response Acknowledgment (PRACK)mechanism[RFC3262] or through an ICE-specific optimization, wherein,the agent retransmits the provisional response with the exponential backofftimers described in[RFC3262]. Such retransmissionsMUST cease on receiptof a STUN Binding request with the transport address matching the candidate addressfor one of the data streams signaled in that SDP or on transmission of the answerin a 2xx response. If no Binding request is received prior to the last retransmit,the agent does not consider the session terminated. For the ICE-lite peers, the agentMUST cease retransmitting the 18x response aftersending it four times since there will be no Binding request sent, andthe number four is arbitrarily chosen to limit the number of 18x retransmits.¶
Once the answer has been sent, the agentSHOULD begin its connectivity checks.Once candidate pairs for each component of a data stream enter the valid list,the answerer can begin sending media on that data stream.¶
However, prior to this point, any media that needs to be sent towards thecaller (such as SIP early media[RFC3960])MUST NOT be transmitted. For thisreason, implementationsSHOULD delay alerting the called party until candidatesfor each component of each data stream have entered the valid list.In the case of a PSTN gateway, this would mean that the setup message into thePSTN is delayed until this point. Doing this increases the post-dial delay, buthas the effect of eliminating 'ghost rings'.Ghost rings are cases where the called party hears the phone ring, picks up, buthears nothing and cannot be heard. This technique works without requiring supportfor, or usage of, preconditions[RFC3312]. It also has the benefit of guaranteeingthat not a single packet of media will get clipped, so that post-pickup delay is zero.If an agent chooses to delay local alerting in this way, itSHOULD generate a 180response once alerting begins.¶
In addition to uses where the offer is in an INVITE, and the answer is in theprovisional and/or 200 OK response, ICE works with cases where the offer appearsin the response.In such cases, which are common in third party call control[RFC3725], ICEagentsSHOULD generate their offers in a reliable provisional response(whichMUST utilize[RFC3262]), and not alert the user on receipt of the INVITE.The answer will arrive in a PRACK.This allows for ICE processing to take place prior to alerting, so that there is nopost-pickup delay, at the expense of increased call setup delays.Once ICE completes, the callee can alert the user and then generate a 200 OKwhen they answer.The 200 OK would contain no SDP, since the offer/answer exchange has completed.¶
Alternatively, agentsMAY place the offer in a 2xx instead (in which case theanswer comes in the ACK).When this happens, the callee will alert the user on receipt of the INVITE,and the ICE exchanges will take place only after the user answers.This has the effect of reducing call-setup delay, but can cause substantialpost-pickup delays and media clipping.¶
[RFC5768] specifies a SIP option tag and media feature tag for usage with ICE.ICE implementations using SIPSHOULD support this specification, which uses afeature tag in registrations to facilitate interoperability through signalingintermediaries.¶
ICE interacts very well with forking.Indeed, ICE fixes some of the problems associated with forking.Without ICE, when a call forks and the caller receives multiple incomingdata streams, it cannot determine which data stream corresponds towhich callee.¶
With ICE, this problem is resolved.The connectivity checks which occur prior to transmission of media carryusername fragments which in turn are correlated to a specific callee.Subsequent media packets that arrive on the same candidate pair as theconnectivity check will be associated with that same callee.Thus, the caller can perform this correlation as long as it has received an answer.¶
Quality of Service (QoS) preconditions, which are defined in[RFC3312]and[RFC4032], apply only to the transport addresses listed as the defaulttargets for media in an offer/answer.If ICE changes the transport address where media is received, this changeis reflected in an updated offer that changes the default destination formedia to match ICE's selection. As such, it appears like any other re-INVITE would,and is fully treated in RFCs 3312 and 4032, which apply without regard to the factthat the destination for media is changing due to ICE negotiations occurring"in the background".¶
Indeed, an agentSHOULD NOT indicate that QoS preconditions have been metuntil the checks have completed and selected the candidate pairs to be used for media.¶
ICE also has interactions with connectivity preconditions[RFC5898].Those interactions are described there. Note that the procedures described inSection 7.1 describe their own type of "preconditions", albeit with less functionality than those provided by the explicit preconditions in[RFC5898].¶
ICE works with Flows I, III, and IV as described in[RFC3725].Flow I works without the controller supporting or being aware of ICE.Flow IV will work as long as the controller passes along the ICE attributes without alteration.Flow II is fundamentally incompatible with ICE; each agent will believe itself to be the answerer and thus never generate a re-INVITE.¶
The flows for continued operation, as described inSection 7 of [RFC3725], require additional behavior of ICE implementations to support.In particular, if an agent receives a mid-dialog re-INVITE that contains no offer, itMUST restart ICE for each data stream and go through the process of gathering new candidates.Furthermore, that list of candidatesSHOULD include the ones currently being used for media.¶
Application Layer Gateways (ALGs) are functions present in a Network Address Translation (NAT) device that inspect the contents of packets and modify them, in order to facilitate NAT traversal for application protocols. Session Border Controllers (SBCs) are close cousins of ALGs, but are less transparent since they actually exist as application-layer SIP intermediaries. ICE has interactions with SBCs and ALGs.¶
If an ALG is SIP aware but not ICE aware, ICE will work through it as long as the ALG correctly modifies the SDP. A correct ALG implementation behaves as follows:¶
If the "m=" and "c=" lines contain internal addresses, the modification depends on the state of the ALG:¶
Unfortunately, many ALGs are known to work poorly in these corner cases. ICE does not try to work around broken ALGs, as this is outside the scope of its functionality. ICE can help diagnose these conditions, which often show up as a mismatch between the set of candidates and the "m=" and "c=" lines and "rtcp" attributes. The "ice-mismatch" attribute is used for this purpose.¶
ICE works best through ALGs when the signaling is run over TLS. This prevents the ALG from manipulating the SDP messages and interfering with ICE operation. Implementations that are expected to be deployed behind ALGsSHOULD provide for TLS transport of the SDP.¶
If an SBC is SIP aware but not ICE aware, the result depends on the behavior of the SBC. If it is acting as a proper Back-to-Back User Agent (B2BUA), the SBC will remove any SDP attributes it doesn't understand, including the ICE attributes. Consequently, the call will appear to both endpoints as if the other side doesn't support ICE. This will result in ICE being disabled, and media flowing through the SBC, if the SBC has requested it. If, however, the SBC passes the ICE attributes without modification, yet modifies the default destination for media (contained in the "m=" and "c=" lines and "rtcp" attribute), this will be detected as an ICE mismatch, and ICE processing is aborted for the call. It is outside of the scope of ICE for it to act as a tool for "working around" SBCs. If one is present, ICE will not be used and the SBC techniques take precedence.¶
The generic ICE security considerations are defined in[RFC8445], and the generic SDP offer/answer security considerations are defined in[RFC3264]. These security considerations also apply to implementations of this document.¶
In some cases, e.g., for privacy reasons, an agent may not want to reveal the related address and port. In this case the addressMUST be set to "0.0.0.0" (for IPv4 candidates) or "::" (for IPv6 candidates) and the port to '9'.¶
An attacker that can modify or disrupt the offer/answer exchanges themselves can readily launch a variety of attacks with ICE. They could direct media to a target of a DoS attack, they could insert themselves into the data stream, and so on. These are similar to the general security considerations for offer/answer exchanges, and the security considerations in[RFC3264] apply. These require techniques for message integrity and encryption for offers and answers, which are satisfied by the TLS mechanism[RFC3261] when SIP is used. As such, the usage of TLS with ICE isRECOMMENDED.¶
The voice hammer attack is an amplification attack, and can be triggered even if the attacker is an authenticated and valid participant in a session. In this attack, the attacker initiates sessions to other agents, and maliciously includes the connection address and port of a DoS target as the destination for media traffic signaled in the SDP. This causes substantial amplification; a single offer/answer exchange can create a continuing flood of media packets, possibly at high rates (consider video sources). The use of ICE can help to prevent against this attack.¶
Specifically, if ICE is used, the agent receiving the malicious SDP will first perform connectivity checks to the target of media before sending media there. If this target is a third-party host, the checks will not succeed, and media is never sent. The ICE extension defined in[RFC7675] can be used to further protect against voice hammer attacks.¶
Unfortunately, ICE doesn't help if it's not used, in which case an attacker could simply send the offer without the ICE parameters. However, in environments where the set of clients is known, and is limited to ones that support ICE, the server can reject any offers or answers that don't indicate ICE support.¶
SIP user agents (UA)[RFC3261] that are not willing to receive non-ICE answersMUST include an "ice" option tag[RFC5768] in the SIP Require header field in their offer. UAs that reject non-ICE offers will generally use a 421 response code, together with an option tag "ice" in the Require header field in the response.¶
The original ICE specification defined seven new SDP attributes per the procedures ofSection 8.2.4 of [RFC4566]. The registration information from the original specificationis included here with modifications to include Mux Category[RFC8859] and also defines a new SDP attribute "ice-pacing".¶
This specification also defines a new SDP attribute, "ice-pacing", accordingto the following data:¶
IANA maintains a registry for "ice-options" identifiers under the SpecificationRequired policy as defined in "Guidelines for Writing an IANA ConsiderationsSection in RFCs"[RFC8126].¶
ICE options are of unlimited length according to the syntax inSection 5.6; however, they areRECOMMENDED to be no longerthan 20 characters. This is to reduce message sizes and allow forefficient parsing. ICE options are defined at the session level.¶
A registration requestMUST include the following information:¶
This section creates a new subregistry, "Candidate Attribute Extensions", under the SDP Parameters registry:http://www.iana.org/assignments/sdp-parameters.¶
The purpose of the subregistry is to register SDP "candidate" attribute extensions.¶
When a "candidate" extension is registered in the subregistry, it needs to meet the "Specification Required" policies defined in[RFC8126].¶
"candidate" attribute extensionsMUST follow the 'cand-extension' syntax. The attribute extension nameMUST follow the 'extension-att-name' syntax, and the attribute extension valueMUST follow the 'extension-att-value' syntax.¶
A registration requestMUST include the following information:¶
[RFC8445] describes the changes made to the common SIP procedures, including removal of aggressive nomination, modifying the procedures for calculating candidate pair states, scheduling connectivity checks, and the calculation of timer values.¶
This document defines the following SDP offer/answer specific changes:¶
For the example shown inSection 15 of [RFC8445], the resulting offer (message 5) encoded in SDP looks like (lines folded for clarity):¶
v=0o=jdoe 2890844526 2890842807 IN IP6 $L-PRIV-1.IPs=c=IN IP6 $NAT-PUB-1.IPt=0 0a=ice-options:ice2a=ice-pacing:50a=ice-pwd:asd88fgpdd777uzjYhagZga=ice-ufrag:8hhYm=audio $NAT-PUB-1.PORT RTP/AVP 0b=RS:0b=RR:0a=rtpmap:0 PCMU/8000a=candidate:1 1 UDP 2130706431 $L-PRIV-1.IP $L-PRIV-1.PORT typ hosta=candidate:2 1 UDP 1694498815 $NAT-PUB-1.IP $NAT-PUB-1.PORT typ srflx raddr $L-PRIV-1.IP rport $L-PRIV-1.PORT¶
The offer, with the variables replaced with their values, will look like (lines folded for clarity):¶
v=0o=jdoe 2890844526 2890842807 IN IP6 fe80::6676:baff:fe9c:ee4as=c=IN IP6 2001:db8:8101:3a55:4858:a2a9:22ff:99b9t=0 0a=ice-options:ice2a=ice-pacing:50a=ice-pwd:asd88fgpdd777uzjYhagZga=ice-ufrag:8hhYm=audio 45664 RTP/AVP 0b=RS:0b=RR:0a=rtpmap:0 PCMU/8000a=candidate:1 1 UDP 2130706431 fe80::6676:baff:fe9c:ee4a 8998 typ hosta=candidate:2 1 UDP 1694498815 2001:db8:8101:3a55:4858:a2a9:22ff:99b9 45664 typ srflx raddr fe80::6676:baff:fe9c:ee4a rport 8998¶
The resulting answer looks like:¶
v=0o=bob 2808844564 2808844564 IN IP4 $R-PUB-1.IPs=c=IN IP4 $R-PUB-1.IPt=0 0a=ice-options:ice2a=ice-pacing:50a=ice-pwd:YH75Fviy6338Vbrhrlp8Yha=ice-ufrag:9uB6m=audio $R-PUB-1.PORT RTP/AVP 0b=RS:0b=RR:0a=rtpmap:0 PCMU/8000a=candidate:1 1 UDP 2130706431 $R-PUB-1.IP $R-PUB-1.PORT typ host¶
With the variables filled in:¶
v=0o=bob 2808844564 2808844564 IN IP4 192.0.2.1s=c=IN IP4 192.0.2.1t=0 0a=ice-options:ice2a=ice-pacing:50a=ice-pwd:YH75Fviy6338Vbrhrlp8Yha=ice-ufrag:9uB6m=audio 3478 RTP/AVP 0b=RS:0b=RR:0a=rtpmap:0 PCMU/8000a=candidate:1 1 UDP 2130706431 192.0.2.1 3478 typ host¶
The "remote-candidates" attribute exists to eliminate a race condition between the updated offer and the response to the STUN Binding request that moved a candidate into the valid list.This race condition is shown inFigure 1.On receipt of message 4, agent L adds a candidate pair to the valid list.If there was only a single data stream with a single component, agent L could now send an updated offer. However, the check from agent R has not yet received a response, and agent R receives the updated offer (message 7) before getting the response (message 9). Thus, it does not yet know that this particular pair is valid.To eliminate this condition, the actual candidates at R that were selected by the offerer (the remote candidates) are included in the offer itself, and the answerer delays its answer until those pairs validate.¶
Agent L Network Agent R |(1) Offer | | |------------------------------------------>| |(2) Answer | | |<------------------------------------------| |(3) STUN Req. | | |------------------------------------------>| |(4) STUN Res. | | |<------------------------------------------| |(5) STUN Req. | | |<------------------------------------------| |(6) STUN Res. | | |-------------------->| | | |Lost | |(7) Offer | | |------------------------------------------>| |(8) STUN Req. | | |<------------------------------------------| |(9) STUN Res. | | |------------------------------------------>| |(10) Answer | | |<------------------------------------------|
When ICE runs between two peers, one agent acts as controlled, and the other as controlling.Rules are defined as a function of implementation type and offerer/answerer to determine who is controlling and who is controlled.However, the specification mentions that, in some cases, both sides might believe they are controlling, or both sides might believe they are controlled.How can this happen?¶
The condition when both agents believe they are controlled shows up in third party call control cases.Consider the following flow:¶
A Controller B |(1) INV() | | |<-------------| | |(2) 200(SDP1) | | |------------->| | | |(3) INV() | | |------------->| | |(4) 200(SDP2) | | |<-------------| |(5) ACK(SDP2) | | |<-------------| | | |(6) ACK(SDP1) | | |------------->|
This flow is a variation on flow III of RFC 3725[RFC3725].In fact, it works better than flow III since it produces fewer messages.In this flow, the controller sends an offerless INVITE to agent A, which responds with its offer, SDP1.The agent then sends an offerless INVITE to agent B, which it responds to with its offer, SDP2.The controller then uses the offer from each agent to generate the answers.When this flow is used, ICE will run between agents A and B, but both will believe they are in the controlling role.With the role conflict resolution procedures, this flow will function properly when ICE is used.¶
At this time, there are no documented flows that can result in the case where both agents believe they are controlled.However, the conflict resolution procedures allow for this case, should a flow arise that would fit into this category.¶
Section 12.1 of [RFC8445] describes rules for sending media.Both agents can send media once ICE checks complete, without waiting for an updated offer.Indeed, the only purpose of the updated offer is to "correct" the SDP so that the default destination for media matches where media is being sent based on ICE procedures (which will be the highest-priority nominated candidate pair).¶
This raises the question -- why is the updated offer/answer exchange needed at all?Indeed, in a pure offer/answer environment, it would not be.The offerer and answerer will agree on the candidates to use through ICE, and then can begin using them.As far as the agents themselves are concerned, the updated offer/answer provides no new information.However, in practice, numerous components along the signaling path look at the SDP information.These include entities performing off-path QoS reservations, NAT traversal components such as ALGs and Session Border Controllers (SBCs), and diagnostic tools that passively monitor the network.For these tools to continue to function without change, the core property of SDP -- that the existing, pre-ICE definitions of the addresses used for media -- the "m=" and "c=" lines and the "rtcp" attribute -- must be retained.For this reason, an updated offer must be sent.¶
A large part of the text in this document was taken from[RFC5245], authored byJonathan Rosenberg.¶
Some of the text in this document was taken from[RFC6336], authored byMagnus Westerlund andColin Perkins.¶
Many thanks toFlemming Andreasen for shepherd review feedback.¶
Thanks to following experts for their reviews and constructive feedback:Thomas Stach,Adam Roach,Peter Saint-Andre,Roman Danyliw,Alissa Cooper,Benjamin Kaduk,Mirja Kühlewind,Alexey Melnikov, andÉric Vyncke for their detailed reviews.¶
The following experts have contributed textual and structural improvements for this work:¶