1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-24 10:12:19 -05:00
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@3923 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2010-02-12 00:04:40 +00:00
parent 5cd1a283a3
commit c12adb4aa4

View File

@ -24,6 +24,12 @@
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
&stpeter;
<revision>
<version>0.10</version>
<date>2010-02-11</date>
<initials>psa</initials>
<remark><p>Described the file retrieval case; updated referenced namespaces.</p></remark>
</revision>
<revision>
<version>0.9</version>
<date>2009-02-19</date>
@ -31,7 +37,7 @@
<remark>
<ul>
<li>Moved Jingle definitions of S5B and IBB transports to standalone documents.</li>
<li>Because the jingle-s5b and jingle-ibb transport methods are backwards-incompatible, incremented protocol version number from 0 to 1 and changed namespace from urn:xmpp:jingle:apps:file-transfer:0 to urn:xmpp:jingle:apps:file-transfer:1.</li>
<li>Because the jingle-s5b and jingle-ibb transport methods are backward-incompatible, incremented protocol version number from 0 to 1 and changed namespace from urn:xmpp:jingle:apps:file-transfer:0 to urn:xmpp:jingle:apps:file-transfer:1.</li>
<li>Moved transport fallback scenario to XEP-0260.</li>
</ul>
</remark>
@ -111,10 +117,10 @@
</header>
<section1 topic='Introduction' anchor='intro'>
<p>&xep0096; defines the current XMPP protocol extension for file transfer. However, that protocol has several drawbacks, most related to the &xep0095; protocol on which it depends:</p>
<p>&xep0096; was the original XMPP protocol extension for file transfer negotiation. However, that protocol has several drawbacks, most related to the &xep0095; protocol on which it depends:</p>
<ol>
<li>It does not enable a true, bidirectional negotiation; instead, the initiator sets the terms for the file transfer and the responder either accepts the terms or cancels the negotiation.</li>
<li>It is the only technology in the Jabber/XMPP protocol "stack" that uses <cite>XEP-095: Stream Initiation</cite>. More modern technologies such as voice and video session negotiation use &xep0166;, and it would be helpful if implementors could use the same code for all negotiation use cases.</li>
<li>It is the only technology in the Jabber/XMPP protocol "stack" that uses <cite>XEP-095: Stream Initiation</cite>. More modern technologies such as voice and video session negotiation use &xep0166;, and it would be helpful if implementors could re-use the same code for all negotiation use cases.</li>
</ol>
<p>To overcome these drawbacks, this specification defines a file transfer negotiation method that meets the following requirements:</p>
<ul>
@ -122,24 +128,25 @@
<li>Reuse the file description format from <cite>XEP-0096</cite>.</li>
<li>Define a clear upgrade path from <cite>XEP-0096</cite> to this specification.</li>
</ul>
<p>Jingle file transfer is only as reliable as the transports on which it depends. In particular, SOCKS5 Bytestreams ("S5B") does not always result in NAT or firewall traversal. To work around that problem, this specification requires all implementations to support In-Band Bytestreams ("IBB"), which tends to result in a successful (if slow) file transfer. It is likely that a future version of this specification will also recommend implementation of a Jingle transport method that emulates the IETF's ICE-TCP technology, which is currently a work in progress (see &ice-tcp;); however, a Jingle ICE-TCP transport method is dependent on the outcome of IETF work in this area.</p>
<p>Jingle file transfer is only as reliable as the transports on which it depends. In particular, SOCKS5 Bytestreams ("S5B") does not always result in NAT or firewall traversal. To work around that problem, this specification requires all implementations to support as a fallback mechanism In-Band Bytestreams ("IBB"), which usually results in a successful (if slow) file transfer.</p>
<p>Note: It is likely that a future version of this specification will also recommend implementation of a Jingle transport method that emulates the IETF's ICE-TCP technology, which is currently a work in progress (see &ice-tcp;); however, a future Jingle ICE-TCP transport method is dependent on the outcome of IETF work in this area.</p>
</section1>
<section1 topic='How It Works' anchor='protocol'>
<p>This section provides a friendly introduction to Jingle file transfer.</p>
<p>First, the party that wishes to initiate the file transfer determines the responder's capabilities (via &xep0030; or &xep0115;). Here we assume that the responder supports the following service discovery features (note: these features may not reflect final namespace assignments):</p>
<p>First, the party that wishes to initiate the file transfer determines the responder's capabilities (via &xep0030; or &xep0115;). Here we assume that the responder supports the following service discovery features:</p>
<ul>
<li>urn:xmpp:jingle:0 as described in XEP-0166</li>
<li>urn:xmpp:jingle:apps:file-transfer:1 as defined in this document</li>
<li>urn:xmpp:jingle:transports:s5b:0 as defined in &xep0260;</li>
<li>urn:xmpp:jingle:1 as described in XEP-0166</li>
<li>urn:xmpp:jingle:apps:file-transfer:1 as defined in this document &NSVER;</li>
<li>urn:xmpp:jingle:transports:s5b:1 as defined in &xep0260;</li>
<li>urn:xmpp:jingle:transports:ibb:0 as defined in &xep0261;</li>
</ul>
<p>The initiator then sends a Jingle session-initiation request to a potential responder. The content-type of the request specifies two things:</p>
<ol>
<li>An application type of "urn:xmpp:jingle:apps:file-transfer:1" &VNOTE;. In particular, the &lt;description/&gt; element contains an &lt;offer/&gt; or &lt;request/&gt; element that in turn contains a &lt;file/&gt; element qualified by the existing 'http://jabber.org/protocol/si/profile/file-transfer' namespace from <cite>XEP-0096</cite>.</li>
<li>An appropriate transport method. So far the suggested methods are jingle-s5b and, as a fallback, jingle-ibb.</li>
<li>An application type of "urn:xmpp:jingle:apps:file-transfer:1". In particular, the &lt;description/&gt; element contains an &lt;offer/&gt; or &lt;request/&gt; element that in turn contains a &lt;file/&gt; element qualified by the existing 'http://jabber.org/protocol/si/profile/file-transfer' namespace from <cite>XEP-0096</cite>.</li>
<li>An appropriate transport method. So far the suggested methods are jingle-s5b (<cite>XEP-0260</cite>) and, as a fallback, jingle-ibb (<cite>XEP-0261</cite>).</li>
</ol>
<p>In this example, the initiator is &lt;romeo@montague.lit&gt;, the responder is &lt;juliet@capulet.lit&gt;, and the initiation request specifies a file offer and a transport method of jingle-s5b (i.e., XEP-0065).</p>
<p>In this example, the initiator is &lt;romeo@montague.lit&gt;, the responder is &lt;juliet@capulet.lit&gt;, the application type is a file offer, and the transport method is jingle-s5b.</p>
<p>The flow is as follows.</p>
<code><![CDATA[
Initiator Responder
@ -167,7 +174,7 @@ Initiator Responder
id='nzu25s8'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='urn:xmpp:jingle:0'
<jingle xmlns='urn:xmpp:jingle:1'
action='session-initiate'
initiator='romeo@montague.lit/orchard'
sid='851ba2'>
@ -175,24 +182,25 @@ Initiator Responder
<description xmlns='urn:xmpp:jingle:apps:file-transfer:1'>
<offer>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
name='test.txt'
size='1022'
date='1969-07-21T02:56:15Z'
hash='552da749930852c69ae5d2141d3766b1'
date='1969-07-21T02:56:15Z'>
name='test.txt'
size='1022'>
<desc>This is a test. If this were a real file...</desc>
</file>
</offer>
</description>
<transport xmlns='urn:xmpp:jingle:transports:s5b:0'
sid='vj3hs98y'
mode='tcp'>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
mode='tcp'
sid='vj3hs98y'>
<streamhost
jid='romeo@montague.lit/orchard'
host='192.168.4.1'
jid='romeo@montague.lit/orchard'
port='5086'/>
<streamhost
jid='streamer.shakespeare.lit'
host='24.24.24.1'
jid='streamer.shakespeare.lit'
type='proxy'
zeroconf='_jabber.bytestreams'/>
</transport>
</content>
@ -206,14 +214,14 @@ Initiator Responder
to='romeo@montague.lit/orchard'
type='result'/>
]]></example>
<p>The initiator then attempts to initiate a SOCKS5 Bytestream with the responder as described in xep-jingle-s5b and <cite>XEP-0065</cite>.</p>
<p>The initiator then attempts to initiate a SOCKS5 Bytestream with the responder as described in <cite>XEP-0260</cite> and <cite>XEP-0065</cite>.</p>
<p>If the responder is able to connect to one of the streamhosts, it returns a Jingle session-accept (including only the JID of the streamhost to which it connected).</p>
<example caption="Responder sends session-accept"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='accept1'
id='jn2vs71g'
to='romeo@montague.lit/orchard'
type='set'>
<jingle xmlns='urn:xmpp:jingle:0'
<jingle xmlns='urn:xmpp:jingle:1'
action='session-accept'
initiator='romeo@montague.lit/orchard'
sid='851ba2'>
@ -229,8 +237,8 @@ Initiator Responder
</file>
</offer>
</description>
<transport xmlns='urn:xmpp:jingle:transports:s5b:0'>
<streamhost jid='streamer.shakespeare.lit'/>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'>
<streamhost-used jid='streamer.shakespeare.lit'/>
</transport>
</content>
</jingle>
@ -238,30 +246,78 @@ Initiator Responder
]]></example>
<p>The initiator acknowledges the Jingle session-accept.</p>
<example caption="Initiator acknowledges session-accept"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='accept1'
to='romeo@montague.lit/orchard'
<iq from='romeo@montague.lit/orchard'
id='jn2vs71g'
to='juliet@capulet.lit/balcony'
type='result'/>
]]></example>
<p>Now the parties exchange the file using SOCKS5 Bytestreams.</p>
<p>Once the transfer is completed, either party can terminate the Jingle session.</p>
<p>Once the transfer is completed, either party can terminate the Jingle session; preferably this is done by the entity that receives the file to ensure that the complete file (up to the advertised size) has been received.</p>
<example caption="Receiver sends session-terminate"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='og61bvs98'
to='romeo@montague.lit/orchard'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='session-terminate'
sid='a73sjjvkla37jfea'>
<reason>
<success/>
</reason>
</jingle>
</iq>
]]></example>
<p>For a description of the transport fallback scenario (from SOCK5 Bytestreams to In-Band Bytestreams), refer to <cite>XEP-0260</cite>.</p>
</section1>
<section1 topic='Requesting a File' anchor='request'>
<p>If the entity that hosts a file has advertised its existence (or if a previous file transfer attempt has failed and the receiver would like to initiate another attempt), the entity that wishes to receive the file can "pull" the file from the hosting entity. This is done by sending a Jingle session-initiate to the hosting entity, including a &DESCRIPTION; element qualified by the 'urn:xmpp:jingle:apps:file-transfer:1' namespace and containing a &lt;request/&gt; element that defines the requested file.</p>
<example caption="Receiver requests hosted file"><![CDATA[
<iq from='juliet@capulet.lit/balcony'
id='wsn361c3'
to='romeo@montague.lit/orchard'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='session-initiate'
initiator='romeo@montague.lit/orchard'
sid='uj3b2'>
<content creator='initiator' name='a-file-request'>
<description xmlns='urn:xmpp:jingle:apps:file-transfer:1'>
<request>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer'
hash='552da749930852c69ae5d2141d3766b1'/>
</request>
</description>
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
mode='tcp'
sid='xig361fj'>
<streamhost
host='24.24.24.2'
jid='proxy.capulet.lit'
type='proxy'/>
</transport>
</content>
</jingle>
</iq>
]]></example>
<p>The parties would then complete a session negotiation flow similar to that outlined above for offering a file.</p>
<p>Note: If the requesting entity knows the hash of the file, then it can include only that metadata in its request. If not, the requesting entity needs include enough metadata to uniquely identify the file, such as the date, name, and size. For similar considerations, see &rfc5547;.</p>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<section2 topic='Mandatory to Implement Technologies' anchor='impl-mti'>
<p>All implementations MUST support the In-Band Bytestreams transport method as a reliable method of last resort. An implementation SHOULD support other transport methods as well.</p>
<p>All implementations MUST support the In-Band Bytestreams transport method as a reliable method of last resort. An implementation SHOULD support other transport methods as well, especially SOCKS5 Bytestreams.</p>
</section2>
<section2 topic='Preference Order of Transport Methods' anchor='impl-pref'>
<p>An application MAY present transport methods in any order, except that the In-Band Bytestreams method MUST be the lowest preference.</p>
</section2>
<section2 topic='Migration from XEP-0096' anchor='impl-migration'>
<p>Support for Jingle file transfer can be determined through discovery of the 'urn:xmpp:jingle:apps:file-transfer:1' namespace &VNOTE;, via either service discovery (<cite>XEP-0030</cite>) or entity capabilities (<cite>XEP-0115</cite>). If the initiator knows that the responder supports Jingle file transfer, it SHOULD first attempt negotiation using XEP-0166 rather than XEP-0095.</p>
<p>Support for Jingle file transfer can be determined through discovery of the 'urn:xmpp:jingle:apps:file-transfer:1' namespace &VNOTE;, via either service discovery (<cite>XEP-0030</cite>) or entity capabilities (<cite>XEP-0115</cite>). If the initiator knows that the responder supports Jingle file transfer, it SHOULD first attempt negotiation using Jingle rather than SI.</p>
</section2>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>In order to secure the data stream, implementations SHOULD use encryption methods appropriate to the transport method being used. For example, end-to-end encryption can be negotiated over either SOCKS5 Bytestreams or In-Band Bytestreams as described in xep-jingle-s5b and xep-jingle-ibb.</p>
<p>In order to secure the data stream, implementations SHOULD use encryption methods appropriate to the transport method being used. For example, end-to-end encryption can be negotiated over either SOCKS5 Bytestreams or In-Band Bytestreams as described in <cite>XEP-0260</cite> and <cite>XEP-0261</cite>.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
@ -270,11 +326,11 @@ Initiator Responder
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespaces:</p>
<p>This specification defines the following XML namespace:</p>
<ul>
<li>urn:xmpp:jingle:apps:file-transfer:1</li>
</ul>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
</section2>
<section2 topic='Namespace Versioning' anchor='registrar-versioning'>
&NSVER;