8

FTP is a pure TCP-connect protocol, and thus AFAIK "as fast as it gets" when considering TCP file transfer options.

However, there are some other products that do not run over TCP - examples are the commercial products BI.DAN-GUN, fasp and FileCatalyst. The latter product points out problems with pure TCP, and one can read more on Wikipedia, e.g. starting from Network Congestion.

What other alternatives are there? .. in particular Open Source ones? Also, one would think that this should be an RFC of sorts - a standard largish-file-transfer-specific protocol, probably running over UDP. Anyone know of such a protocol, or an initiative? (The Google SPDY is interesting, but doesn't directly address fast large-file-transfer)

stolsvik
  • 5,253
  • 7
  • 43
  • 52

4 Answers4

9

Why do you think using TCP makes the transfer slower? TCP is usually able to use all available bandwidth. Using UDP instead is unlikely to be faster. In fact, if you tried to make a reliable UDP based file transfer, you'd likely end up implementing an inferior alternative to TCP - since you'd have to implement the reliability yourself.

What is problematic about FTP is that it performs multiple synchronous request-response commands for every file you transfer, and opens a new data connection for every file. This results in extremely inefficient transfers when a lot of smaller files are being transferred, because much of the time is spent waiting requests/responses and establishing data connections instead of actually transferring data.

A simple way to get around this issue is to pack the files/folders into an archive. While you can, of course, just make the archive, send it using FTP or similar, and unpack it on the other side, the time spent packing and unpacking may be unacceptable. You can avoid this delay by doing the packing and unpacking on-line. I'm not aware of any software that integrates such on-line packing/unpacking. You can, however, simply use the nc and tar programs in a pipeline (Linux, on Windows use Cygwin):

First run on the receiver:

nc -l -p 7000 | tar x -C <destination_folder>

This will make the receiver wait for a connection on port number 7000. Then run on the sender:

cd /some/folder
tar c ./* | nc -q0 <ip_address_of_receiver>:7000

This will make the sender connect to the receiver, starting the transfer. The sender will creating the tar archive, sending it to the receiver, which will be extracting it - all at the same time. If you need, you can reverse the roles of sender and receiver (by having the receiver connect to the sender).

This online-tar approach has none of the two performance issues of FTP; it doesn't perform any request-response commands, and uses only a single TCP connections.

However, note that this is not secure; anybody could connect to the receiver before our sender does, send him his own tar archive. If this is an issue, a VPN can be used, in combination with appropriate firewall rules.

EDIT: you mentioned packet loss as a problem with TCP performance, which is a significant problem, if the FileCatalyst page is to be believed. It is true that TCP may perform non-optimally with high packet loss links. This is because TCP usually reacts aggressively to packet loss, because it assumes loss is due to congestion; see Additive_increase/multiplicative_decrease. I'm not aware of any free/open source file transfer programs that would attempt to overcome this with custom protocols. You may however try out different TCP congestion avoidance algorithms. In particular, try Vegas, which does not use packet loss as a signal to reduce transmission rate.

GregC
  • 7,737
  • 2
  • 53
  • 67
Ambroz Bizjak
  • 7,809
  • 1
  • 38
  • 49
  • 1
    Did you check out the links I included? If you have a 500GB file to transfer, the control connections of FTP is utterly negligible, and what you end up with is the raw TCP performance. Which isn't necessarily tuned for as-fast-as-possible transfer of large files - in particular not over links with any packet loss. The products in the links I included DO implement reliability themselves, obviously. – stolsvik Feb 19 '12 at 10:44
  • @stolsvik you haven't mentioned high loss links, which AFAIK are rare in the Internet. I've added something about that. – Ambroz Bizjak Feb 19 '12 at 12:45
  • 1
    Actually the TCP protocol really isn't designed for bulk one way transfer. Sure it can be made to do it, but TCP requires return packets in such a way that causes brief stalls and it can be a balancing act to choose buffer sizes and window sizes for truly optimal speed. Also, implementations may not always do what they are really supposed to with various optional settings. –  Mar 12 '13 at 01:50
7

There is a number of open source projects trying to tackle file transfer via UDP. Take a look at UFTP, Tsunami or UDT, each project is at a different stage of development.

Depending on the bandwidth the latency and the pocket loss you are working with, each project will produce a different result. There is a blog article that tries to compare the 3 projects, here is the link http://www.filecatalyst.com/open-source-fast-file-transfers

dbush
  • 205,898
  • 23
  • 218
  • 273
  • This is an older answer, the link to the comparison of various open source file transfer acceleration projects has changed, here is the new link: https://www2.filecatalyst.com/l/14012/2014-10-21/3qx4lm/14012/107394/FileCatalyst_Open_source_file_transfer.pdf – John Tkaczewski Sep 18 '20 at 20:15
2

Not open source, but Aspera's transfer speeds are worth checking out and are not affected by packet loss or network delay. You can see a chart here. It also uses a proprietary protocol called fasp.

Nicola
  • 21
  • 1
  • 1
    Other non-open source ones are signiant and smartjog. They are often in competiotion with aspera in entertainment (movie productions) industry. – satoc May 16 '15 at 15:01
1

Consider using UDP based file transfer, have a look at JSCAPE MFT Server which implements a proprietary protocol known as AFTP (Accelerated File Transfer Protocol). Please review this link :

http://www.jscape.com/blog/bid/80668/UDP-File-Transfer-up-to-100x-Faster-than-TCP

Please keep in mind that JSCAPE's AFTP works optimally over long distance connections which have network latency. If there is no network latency AFTP will not perform any better than plain old regular FTP (over TCP).

Yes I do work for JSCAPE LLC.