Abstract: | This document specifies a simple extension to existing protocols that allows an entity to request information about files. |
Authors: | Jefry Lagrange, Lance Stout |
Copyright: | © 1999 - 2013 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Experimental |
Type: | Standards Track |
Version: | 0.1 |
Last Updated: | 2013-06-11 |
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
1. Introduction
2. Requirements
3. Assumptions
4. Getting Information About Files
4.1. Traversing Files
5. Bandwidth Considerations
5.1. Using Result Set Management
5.2. Out of Band Transfer
6. Implementation Notes
6.1. File identification
6.2. File Sharing in MUCs
7. Security Considerations
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
XMPP extensions provide ways of transferring files between peers (such as Jingle File Transfer [1] and SI File Transfer [2]). However, file transfer is currently limited to needing that the transfer be initiated by the hosting entity. The Jingle File Transfer [3] extension, provides for a way to request files, but it requires the requesting entity to have information about the file being requested, so that it can be uniquely identified.
This document defines an extension which allows the request of information of files being offered by a hosting entity so they can later be requested in a file transfer; If the requesting entity is interested in the file.
File Sharing [4] is a previous extention that attempted to solve the same problem as this one, but unfortunetly it didn't generate much interest and it got deprecated. This extention aims be a modern replacement for XEP-0135.
IRC users have been able to bypass the limitations of the protocol by using bots that provide information of files and initiate transfer on command. A major downside of this method is that not every user is capable of sharing its files. The aim of this document is to provide a similar functionality while making it easier for users to offer and request information about files.
Microsoft's MSN proprietary IM client, used to provide similar functionality using "Sharing Folders", but this was replaced by Windows Live SkyDrive
This protocol assumes the existence of one or more shared directories (either virtual or physical). The hosting entity must not advertise empty directories. The hosting entity is responsible of maintaining the structure of those directories (such as not allowing two files with the same name and preventing cycles within directories). The hosting entity is in no way required to present the same shared directories to different requesters. In fact, the reason multiple share directories are allowed, is to make it easier for implementers to manage permissions of who can see what files.
If a requesting entity wishes to know what files are being shared by an offering entity, it can do so by sending the following query:
<iq type='get' from='juliet@capulet.com/chamber' to='romeo@montague.net/home' id='1234'> <query xmlns="urn:xmpp:fis" /> </iq>
If the offering entity wishes to share files with the requesting entity, it may respond with a list of shared folders. It MUST not include any files in this response.
<iq type='result' from='romeo@montague.net/home' to='juliet@capulet.com/chamber' id='1234'> <query xmlns="urn:xmpp:fis"> <directory name='documents'/> <directory name='pics'/> <directory name='audio'/> </query> </iq>
if the offering entity has no files to offer
<iq type='result' from='romeo@montague.net/home' to='juliet@capulet.com/chamber' id='1234'> <query xmlns="urn:xmpp:fis" /> </iq>
Requesting the list of files and directories within a directory.
<iq type='get' from='juliet@capulet.com/chamber' to='romeo@montague.net/home' id='1234'> <query xmlns="urn:xmpp:fis" node="documents" /> </iq>
When replying with a list of files, the offering entity can choose to either reply with verbose information on the file using the file attributes defined by PubSub Queueing [5] or it may reply only with the 'name' attribute, which is required and MUST be included in every response.
It is RECOMENDED, when the list files to be sent is small, that a verbose response be made (in order to avoid going back and forth requesting information), and that a non-verbose reponse be made otherwise. This recomendation is made to save bandwidth.
<iq type='result' from='romeo@montague.net/home' to='juliet@capulet.com/chamber' id='1234'> <query xmlns="urn:xmpp:fis" node="documents"> <file xmlns='urn:xmpp:jingle:apps:file-transfer:3'> <name>test.txt</name> <date>1969-07-21T02:56:15Z</date> <desc>This is a test. If this were a real file...</desc> <range/> <size>1022</size> <hash xmlns='urn:xmpp:hashes:1' algo='sha-1'>552da749930852c69ae5d2141d3766b1</hash> </file> <file xmlns='urn:xmpp:jingle:apps:file-transfer:3'> <name>test2.txt</name> </file> <directory name="secret docs" /> </query> </iq>
If the requesting entity wants to get detailed information about a file. It can do so by providing its full path.
<iq type='get' from='juliet@capulet.com/chamber' to='romeo@montague.net/home' id='1234'> <query xmlns="urn:xmpp:fis" node="documents/test2.txt" /> </iq>
<iq type='result' from='romeo@montague.net/home' to='juliet@capulet.com/chamber' id='1234'> <query xmlns="urn:xmpp:fis" node="test2.txt"> <file xmlns='urn:xmpp:jingle:apps:file-transfer:3'> <name>test2.txt</name> <size>1000</size> </file> </query> </iq>
If a considerable amount of files are being shared by the offering entity, it may be the case that the offering entity response might be too be for the server to handle; As there might be a limitation on the size of the stanzas in the current stream. In order to solve this, extensions have been devised and their implementation are hereby recommended along with the implementation of this extension.
Result Set Management [6] defines a way of limiting the results of a request. There are some considerations to use result sets along with this extension.
First, it is defined that the requesting entity is the one that sets the limit of the number of items that can be replied. So it is up to the requesting entity to choose a sensible number.
Second, since this protocol defines a way of handling the directory tree structure by allowing file tags to be children of a directory tags, it becomes difficult to define items for Result Set Management. Therefore, when responding to a request, the offering entity MUST NOT send directory tags with files as their children.
One obvious way to overcome the limitations of sending large stanzas in-band, is to transfer that information out of band. Out-of-Band Stream Data [7] could be used for that purpose. It is hereby RECOMMENDED its implementation when the offering entity has a massive amount of files that would not be practical to advertise in-band.
It is further recommended that when using XEP-0265, the entire directory structure, along with all the files in the shared folder and subfolders, be exchanged in one single reply. Also, all the files attributes should be included. This is to avoid wasting bandwidth initiating out of band streams going back and forth.
As it was previously discussed, when requesting detailed information about a file, only the "name" attribute is required, but it is strongly RECOMMENDED that the hash attribute be included, in order to reduce the chances of sending the wrong file. When requesting the file to be transferred using Jingle File Transfer [8], the information that must be provided has to identify the file uniquely. It is then RECOMMENDED that when requesting a file, the full path of the file in the shared folder be included in the "name" attribute.
<jingle xmlns='urn:xmpp:jingle:1' action='session-initiate' initiator='juliet@capulet.com/chamber' sid='uj3b2'> <content creator='initiator' name='a-file-request'> <description xmlns='urn:xmpp:jingle:apps:file-transfer:3'> <request> <file xmlns='urn:xmpp:jingle:apps:file-transfer:3'> <name>pics/test4.png</name> <size>10740</size> </file> </request> </description>
For the most part, discovering files in a MUC is exactly the same as what has been described in this document. However, it is RECOMMENDED that a participant in a MUC should have a single shared folder associated with the entire room, as opposed to advertise different files to different participants of the room. This is to reduce the complexity of the client software. Also, due to volatile nature of the participants in a room, keeping track of permissions is more trouble than what it is worth.
A denial of service is possible by repeatedly requesting files. Implementers are advised to take this into consideration and include queues and limits into their implementations.
Series: XEP
Number: 0329
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2013-06-11
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0234, XEP-0059, XEP-0265
Supersedes: XEP-0135
Superseded By: None
Short Name: fis
Source Control:
HTML
This document in other formats:
XML
PDF
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0234: Jingle File Transfer <http://xmpp.org/extensions/xep-0234.html>.
2. XEP-0096: SI File Transfer <http://xmpp.org/extensions/xep-0096.html>.
3. XEP-0234: Jingle File Transfer <http://xmpp.org/extensions/xep-0234.html>.
4. XEP-0135: File Sharing <http://xmpp.org/extensions/xep-0135.html>.
5. XEP-0254: PubSub Queueing <http://xmpp.org/extensions/xep-0254.html>.
6. XEP-0059: Result Set Management <http://xmpp.org/extensions/xep-0059.html>.
7. XEP-0265: Out-of-Band Stream Data <http://xmpp.org/extensions/xep-0265.html>.
8. XEP-0234: Jingle File Transfer <http://xmpp.org/extensions/xep-0234.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Initial published version approved by the XMPP Council.
(psa)END