The File Transfer Protocol
The File Transfer Protocol
FTP is one of the oldest application protocols still used on the Internet, and is
invoked by web browsers when a user requests a file download. FTP predates
both IP and TCP. As TCP/IP was created, a new version of FTP was
developed to work with the new Internet protocols. FTP is still heavily used --
only in 1995 did web traffic on the Internet surpass FTP traffic for the first
time.
FTP Commands
FTP is designed to run from a program, e.g. a browser, or for interactive use.
When invoked, FTP must handle all the details and then inform the user
whether the operation succeeded or failed; the user never sees the FTP
interface.
Although file representations may differ on two computer systems, FTP does
not attempt to handle all possible representations. Instead, FTP defines two
basic types of transfer -- text and binary. A text file contains a sequence of
characters (usually in ASCII) separated into lines. Binary transfer mode is
used for all non-text files. FTP does not interpret the contents of a file
transferred in binary mode -- this can cause problems, e.g. a file of 32-bit
floating point numbers where the representation is different on the two
computers.
Like other network applications, FTP uses the client-server paradigm. The
client establishes a control connection. When the user enters a command, the
client forms a request using the FTP protocol and sends it to the server.
Similarly, the server uses the FTP protocol to send a reply.
FTP uses the control connection only to send and receive control messages.
It establishes a separate data connection for each file transfer. Although these
data connections appear and disappear frequently, the control connection
persists for the entire session. Figure 2 illustrates the concept.
The arrows on the connections show which side initiated the connection.
Separate connections for control and transfer have several advantages -- it
simplifies the protocol and allows the control connection to be used during a
file transfer, e.g. to abort the transfer.