From dadf4a5741a5c7c2440a3e7054346c6e1494f03d Mon Sep 17 00:00:00 2001
From: Peter Saint-Andre Simplified flow by including candidates in session-initiate and session-accept. The process for ICE negotiation is largely the same in Jingle as it is in ICE. There are several differences: The transport negotiation process is defined in the Protocol Description section of this document. The semantics of the &TRANSPORT; element are defined in the ICE Negotiation section of this document. Successful negotiation of the ice-udp method results in use of a datagram transport that is suitable for applications where some packet loss is tolerable, such as audio and video. If multiple components are to be communicated over the transport in the context of the Real-time Transport Protocol (RTP; see &rfc3550;), the component numbered "1" shall be associated with RTP and the component numbered "2" shall be associated with the Real Time Control Protocol (RTCP). If multiple components are to be communicated by the application type that uses the transport, the transport shall support those components and assign identifiers for them as described in the specification that defines the application type. Note: The examples in this document follow the scenario described in Section 17 of &icecore;, except that we substitute the Shakespearean characters "Romeo" and "Juliet" for the generic entities "L" and "R". In order for the initiator in a Jingle exchange to start the negotiation, it sends a Jingle "session-initiate" stanza that includes at least one content type, as described in XEP-0166. If the initiator wishes to negotiate the ice-udp transport method for an application format, it MUST include an empty &TRANSPORT; child element qualified by the 'urn:xmpp:jingle:transports:ice-udp:0' namespace &VNOTE;. In order for the initiator in a Jingle exchange to start the negotiation, it sends a Jingle "session-initiate" stanza that includes at least one content type, as described in XEP-0166. If the initiator wishes to negotiate the ice-udp transport method for an application format, it MUST include a &TRANSPORT; child element qualified by the 'urn:xmpp:jingle:transports:ice-udp:1' namespace &VNOTE;. This element SHOULD in turn contain one &CANDIDATE; element for each of the higher-priority transport candidates as determined in accordance with the ICE methodology, but MAY instead be empty (with each candidate to be sent as the payload of a transport-info message). The 'pwd' and 'ufrag' attributes MUST be included in the session-initiate request, in subsequent content-add and transport-replace actions, and when offering candidates via the transport-info action. The attributes SHOULD NOT be included in a session-accept action. The values are separately generated for both the initiator and the responder, in accordance with &icecore; and as shown in the examples. The attributes are defined as follows. The &TRANSPORT; element's 'pwd' and 'ufrag' attributes MUST be included in the session-initiate request, in subsequent content-add and transport-replace actions, and when offering candidates via the transport-info action. The attributes MAY be included in a session-accept action. The values are separately generated for both the initiator and the responder, in accordance with &icecore; and as shown in the examples. The attributes are defined as follows. The attributes of the <candidate/> element are described in the following table: As described in XEP-0166, to acknowledge receipt of the session initiation request, the responder returns an IQ-result: As described in XEP-0166, to acknowledge receipt of the session initiation request, the responder immediately returns an IQ-result. Once the responder acknowledges receipt of the session initiation request as shown above, both initiator and responder MUST immediately negotiate connectivity over ICE by exchanging XML-formatted transport "candidates" for the channel. This negotiation proceeds immediately in order to maximize the possibility that media can be exchanged as quickly as possible. In order to expedite session establishment, the initiator MAY send transport candidates immediately after sending the "session-initiate" message and before receiving acknowledgement from the responder (i.e., the initiator MUST consider the session to be live even before receiving acknowledgement). Given in-order delivery as mandated by &xmppcore;, the responder will receive such "transport-info" messages after receiving the "session-initiate" message; if not, it is appropriate for the responder to return <unknown-session/> errors since according to its state machine the session does not exist.
+
Name
@@ -284,233 +316,128 @@ INITIATOR RESPONDER
8hhy
+
+
+ Name
+ Description
+ SDP Syntax
+ Example
+
+
+ component
+ A Component ID as defined in &icecore;.
+ Component ID value in a=candidate line
+ 1
+
+
+ foundation
+ A Foundation as defined in &icecore;.
+ Foundation value in a=candidate line
+ 1
+
+
+ generation
+ An index, starting at 0, that enables the parties to keep track of updates to the candidate throughout the life of the session.
+ N/A
+ 0
+
+
+ id
+ A unique identifier for the candidate.
+ N/A
+ el0747fg11
+
+
+ ip
+ The Internet Protocol (IP) address for the candidate transport mechanism; this may be either an IPv4 address or an IPv6 address.
+ IP Address value in a=candidate line
+ 192.0.2.3
+
+
+ network
+ An index, starting at 0, referencing which network this candidate is on for a given peer (used for diagnostic purposes if the calling hardware has more than one Network Interface Card).
+ N/A
+ 0
+
+
+ port
+ The port at the candidate IP address.
+ Port value in a=candidate line
+ 45664
+
+
+ priority
+ A Priority as defined in &icecore;
+
+ Priority value in a=candidate line
+ 2130706431
+
+
+ protocol
+ The protocol to be used. The only value defined by this specification is "udp".
+ Transport protocol field in a=candidate line
+ udp
+
+
+ rel-addr
+ A related address as defined in &icecore;.
+ raddr value in a=candidate line
+ 10.0.1.1
+
+
+ rel-port
+ A related port as defined in &icecore;.
+ rport value in a=candidate line
+ 8998
+
+
+ rem-addr
+ A IP address for a remote address as defined in &icecore;.
+ connection-address value in a=remote-candidates line
+ 192.0.2.1
+
+
+ rem-port
+ The port for a remote address as defined in &icecore;.
+ port value in a=remote-candidates line
+ 3478
+
+
+ type
+ A Candidate Type as defined in &icecore;. The allowable values are "host" for host candidates, "prflx" for peer reflexive candidates, "relay" for relayed candidates, and "srflx" for server reflexive candidates.
+ Typ field in a=candidate line
+ srflx
+
Note: See the Security Considerations section of this document regarding the exposure of IP addresses on behalf by the responder's client.
+If either party receives an <unknown-session/> error from the other party, it MUST terminate the negotiation and the session.
-Note: See the Security Considerations section of this document regarding the exposure of IP addresses on behalf by the responder's client.
-The candidate syntax and negotiation flow are described below.
-The following is an example of the candidate format:
-
- ]]>
- The attributes of the <candidate/> element are described in the following table:
-Name | -Description | -SDP Syntax | -Example | -
---|---|---|---|
component | -A Component ID as defined in &icecore;. | -Component ID value in a=candidate line | -1 | -
foundation | -A Foundation as defined in &icecore;. | -Foundation value in a=candidate line | -1 | -
generation | -An index, starting at 0, that enables the parties to keep track of updates to the candidate throughout the life of the session. | -N/A | -0 | -
id | -A unique identifier for the candidate. | -N/A | -el0747fg11 | -
ip | -The Internet Protocol (IP) address for the candidate transport mechanism; this may be either an IPv4 address or an IPv6 address. | -IP Address value in a=candidate line | -192.0.2.3 | -
network | -An index, starting at 0, referencing which network this candidate is on for a given peer (used for diagnostic purposes if the calling hardware has more than one Network Interface Card). | -N/A | -0 | -
port | -The port at the candidate IP address. | -Port value in a=candidate line | -45664 | -
priority | -A Priority as defined in &icecore;
- |
- Priority value in a=candidate line | -2130706431 | -
protocol | -The protocol to be used. The only value defined by this specification is "udp". | -Transport protocol field in a=candidate line | -udp | -
rel-addr | -A related address as defined in &icecore;. | -raddr value in a=candidate line | -10.0.1.1 | -
rel-port | -A related port as defined in &icecore;. | -rport value in a=candidate line | -8998 | -
rem-addr | -A IP address for a remote address as defined in &icecore;. | -connection-address value in a=remote-candidates line | -192.0.2.1 | -
rem-port | -The port for a remote address as defined in &icecore;. | -port value in a=remote-candidates line | -3478 | -
type | -A Candidate Type as defined in &icecore;. The allowable values are "host" for host candidates, "prflx" for peer reflexive candidates, "relay" for relayed candidates, and "srflx" for server reflexive candidates. | -Typ field in a=candidate line | -srflx | -
The first step in negotiating connectivity is for each party to immediately begin sending transport candidates to the other party.
Each candidate or set of candidates shall be sent as <candidate/> children of a &TRANSPORT; element qualified by the 'urn:xmpp:jingle:transports:ice-udp:0' namespace. The &TRANSPORT; element shall be sent via a Jingle action of "transport-info" as shown in the examples below.
-Either party MAY include multiple <candidate/> elements in one &TRANSPORT; element. Sending one candidate per transport-info action typically results in a faster negotiation because the candidates most likely to succeed are sent first and it is not necessary to gather all candidates before beginning to send any candidates. Furthermore, because certain candidates can be more "expensive" in terms of bandwidth or processing power, the initiator might not want to advertise their existence unless it is necessary to do so after other candidates have failed. However, sending multiple candidates in a single "transport-info" action can help to ensure interoperability with entities that implement the SDP offer/answer model described in RFC 3264. An entity SHOULD send one candidate per "transport-info" action and send multiple such actions, instead of sending multiple candidates in a single "transport-info" action; the only exception is if the other party advertises support for the "urn:ietf:rfc:3264" service discovery feature as described in the SDP Offer / Answer Support section of this document.
-If the responder receives and can successfully process a given candidate or set of candidates, it returns an IQ-result (if not, for example because the candidate data is improperly formatted, it returns an IQ-error). At this point, the responder is only indicating receipt of the candidate or set of candidates, not telling the initiator that the candidate will be used.
-The initiator keeps sending candidates (without stopping to receive an acknowledgement of receipt from the responder for each candidate) until it has exhausted its supply of possible or desirable candidate transports. For each candidate or set of candidates, the responder acknowledges receipt.
-At the same time (i.e., immediately after acknowledging receipt of the session-initiate request, not waiting for the initiator to begin or finish sending candidates), the responder also begins sending potential candidates, in order of desirability according to the responder. As above, the initiator acknowledges receipt of the candidates.
-For each candidate received, the other party (in this case the responder) MUST acknowledge receipt or return an error.
-At the same time (i.e., immediately after acknowledging the session-initation request, not waiting for the initiator to begin or finish sending candidates), the responder also sends candidates that may work for it.
-As above for the candidates sent by the initiator, here the initiator acknowledges receipt of the candidates sent by the responder.
-The initiator and responder negotiate connectivity over ICE by exchanging XML-formatted transport candidates for the channel. This negotiation proceeds immediately in order to maximize the possibility that connectivity can be established (and therefore media can be exchanged) as quickly as possible. In order to expedite session establishment, the initiator SHOULD include transport candidates in its session-initiate message but MAY also send additional transport candidates as soon as it learns of them, even before receiving acknowledgement of the session-initiate message (i.e., the initiator MUST consider the session to be live as soon as it sends the session-initiate message).
The first step in negotiating connectivity is for each party to send transport candidates to the other party.
Each candidate or set of candidates shall be sent as <candidate/> children of a &TRANSPORT; element qualified by the 'urn:xmpp:jingle:transports:ice-udp:1' namespace. The &TRANSPORT; element is sent via a Jingle action of session-initiate, session-accept, or transport-info.
+Either party MAY include multiple <candidate/> elements in one &TRANSPORT; element, especially in the session-initiate and session-accept messages sent at the beginning of the session negotiation. Including multiple candidates in the session-initiate and session-accept messages can help to ensure interoperability with entities that implement the SDP offer/answer model described in RFC 3264; in particular, an entity SHOULD include multiple candidates in its session-initiate or session-accept message if the other party advertises support for the "urn:ietf:rfc:3264" service discovery feature as described in the SDP Offer / Answer Support section of this document. However, including one candidate per subsequent transport-info action typically results in a faster negotiation because the candidates most likely to succeed are sent first (in the session-info and session-accept messages) and it is not necessary to gather all candidates before beginning to send any candidates; furthermore, because certain candidates can be more "expensive" in terms of bandwidth or processing power, either party might not want to advertise the existence of such candidates unless it is necessary to do so after other candidates have failed.
+If the party that receives a candidate in a Jingle message can successfully process a given candidate or set of candidates, it returns an IQ-result (if not, for example because the candidate data is improperly formatted, it returns an IQ-error). At this point, the receiving entity is only indicating receipt of the candidate or set of candidates, not telling the other party that the candidate will be used.
+The initiator can keep sending candidates (without stopping to receive an acknowledgement of receipt from the responder for each candidate) until it has exhausted its supply of possible or desirable transport candidates; for each candidate or set of candidates, the responder acknowledges receipt. The responder can also keep sending potential candidates, which the initiator will acknowledge.
As the initiator and responder receive candidates, they probe the various candidate transports for connectivity. In performing these connectivity checks, each party SHOULD follow the procedure specified in Section 7 of &icecore;. The following business rules apply:
+As the initiator and responder receive candidates, they probe the various transport candidates for connectivity. In performing these connectivity checks, each party SHOULD follow the procedure specified in Section 7 of &icecore;. The following business rules apply:
Note: Here the initiator (controlling agent) is using "aggressive nomination" as described in Section 8.1.1.2 of &icecore; and therefore includes the USE-CANDIDATE attribute in the STUN Binding Requests it sends.
If, based on STUN connectivity checks, the parties determine that they will be able to exchange media between a given pair of local candidates and remote candidates (i.e., the pair is "nominated" and ICE processing is "completed"), the parties shall proceed as follows:
-First, the responder sends a session-accept action to the initiator, specifying the candidate that succeeded. The session-accept MUST contain information about the nominated pair, including the "rem-addr" and "rem-port" attributes (which specify the IP address and port for the responder's end of the pair, which is a "remote address" according to the initiator). This enables both parties to explicitly agree to both ends of the connection pair (i.e., the local address+port and the remote address+port).
-Since according to the connectivity checks the initiator can also send data over that candidate, it acknowledges the responder's acceptance:
-Now the initiator and responder can begin sending media data over the negotiated connection (in fact, they could have sent data as soon as the connectivity checks succeeded, as shown in the preceding examples).
-If a candidate succeeded for the responder but the initiator cannot send data over that candidate, it MUST return a ¬acceptable; error in response to the responder's acceptance of the successful candidate:
-If the responder cannot find a suitable candidate transport or it receives a ¬acceptable; error from the initiator in response to its acceptance of a suitable transport, it SHOULD terminate the session as described in XEP-0166.
+If, based on STUN connectivity checks, the parties determine that they will be able to exchange media between a given pair of local candidates and remote candidates (i.e., the pair is "nominated" and ICE processing is "completed"), they can then begin using that candidate pair to exchange media. There is no need for the parties to communicate the chosen candidate pair in the signalling channel.
+In the unlikely event that one of the parties determines that it cannot establish connectivity even after sending and checking lower-priority candidates, it SHOULD terminate the session as described in XEP-0166.
The creator of a content type MAY modify an existing, in-use candidate at any time during the session, for example to change the IP address or port. This is done by sending a transport-replace action with the changed candidate information, where the value of the 'generation' attribute is incremented to specify that the candidate information is a modification to an existing candidate.
@@ -683,7 +551,7 @@ INITIATOR NAT RESPONDER initiator='romeo@montague.lit/orchard' sid='a73sjjvkla37jfea'>Even after content acceptance or session acceptance, either party MAY continue to send additional candidates to the other party (e.g., because the user agent has become aware of a new media proxy or network interface card). As above, such candidates are shared by sending a transport-info action.
-If an entity supports the Jingle ice-udp transport, it MUST return a feature of "urn:xmpp:jingle:transports:ice-udp:0" &VNOTE; in response to &xep0030; information requests.
+If an entity supports the Jingle ice-udp transport, it MUST return a feature of "urn:xmpp:jingle:transports:ice-udp:1" &VNOTE; in response to &xep0030; information requests.
This specification defines the following XML namespace:
Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.