diff --git a/xep-0234.xml b/xep-0234.xml index 00cd70d2..a86fa351 100644 --- a/xep-0234.xml +++ b/xep-0234.xml @@ -4,14 +4,6 @@ %ents; ]> - - -
Jingle File Transfer @@ -32,6 +24,12 @@ NOT_YET_ASSIGNED &stpeter; + + 0.13 + 2011-06-01 + psa +

Added multi-file use case; updated spec to reflect XEP-0260 and XEP-0261; added algorithm attribute from XEP-0096; increased namespace versions from 1 to 2.

+
0.12 2011-01-05 @@ -57,7 +55,7 @@
  • Moved Jingle definitions of S5B and IBB transports to standalone documents.
  • -
  • 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.
  • +
  • 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:2.
  • Moved transport fallback scenario to XEP-0260.
@@ -144,9 +142,10 @@

To overcome these drawbacks, this specification defines a file transfer negotiation method that meets the following requirements:

    -
  • Reuse the session negotiation semantics from XEP-0166.
  • -
  • Reuse the file description format from XEP-0096.
  • -
  • Define a clear upgrade path from XEP-0096 to this specification.
  • +
  • Use the session negotiation semantics from XEP-0166.
  • +
  • Use the file description format from XEP-0096.
  • +
  • Use &xep0260; and &xep0261;.
  • +
  • Define a clear upgrade path from SI File Transfer to Jingle File Transfer.

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.

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.

@@ -156,24 +155,25 @@

This section provides a friendly introduction to Jingle file transfer.

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:

    -
  • urn:xmpp:jingle:1 as described in XEP-0166
  • -
  • urn:xmpp:jingle:apps:file-transfer:1 as defined in this document &NSVER;
  • -
  • urn:xmpp:jingle:transports:s5b:1 as defined in &xep0260;
  • -
  • urn:xmpp:jingle:transports:ibb:0 as defined in &xep0261;
  • +
  • urn:xmpp:jingle:1 as described in XEP-0166
  • +
  • urn:xmpp:jingle:apps:file-transfer:2 as defined in this document &NSVER;
  • +
  • urn:xmpp:jingle:transports:s5b:1 as defined in XEP-0260
  • +
  • urn:xmpp:jingle:transports:ibb:1 as defined in XEP-0261

The initiator then sends a Jingle session-initiation request to a potential responder. The content-type of the request specifies two things:

    -
  1. An application type of "urn:xmpp:jingle:apps:file-transfer:1". In particular, the <description/> element contains an <offer/> or <request/> element that in turn contains a <file/> element qualified by the existing 'http://jabber.org/protocol/si/profile/file-transfer' namespace from XEP-0096.
  2. +
  3. An application type of "urn:xmpp:jingle:apps:file-transfer:2". In particular, the <description/> element contains an <offer/> element or a <request/> element that in turn contains one or more <file/> elements qualified by the existing 'http://jabber.org/protocol/si/profile/file-transfer' namespace from XEP-0096.
  4. An appropriate transport method. So far the suggested methods are jingle-s5b (XEP-0260) and, as a fallback, jingle-ibb (XEP-0261).
-

Note: All attributes of the <file/> element are defined in XEP-0096, not in this specification.

+

Note: All attributes of the <file/> element are defined in XEP-0096, not in this specification.

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.

The flow is as follows.

or | + | and S5B) | |---------------------------->| | ack | |<----------------------------| @@ -200,7 +200,7 @@ Initiator Responder initiator='romeo@montague.lit/orchard' sid='851ba2'> - + - - + + @@ -238,8 +241,7 @@ Initiator Responder to='romeo@montague.lit/orchard' type='result'/> ]]> -

The initiator then attempts to initiate a SOCKS5 Bytestream with the responder as described in XEP-0260 and XEP-0065.

-

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).

+

The initiator then attempts to initiate a SOCKS5 Bytestream with the responder as described in XEP-0260 and XEP-0065. In the meantime, the responder returns a Jingle session-accept. In the session-accept message, the <file/> element MAY contain a <range/> element to indicate that the receiver also supports ranged transfers as described below under Ranged Transfers.

- + - - + + + + ]]> -

Note: Inclusion of the <range/> child of the <file/> element indicates that the receiver also supports ranged transfers as described below under Ranged Transfers.

The initiator acknowledges the Jingle session-accept.

]]> +

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.

+ + + + + + + + + + ]]> +

The peer immediately acknowledges receipt.

+ + ]]> +

(See XEP-0260 for further details.)

Now the parties exchange the file using the negotiated transport (here, SOCKS5 Bytestreams).

-

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.

+

Once the transfer is completed, either party can acknowledge completion (see Sending Multiple Files) 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.

]]> -

For a description of the transport fallback scenario (from SOCK5 Bytestreams to In-Band Bytestreams), refer to XEP-0260.

+

For a description of the transport fallback scenario (from SOCKS5 Bytestreams to In-Band Bytestreams), refer to XEP-0260.

-

At any time during the lifetime of the file transfer session, the hosting entity can communicate the hash of the file to the receiving entity. This is done by sending a session-info message containing a <hash/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:info:1' namespace. The XML character data of this <hash/> element has the same meaning as the 'hash' attribute of the <file/> element qualified by the 'http://jabber.org/protocol/si/profile/file-transfer' namespace from XEP-0096; that is, it is 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;. For historical reasons and for backward-compatibility with XEP-0096, the 'algo' attribute defaults to a value of "md5".

- 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 hash of the file to the receiving entity. This is done by sending a session-info message containing a <hash/> element qualified by the 'urn:xmpp:jingle:apps:file-transfer:info:2' namespace. The XML character data of this <hash/> element has the same meaning as the 'hash' attribute of the <file/> element qualified by the 'http://jabber.org/protocol/si/profile/file-transfer' namespace from XEP-0096; that is, it is 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;. For historical reasons and for backward-compatibility with XEP-0096, the 'algo' attribute defaults to a value of "md5".

+ - 552da749930852c69ae5d2141d3766b1 + + 552da749930852c69ae5d2141d3766b1 + ]]>
-

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 <request/> element that defines the requested file.

+

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:2' namespace and containing a <request/> element that defines the requested file.

- + @@ -334,17 +383,31 @@ Initiator Responder - + + + ]]>

The parties would then complete a session negotiation flow similar to that outlined above for offering a file.

-

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 to include enough metadata to uniquely identify the file, such as the date, name, and size. For similar considerations, see &rfc5547;.

+

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;.

@@ -360,7 +423,7 @@ Initiator Responder initiator='romeo@montague.lit/orchard' sid='uj3b2'> - + @@ -371,10 +434,24 @@ Initiator Responder - + + + @@ -383,8 +460,82 @@ Initiator Responder

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.

+ +

The initiator can send multiple files by including multiple <file/> elements in its session-initiate message.

+ + + + + + + + + + + + + + + + + + ]]> +

The parties would negotiate the file transfer session as previously described.

+

After exchange of the first file, the recipient SHOULD send a Jingle session-info message indicating receipt of the complete file.

+ + + + + + + + ]]> +

The hosting entity SHOULD NOT wait for arrival of the <received/> acknowledgement before starting to send the next file in its list.

+

After the recipient has received all of the files, it SHOULD send a final acknowledgement and then terminate the session.

+

OPEN ISSUE: Provide a way for the hosting entity to add more files to the original "manifest"?

+
+ -

Jingle file transfer uses only a few of the actions defined in XEP-0166. Jingle usage is summarized in the following table.

+

Jingle file transfer uses only a few of the actions defined in XEP-0166. Jingle usage is summarized in the following table.

@@ -424,7 +575,7 @@ Initiator Responder - + @@ -440,7 +591,7 @@ Initiator Responder - + @@ -461,12 +612,12 @@ Initiator Responder

An application MAY present transport methods in any order, except that the Jingle In-Band Bytestreams Transport Method MUST be the lowest preference.

-

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 (XEP-0030) or entity capabilities (XEP-0115). If the initiator knows that the responder supports Jingle file transfer, it SHOULD first attempt negotiation using Jingle rather than SI.

+

Support for Jingle file transfer can be determined through discovery of the 'urn:xmpp:jingle:apps:file-transfer:2' namespace &VNOTE;, via either service discovery (XEP-0030) or entity capabilities (XEP-0115). If the initiator knows that the responder supports Jingle file transfer, it SHOULD first attempt negotiation using Jingle rather than Stream Initiation.

-

For historical reasons and for backward-compatibility with XEP-0096, the hashing algorithm used in computing the file checksum defaults to MD5. It is RECOMMENDED for implementations to use stronger hashing algorithms.

+

For historical reasons and for backward-compatibility with XEP-0096, the hashing algorithm used in computing the file checksum defaults to MD5. It is RECOMMENDED for implementations to use stronger hashing algorithms.

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-0260 and XEP-0261.

Refer to XEP-0047, XEP-0065, XEP-0096, XEP-0260, and XEP-0261 for related security considerations.

@@ -479,7 +630,7 @@ Initiator Responder

This specification defines the following XML namespace:

    -
  • urn:xmpp:jingle:apps:file-transfer:1
  • +
  • urn:xmpp:jingle:apps:file-transfer:2

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;.

@@ -506,8 +657,8 @@ Initiator Responder + + + + + + + + ]]> -

Thanks to Steffen Larsen, Marcus Lundblad, Joe Maissel, Ali Sabil, Matthew Wild, and Jiří Zárevúcky for their feedback.

+

Thanks to Diana Cionoiu, Olivier Crête, Justin Karneges, Steffen Larsen, Yann Leboulanger, Marcus Lundblad, Joe Maissel, Robert McQueen, Ali Sabil, Sjoerd Simons, Will Thompson, Matthew Wild, and Jiří Zárevúcky for their feedback.

Action
session-infoCommunication of the file hashCommunicating the file hash
session-initiate
transport-infoUnusedUsed in SOCKS5 Bytestreams
transport-reject