mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-21 16:55:07 -05:00
0.16
This commit is contained in:
parent
4290e43d62
commit
7ae3faeb4d
355
xep-0234.xml
355
xep-0234.xml
@ -7,10 +7,10 @@
|
||||
<xep>
|
||||
<header>
|
||||
<title>Jingle File Transfer</title>
|
||||
<abstract>This specification defines a Jingle application type for transferring files between two entities. The protocol provides a modular framework that enables the exchange of information about the file to be transferred as well as the negotiation of parameters such as the transport to be used.</abstract>
|
||||
<abstract>This specification defines a Jingle application type for transferring a file from one entity to another. The protocol provides a modular framework that enables the exchange of information about the file to be transferred as well as the negotiation of parameters such as the transport to be used.</abstract>
|
||||
&LEGALNOTICE;
|
||||
<number>0234</number>
|
||||
<status>Deferred</status>
|
||||
<status>Experimental</status>
|
||||
<type>Standards Track</type>
|
||||
<sig>Standards</sig>
|
||||
<dependencies>
|
||||
@ -24,6 +24,23 @@
|
||||
<supersededby/>
|
||||
<shortname>NOT_YET_ASSIGNED</shortname>
|
||||
&stpeter;
|
||||
<revision>
|
||||
<version>0.16</version>
|
||||
<date>2014-08-11</date>
|
||||
<initials>psa</initials>
|
||||
<remark>
|
||||
<ul>
|
||||
<li>Modified protocol to support sending only one file at a time (multi-file adds unnecessary complexity).</li>
|
||||
<li>Removed <request/> flow in favor of a dedicated protocol similar to XEP-0137 ("jingle-pub").</li>
|
||||
<li>Removed <offer/> wrapper since it is no longer necessary (with the removal of the request flow).</li>
|
||||
<li>Removed the <abort/> element since it was related to the transfer of multiple files.</li>
|
||||
<li>Changed <candidate-used/> to >remote-candidate/> for consistency with XEP-0176.</li>
|
||||
<li>Added media-type child to <file/> element.</li>
|
||||
<li>Added example for communicating empty <hash/> element in the session-initiate message.</li>
|
||||
<li>Incremented namespace version from 3 to 4.</li>
|
||||
</ul>
|
||||
</remark>
|
||||
</revision>
|
||||
<revision>
|
||||
<version>0.15</version>
|
||||
<date>2012-02-08</date>
|
||||
@ -41,7 +58,7 @@
|
||||
<li>Described the process of aborting a file transfer</li>
|
||||
<li>Clarified the order of events (Jingle, then transport) when the session is terminated</li>
|
||||
<li>Added section on determining spport, including service discovery feature for multi-file support</li>
|
||||
<li>Removed the 'urn:xmpp:jingle:apps:file-transfer:info:2' namespace by putting all elements into the 'urn:xmpp:jingle:apps:file-transfer:3' namespace</li>
|
||||
<li>Removed the 'urn:xmpp:jingle:apps:file-transfer:info:2' namespace by putting all elements into the 'urn:xmpp:jingle:apps:file-transfer:4' namespace</li>
|
||||
<li>Incremented namespace version from 2 to 3</li>
|
||||
</ul>
|
||||
</remark>
|
||||
@ -165,12 +182,12 @@
|
||||
<p>To overcome these drawbacks, this specification defines a file transfer negotiation method that meets the following requirements:</p>
|
||||
<ul>
|
||||
<li>Use the session negotiation semantics from <cite>XEP-0166</cite>.</li>
|
||||
<li>Use &xep0260; and &xep0261;.</li>
|
||||
<li>Define a file description format that, unlike <cite>XEP-0096</cite> enables hash agility (via &xep0300;).</li>
|
||||
<li>Use &xep0260; and &xep0261; as transport methods.</li>
|
||||
<li>Define a file description format that, unlike <cite>XEP-0096</cite>, enables hash agility (via &xep0300;).</li>
|
||||
<li>Define a clear upgrade path from SI File Transfer to Jingle File Transfer.</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 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>
|
||||
<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, as specified in &rfc6544;.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='How It Works' anchor='protocol'>
|
||||
@ -178,24 +195,22 @@
|
||||
<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:1 as described in <cite>XEP-0166</cite></li>
|
||||
<li>urn:xmpp:jingle:apps:file-transfer:3 as defined in this document &NSVER;</li>
|
||||
<li>urn:xmpp:jingle:apps:file-transfer:4 as defined in this document &NSVER;</li>
|
||||
<li>urn:xmpp:jingle:transports:s5b:1 as defined in <cite>XEP-0260</cite></li>
|
||||
<li>urn:xmpp:jingle:transports:ibb:1 as defined in <cite>XEP-0261</cite></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:3". In particular, the <description/> element contains an <offer/> element or a <request/> element that in turn contains one or more <file/> elements defining a file to be sent.</li>
|
||||
<li>An application type of "urn:xmpp:jingle:apps:file-transfer:4". In particular, the <description/> element contains a <file/> elements describing the file to be sent.</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>Note: All attributes of the <file/> element are defined in <cite>XEP-0096</cite>, not in this specification.</p>
|
||||
<p>In this example, the initiator is <romeo@montague.lit>, the responder is <juliet@capulet.lit>, 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
|
||||
| |
|
||||
| session-initiate |
|
||||
| (with <offer/> or |
|
||||
| <request/> and S5B) |
|
||||
| (with <file/> and S5B) |
|
||||
|---------------------------->|
|
||||
| ack |
|
||||
|<----------------------------|
|
||||
@ -222,17 +237,16 @@ Initiator Responder
|
||||
initiator='romeo@montague.lit/orchard'
|
||||
sid='851ba2'>
|
||||
<content creator='initiator' name='a-file-offer'>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
|
||||
<offer>
|
||||
<file>
|
||||
<date>1969-07-21T02:56:15Z</date>
|
||||
<desc>This is a test. If this were a real file...</desc>
|
||||
<name>test.txt</name>
|
||||
<range/>
|
||||
<size>1022</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</offer>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
|
||||
<file>
|
||||
<date>1969-07-21T02:56:15Z</date>
|
||||
<desc>This is a test. If this were a real file...</desc>
|
||||
<media-type>text/plain</media-type>
|
||||
<name>test.txt</name>
|
||||
<range/>
|
||||
<size>1022</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</description>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
mode='tcp'
|
||||
@ -274,17 +288,16 @@ Initiator Responder
|
||||
initiator='romeo@montague.lit/orchard'
|
||||
sid='851ba2'>
|
||||
<content creator='initiator' name='a-file-offer'>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
|
||||
<offer>
|
||||
<file>
|
||||
<date>1969-07-21T02:56:15Z</date>
|
||||
<desc>This is a test. If this were a real file...</desc>
|
||||
<name>test.txt</name>
|
||||
<range/>
|
||||
<size>1022</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</offer>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
|
||||
<file>
|
||||
<date>1969-07-21T02:56:15Z</date>
|
||||
<desc>This is a test. If this were a real file...</desc>
|
||||
<media-type>text/plain</media-type>
|
||||
<name>test.txt</name>
|
||||
<range/>
|
||||
<size>1022</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</description>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
mode='tcp'
|
||||
@ -319,8 +332,8 @@ Initiator Responder
|
||||
to='juliet@capulet.lit/balcony'
|
||||
type='result'/>
|
||||
]]></example>
|
||||
<p>Once one client has successfully created a connection, it sends a <candidate-used/> element to the peer inside a Jingle transport-info message. If a client receives a candidate-used notification it SHOULD continue trying to connect to candidates sent by its peer if it has not tried all candidates with a higher priority than the one successfully used by the peer.</p>
|
||||
<example caption="Initiator sends candidate-used in Jingle transport-info"><![CDATA[
|
||||
<p>Once one client has successfully created a connection, it sends a <remote-candidate/> element to the peer inside a Jingle transport-info message. If a client receives a remote-candidate notification it SHOULD continue trying to connect to candidates sent by its peer if it has not tried all candidates with a higher priority than the one successfully used by the peer.</p>
|
||||
<example caption="Initiator sends remote-candidate in Jingle transport-info"><![CDATA[
|
||||
<iq from='romeo@montague.lit/orchard'
|
||||
id='hjdi8'
|
||||
to='juliet@capulet.lit/balcony'
|
||||
@ -332,14 +345,14 @@ Initiator Responder
|
||||
<content creator='initiator' name='ex'>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
sid='vj3hs98y'>
|
||||
<candidate-used cid='hr65dqyd'/>
|
||||
<remote-candidate cid='hr65dqyd'/>
|
||||
</transport>
|
||||
</content>
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>The peer immediately acknowledges receipt.</p>
|
||||
<example caption="Responder acknowledges candidate-used message"><![CDATA[
|
||||
<example caption="Responder acknowledges remote-candidate message"><![CDATA[
|
||||
<iq from='juliet@capulet.lit/balcony'
|
||||
id='hjdi8'
|
||||
to='romeo@montague.lit/orchard'
|
||||
@ -347,7 +360,7 @@ Initiator Responder
|
||||
]]></example>
|
||||
<p>(See <cite>XEP-0260</cite> for further details.)</p>
|
||||
<p>Now the parties exchange the file using the negotiated transport (here, SOCKS5 Bytestreams).</p>
|
||||
<p>Once the transfer is completed, either party can acknowledge completion (see <link url='#multi'>Sending Multiple Files</link>) or 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>
|
||||
<p>Once the transfer is completed, either party can acknowledge completion or 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'
|
||||
@ -366,9 +379,11 @@ Initiator Responder
|
||||
<p>For a description of the transport fallback scenario (from SOCKS5 Bytestreams to In-Band Bytestreams), refer to <cite>XEP-0260</cite>.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Communicating the Hash' anchor='hash'>
|
||||
<p>At any time during the lifetime of the file transfer session, the hosting entity (i.e., the entity where the file resides) can communicate the checksum of the file to the receiving entity. This is done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:3' namespace, which in turn contains a <file/> element that MUST at least contain a child element of <hash/> qualified by the 'urn:xmpp:hashes:1' namespace and MAY contain other elements qualified by the 'urn:xmpp:jingle:apps:file-transfer:3' namespace (e.g. <name/> and <date/>). Each <hash/> element contains a checksum of the file contents produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.</p>
|
||||
<example caption="Hosting entity sends hash in session-info"><![CDATA[
|
||||
<section1 topic='Communicating the Checksum or Hashing Algorithm' anchor='hash'>
|
||||
<p>At any time during the lifetime of the file transfer session, the hosting entity (i.e., the entity where the file resides) can communicate the checksum of the file to the receiving entity.</p>
|
||||
<p>This can be done in the session-initiate message if the sender already knows the checksum, as shown above in Example 1.</p>
|
||||
<p>After the session-initiate message, this can also be done by sending a session-info message containing a <checksum/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace, which in turn contains a <file/> element that MUST at least contain a child element of <hash/> qualified by the 'urn:xmpp:hashes:1' namespace and MAY contain other elements qualified by the 'urn:xmpp:jingle:apps:file-transfer:4' namespace (e.g. <name/> and <date/>). Each <hash/> element contains a checksum of the file contents produced in accordance with the hashing function specified by the 'algo' attribute, which MUST be one of the functions listed in the &ianahashes;.</p>
|
||||
<example caption="Initiator sends checksum in session-info"><![CDATA[
|
||||
<iq from='romeo@montague.lit/orchard'
|
||||
id='kqh401b5'
|
||||
to='juliet@capulet.lit/balcony'
|
||||
@ -377,7 +392,7 @@ Initiator Responder
|
||||
action='session-info'
|
||||
initiator='romeo@montague.lit/orchard'
|
||||
sid='a73sjjvkla37jfea'>
|
||||
<checksum xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
|
||||
<checksum xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
|
||||
<file>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
@ -385,177 +400,27 @@ Initiator Responder
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Aborting a Transfer' anchor='abort'>
|
||||
<p>If either party wishes to abort the transfer of a file but not the entire session (e.g., when the parties are exchanging multiple files), it SHOULD send a Jingle session-info message containing an <abort/> child element qualified by the 'urn:xmpp:jingle:apps:file-transfer:3' namespace.</p>
|
||||
<example caption="Initiator aborts transfer of file"><![CDATA[
|
||||
<p>If the initiator wishes to communicate only the hashing algorithm as the beginning of the session (e.g., because it has not yet calculated the checksum), it can send an empty <hash/> element (without a checksum in the XML character data as shown in the previous examples) in the session-initiate message; this enables the recipient to check the file during the transfer session (which can be helpful in the case of transfers that are truncated or fail mid-stream).</p>
|
||||
<example caption="Initiator communicates hashing algorithm in session-initiate"><![CDATA[
|
||||
<iq from='romeo@montague.lit/orchard'
|
||||
id='hv9sx61j'
|
||||
to='juliet@capulet.lit/balcony'
|
||||
type='set'>
|
||||
<jingle xmlns='urn:xmpp:jingle:1'
|
||||
action='session-info'
|
||||
initiator='romeo@montague.lit/orchard'
|
||||
sid='a73sjjvkla37jfea'>
|
||||
<abort xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
|
||||
<file>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</abort>
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>If either party wishes to end the entire file transfer session instead of aborting transfer of a particular file, it MUST instead send a session-terminate message containing a reason of <cancel/> as described in <cite>XEP-0166</cite>.</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>
|
||||
<cancel/>
|
||||
</reason>
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>After terminating the session, the parties would close the data transport as described in the relevant specification (e.g., <cite>XEP-0260</cite> or <cite>XEP-0261</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:3' namespace and containing a <request/> 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:3'>
|
||||
<request>
|
||||
<file>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</request>
|
||||
</description>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
mode='tcp'
|
||||
sid='xig361fj'>
|
||||
<candidate cid='ht567dq'
|
||||
host='192.169.1.10'
|
||||
jid='juliet@capulet.lit/balcony'
|
||||
port='6539'
|
||||
priority='8257636'
|
||||
type='direct'/>
|
||||
<candidate cid='hr65dqyd'
|
||||
host='134.102.201.180'
|
||||
jid='juliet@capulet.lit/balcony'
|
||||
port='16453'
|
||||
priority='7929856'
|
||||
type='assisted'/>
|
||||
<candidate cid='grt654q2'
|
||||
host='2001:638:708:30c9:219:d1ff:fea4:a17d'
|
||||
jid='juliet@capulet.lit/balcony'
|
||||
port='6539'
|
||||
priority='8257606'
|
||||
type='direct'/>
|
||||
</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, it can include only that metadata in its request. If not, the requesting entity needs to include enough metadata to uniquely identify the file, such as the date, name, and size. For similar considerations, see &rfc5547;.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Ranged Transfers' anchor='range'>
|
||||
<p>As in <cite>XEP-0096</cite>, a transfer can include only part of a file (e.g., to restart delivery of a truncated transfer session at a point other than the start of the file). This is done using the <range/> element from <cite>XEP-0096</cite>. The usage is illustrated in the following examples.</p>
|
||||
<p>Let us imagine that the parties negotiate a file transfer session using, say, In-Band Bytestreams. During the transfer, the recipient goes offline unexpectedly and IBB stanzas from the sender to the recipient begin to bounce. When the recipient comes back online, the recipient could initiate a new Jingle session (to retrieve the file) and specify that it wants to receive all chunks after byte 270336 (which might be the 66th chunk of size 4096).</p>
|
||||
<example caption="Receiver requests hosted file, with range"><![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:3'>
|
||||
<request>
|
||||
<file>
|
||||
<range offset='270336'/>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</request>
|
||||
</description>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
mode='tcp'
|
||||
sid='xig361fj'>
|
||||
<candidate cid='ht567dq'
|
||||
host='192.169.1.10'
|
||||
jid='juliet@capulet.lit/balcony'
|
||||
port='6539'
|
||||
priority='8257636'
|
||||
type='direct'/>
|
||||
<candidate cid='hr65dqyd'
|
||||
host='134.102.201.180'
|
||||
jid='juliet@capulet.lit/balcony'
|
||||
port='16453'
|
||||
priority='7929856'
|
||||
type='assisted'/>
|
||||
<candidate cid='grt654q2'
|
||||
host='2001:638:708:30c9:219:d1ff:fea4:a17d'
|
||||
jid='juliet@capulet.lit/balcony'
|
||||
port='6539'
|
||||
priority='8257606'
|
||||
type='direct'/>
|
||||
</transport>
|
||||
</content>
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>Alternatively, the sender could initiate a new file transfer, indicating that it supports ranged transfers, and in the Jingle session-accept message the receiver could indicate that it wants the transfer to begin at the specified offset.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Sending Multiple Files' anchor='multi'>
|
||||
<p>The initiator can send multiple files by including multiple <file/> elements in its session-initiate message.</p>
|
||||
<example caption="Initiator sends session-initiate with multiple files"><![CDATA[
|
||||
<iq from='romeo@montague.lit/orchard'
|
||||
id='bv2gs986'
|
||||
id='nzu25s8'
|
||||
to='juliet@capulet.lit/balcony'
|
||||
type='set'>
|
||||
<jingle xmlns='urn:xmpp:jingle:1'
|
||||
action='session-initiate'
|
||||
initiator='romeo@montague.lit/orchard'
|
||||
sid='h2va419i'>
|
||||
sid='851ba2'>
|
||||
<content creator='initiator' name='a-file-offer'>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
|
||||
<offer>
|
||||
<file>
|
||||
<date>2011-06-01T15:58:15Z</date>
|
||||
<name>somefile.txt</name>
|
||||
<size>1234</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>a749930852c69ae5d2141d3766b1552d</hash>
|
||||
</file>
|
||||
<file>
|
||||
<date>2011-06-01T15:58:15Z</date>
|
||||
<name>anotherfile.txt</name>
|
||||
<size>2345</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>930852c69ae5d2141d3766b1552da749</hash>
|
||||
</file>
|
||||
<file>
|
||||
<date>2011-06-01T15:58:15Z</date>
|
||||
<name>yetanotherfile.txt</name>
|
||||
<size>3456</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>52c69ae5d2141d3766b1552da7499308</hash>
|
||||
</file>
|
||||
</offer>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
|
||||
<file>
|
||||
<date>1969-07-21T02:56:15Z</date>
|
||||
<desc>This is a test. If this were a real file...</desc>
|
||||
<media-type>text/plain</media-type>
|
||||
<name>test.txt</name>
|
||||
<range/>
|
||||
<size>1022</size>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'/>
|
||||
</file>
|
||||
</description>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
mode='tcp'
|
||||
@ -577,30 +442,47 @@ Initiator Responder
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>The parties would negotiate the file transfer session as previously described.</p>
|
||||
<p>After exchange of the first file, the recipient SHOULD send a Jingle session-info message indicating receipt of the complete file.</p>
|
||||
<example caption="Receiver sends ack in session-info"><![CDATA[
|
||||
<iq from='juliet@capulet.lit/balcony'
|
||||
id='jp2ba614'
|
||||
to='romeo@montague.lit/orchard'
|
||||
</section1>
|
||||
|
||||
<section1 topic='Ranged Transfers' anchor='range'>
|
||||
<p>As in <cite>XEP-0096</cite>, a transfer can include only part of a file (e.g., to restart delivery of a truncated transfer session at a point other than the start of the file). This is done using the <range/> element from <cite>XEP-0096</cite>. The usage is illustrated in the following examples.</p>
|
||||
<p>Let us imagine that the parties negotiate a file transfer session using, say, In-Band Bytestreams. During the transfer, the recipient goes offline unexpectedly and IBB stanzas from the sender to the recipient begin to bounce. When the recipient comes back online, the sender could initiate a new Jingle session and specify that it wants to send all chunks after byte 270336 (which might be the 66th chunk of size 4096).</p>
|
||||
<example caption="Sender requests session to send file, with range"><![CDATA[
|
||||
<iq from='romeo@montague.lit/orchard'
|
||||
id='wsn361c3'
|
||||
to='juliet@capulet.lit/balcony'
|
||||
type='set'>
|
||||
<jingle xmlns='urn:xmpp:jingle:1'
|
||||
action='session-info'
|
||||
action='session-initiate'
|
||||
initiator='romeo@montague.lit/orchard'
|
||||
sid='a73sjjvkla37jfea'>
|
||||
<received xmlns='urn:xmpp:jingle:apps:file-transfer:3'>
|
||||
<file>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>a749930852c69ae5d2141d3766b1552d</hash>
|
||||
</file>
|
||||
</received>
|
||||
sid='uj3b2'>
|
||||
<content creator='initiator' name='restart'>
|
||||
<description xmlns='urn:xmpp:jingle:apps:file-transfer:4'>
|
||||
<file>
|
||||
<range offset='270336'/>
|
||||
<hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash>
|
||||
</file>
|
||||
</description>
|
||||
<transport xmlns='urn:xmpp:jingle:transports:s5b:1'
|
||||
mode='tcp'
|
||||
sid='vj3hs98y'>
|
||||
<candidate cid='hft54dqy'
|
||||
host='192.168.4.1'
|
||||
jid='romeo@montague.lit/orchard'
|
||||
port='5086'
|
||||
priority='8257636'
|
||||
type='direct'/>
|
||||
<candidate cid='hutr46fe'
|
||||
host='24.24.24.1'
|
||||
jid='romeo@montague.lit/orchard'
|
||||
port='5087'
|
||||
priority='8258636'
|
||||
type='direct'/>
|
||||
</transport>
|
||||
</content>
|
||||
</jingle>
|
||||
</iq>
|
||||
]]></example>
|
||||
<p>The hosting entity SHOULD NOT wait for arrival of the <received/> acknowledgement before starting to send the next file in its list.</p>
|
||||
<p>After the recipient has received all of the files, it SHOULD send a final acknowledgement and then terminate the session.</p>
|
||||
<p>After terminating the session, the parties would close the data transport as described in the relevant specification (e.g., <cite>XEP-0260</cite> or <cite>XEP-0261</cite>).</p>
|
||||
<p class='box'>OPEN ISSUE: Provide a way for the hosting entity to add more files to the original "manifest"?</p>
|
||||
<p>Support for transferring multiple files is OPTIONAL. If an application supports multi-file exchange, it MUST advertise a service discovery feature of "urn:xmpp:jingle:apps:file-transfer:multi".</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Use of Jingle Actions' anchor='jingle'>
|
||||
@ -681,12 +563,12 @@ Initiator Responder
|
||||
<p>An application MAY present transport methods in any order, except that the Jingle In-Band Bytestreams Transport 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:3' 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 Stream Initiation.</p>
|
||||
<p>Support for Jingle file transfer can be determined through discovery of the 'urn:xmpp:jingle:apps:file-transfer:4' 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 Stream Initiation.</p>
|
||||
</section2>
|
||||
</section1>
|
||||
|
||||
<section1 topic='Determining Support' anchor='support'>
|
||||
<p>To advertise its support for the Jingle File Transfer, when replying to service discovery information ("disco#info") requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:apps:file-transfer:3" for this version &VNOTE;.</p>
|
||||
<p>To advertise its support for the Jingle File Transfer, when replying to service discovery information ("disco#info") requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:apps:file-transfer:4" for this version &VNOTE;.</p>
|
||||
<example caption="Service discovery information request"><![CDATA[
|
||||
<iq from='romeo@montague.lit/orchard'
|
||||
id='uw72g176'
|
||||
@ -702,7 +584,7 @@ Initiator Responder
|
||||
type='result'>
|
||||
<query xmlns='http://jabber.org/protocol/disco#info'>
|
||||
<feature var='urn:xmpp:jingle:1'/>
|
||||
<feature var='urn:xmpp:jingle:apps:file-transfer:3'/>
|
||||
<feature var='urn:xmpp:jingle:apps:file-transfer:4'/>
|
||||
<feature var='urn:xmpp:jingle:transports:s5b:1'/>
|
||||
<feature var='urn:xmpp:jingle:transports:ibb:1'/>
|
||||
</query>
|
||||
@ -713,20 +595,21 @@ Initiator Responder
|
||||
</section1>
|
||||
|
||||
<section1 topic='Security Considerations' anchor='security'>
|
||||
<p>For historical reasons and for backward-compatibility with <cite>XEP-0096</cite>, the hashing algorithm used in computing the file checksum defaults to MD5. It is RECOMMENDED for implementations to use stronger hashing algorithms.</p>
|
||||
<p>It is RECOMMENDED for implementations to use the strongest hashing algorithm available to both parties. See XEP-0300 for further discussion.</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>
|
||||
<p>Refer to <cite>XEP-0047</cite>, <cite>XEP-0065</cite>, <cite>XEP-0096</cite>, <cite>XEP-0260</cite>, and <cite>XEP-0261</cite> for related security considerations.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='IANA Considerations' anchor='iana'>
|
||||
<p>No interaction with &IANA; is required as a result of this document.</p>
|
||||
<p>The XML character data of the <media-type/> element SHOULD be a value registered with the IANA in the &ianamedia;.</p>
|
||||
</section1>
|
||||
|
||||
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
|
||||
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
|
||||
<p>This specification defines the following XML namespace:</p>
|
||||
<ul>
|
||||
<li>urn:xmpp:jingle:apps:file-transfer:3</li>
|
||||
<li>urn:xmpp:jingle:apps:file-transfer:4</li>
|
||||
</ul>
|
||||
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespace to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
|
||||
</section2>
|
||||
@ -763,8 +646,8 @@ Initiator Responder
|
||||
|
||||
<xs:schema
|
||||
xmlns:xs='http://www.w3.org/2001/XMLSchema'
|
||||
targetNamespace='urn:xmpp:jingle:apps:file-transfer:3'
|
||||
xmlns='urn:xmpp:jingle:apps:file-transfer:3'
|
||||
targetNamespace='urn:xmpp:jingle:apps:file-transfer:4'
|
||||
xmlns='urn:xmpp:jingle:apps:file-transfer:4'
|
||||
elementFormDefault='qualified'>
|
||||
|
||||
<xs:import namespace='urn:xmpp:hashes:1'/>
|
||||
@ -772,16 +655,11 @@ Initiator Responder
|
||||
<xs:element name='description'>
|
||||
<xs:complexType>
|
||||
<xs:choice>
|
||||
<xs:element name='offer' type='fileTransferElementType'/>
|
||||
<xs:element name='request' type='fileTransferElementType'/>
|
||||
<xs:element name='file' type='fileTransferElementType'/>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
|
||||
<xs:element name='abort' type='fileTransferElementType'/>
|
||||
|
||||
<xs:element name='received' type='fileTransferElementType'/>
|
||||
|
||||
<xs:element name='checksum' type='fileTransferElementType'/>
|
||||
|
||||
<xs:complexType name='fileTransferElementType'>
|
||||
@ -794,6 +672,7 @@ Initiator Responder
|
||||
<xs:complexType>
|
||||
<xs:sequence xmlns:h='urn:xmpp:hashes:1'>
|
||||
<xs:element name='date' type='xs:date'/>
|
||||
<xs:element name='media-type' type='xs:string'/>
|
||||
<xs:element name='name' type='xs:string'/>
|
||||
<xs:element name='size' type='xs:positiveInteger'/>
|
||||
<xs:element ref='h:hash' minOccurs='0' maxOccurs='unbounded'/>
|
||||
@ -806,7 +685,7 @@ Initiator Responder
|
||||
</section1>
|
||||
|
||||
<section1 topic='Acknowledgements' anchor='ack'>
|
||||
<p>Thanks to Diana Cionoiu, Olivier Crête, Viktor Fast, Waqas Hussain, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Robert McQueen, Joe Maissel, Glenn Maynard, Ali Sabil, Sjoerd Simons, Will Thompson, Matthew Wild, and Jiří Zárevúcky for their feedback.</p>
|
||||
<p>Thanks to Diana Cionoiu, Olivier Crête, Viktor Fast, Philipp Hancke, Waqas Hussain, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Robert McQueen, Joe Maissel, Glenn Maynard, Ali Sabil, Sjoerd Simons, Lance Stout, Will Thompson, Matthew Wild, and Jiří Zárevúcky for their feedback.</p>
|
||||
</section1>
|
||||
|
||||
</xep>
|
||||
|
Loading…
Reference in New Issue
Block a user