The difference between HTTP protocol and FTP protocol (reprint content)

Source: Internet
Author: User
Tags ftp file ftp client ftp file transfer ftp protocol ftp transfer

Many sites, such as Facebook or some blogs, allow users to upload or download files, such as pictures of a forum or blog system. In this case, there are usually two options for uploading files to the server, which is the FTP protocol and the HTTP protocol.

The differences between the two are listed below:

1, the HTTP protocol is used to browse the site, and FTP is used to access and transfer files, FTP file transfer a little bulk upload and maintain the meaning of the site, and HTTP file transfer is more for the end user to provide file transfer, such as movies, pictures, music and so on.

2, HTTP and FTP client: The usual HTTP client is the browser, and the FTP service can be through the command line or user-owned graphical interface client.

3, HTTP Header: HTTP header contains metadata, such as the date of the last change, encoding, server name version and some other information, which does not exist in the FTP.

4, FTP than HTTP appeared 10 years or so.

5, Data format: FTP can transmit acsii data or binary format data, and HTTP is only in binary format.

6. Pipeline in http: HTTP support pipeline, which means that the client can issue the next request before the last request is processed, and the result is to omit some server client round-trip latency before requesting data multiple times. And FTP does not have this support.

7. Dynamic port in http: FTP One of the biggest problems is that it uses two connections, the first connection is used to send a control instruction, and when the data is accepted or sent, the second TCP connection is opened. Instead, HTTP uses dynamic ports in bidirectional transmissions.

8. Persistent connection in http: For an HTTP session, the client can maintain a single connection and use it for any number of data transfers. FTP creates a new connection each time the data is needed. It is not good to repeat the experience of creating a new connection, because each time you create a connection you have to have both sides handshake verification, which consumes a lot of time.

9. The compression algorithm in http: HTTP provides a way for clients and servers to negotiate options in some compression algorithms. Gzip is one of the most influential, and there is no such complex algorithm in FTP.

10, HTTP Support agent: HTTP is a big feature is the support agent, this function is built in the protocol, and FTP is not supported.

11, but the FTP can also stand out from the point is that this protocol is directly oriented to the file level. This means that FTP has for example a list of directories on a remote server can be listed by command, and HTTP does not have this concept.

12, Speed: Probably the most common problem: which transmission is faster?

What makes the FTP service faster?

1. No meta-data is added to the emitted data, only the original binary files are transmitted.

2. No excessive block coding

What makes the HTTP service faster?

1. Reuse existing persistent connections for better TCP performance.

2. Pipeline support makes it faster to request multiple files from the same server.

3, the automatic compression mechanism makes the transmission of data less.

4, no command/response mechanism to minimize the round-trip delay.

Summary: Of course the final result will vary depending on the specific situation, but I want to say that a single transmission of a static file, it is difficult to measure the difference between the two for a single small file, the FTP transfer faster, when the transfer of multiple files, HTTP faster.

The difference between HTTP protocol and FTP protocol (reprint content)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.