Web Technologies - Old Questions

2.  What is FTP? Discuss its functions in detail.

10 marks | Asked in 2071

File transfer protocol (FTP) is a set of rules that computers follow for the transferring of files from one system to another over the internet. It is mainly used for transferring the web page files from their creator to the computer that acts as a server for other computers on the internet. It is also used for downloading the files to computer from other servers.

When a user wishes to engage in File transfer, FTP sets up a TCP connection to the target system for the exchange of control messages. These allow used ID and password to be transmitted and allow the user to specify the file and file action desired. Once file transfer is approved, a second TCP connection is set up for data transfer. The file is transferred over the data connection, without the overhead of headers, or control information at the application level. When the transfer is complete, the control connection is used to signal the completion and to accept new file transfer commands.


Fig: Basic model of FTP

FTP can be run in active or passive mode, which determines how the data connection is established. In active mode, the server initiates the data connection with the client after the client has established a connection on the command channel. In passive mode it is the other way round, the client initiates the data connection with the server.

FTP includes three different transmission modes: stream, block and compressed. In stream mode, data is sent as a continuous sequence of bytes to TCP; in block mode, data is formatted into blocks with headers and then passes it on to TCP; and in compressed mode, bytes are compacted using run-length encoding. Stream mode is the one most commonly used.