File Transfer Protocol (FTP):

Ø  Transferring files from one computer to another is one of the most common tasks expected from a networking or inter-networking environment.
Ø  The greatest volume of data exchange in the Internet today is due to file transfer.
Ø  File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for copying a file from one host to another.
Ø  Although transferring files from one system to another seems simple and straightforward, some problems must be dealt with first.
Ø   For example, two systems may use different file name conventions. Two systems may have different ways to represent text and data. Two systems may have different directory structures. All these problems have been solved by FTP in a very simple and elegant approach.
Ø  FTP differs from other client/server applications in that it establishes two connections between the hosts. One connection is used for data transfer, the other for control information (commands and responses).
Ø  The control connection uses very simple rules of communication. We need to transfer only a line of command or a line of response at a time.
Ø   The data connection, on the other hand, needs more complex rules due to the variety of data types transferred.
Ø  FTP uses two well-known TCP ports: Port 21 is used for the control connection, and port 20 is used for the data connection.
Ø  The client has three components: user interface, client control process, and the client data transfer process.
Ø  The server has two components: the server control process and the server data transfer process.
Ø  The control connection is made between the control processes. The data connection is made between the data transfer processes.
Ø  The control connection remains connected during the entire interactive FTP session.
Ø  The data connection is opened and then closed for each file transferred. It opens each time commands that involve transferring files are used, and it closes when the file is transferred.
Ø  In other words, when a user starts an FTP session, the control connection opens. While the control connection is open, the data connection can be opened and closed multiple times if several files are transferred.



a)      Communication over Control Connection
Ø  FTP uses the same approach as SMTP to communicate across the control connection.
Ø   It uses the 7-bit ASCII character set.
Ø  Communication is achieved through commands and responses. Ø  This simple method is adequate for the control connection because we send one command (or response) at a time.
Ø  Each command or response is only one short line, so we need not worry about file format or file structure.
Ø  Each line is terminated with a two-character (carriage return and line feed) end-of-line token.



b)      Communication over Data Connection
Ø  The purpose of the data connection is different from that of the control connection.
Ø  File transfer occurs over the data connection under the control of the commands sent over the control connection.
Ø  However, we should remember that file transfer in FTP means one of three things:
1)     A file is to be copied from the server to the client. This is called retrieving aft/e. It
is done under the supervision of the RETR command,
2)    A file is to be copied from the client to the server. This is called storing aft/e. It is
done under the supervision of the STOR command.
3)    A list of directory or file names is to be sent from the server to the client. This is
done under the supervision of the LIST command. Note that FTP treats a list of
directory or file names as a file. It is sent over the data connection.

Ø  The client must define the type of file to be transferred, the structure of the data, and the transmission mode. Before sending the file through the data connection, we prepare for transmission through the control connection.
Ø   The heterogeneity problem is resolved by defining three attributes of communication: file type, data structure, and transmission mode.
·       File Type: FTP can transfer one of the following file types across the data connection: an ASCII file, EBCDIC file, or image file.
·       Data Structure: FTP can transfer a file across the data connection by using one of the following interpretations about the structure of the data: file structure, record structure, and page structure. In the file structure format, the file is a continuous stream of bytes. In the record structure, the file is divided into records. This can be used only with text files. In the page structure, the file is divided into pages.
·       Transmission Mode FTP can transfer a file across the data connection by using one of the following three transmission modes: stream mode, block mode, and compressed mode.



Search related post on google