 |
FILE TRANSFER AND REMOTE FILE ACCESS
As network application began to use intermediate files, programmers wrote code to transfer a complete file from one computer to another. Because the steps required to transfer a file for one application are similar to the steps required to transfer a file for another, programmers were duplicating code, making only minor modifications in file names or the way data was represented. It quickly became apparent that a single, generalized utility could be devised to work with many applications. The problem became known as the file transfer problem, and a software system that moved arbitrary data from a file on one computer to a file on another became known as file transfer software.
To be useful, file transfer software must be general and flexible. It `must allow transfer of an arbitrary file, and must accommodate multiple file types. Because an Internet can connect heterogeneous computer systems, file transfer software must accommodate differences among the ways computer systems store files. For example, each computer system has rules about file names; a name that is valid on one computer system may be invalid on another. Furthermore, because most computer systems use login accounts to define file ownership, the owner on one computer system may not have a corresponding login account on another computer. Finally, file transfer software must accommodate other minor differences in file representations, type information, and file protection mechanisms.
A file transfer service can move a copy of a file from one computer to another, either interactively or in batch mode. It is possible to build a service that can be used in the either mode.
File Transfer Protocol (FTP)
The most widely-deployed Internet file transfer service uses the File Transfer Protocol (FTP). A general-purpose protocol, FTP handles many of the concepts discussed above. FTP permits transfer of an arbitrary file, and includes a mechanism that allows files to have ownership and access restrictions. More important, because it hides the details of individual computer systems, FTP accommodates heterogeneity-it can be used to transfer a copy of a file between an arbitrary pair of computers.
FTP is among the oldest application protocols still used in the Internet. Originally defined as part of the ARPANET protocols, FTP predates both TCP and IP. As TCP/ IP was created, a new version of FTP was developed that worked with the new Internet Protocols.
FTP is among the most heavily used applications. Early in the history of the Internet, datagram’s carrying file transfers accounted for approximately one-third of all Internet traffic; the traffic generated by services such as e-mail and the domain name system did not come close to exceeding that generated by FTP.
The most popular file transfer service in the Internet uses FTP, the File Transfer Protocol. FTP is a general-purpose protocol that can be used to copy an arbitrary file from one computer to another.
FTP is designed to permit interactive or batch use. Most users invoke FTP interactively; they run an FTP client that establishes communication with a specified server to transfer files. However, some software systems invoke FTP automatically, without requiring a user to interact with an FTP client. When it invokes FTP, a program handles all details. The program interacts with FTP and then informs the user whether the operation succeeded or failed; the program completely hides the FTP interface from the user.
When a user invokes FTP interactively, the user communicates with a command driven interface. FTP issues a prompt to which the user responds by entering a command. FTP executes the command, and then issues another prompt.
FTP has commands that allow a user to specify a remote computer to provide authorization, find out which remote files are available, and request file transfer of one or more files. Some FTP commands require little or no time to execute, while others can take a significant time. For example, it may take many seconds to transfer a copy of a large file.FTP requires a user to establish a control connection to a remote computer before files can be transferred. To obtain authorization, a user must supply a login and password. The control connection remains in place until the user decides to close it.
Client-Server Interaction in FTP
Like other network applications, FTP uses the client-server paradigm. A user runs a local FTP application, which interprets commands that the user enters. When a user enters an open command and specifies a remote computer, the local application becomes an FTP client that uses TCP to establish a control connection to an FTP server on the specified computer. The client and the server use the FTP protocol when they communicate across the control connection. That is, the client does not pass the user's keystrokes directly to the server. Instead, when a user enters a command, the client interprets the command. If the command requires interaction with the server, the client forms a request using the FTP protocol and sends the request using the FTP protocol and sends the request to the server. The server uses the FTP protocol when it sends a reply.
FTP uses a control connection only to send commands and receive responses. When it transfers a file, FTP does not send the data across the control connection. Instead, the client and the server establish a separate data connection for each file transfer, use it to send one file, and then close the connection. If the user requests another transfer, the client and the server establish a new data connection. To avoid conflict between the control and data connections, FTP uses a different protocol port number for each.
Although data connections appear and disappear frequently, the control connection persists for the entire session. Thus, while a transfer is in progress, the client and the server have two connections open: a control connection and data connection for the transfer. Once the transfer completes, the client and the server close the data connection and continue to use the control connection.
Figure 12.5 illustrates the concept.

In Figure , arrows on the connection shows which side initiated the connection. The arrow on the control connection extends from the client to the server because a client forms the control connection. Interestingly, a data connection is formed in the opposite direction. That is, the roles of client and the server are reversed, with the server acting as a client, and the client acting as a server.
Using separate connections for transfer and control has several advantages. First, the scheme keeps the protocols simpler and makes implementation easier-data from a file is never confused with FTP commands. Second, because the control connection remains in place, it can be used during the transfer (for example, the client can send a request to abort the transfer). Third, the sender and the receiver can use an end-offile condition on the data connection to inform the other side when all data has arrived.
Note that in Figure , although the control connection remains open, the data connection is closed after completion.
BACK |  |