Skip to content
web protocol

FTP vs HTTP Protocols

Two of the most important technologies (protocols) you need to grasp if you are to become a brilliant web designer or developer are FTP and HTTP.

What is Protocol

Sometimes referred to as an access method, a protocol is a standard used to define a method of exchanging data over a computer network such as local area network, Internet, Intranet, etc. Each protocol has its own method of how data is formatted when sent and what to do with it once received, how that data is compressed or how to check for errors in data.

File Transfer Protocol (FTP) and HyperText Transfer Protocol (HTTP) are standard network protocols used to transfer files from one host to another host over a TCP-based network, such as the Internet.

FTP

FTP is a standard way of sending and receiving files between two computers. FTP is built on client-server architecture and uses separate control and data connections between the client and the server. FTP users may authenticate themselves using a clear-text sign-in protocol, normally in the form of a username and password, but can connect anonymously if the server is configured to allow it.

It is also important to realize that FTP is insecure. When your username and password are sent to the server they’re both sent as plaintext and could be intercepted and read. For secure transmission that hides (encrypts) the username and password, and encrypts the content, FTP is often secured with SSL/TLS (“FTPS”). SSH File Transfer Protocol (“SFTP”) is sometimes also used instead, but is technologically different.

A good example of how FTP is used today is by web developers, who will connect to their web server using FTP and send updated versions of their web pages to the server.

HTTP

Hypertext Transfer Protocol (HTTP) is the protocol (set of standards) used by the World Wide Web to access web pages. HTTP is the foundation of data communication for the World Wide Web. The client sends a short request to the server requesting a document or an image and then closes connection. The server then sends on the information to the client.

When wanting to access any web page enter http:// in front of the web address, which tells the browser to communicate over HTTP. For example, the full URL for BBC is http://www.bbc.com. Today’s modern browsers no longer require HTTP in front of the URL since it is the default method of communication. However, it is still used in browsers because of the need to access other protocols such as FTP through the browser.

Hypertext is structured text that uses logical links (hyperlinks) between nodes containing text. HTTP is the protocol to exchange or transfer hypertext.

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

Major Differences between FTP and HTTP:

  1. HTTP is used to view websites while FTP is used to access and transfer files. FTP’s file transfer purpose is more or less for website maintenance and batch uploads, while HTTP is for client-end work and for end users to upload things such as movies, pictures and other files to the server.
  2. HTTP and FTP clients: The common HTTP client is the browser while FTP can be accessed 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 only uses Binary Format.
  6. Pipelining in HTTP: HTTP supports pipelining. It means that a client can ask for the next transfer already before the previous one has ended, which thus allows multiple documents to get sent without a round-trip delay between the documents, but this pipelining is missing in FTP.
  7. Dynamic Port Numbers in HTTP: One of the biggest hurdles about FTP in real life is its use of two connections. It uses a first primary connection to send control commands on, and when it sends or receives data, it opens a second TCP stream for that purpose. HTTP uses dynamic port numbers and can go in either direction.
  8. Persistent Connection in HTTP: For HTTP communication, a client can maintain a single connection to a server and just keep using that for any amount of transfers. FTP must create a new one for each new data transfer. Repeatedly making new connections are 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 server to negotiate and choose among several compression algorithms. The gzip algorithm being the perhaps most compact one but such kind of sophisticated algorithms are not present in FTP.
  10. Support for Proxies in HTTP: One of the biggest selling points for HTTP over FTP is its support for proxies, already built-in into the protocol.
  11. One area in which FTP stands out somewhat is that it is a protocol that is directly on file level. It means that FTP has for example commands for listing dir contents of the remote server, while HTTP has no such concept.
  12. Speed: Possibly the most common question: which is faster for transfers?

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

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top