git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1015 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2007-06-28 13:24:19 +00:00
parent 92efceba46
commit 4fff6c5eb7
1 changed files with 94 additions and 78 deletions

View File

@ -2,7 +2,7 @@
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
<!ENTITY icecurr "<cite>ICE-CORE</cite>">
<!ENTITY icecore "<cite>ICE-CORE</cite>">
<!ENTITY icetcp "<cite>ICE-TCP</cite>">
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
@ -28,6 +28,12 @@
&scottlu;
&hildjj;
&seanegan;
<revision>
<version>0.9</version>
<date>2007-06-28</date>
<initials>psa</initials>
<remark><p>Updated to track ICE-16.</p></remark>
</revision>
<revision>
<version>0.8</version>
<date>2007-04-17</date>
@ -78,32 +84,32 @@
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p><em>Note: This document depends on the IETF's &ice; and &icetcp; specifications, which are works in progress. Every effort has been made to keep this document synchronized with <cite>draft-ietf-mmusic-ice</cite> and <cite>draft-ietf-mmusic-ice-tcp</cite>. The interested reader is referred to &icecore; for a detailed description of the ICE methodology, which for the most part this document merely maps to XMPP syntax.</em></p>
<p>&xep0166; defines a framework for negotiating and managing out-of-band data sessions over XMPP. In order to provide a flexible framework, the base Jingle specification defines neither data transport methods nor content formats, leaving that up to separate specifications. The current document defines two transport methods (ice-udp and ice-tcp) for establishing and managing data connections between XMPP entities, using the ICE methodology currently being developed within the IETF. The ice-udp method results in a lossy transport suitable for use in media applications where some packet loss is tolerable (e.g., audio and video), whereas the ice-tcp method results in a reliable transport suitable for use in applications where packet loss is not tolerable (e.g., file transfer).</p>
<p>The process for ICE negotiation is largely the same in Jingle as it is in &icecurr;. There are several differences:</p>
<p>The process for ICE negotiation is largely the same in Jingle as it is in ICE. There are several differences:</p>
<ul>
<li>Instead of using SIP as the signalling channel, Jingle uses XMPP as the signalling channel.</li>
<li>In Jingle, each candidate transport is sent in a separate IQ exchange (rather than sending all candidates at once as in &icecurr;); this approach takes advantage of the request-response semantics of the XMPP &IQ; stanza type and enables the parties to send higher-priority candidates earlier in the negotiation.</li>
<li>In Jingle, each candidate transport is sent in a separate IQ exchange (rather than sending all candidates at once as in &icecore;). <note>This approach takes advantage of the request-response semantics of the XMPP &IQ; stanza type and enables the parties to send higher-priority candidates earlier in the negotiation, but implies that Jingle is not exactly an offer-answer protocol as specified in RFC 3264.</note></li>
<li>Syntax from the Session Description Protocol (see &rfc4566;) is mapped to an XML syntax suitable for sending over the XMPP signalling channel.</li>
</ul>
<p><em>Note: This document depends on the IETF's &ice; specification, which is a work in progress. Every effort has been made to keep this document synchronized with <cite>draft-ietf-mmusic-ice</cite>, for which the latest published version is 15 (hereafter referred to as "&icecurr;"). The interested reader is referred to &icecurr; for a detailed description of the ICE methodology, which for the most part this document merely maps to XMPP syntax.</em></p>
</section1>
<section1 topic='Glossary' anchor='terms'>
<p>The reader is referred to &icecurr; and &icetcp; for a description of various terms used in the context of ICE. Those terms are not reproduced here.</p>
<p>The reader is referred to &icecore; and &icetcp; for a description of various terms used in the context of ICE. Those terms are not reproduced here.</p>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>The Jingle transport methods defined herein is designed to meet the following requirements:</p>
<p>The Jingle transport methods defined herein are designed to meet the following requirements:</p>
<ol>
<li>Make it possible to establish and manage out-of-band connections between two XMPP entities, even if they are behind Network Address Translators (NATs) or firewalls.</li>
<li>Enable use of either UDP (see &icecurr;) or TCP (see &ice-tcp;) as the transport protocol itself.</li>
<li>Enable use of either UDP (see &icecore;) or TCP (see &icetcp;) as the transport protocol itself.</li>
<li>Make it relatively easy to implement support in standard Jabber/XMPP clients.</li>
<li>Where communication with non-XMPP entities is needed, push as much complexity as possible onto server-side gateways between the XMPP network and the non-XMPP network.</li>
</ol>
</section1>
<section1 topic='Jingle Conformance' anchor='conformance'>
<p>In accordance with Section 8 of <cite>XEP-0166</cite>, this document specifies the following information related to the Jingle ice-udp and ice-tcp transport types:</p>
<p>In accordance with Section 8 of <cite>XEP-0166</cite>, this document specifies the following information related to the Jingle ice-udp and ice-tcp transport methods:</p>
<ol>
<li><p>The transport negotiation process is defined in the <link url='#protocol'>Protocol Description</link> section of this document.</p></li>
<li><p>The semantics of the &DESCRIPTION; element are defined in the <link url='#initiate'>Transport Initiation</link> section of this document.</p></li>
<li><p>The semantics of the &DESCRIPTION; element are defined in the <link url='#protocol-negotiate'>ICE Negotiation</link> section of this document.</p></li>
<li><p>Successful negotiation of the ice-udp method results in use of a lossy transport that is suitable for applications where some packet loss is tolerable, such as audio and video; successful negotiation of the ice-tcp method results in use of a reliable transport that is suitable for applications where packet loss is not tolerable, such as file transfer.</p></li>
<li><p>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).</p></li>
</ol>
@ -112,7 +118,10 @@
<section2 topic='Transport Initiation' anchor='protocol-initiate'>
<p>In order for the initiator in a Jingle exchange to start the negotiation, it MUST send a Jingle "session-initiate" stanza as described in <cite>XEP-0166</cite>. This stanza MUST include at least one transport method. If the initiator wishes to negotiate the ice-udp or ice-tcp transport, it MUST include an empty &TRANSPORT; child element qualified by the 'http://www.xmpp.org/extensions/xep-0176.html#ns-udp' or 'http://www.xmpp.org/extensions/xep-0176.html#ns-tcp' namespace &NSNOTE;.</p>
<example caption="Initiation"><![CDATA[
<iq to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='jingle1' type='set'>
<iq from='romeo@montague.net/orchard'
id='jingle1'
to='juliet@capulet.com/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='session-initiate'
initiator='romeo@montague.net/orchard'
@ -130,7 +139,10 @@
<section2 topic='Receiver Response' anchor='protocol-response'>
<p>As described in <cite>XEP-0166</cite>, to provisionally accept the session initiation request, the responder returns an IQ-result:</p>
<example caption="Receiver Provisionally Accepts the Session Request"><![CDATA[
<iq type='result' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='jingle1'/>
<iq from='juliet@capulet.com/balcony'
id='jingle1'
to='romeo@montague.net/orchard'
type='result'/>
]]></example>
</section2>
<section2 topic='ICE Negotiation' anchor='protocol-negotiate'>
@ -139,7 +151,10 @@
<section3 topic='Syntax of Candidate Element' anchor='protocol-negotiate-candidate'>
<p>The following is an example of the candidate format:</p>
<example caption="Initiator Sends a Candidate Transport"><![CDATA[
<iq to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='info1' type='set'>
<iq from='romeo@montague.net/orchard'
id='info1'
to='juliet@capulet.com/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='transport-info'
initiator='romeo@montague.net/orchard'
@ -155,7 +170,7 @@
priority='2114978302'
protocol='udp'
pwd='asd88fgpdd777uzjYhagZg'
type='local'
type='host'
ufrag='8hhy'/>
</transport>
</content>
@ -172,13 +187,13 @@
</tr>
<tr>
<td>component</td>
<td>A Component ID as defined in &icecurr;.</td>
<td>A Component ID as defined in &icecore;.</td>
<td>Component ID value in a=candidate line</td>
<td>1</td>
</tr>
<tr>
<td>foundation</td>
<td>A Foundation as defined in &icecurr;.</td>
<td>A Foundation as defined in &icecore;.</td>
<td>Foundation value in a=candidate line</td>
<td>1</td>
</tr>
@ -196,7 +211,7 @@
</tr>
<tr>
<td>network</td>
<td>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 or NIC).</td>
<td>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).</td>
<td>N/A</td>
<td>0</td>
</tr>
@ -208,11 +223,11 @@
</tr>
<tr>
<td>priority</td>
<td>A Priority as defined in &icecurr;
<note>In accordance with the rules specified in Section 5.3 of &icecurr;, the priority values shown in the examples within this document have been calculated as follows. The "type preference" for local candidates is stipulated to be "126" and for server reflexive candidates "66". The "local preference" for network 0 is stipulated to be "4096", for network 1 "2048", and for network 2 "1024".</note>
<td>A Priority as defined in &icecore;
<note>In accordance with the rules specified in Section 4.1.1 of &icecore;, the priority values shown in the examples within this document have been calculated as follows. The "type preference" for host candidates is stipulated to be "126" and for server reflexive candidates "100". The "local preference" for network 0 is stipulated to be "4096", for network 1 "2048", and for network 2 "1024".</note>
</td>
<td>Priority value in a=candidate line</td>
<td>9909</td>
<td>1678246398</td>
</tr>
<tr>
<td>protocol</td>
@ -222,33 +237,36 @@
</tr>
<tr>
<td>pwd</td>
<td>A Password as defined in &icecurr;.</td>
<td>A Password as defined in &icecore;.</td>
<td>a=ice-pwd line</td>
<td>asd88fgpdd777uzjYhagZg</td>
</tr>
<tr>
<td>type</td>
<td>A Candidate Type as defined in &icecurr;. The allowable values are "host" for host candidates, "prflx" for peer reflexive candidates, "relay" for relayed candidates, and "srflx" for server reflexive candidates.</td>
<td>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.</td>
<td>Typ field in a=candidate line</td>
<td>srflx</td>
</tr>
<tr>
<td>ufrag</td>
<td>A User Fragment as defined in &icecurr;.</td>
<td>A User Fragment as defined in &icecore;.</td>
<td>a=ice-ufrag line</td>
<td>8hhy</td>
</tr>
</table>
</section3>
<section3 topic='Negotiation Flow' anchor='protocol-negotiate-flow'>
<p>The first step in negotiating connectivity is for each client to immediately begin sending candidate transport methods to the other client. These candidates SHOULD be gathered by following the procedure specified in Section 5.3 of &icecurr; and prioritized by following the procedure specified in Section 5.4 of &icecurr;. Each candidate MUST be sent in a &JINGLE; element with an action of "transport-info".</p>
<p>The first step in negotiating connectivity is for both parties to immediately begin sending candidate transport methods to the other client. <note>The fact that both parties send candidates means that Jingle requires each party to be a full implementation of ICE, not a "lite" implementation as specified in &icecore;.</note> These candidates SHOULD be gathered by following the procedure specified in Section 4.1.1 of &icecore; and prioritized by following the procedure specified in Section 4.1.2 of &icecore;. Each candidate MUST be sent in a &JINGLE; element with an action of "transport-info".</p>
<p>If the responder receives and can successfully process a given candidate, it returns an IQ-result (if not, for example because the candidate data is improperly formatted, it returns an error).</p>
<p>Note well that the responder is only indicating receipt of the candidate, not telling the initiator that the candidate will be used.</p>
<p>Note: The responder is only indicating receipt of the candidate, not telling the initiator that the candidate will be used.</p>
<p>The initiator keeps sending candidates, one after the other (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. (Because certain candidates may be more "expensive" in terms of bandwidth or processing power, the initiator may not want to advertise their existence unless necessary.) For each candidate, the responder acknowledges receipt.</p>
<p>At the same time (i.e., immediately after provisionally accepting the session, not waiting for the initiator to begin or finish sending candidates), the responder also begins sending candidates that may work for it. As above, the initiator acknowledges receipt of the candidates.</p>
<p>As the initiator and responder receive candidates, they probe the various candidate transports for connectivity. In performing these connectivity checks, a client SHOULD follow the procedure specified in Section 7 of &icecurr;.</p>
<p>As the initiator and responder receive candidates, they probe the various candidate transports for connectivity. In performing these connectivity checks, a client SHOULD follow the procedure specified in Section 7 of &icecore;.</p>
<example caption="Initiator Sends a Candidate"><![CDATA[
<iq to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='info1' type='set'>
<iq from='romeo@montague.net/orchard'
id='info1'
to='juliet@capulet.com/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='transport-info'
initiator='romeo@montague.net/orchard'
@ -264,7 +282,7 @@
priority='2114978302'
protocol='udp'
pwd='asd88fgpdd777uzjYhagZg'
type='local'
type='host'
ufrag='8hhy'/>
</transport>
</content>
@ -272,20 +290,23 @@
</iq>
]]></example>
<example caption="Initiator Sends a Second Candidate"><![CDATA[
<iq to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='info2' type='set'>
<iq from='romeo@montague.net/orchard'
id='info2'
to='juliet@capulet.com/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='transport-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='this-is-the-audio-content'>
<transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns-udp'>
<candidate component='2'
<candidate component='1'
foundation='1'
generation='0'
ip='192.0.2.3'
network='1'
port='45664'
priority='1107821052'
priority='1678246398'
protocol='udp'
pwd='asd88fgpdd777uzjYhagZg'
type='srflx'
@ -296,20 +317,23 @@
</iq>
]]></example>
<example caption="Initiator Sends a Third Candidate"><![CDATA[
<iq to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='info3' type='set'>
<iq from='romeo@montague.net/orchard'
id='info3'
to='juliet@capulet.com/balcony'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='transport-info'
initiator='romeo@montague.net/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='this-is-the-audio-content'>
<transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns-udp'>
<candidate component='2'
<candidate component='1'
foundation='1'
generation='0'
ip='208.245.212.67'
network='2'
port='53267'
priority='1107558908'
priority='1677984254'
protocol='udp'
pwd='asd88fgpdd777uzjYhagZg'
type='srflx'
@ -331,8 +355,11 @@
</section2>
<section2 topic='Acceptance of Successful Candidate' anchor='protocol-acceptance'>
<p>If, based on STUN connectivity checks, the responder determines that it will be able to establish a connection using a given candidate, it sends a &JINGLE; element with an action of 'content-accept' (or 'session-accept') to the initiator, specifying the candidate that succeeded:</p>
<example caption="Juliet Definitively Accepts the Successful Candidate"><![CDATA[
<iq type='set' from='juliet@capulet.com/balcony' to='romeo@montague.net/orchard' id='accept1'>
<example caption="Responder Definitively Accepts the Successful Candidate"><![CDATA[
<iq from='juliet@capulet.com/balcony'
id='accept1'
to='romeo@montague.net/orchard'
type='set'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='content-accept'
initiator='romeo@montague.net/orchard'
@ -340,7 +367,7 @@
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='this-is-the-audio-content'>
<transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns-udp'>
<candidate component='2'
<candidate component='1'
foundation='1'
generation='0'
ip='192.0.2.3'
@ -356,36 +383,21 @@
</jingle>
</iq>
]]></example>
<p>The &JINGLE; element in the content-accept stanza SHOULD possess a 'responder' attribute that explicitly specifies the full JID of the responding entity. If provided, all future commmunications SHOULD be sent to the JID provided in the 'responder' attribute.</p>
<p>The &JINGLE; element in the content-accept stanza SHOULD possess a 'responder' attribute that explicitly specifies the full JID of the responding entity. If the 'responder' attribute is provided, all future commmunications SHOULD be sent to the JID provided in the 'responder' attribute.</p>
<p>If the initiator can also send data over that candidate, then it acknowledges the responder's acceptance:</p>
<example caption="Romeo Acknowledges Acceptance of Successful Candidate"><![CDATA[
<iq type='result' to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='accept1'/>
<example caption="Initiator Acknowledges Acceptance of Successful Candidate"><![CDATA[
<iq from='romeo@montague.net/orchard'
id='accept1'
to='juliet@capulet.com/balcony'
type='result'/>
]]></example>
<p>Now the initiator and responder can begin sending data over the negotiated connection.</p>
<p>If a candidate succeeded for the responder but the initiator cannot send data over that candidate, it MUST return a &notacceptable; error in response to the responder's acceptance of the successful candidate:</p>
<example caption="Romeo Returns Error in Response to Acceptance of Successful Candidate"><![CDATA[
<iq type='error' to='juliet@capulet.com/balcony' from='romeo@montague.net/orchard' id='accept1'>
<jingle xmlns='http://www.xmpp.org/extensions/xep-0166.html#ns'
action='transport-accept'
initiator='romeo@montague.net/orchard'
responder='juliet@capulet.com/balcony'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='this-is-the-audio-content'>
<transport xmlns='http://www.xmpp.org/extensions/xep-0176.html#ns-udp'>
<candidate component='2'
foundation='1'
generation='0'
ip='192.0.2.3'
network='1'
port='45664'
priority='1107821052'
protocol='udp'
pwd='asd88fgpdd777uzjYhagZg'
type='srflx'
ufrag='8hhy'/>
</transport>
</content>
</jingle>
<example caption="Initiator Returns Error in Response to Acceptance of Successful Candidate"><![CDATA[
<iq from='romeo@montague.net/orchard'
id='accept1'
to='juliet@capulet.com/balcony'
type='error'>
<error type='cancel'>
<not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
@ -398,39 +410,39 @@
<section1 topic='Determining Support' anchor='support'>
<p>If an entity supports the Jingle ice-udp transport, it MUST return a feature of "http://www.xmpp.org/extensions/xep-0176.html#ns-udp" &NSNOTE; in response to &xep0030; information requests.</p>
<example caption="Service Discovery information request"><![CDATA[
<iq type='get'
from='romeo@montague.net/orchard'
<iq from='romeo@montague.net/orchard'
id='disco1'
to='juliet@capulet.com/balcony'
id='disco1'>
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service Discovery information response"><![CDATA[
<iq type='result'
from='juliet@capulet.com/balcony'
<iq from='juliet@capulet.com/balcony'
id='disco1'
to='romeo@montague.net/orchard'
id='disco1'>
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='http://www.xmpp.org/extensions/xep-0176.html#ns-tcp'/>
<feature var='http://www.xmpp.org/extensions/xep-0176.html#ns-udp'/>
...
</query>
</iq>
]]></example>
<p>If an entity supports the Jingle ice-tcp transport, it MUST return a feature of "http://www.xmpp.org/extensions/xep-0176.html#ns-tcp" &NSNOTE; in response to &xep0030; information requests.</p>
<p>If an entity supports the Jingle ice-tcp transport, it MUST return a feature of "http://www.xmpp.org/extensions/xep-0176.html#ns-tcp" &NSNOTE; in response to <cite>XEP-0030</cite> information requests.</p>
<example caption="Service Discovery information request"><![CDATA[
<iq type='get'
from='romeo@montague.net/orchard'
<iq from='romeo@montague.net/orchard'
id='disco3'
to='juliet@capulet.com/balcony'
id='disco1'>
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service Discovery information response"><![CDATA[
<iq type='result'
from='juliet@capulet.com/balcony'
<iq from='juliet@capulet.com/balcony'
id='disco2'
to='romeo@montague.net/orchard'
id='disco1'>
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<feature var='http://www.xmpp.org/extensions/xep-0176.html#ns-tcp'/>
@ -440,8 +452,12 @@
]]></example>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<p>In order to speed the negotiation process so that media can flow as quickly as possible, the initiatior should gather and priorities candidates in advance or as soon as the principal begins the process of initiating a session.</p>
</section1>
<section1 topic='Deployment Notes' anchor='deploy'>
<p>This specification applies exclusively to Jabber/XMPP clients and places no additional requirements on Jabber/XMPP servers. However, service administrators may wish to deploy a STUN server in order to ease the client-to-client negotiation process.</p>
<p>This specification applies exclusively to Jabber/XMPP clients and places no additional requirements on Jabber/XMPP servers. However, service administrators may wish to deploy a STUN server in order to ease the client-to-client negotiation process. See &xep0215; for related information.</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
@ -454,7 +470,7 @@
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='ns'>
<p>Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0176.html#ns"; upon advancement of this specification, the &REGISTRAR; shall issue a permanent namespace in accordance with the process defined in Section 4 of &xep0053;.</p>
<p>Until this specification advances to a status of Draft, its associated namespaces shall be "http://www.xmpp.org/extensions/xep-0176.html#ns-udp" and "http://www.xmpp.org/extensions/xep-0176.html#ns-tcp"; upon advancement of this specification, the &REGISTRAR; shall issue permanent namespaces in accordance with the process defined in Section 4 of &xep0053;.</p>
</section2>
<section2 topic='Jingle Transport Methods' anchor='registrar-transports'>
<p>The XMPP Registrar shall include "ice-udp" and "ice-tcp" in its registry of Jingle transport methods. The registry submission is as follows:</p>