Slashdot Mirror


FTP: Better Than HTTP, Or Obsolete?

An anonymous reader asks "Looking to serve files for downloading (typically 1MB-6MB), I'm confused about whether I should provide an FTP server instead of / as well as HTTP. According to a rapid Google search, the experts say 1) HTTP is slower and less reliable than FTP and 2) HTTP is amateur and will make you look a wimp. But a) FTP is full of security holes. and b) FTP is a crumbling legacy protocol and will make you look a dinosaur. Surely some contradiction... Should I make the effort to implement FTP or take desperate steps to avoid it?"

15 of 870 comments (clear)

  1. hmm by nomadic · · Score: 5, Interesting

    I haven't really noticed any reliability issues with http anymore. If it starts loading it usually finishes, and I haven't run into any corruption problems. Maybe if you were serving huge files ftp would be a good idea, but for 1-6 mb it's probably not worth it.

    1. Re:hmm by nomadic · · Score: 4, Interesting

      Right, but for 1-6 mb I'd rather just try my luck with http. Especially since http is faster to connect to than ftp.

  2. SCP by elliotj · · Score: 5, Interesting

    If you're only offering files to a group of users who you can give passwords to, you could even use SCP. (Secure copy...uses sshd on the server side)

    It all depends on the application. I only use SCP to move files around if I have the choice, just because I like better security if I can have it.

    But if you want to offer files to the public, I'd recommend offering both FTP and HTTP so people can use the most convenient.

  3. I don't believe there is anonymous sftp... by emil · · Score: 4, Interesting

    What I don't care for with FTP is the continuous setup/teardown of data connections. What is even worse with active FTP is that the client side of the data connection establishes server ports, and the server becomes the client (I'd like to be able to use plug-gw from the TIS FWTK for FTP, but this is not possible for the data connections). However, even when enabling passive FTP, the data connections are too prone to lockup. The difficulty of implementing all of this in C probably contributes to the FTP server vulnerabilities.

    Still, if you want both (optionally anonymous) upload ability and access from a web browser, FTP is the only game in town.

    From the network perspective, the rsh/rcp mechanism is cleaner (in that there is only one connection), but it still has the problem of either passing cleartext authentication or establishing unreasonable levels of trust with trivial authentication. In addition, with rcp syntax you must know much more about the path to a file, and there is no real "browsing."

    Many say that SSH is the panacea for these problems, but sometimes I am not concerned about encryption and I just want to quickly transfer a file. The SSH man pages indicate that encryption can be disabled, but I have never been able to make this work. SCP also has never been implemented in a browser for file transfers. I should also say that I've never used sftp, because it has so little support.

    Someday, we will have a good, encrypted file transfer protocol (and reliable implementations of that protocol). Sorry to say, but ftp, rcp, and scp are not it. What will this new protocol support?

    1. Stateless operation a la NFS and FSP.
    2. Unlike early (non-V3) NFS, selection of either TCP or UDP for lossy or non-lossy networks.
    3. Support for a centralized authentication key repository (a la Verisign), but support also for locally-defined, non-registered keys.
    4. Support for both encrypted and non-encrypted transfers.
    5. Multiple client connections per server, possibly implemented with threads (do not spawn one server process per client a la Samba, ftpd, httpd, etc.).
    6. Support for chroot operation on UNIX, without the need for implementing /bin/ls, libc, passwd, et al.
    7. And, of course, we need to keep compression.

    Boy, I never thought that I could rant about file transfer software for so long!

  4. Re:Different, not better or wose by Anonymous Coward · · Score: 5, Interesting

    Everyone disables the only unique thing FTP can do (third-party transfers) to prevent a variety of attacks by proxy. It might be worth accomodating decrepit machines that lack HTTP clients, but there are no actual advantages to using FTP.

  5. Re:OR, How about... by mlinksva · · Score: 3, Interesting
    Excellent tutorial overall, save the sniping at non-Shareaza Gnutella clients. The great thing about MAGNET is that it is client/network agnostic. Shareaza was the first client to support MAGNET and it's an excellent program, but it isn't the only one (at least Xolox does right now, with several others either recently or very soon to be added). The part about disallowing uploads to non-Shareaza clients is completely bogus -- allowing others to download a) doesn't prevent other Shareaza users from downloading and b) limits the number of people you'll be able to distribute content to in a cost effective P2P manner. BTW, you can share your content with any modern Gnutella client (i.e., allows download by hash), and it will be available to people using MAGNET, even if the sharing client doesn't support MAGNET yet.

    Also, you forgot the first and biggest site with MAGNET links. Still, an excellent tutorial, thanks for writing it!

  6. College blocking ftp? by ende · · Score: 4, Interesting

    I would say go with http.. my reason is simple.. my college blocks ftp! There are two sides of the story, first off, the complete blocking of ftp started a week ago when they switched firewalls.. they couldn't get the ftp to work, and they decided it wasn't a high priority so they didn't do anything to fix it... After yelling at the IT department for half the day I got the priority up. But besides that.. Even before, when they allowed ftp, it was only active ftp.. I was unable to go to a website, click on a file that is served from ftp:// and download it! I'd have to use flashfxp or another client to d/l files.. I was able to figure that out quickly, but what about the other 99% of the school that wants to download say shareware from download.com or a driver from somewhere.. they are denied! FTP is a superior protocol for file transfer in my opinion, but administrators don't seem to care about it as much as they do http.

  7. Re:Different, not better or wose by Anonymous Coward · · Score: 5, Interesting

    They serve different purposes, and each was designed to meet those needs. Each one has its own positives and negatives.

    True, but ftp has far more negatives. The connection model ftp uses, in which the server connects back to the client for data transfers, is a horrible idea. Surely, there must be a benefit to this method (or else why would ftp have become such a standard?), but I've yet to hear it. Passive ftp (PASV) is supposed to compensate for the fact that clients behind NAT can't use ftp, and passive is pretty much supported everywhere now. But passive doesn't solve the problem of many-connections, it just shifts it: With passive ftp, there is still a seperate "data" connection for every file transfer, or transfer of directory contents. It's just that with passive ftp the data connection is initiated by the client to some high-numbered port on the server. This allows clients behind NAT to do ftp, but it makes firewalling the server a pain in the ass, especially if the server is (god forbid) behind nat itself. It's relatively easy to setup a mailserver, or webserver, or ssh server, on a machine behind nat (assuming you can forward ports on the nat gateway). But try doing the same with ftp. Passive connections won't work, unless the ftpd is configured to only use a certain range of high ports for it's data connection, and the firewall forwards that entire range. You'd think with all these connections, the protocol might support multiple connections from one login, ie list another directory while downloading. Well, thats not the case at all, you have to login again if you want simultaneous transactions.

    And then if you want tunneled connections... oh boy, what a pain in the ass:

    I set this all up for someone recently, and it DOES finally work, with tunneled passive ftp connections to a proftpd server behind a nat gateway, but it was a big pain. Due to the way proftpd works (not sure about other daemons...) the passive connections are directed to the interface the client is connected to. So, with an ssh tunneled connection, proftpd sees the client connection TO 127.0.0.1 (because thats where sshd is). So it tells the client, connect back to me for the data connection, my IP is 127.0.0.1. And the client tries to connect to itself, and fails saying "can't open data connection". The solution was to point the tunnel not to 127.0.0.1, but to the external IP, and have the nat gateway forward internal traffic back to itself. So traffic comes in over ssh, over to the firewallwall (where the nat rewriting happens), and then back to the same machine for ftp.

    If people could just use sFTP clients, this wouldn't be an issue _at_all_ (One client connection, one tcp connection! Hey, what a concept!). But due to the integrated ftp clients in programs like bbedit and dreamweaver, I suspect we'll be dealing with that bastard protocol known as ftp for quite a long time....

    Damn, reading back over this, I'm kind of ranting. BUT ITS ALL TRUE!
    Sorry bout that.
    [X] Post Anonymously

  8. Re:No, by Guspaz · · Score: 3, Interesting

    Because you get a larger share of the bandwidth pie. This applies both on the server end, and your ISP end. If you have bandwidth to spare, you can get 6 (or 8, or 10, depends on the client) users worth of bandwidth because each connection is treated by the server as seperate. On the other hand if you have a slow ISP, you can get a larger share of your ISP's bandwidth.

    I have 3.5mbit DSL, but my ISP's performance is flaky. However, I have no problem pulling 300-350KB/s with a download accelerator.

  9. Re:how about rsync? by swillden · · Score: 4, Interesting

    Rsync is the way to go!

    Rsync is great in theory, but the implementation has one major problem that makes it less than ideal for many cases: It puts a huge burden on the server, because the server has to calculate the MD5 sums on each block of each file it serves up, which is a CPU-intensive task. A machine which could easily handle a few dozen HTTP downloads at a time would choke with only a few rsync downloads.

    This is a problem with the implementation, not with the theory, because it wouldn't be that difficult for the rsync server to cache the MD5 sums so that it only had to calculate them once for each file (assuming it's downloading static content -- for dynamic content rsync will probably never make sense, particularly since we can probably expect bandwidth to increase faster than processing power). The server could even take advantage of 'idle' times to precalculate sums. Once it had all of the sums cached, serving files via rsync wouldn't be that much more costly in terms of CPU power than HTTP or FTP, and it would often be *much* more efficient in terms of bandwidth.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  10. Re:Different, not better or wose by alangmead · · Score: 5, Interesting

    In FTP the sender connects to the receiver, but client issuing commands does not have to be either of those two machines. As designed, FTP should be able to allow a client to send data between two arbitrary machines. Its an infrequently used feature, and I'm not sure if it is implemented by all clients, but it is, technically, a feature that HTTP doesn't have.

  11. 1-6MB files to how many users? by digital+photo · · Score: 3, Interesting

    Hmm.. There's no reason why you couldn't just perform the download via HTTP if your target customer or audience has the bandwidth.

    If you're concerned about the customer losing connectivity, you could always just break the file up into small chunks for download.

    Both FTP and HTTP, depending on clients and servers, supports continuation-downloading(ie, recovering from where you left off.) So if one connection flakes out, you can always recover.

    The long and short of it?

    HTTP(S) or FTP(s/FTP), it doesn't matter. With both, you can restrict access and/or grant access to specific files. You can recover from some point or offer split files. With HTTP, you can have the information piped through a back-end piece of code so that you can monitor who does what when, but something similar can be done with FTP as well.

    If you've already got a webserver going and secured, you're probably better off offering the files via HTTP. Nothing unprofessional about it.

    Fact is, if your target audience is the general public, you'll fare better with HTTP. Why? Because while most people who are online will probably have access to a web browser and know how to download HTTP files, they may not have an FTP client or necessarily know how to use their browser as an FTP client.

    Me? I offer photos and docs online via HTTP. It's easier and I can control the visual aspect of the "download area" to create a more professional look than that of the "industrial" FTP interface.

    Nothing wrong with FTP or sFTP. I use them at work and at home. But then again, when I find a site which offers HTTP or FTP? I pick HTTP to download first. It's only when I'm still looking for something that I go with FTP... which, by the way, becomes difficult to navigate on some clients. A nicely generated webpage featuring the item via HTTP would be much more elegant.

    Just my two cents.

  12. I'm dealing with this decision now too by osgeek · · Score: 3, Interesting

    After hosting an HTTP file transfer area for some time for my company, we decided to move to an FTP setup that was a bit more sophisticated.

    So far, it's been a failure for two reasons:

    1. IE blows as an FTP client, and users aren't comfortable dropping into the (somewhat crappy) DOS FTP client.
    2. Firewall setups at the fortune 500 companies that we deal with normally seem to keep FTP access off-site restricted.

  13. Re:Different, not better or wose by fault0 · · Score: 3, Interesting

    > For getting (possibly multiple) files whose location you don't know in advance, FTP is more flexible and efficient.

    Ever heard of web page directories that almost every common web server uses, and most web servers automatically do when no index file is present?

    I find lynx+ web page directories a lot faster to get files across my network than ftp.

    The only real advantage I see with ftp is uploading files quickly and easily... but that's not for me :>

  14. Limit number of connexions, NOT which FTP client by Reziac · · Score: 3, Interesting

    Instead of banning download managers that can do segmented downloading, why not just limit the number of connexions from a given IP? That solves both the segmenting and the "tons of files at once" problems.

    I can make a dozen or more connexions to your FTP server with nothing more exotic than Netscape. Why pick on download managers when they use the same number of connexions? (BTW, Getright says right in its configuration that "some servers regard segmenting as rude" and recommends against it.) Better to limit connexions to x-many per IP address, and let the user spend them any way they wish.

    BTW, if you do limit connexions, please remember that it usually takes one for browsing the site (using Netscape or whatever) PLUS one for the download manager to fetch the file. Otherwise the user who was looking with a browser has to leave the server, then wait for the browser connexion to close (which can take a while) then finally paste the link into the DLManager. So a limit of two connexions from a given IP is a nice practical minimum, and surely not a hard load for anything outside of home servers operating over dialup.

    PS. I love FTP's convenience, and I always try to be extra-polite to small servers (and not rude to big ones). I do use Getright, and have segmenting disabled (which BTW is the default).

    --
    ~REZ~ #43301. Who'd fake being me anyway?