noted fast-mode reuse; added type attribute

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@3326 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2009-07-14 01:34:14 +00:00
parent 360eb28199
commit 0d6b5ea95a
1 changed files with 32 additions and 17 deletions

View File

@ -24,11 +24,12 @@
<discuss>jingle</discuss>
&stpeter;
&dmeyer;
&infiniti;
<revision>
<version>0.3</version>
<date>2009-07-13</date>
<initials>dm</initials>
<remark><p>Major update to make Jingle S5B inherit more features from ICE and ICE-TCP. This includes priorities and candidate identifier and the renaming of the streamhost element to candidate. The candidate selection was updated to the use of priorities and it is now required for both clients to send a candidate-used or candidate-error information. Due to incompatibilities to previous version the namespace changed to urn:xmpp:jingle:transports:s5b:1.</p></remark>
<initials>dm/psa/jk</initials>
<remark><p>Major update to make Jingle S5B inherit more features from ICE and ICE-TCP. This includes priorities and candidate identifier and the renaming of the streamhost element to candidate. The candidate selection was updated to the use of priorities and it is now required for both clients to send a candidate-used or candidate-error notification. Also defined type attribute to differentiate between various kinds of candidates. Noted reuse of fast-mode methodology from older S5B optimization specification. Due to incompatibilities to previous version the namespace changed to urn:xmpp:jingle:transports:s5b:1.</p></remark>
</revision>
<revision>
<version>0.2</version>
@ -64,7 +65,6 @@
<section1 topic='Introduction' anchor='intro'>
<p>&xep0166; defines a framework for negotiating and managing data sessions over XMPP. In order to provide a flexible framework, the base Jingle specification defines neither data transport methods nor application formats, leaving that up to separate specifications. The current document defines a transport method for establishing and managing data exchanges between XMPP entities using the existing SOCKS5 Bytestreams (S5B) protocol specified in &xep0065;. This "jingle-s5b" method results in a streaming transport method suitable for use in Jingle application types where packet loss cannot be tolerated (e.g., file transfer). Jingle-S5B reuses the protocol flow from <cite>XEP-0065</cite> for the communication with a SOCKS5 streamhost; the communication between two clients to negotiate the possible candidates differs from <cite>XEP-0065</cite> and share similarities with &xep0176;</p>
<p>It is RECOMMENDED that a client offers as many &lt;candidate/&gt; elements as possible with itself as the host (i.e., non-proxy candidates). This includes opening the TCP port on all available interfaces the user wants to use (e.g. maybe not an expensive UMTS link), both the IPv4 and IPv6 addresses of that interface (if available), and using an assisting NAT protocol if possible. If the client knows it is behind a NAT and the router announces UPnP IGD or NAT-PMP support, the client SHOULD map the open port to the external interface of the router and include the public IP address and port information in the &lt;candidate/&gt; offers. To increase the chance of success without using a proxy, this specification allows the responder to also send offers.</p>
</section1>
<section1 topic='Protocol' anchor='protocol'>
@ -73,12 +73,12 @@
Romeo Juliet
| |
| session-initiate |
| (with S5B info) |
| (with S5B candidates) |
|--------------------------------->|
| ack |
|<---------------------------------|
| session-accept |
| (with S5B info) |
| (with S5B candidates) |
|<---------------------------------|
| ack |
|--------------------------------->|
@ -101,6 +101,7 @@ Romeo Juliet
<p>This flow is illustrated in the following examples (to simplify the presentation these use a "stub" application instead of a real application type).</p>
<section2 topic='Exchange Candidates'>
<p>First the initiator sends a Jingle session-initiate request that contains one or more transport candidates which are a mixture of <cite>XEP-0065</cite> streamhosts and ICE candidates used in <cite>XEP-0176</cite>.</p>
<p>It is RECOMMENDED that a client will offer as many &lt;candidate/&gt; elements as possible with itself as the host (i.e., non-proxy candidates). This includes opening the TCP port on all available interfaces the user wants to use (e.g. maybe not an expensive UMTS link), both the IPv4 and IPv6 addresses of that interface (if available), and using an assisting NAT protocol if possible. If the client knows it is behind a NAT and the router announces UPnP IGD or NAT-PMP support, the client SHOULD map the open port to the external interface of the router and include the public IP address and port information in the &lt;candidate/&gt; offers. To increase the chance of success without using a proxy, this specification allows the responder to also send offers, effectively equivalent to the "fast mode" for SOCKS5 Bytestreams as previously described at &lt;<link url='http://delta.affinix.com/specs/stream.html'>http://delta.affinix.com/specs/stream.html</link>&gt;.</p>
<example caption="Initiator sends session-initiate (stub)"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='xn28s7gk'
@ -119,12 +120,14 @@ Romeo Juliet
host='192.168.4.1'
jid='romeo@montague.lit/orchard'
port='5086'
priority='8257636'/>
priority='8257636'
type='direct'/>
<candidate cid='hutr46fe'
host='24.24.24.1'
jid='romeo@montague.lit/orchard'
port='5086'
priority='8258636'/>
port='5087'
priority='8258636'
type='direct'/>
</transport>
</content>
</jingle>
@ -138,7 +141,7 @@ Romeo Juliet
type='result'/>
]]></example>
<p>Depending on the application type, a user agent controlled by a human user might need to wait for the user to affirm a desire to proceed with the session before continuing. When the user agent has received such affirmation (or if the user agent can automatically proceed for any reason, e.g. because no human intervention is expected or because a human user has configured the user agent to automatically accept sessions with a given entity), it returns a Jingle session-accept message. This message MUST contain a &TRANSPORT; element qualified by the 'urn:xmpp:jingle:transports:s5b:1' namespace, which SHOULD in turn contain one &lt;candidate/&gt; element for each SOCKS5 Bytestreams candidate generated by or known to the responder, but MAY instead be empty if the responder does not wish to offer any candidates or wishes to send each candidate as the payload of a transport-info message.</p>
<p>Note: If the responder sends candidates, the chances of a successful connection are increased. For example, the initiator might be behind a NAT or might have no access to a proxy, whereas the responder might have a public IP address, might know about a proxy, or might have NAT penetration support like NAT-PMP in the router.</p>
<p>Note: If the responder sends candidates, the chances of a successful connection are increased. For example, the initiator might be behind a NAT or might have no access to a proxy, whereas the responder might have a public IP address, might know about a proxy, or might have NAT penetration support like NAT-PMP in the router. (Whereas this "fast mode" was a special extension previously, it is the default in Jingle.)</p>
<p>In the following example, Juliet's client opens one port. The provided &lt;candidates/&gt; are the (private) IPv4 address of the interface, a (public) IPv6 address, and the public IPv4 address created by mapping the private IP address/port using NAT-PMP.</p>
<example caption="Responder sends session-accept with candidates"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
@ -158,17 +161,20 @@ Romeo Juliet
host='192.169.1.10'
jid='juliet@capulet.lit/balcony'
port='6539'
priority='8257636'/>
priority='8257636'
type='direct'/>
<candidate cid='hr65dqyd'
host='134.102.201.180'
jid='juliet@capulet.lit/balcony'
port='16453'
priority='7929856'/>
priority='7929856'
type='direct'/>
<candidate cid='grt654q2'
host='2001:638:708:30c9:219:d1ff:fea4:a17d'
jid='juliet@capulet.lit/balcony'
port='6539'
priority='8257606'/>
priority='8257606'
type='direct'/>
</transport>
</content>
</jingle>
@ -237,7 +243,7 @@ priority = (2^16)*(type preference) + (local preference)
to='romeo@montague.lit/orchard'
type='result'/>
]]></example>
<p>If a client was unable to connect to any candidate of its peer or stopped trying because the peer already send a candidate-used notification with a priority higher than its remaining candidates, it sends a candidate-error Jingle transport-info message. If both clients happen to send a candidates-used message with candidates with the same priority, the candidate chosen by the initiator wins (consistent with the rules in <cite>XEP-0166</cite>) and the responder closes the connection it was able to establish.</p>
<p>If a client was unable to connect to any candidate of its peer or stopped trying because the peer already send a candidate-used notification with a priority higher than its remaining candidates, it sends a candidate-error Jingle transport-info message (this is equivalent to the IQ-error with code="500" from the "fast-mode" extension). If both clients happen to send a candidates-used message with candidates with the same priority, the candidate chosen by the initiator wins (consistent with the rules in <cite>XEP-0166</cite>) and the responder closes the connection it was able to establish.</p>
<example caption="Responder sends candidate-error in Jingle transport-info"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='gft65ewd'
@ -263,7 +269,7 @@ priority = (2^16)*(type preference) + (local preference)
to='juliet@capulet.lit/balcony'
type='result'/>
]]></example>
<p>Once both clients sent their candidate-error or candidate-used message to the peer and at least one made a successful connection, both clients can begin sending data over the SOCKS5 bytestream as described in XEP-0065.</p>
<p>If at least party makes a successful connection, both clients can begin sending data over the SOCKS5 bytestream as described in XEP-0065.</p>
</section2>
<section2 topic='Closing the Bytestream'>
<p>Once the parties have finished using the bytestream (e.g., because a complete file has been sent), either party can send a Jingle session-terminate action.</p>
@ -317,7 +323,7 @@ Romeo Juliet
|--------------------------------->|
| |
]]></code>
<p>First the initiator sends a Jingle session-initiate, in this case with a transport of SOCKS5 Bytestreams. The protocol flow is exactly the same as described above. If both clients are unable to connect to a candidate provided by the peer, both send candidate-error messages and SOCKS5 as failed. The initiator MUST either terminate the Jingle session with a Jingle reason of &lt;connectivity-error/&gt; or replace the transport by something else using the transport-replace action. Typically the fallback option is &xep0047;. Therefore the initiator sends a transport-replace action including a transport of IBB.</p>
<p>First the initiator sends a Jingle session-initiate, in this case with a transport of SOCKS5 Bytestreams. The protocol flow is exactly the same as described above. If both clients are unable to connect to a candidate provided by the peer, both send candidate-error messages and SOCKS5 as failed. The initiator MUST either terminate the Jingle session with a Jingle reason of &lt;connectivity-error/&gt; or replace the transport with something else using the transport-replace action. Typically the fallback option is IBB. Therefore the initiator sends a transport-replace action including a transport of IBB.</p>
<example caption="Initiator replaces transport with IBB"><![CDATA[
<iq from='romeo@montague.lit/orchard'
id='hs92n57'
@ -343,7 +349,7 @@ Romeo Juliet
type='result'/>
]]></example>
<p>If the transport replacement is acceptable, the responder then sends a transport-accept action to the initiator (if not, the responder sends a transport-reject action).</p>
<example caption="Responder sends session-accept"><![CDATA[
<example caption="Responder sends transport-accept"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='is71ns63'
to='romeo@montague.lit/orchard'
@ -376,7 +382,7 @@ Romeo Juliet
<li>A client SHOULD try the offered candidates in the order of their priority.</li>
<li>If more than one &lt;candidate/&gt; element is present a client SHOULD wait 200ms before trying the next one.</li>
<li>If the candidate has a JID attribute and that JID is not the one of the peer it indicates the usage of a proxy. If the client had offered direct connection information it MAY want to wait a little bit longer than 200ms before trying the first proxy.</li>
<li>A client SHOULD NOT wait for a TCP timeout on connect. If it is unable to connect to any candidate within 5 seconds it SHOULD send a candidate-error.</li>
<li>A client SHOULD NOT wait for a TCP timeout on connect. If it is unable to connect to any candidate within 5 seconds it SHOULD send a candidate-error to the other party.</li>
</ol>
</section1>
@ -472,6 +478,15 @@ Romeo Juliet
<xs:attribute name='jid' type='xs:string' use='optional'/>
<xs:attribute name='port' type='xs:positiveInteger' use='optional'/>
<xs:attribute name='priority' type='xs:positiveInteger' use='required'/>
<xs:attribute name='type' use='optional' default='direct'>
<xs:simpleType>
<xs:restriction base='xs:NCName'>
<xs:enumeration value='direct'/>
<xs:enumeration value='proxy'/>
<xs:enumeration value='teredo'/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name='zeroconf' type='xs:string' use='optional'/>
</xs:extension>
</xs:simpleContent>