File Transfer
From PsiWiki
Contents |
[edit] Introduction
File transfer with Psi depends like everything in Psi on the XMPP/Jabber protocol standards. To accomplish a file transfer, the sender and the receiver have to establish a connection which allows them to transfer binary data streams between each other.
[edit] Binary Streaming Methods
In XMPP there are two different methods defined to manage a binary data stream: in-band and out-of-band. Both are described below.
[edit] In-Band
In this method the data is sent in pieces on the same XML connection used for chatting.
- Disadvantages
- In this method all of the traffic flows inline over the Jabber server(s) to which the sender and the receiver are connected. This creates additional load on the Jabber server(s), making it potentially difficult for some high-traffic servers to support.
- Furthermore, due to the inline nature of this method, the transfer speed is often much slower than through a direct (Out-Of-Band) connection.
- Advantages
- One advantage is a bit of anonymity between the sender and the receiver as only the server knows their IP-addresses. Furthermore, this method requires no special configuration on the client side, making the ability to send a file automatic among established peers.:
Psi currently doesn't support data transfer over an In-Band data stream.
[edit] Out-Of-Band
In this method a separate connection is made for the binary data transfer. The clients themselves have to negotiate a working data stream/connection by sending each other their IP-addresses or the address of a proxy which is capable of connecting the partners together.
- Disadvantage
- This method carries added complexity when firewalls are involved between the sender and receiver. This can be minimized by using a proxy server, which also adds a layer of anonymity as the sender and the receiver need not know know each others IP-addresses.
- Advantage
- The transfer speed may be faster with this method. Throughput is generally limited only by the connection speed of the sender and receiver.
This is the only method Psi can currently use to execute a file transfer.
[edit] Configuration
A very important fact about file transfer with Psi is, that the client must be enabled to connect through a TCP port to an external computer. The default port for this is 8010 but it can be freely changed in the "Options" dialog available through the main menu of Psi. The option is called "Data Transfer Port" and resides on the "Application" tab.
Also on this tab is the option "Data Transfer External Address" which is to be used when Psi is not able to detect your external IP-address because you are connected to the internet through a router.
- If you have a static internet address you can fill it in this field.
- If your provider assigns a dynamic address to you everytime you connect to the internet, you should use a dynamic DNS name which contains your current IP-address. Two well known providers for free dynamic DNS are DynDNS.org and No-IP, a more scalable and also free offer is available at the german noxa.de Network (seems to be only accessible in german language at the moment).
For a file transfer to work, at least one of the partners has to be able to act as a server and is reachable through a direct connection on the defined Data Transfer Port. If you use a common home router, you could specify a static port mapping (often called "Virtual Server") to your computer or better use a triggered port mapping by defining the Data Transfer Port Psi uses (mostly 8010) as the trigger to bind exactly the same port to your local machine.
If everything above hasn't helped you, or is in anyway not possible on your network your last chance is to use a Data Transfer Proxy. You can tell Psi to use such a proxy by opening your "Account Setup" window through the main menu and modify your currently used profile. On the account modification dialog "Psi: Account Properties" go to the tab "Misc" and use the text-box labeled "Data Transfer Proxy" to set the proxy's address.
The most popular proxies are "proxy.jabber.org" (hosted by the Jabber Foundation) and "proxy64.jabber.ccc.de" (hosted by the Chaos Computer Club from germany).
Now you should be able to send and receive files. If not, your network configuration probably prohibits Out-Of-Band file transfer through Psi, or you might have missed something above.
[edit] Sending files
A transfer can be started by:
- right-clicking on a contact in your roster and then choosing "Send File"
- simply by dragging a file from the shell over a contact in your roster and drop it there.
This will open a "Send File" dialog in which you can:
- choose the account from which you want to send the file by using the drop down menu labeled "Identity"
- define the JID, including the resource to whom you want to send the file by editing the "To" text-box (should be automatically filled)
- specify a path to the file you want to send by using the text-box labeled "File" or the button near to it if you didn't use the drag & drop way to open the "Send File" dialog.
- optional: you can give your partner a description of the file you want to send her/him by typing anything into the "Description" text-box.
As soon as everything is correctly filled in you can start the negotiation and transfer process by clicking on the "Send" button. The animations states that Psi is still working on it's task. After the choosen receiver accepted the file and has choosen a path for the incoming file to save and if everything is configured the right way, the Transfer Manager will open and display a progress bar indicating the state of the file transfer. If the Transfer Manager doesn't appear either your partner has declined the file transfer or no data stream connection could be established. If the last case is right, read about Configuration paragraph.
[edit] Transfer Manager
The Transfer Manager window lists every file transfer and indicates the progress of every one. It will save every previous transaction until the "Clear Finished" button is pressed or the entry is individualy deleted by right-clicking and using the "Clear" option. Also transfers which are not yet finished can be aborted by right-clicking and using "Cancel". The Transfer Manager can be opened manually through the same named entry in the main menu of Psi.
[edit] Technical Details
After a file transfer request is sent to a Jabber user and this user accepts the request, both partners are sending their IP-addresses, DNS-names or those of a proxy to the partner. Both will then try to establish a connection through any of these. If this works a Out-Of-Band binary data stream connection is established and will be used to transfer the file.
[edit] Encryption
Warning: You should be aware of the fact that neither the file itself nor the file name and the file description will be sent encrypted although you are using OpenPGP encryption for chatting. If you want an encrypted file transfer you have to encrypt the file manually before transfer. On Windows you can use the your OpenPGP keys and Windows Privacy Tools (WinPT) or any other file encryption tool to do this.
[edit] Foreign Networks
A file transfer to different instant-messaging network through a Gateways (Transports) is not impossible. But it resides in the responsibility of the Gateway you use to offer this ability. At the moment there seem to be very less Gateways which support such a feature. Psi is only a XMPP-client and so it will never be responsible for this to work.
[edit] The Future
In the future it will most likely be possible to send files to contacts which are offline and also to receive file if the sender is already offline. This will be possible due to a WebDAV based storage service which the XMPP server has to offer to it's users. Actualy this process is discussed about at the Jabber Foundation as JEP-0129.
Also it is possible that in a later version Psi will support In-Band binary stream connections which would help all people who cannot use file transfer because of firewall and routing limitations.
Google Talk have implemented File Transfer via Jingle - this makes it far more likely that a file transfer will succeed. There is a Google Summer of Code 2006 Project to implement Jingle File Transfer in Psi.

