Http and Ftp

download Http and Ftp

of 2

Transcript of Http and Ftp

  • 8/12/2019 Http and Ftp

    1/2

    Many sites, such as Facebook or a blog, will allow a user to upload or download files tothe site for a myriad of reasons, such as pictures for a website or files for a forum orblog software. In either case, there are two ways to upload a file to a server or website:using HTTP or using FTP.Here are some of the differences:

    1.HTTP is used to view websites while FTP is used to access and transfer files. FTP'sfile transfer purpose is more or less for website maintenance and batch uploads, whileHTTP is for client-end work and for end users to upload things such as movies, picturesand other files to the server.2. HTTP and FTP clients:The common HTTP client is the browser while FTP can beaccessed via the command line or a graphical client of its own.3. HTTP Headers: HTTP Headers contains metadata such as last modified date,

    character encoding, server name and version and more which is absent in FTP.

    4. Age Difference:FTP is about 10 years older than HTTP.5. Data Formats:FTP can send data both in ASCII and Binary Format but HTTP onlyuses Binary Format.6. Pipelining in HTTP:HTTP supports pipelining. It means that a client can ask for thenext transfer already before the previous one has ended, which thus allows multipledocuments to get sent without a round-trip delay between the documents, but thispipelining is missing in FTP.7. Dynamic Port Numbers in HTTP:One of the biggest hurdles about FTP in real lifeis its use of two connections. It uses a first primary connection to send controlcommands on, and when it sends or receives data, it opens a second TCP stream forthat purpose. HTTP uses dynamic port numbers and can go in either direction,8. Persistent Connection in HTTP:For HTTP communication, a client can maintain asingle connection to a server and just keep using that for any amount of transfers. FTPmust create a new one for each new data transfer. Repeatedly making new connectionsare bad for performance due to having to do new handshakes/connections all the time. 9.Compression Algorithms in HTTP:HTTP provides a way for the client and serverto negotiate and choose among several compression algorithms. The gzip algorithmbeing the perhaps most compact one but such kind of sophisticated algorithms are notpresent in FTP.10. Support for Proxies in HTTP:One of the biggest selling points for HTTP over FTPis its support for proxies, already built-in into the protocol.

  • 8/12/2019 Http and Ftp

    2/2

    11.One area in which FTP stands out somewhat is that it is a protocol that is directly onfile level. It means that FTP has for example commands for listing dir contents of theremote server, while HTTP has no such concept.

    12. Speed:Possibly the most common question: which is faster for transfers?

    What makes FTP faster?

    1. No added meta-data in the sent files, just the raw binary2. Never chunked encoding "overhead"

    What makes HTTP faster?

    1. Reusing existing persistent connections make better TCP performance2. Pipelining makes asking for multiple files from the same server faster3. Automatic compression makes less data get sent

    4. No command/response flow minimizes extra round-trips

    Conclusion:Ultimately the net outcome of course differ depending on specific details,but I would say that for single-shot static files, you won't be able to measure adifference. For a single shot small file, you might get it faster with FTP (unless theserver is at a long round-trip distance). When getting multiple files, HTTP should be thefaster one.