The Internet File Transfer Protocol (FTP) is defined by RFC 959 published in 1985. It provides facilities for transferring to and from remote computer systems. Usually the user transferring a file needs authority to login and access files on the remote system. The common facility known as anonymous FTP actually works via a special type of public guest account implemented on the remote system.
An FTP session normally involves the interaction of five software elements.
User
Interface |
This
provides a user interface and drives the client protocol interpreter. |
Client
PI |
This
is the client protocol interpreter. It issues commands to the remote
server protocol interpreter and it also drives the client data transfer
process. |
Server
PI |
This
is the server protocol interpreter which responds to commands issued by
the client protocol interpreter and drives the server data transfer
process. |
Client
DTP |
This
is the client data transfer process responsible for communicating with the
server data transfer process and the local file system. |
Server
DTP |
This
is the server data transfer process responsible for communicating with the
client data transfer process and the remote file system. |
RFC 959 refers to the user rather than the client. RFC 959 defines the means by which the two PIs talk to each other and by which the two DTPs talk to each other. The user interface and the mechanism by which the PIs talk to the DTPs are not part of the standard. It is common practice for the PI and DTP functionalities to be part of the same program but this is not essential.
During an FTP session there will be two separate network connections one between the PIs and one between the DTPs. The connection between the PIs is known as the control connection. The connection between the DTPs is known as the data connection.
The control and data connections use TCP.
In normal Internet operation the FTP server listens on the well-known port number 21 for control connection requests. The choice of port numbers for the data connection depends on the commands issued on the control connection. Conventionally the client sends a control message which indicates the port number on which the client is prepared to accept an incoming data connection request.
The use of separate connections for control and data offers the advantages that the two connections can select different appropriate qualities of service e.g. minimum delay for the control connection and maximum throughput for the data connection, it also avoids problems of providing escape and transparency for commands embedded within the data stream.
When a transfer is being set up it always initiated by the client, however either the client or the server may be the sender of data. As well as transferring user requested files, the data transfer mechanism is also used for transferring directory listings from server to client.