From 7ae3faeb4d01d85957a3f3eea5526454ec5dc960 Mon Sep 17 00:00:00 2001 From: Peter Saint-Andre Date: Mon, 11 Aug 2014 17:03:00 -0600 Subject: [PATCH] 0.16 --- xep-0234.xml | 355 +++++++++++++++++---------------------------------- 1 file changed, 117 insertions(+), 238 deletions(-) diff --git a/xep-0234.xml b/xep-0234.xml index eb099e46..8bd0bbef 100644 --- a/xep-0234.xml +++ b/xep-0234.xml @@ -7,10 +7,10 @@
Jingle File Transfer - 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. + 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. &LEGALNOTICE; 0234 - Deferred + Experimental Standards Track Standards @@ -24,6 +24,23 @@ NOT_YET_ASSIGNED &stpeter; + + 0.16 + 2014-08-11 + psa + +
    +
  • Modified protocol to support sending only one file at a time (multi-file adds unnecessary complexity).
  • +
  • Removed <request/> flow in favor of a dedicated protocol similar to XEP-0137 ("jingle-pub").
  • +
  • Removed <offer/> wrapper since it is no longer necessary (with the removal of the request flow).
  • +
  • Removed the <abort/> element since it was related to the transfer of multiple files.
  • +
  • Changed <candidate-used/> to >remote-candidate/> for consistency with XEP-0176.
  • +
  • Added media-type child to <file/> element.
  • +
  • Added example for communicating empty <hash/> element in the session-initiate message.
  • +
  • Incremented namespace version from 3 to 4.
  • +
+
+
0.15 2012-02-08 @@ -41,7 +58,7 @@
  • Described the process of aborting a file transfer
  • Clarified the order of events (Jingle, then transport) when the session is terminated
  • Added section on determining spport, including service discovery feature for multi-file support
  • -
  • 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
  • +
  • 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
  • Incremented namespace version from 2 to 3
  • @@ -165,12 +182,12 @@

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

    • Use the session negotiation semantics from XEP-0166.
    • -
    • Use &xep0260; and &xep0261;.
    • -
    • Define a file description format that, unlike XEP-0096 enables hash agility (via &xep0300;).
    • +
    • Use &xep0260; and &xep0261; as transport methods.
    • +
    • Define a file description format that, unlike XEP-0096, enables hash agility (via &xep0300;).
    • 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.

    +

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

    @@ -178,24 +195,22 @@

    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:3 as defined in this document &NSVER;
    • +
    • urn:xmpp:jingle:apps:file-transfer:4 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: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.
    2. +
    3. 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.
    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.

    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) | + | (with and S5B) | |---------------------------->| | ack | |<----------------------------| @@ -222,17 +237,16 @@ Initiator Responder initiator='romeo@montague.lit/orchard' sid='851ba2'> - - - - 1969-07-21T02:56:15Z - This is a test. If this were a real file... - test.txt - - 1022 - 552da749930852c69ae5d2141d3766b1 - - + + + 1969-07-21T02:56:15Z + This is a test. If this were a real file... + text/plain + test.txt + + 1022 + 552da749930852c69ae5d2141d3766b1 + - - - - 1969-07-21T02:56:15Z - This is a test. If this were a real file... - test.txt - - 1022 - 552da749930852c69ae5d2141d3766b1 - - + + + 1969-07-21T02:56:15Z + This is a test. If this were a real file... + text/plain + test.txt + + 1022 + 552da749930852c69ae5d2141d3766b1 + ]]> -

    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.

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

    + - +
    ]]>

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

    +

    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.

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

    - +

    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 can be done in the session-initiate message if the sender already knows the checksum, as shown above in Example 1.

    +

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

    + - + 552da749930852c69ae5d2141d3766b1 @@ -385,177 +400,27 @@ Initiator Responder ]]> -
    - - -

    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.

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

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

    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 XEP-0166.

    - - - - - - - - ]]> -

    After terminating the session, the parties would close the data transport as described in the relevant specification (e.g., XEP-0260 or XEP-0261).

    -
    - - -

    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.

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

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

    -
    - - -

    As in XEP-0096, 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 XEP-0096. The usage is illustrated in the following examples.

    -

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

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

    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.

    - + sid='851ba2'> - - - - 2011-06-01T15:58:15Z - somefile.txt - 1234 - a749930852c69ae5d2141d3766b1552d - - - 2011-06-01T15:58:15Z - anotherfile.txt - 2345 - 930852c69ae5d2141d3766b1552da749 - - - 2011-06-01T15:58:15Z - yetanotherfile.txt - 3456 - 52c69ae5d2141d3766b1552da7499308 - - + + + 1969-07-21T02:56:15Z + This is a test. If this were a real file... + text/plain + test.txt + + 1022 + + ]]> -

    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.

    - + + +

    As in XEP-0096, 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 XEP-0096. The usage is illustrated in the following examples.

    +

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

    + - - - a749930852c69ae5d2141d3766b1552d - - + sid='uj3b2'> + + + + + 552da749930852c69ae5d2141d3766b1 + + + + + + + ]]> -

    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.

    -

    After terminating the session, the parties would close the data transport as described in the relevant specification (e.g., XEP-0260 or XEP-0261).

    -

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

    -

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

    @@ -681,12 +563,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:3' 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.

    +

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

    -

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

    +

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

    - + @@ -713,20 +595,21 @@ Initiator Responder
    -

    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.

    +

    It is RECOMMENDED for implementations to use the strongest hashing algorithm available to both parties. See XEP-0300 for further discussion.

    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.

    No interaction with &IANA; is required as a result of this document.

    +

    The XML character data of the <media-type/> element SHOULD be a value registered with the IANA in the &ianamedia;.

    This specification defines the following XML namespace:

      -
    • urn:xmpp:jingle:apps:file-transfer:3
    • +
    • urn:xmpp:jingle:apps:file-transfer:4

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

    @@ -763,8 +646,8 @@ Initiator Responder @@ -772,16 +655,11 @@ Initiator Responder - - + - - - - @@ -794,6 +672,7 @@ Initiator Responder + @@ -806,7 +685,7 @@ Initiator Responder
    -

    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.

    +

    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.