COMPARISON | HTTP | FTP |
---|---|---|
Basic | HTTP is used to access websites. | FTP transfers file from one one host to another. |
Connection | HTTP establishes data connection only. | FTP establishes two connection one for data and one for the control connection. |
TCP ports | HTTP uses TCP's port number 80. | FTP uses TCP's port number 20 and 21. |
URL | If you are using HTTP, http will appear in URL. | If you are using FTP, ftp will appear in URL. |
Efficient | HTTP is efficient in transferring smaller files like web pages. | FTP is efficient in transferring larger files. |
Authentication | HTTP does not require authentication. | FTP requires a password. |
Data | The content transferred to a device using HTTP is not saved to the memory of that device. | The file transferred to the host device using FTP is saved in the memory of that host device. |
Definition of HTTP
HTTP is a Hyper Text Transfer Protocol. It helps in accessing data from the World Wide Web. HTTP works similar to the combine functions of FTP and SMTP. Similar to the functioning of FTP because like FTP, it transfers file using service of TCP. But it uses only one TCP connection i.e. data connection, no separate Control Connection is used in HTTP. HTTP uses services of TCP on port no 80.
HTTP is similar to SMTP because the data transferred between client and server appear like SMTP messages. But HTTP messages are not destined to the humans for reading , they are interpreted and read by the web server and web browser. Unlike SMTP messages, HTTP messages are delivered immediately instead of storing and then forwarding.
The commands from the client side are sent in a request message to the web server. The web server sends the requested content in a response message. The HTTP does not provide any security, to enable security it is run over the Secure Socket layer.
Definition of FTP
FTP is a File Transfer Protocol. It is used to copy a file from one host to another. While copying a file from one host to another the problems that may occur are, the communicating host may have different file name conventions, may have different directory structures, different way to represent data. FTP overcomes all these problems. FTP is used when two hosts with different configurations want to exchange data between them.
FTP uses the services of TCP to transfer the file between client and server. FTP establishes two connections one for data transfer on TCP's port number 20 and one for control information (commands and responses) on TCP's port number 21. Separate connection for data and command makes FTP more efficient.
Control connection has ver simple rules for communication, but data connection has complex rules due to the variety of the data that is transferred. FTP was designed when security was not a big issue. Though FTP requires a password which is sent in a plain text that could be intercepted. So one can add Secured Socket Layer between FTP application layer and TCP layer to provide security.
Key Differences Between HTTP and FTP
- The basic difference between HTTP and FTP is that HTTP is used to access different websites on the internet. On the other hand, the FTP is used to transfer files from one host to the another.
- HTTP establishes data connection only whereas, the FTP establishes data as well as control connection.
- HTTP uses the TCP's port number 80 whereas, FTP uses TCP's port number 20 and 21.
- In case you are using HTTP, http appears in the URL of the website and if you are using FTP, ftp appears in your URL.
- HTTP is efficient to transfer smaller files like web pages whereas, FTP is efficient to transfer large files.
- HTTP does not require authentication whereas, FTP uses the password for authentication.
- Web pages or data content transferred to a device using HTTP are not saved in the memory of that device whereas, the data delivered to a device using FTP is saved in the memory of that device.
Transfer Speed
Possibly the most common question: which is faster for transfers?
Given all details on this page. What makes FTP faster:
- No added meta-data in the sent files, just the raw binary
- Never chunked encoding "overhead"
What makes HTTP faster:
- reusing existing persistent connections make better TCP performance
- pipelining makes asking for multiple files from the same server faster
- (automatic) compression makes less data get sent
- no command/response flow minimizes extra round-trips
Ultimately the net outcome of course differs depending on specific details, but I would say that for single-shot static files, you won't be able to measure a difference. For a single shot small file, you might get it faster with FTP (unless the server is at a long round-trip distance). When getting multiple files, HTTP should be the faster one.
Age
FTP (RFC959) appeared roughly ten years before HTTP was invented. FTP was the one and only protocol back then. The initial traces of what become RFC 959 can be found already as early as 1971.
Upload
Both protocols offer uploads. FTP has an "append" command, where HTTP is more of a "here's data coming now you deal with it" approach.
It could be worth noticing that WebDAV is a protocol on top of HTTP that provides "filesystem-like" abilities
No comments:
Post a Comment