Application Layer

2.3 File Transfer: FTP

Home
Introduction
2.1 Principles of Network Applications
2.1.1 Network Application Architectures
2.1.2 Processes Communcating
2.1.3 Application-Layer Protocols
2.1.4 What Services Does an Application Need?
2.1.5 Services Provided by the Internet Transport Protocols
2.2 The Web and HTTP
2.2.1Overview of HTTP
2.2.2 Nonpersistent and Persistent Connections
2.2.3 HTTP Message Format
2.2.4 User-Server Ineraction: Cookies
2.2.5 HTTP Content
2.2.6 Web Caching
2.2.7 The Conditional GET
2.3 File Transfer: FTP
2.3.1 FTP Commands and Replies
2.4 Electronic Mail in the Internet
2.4.1 STMP
2.4.2 Comparison with HTTP
2.4.3 Mail Message Formats and MIME
2.4.4 Mail Access Protocols
2.5 DNS--The Internet's Directory Service
2.5.1 Services Provided by DNS
2.5.2 Overview of How DNS Works
2.5.3 DNS Records and Messages
2.6 P2P File Sharing
2.7 Socket Programming with TCP
2.7.1 Socket Programming with TCP
2.7.2 An Example Client/Server Application in Java
2.8 Socket Programming with UDP

File Transfer: FTP

In a typically FTP session, the user is sitting in front of one host and wants to transfer files to or from a remote host.  In order for the user to access the remote account, the user must provide a user identification and a password.  After providing this authorization, the user cant transfer files from the local file system to the remote file system and vice versa.  The user interacts with FTP through an FTP user agent.  The user first provides the hostname of the remote host, causing the FTP client process in the local host to establish a TCP connection with the FTP server process in the remote host.  The user then provides the user identification and password, which get sent over the TCP connection as part of FTP commands.  Oncethe server has authorized the user, the user copies one or more files stored in the local file system into the remote file system.
 
HTTP and FTP are both files transfer protocols and have many common characteristics; for example, they both run on top of TCP.

The two application-layer protocols have some important differences.  FTP uses two parallel TCP connections to transfer a file, a control connection and a data connection. The control connection is used for sending control information between the two hosts.  The data connection is used to actually send a file.  Because FTP uses a separate control connection, FTP is said to send its control information out-of-band.  When a user starts an FTP session with a remote host, the client side of FTP first initiates a control TCP connection with the server side on server port number 21.  The client side of FTP sends the user identification and password over this control connection.  The client side of FTP sends also sends, over the side receives over the control connection a command for a file transfer, the server side initiates a TCP data connection to the data connection.

Throughout a session, the FTP server must maintain state about the user.  The server must associate the control connection witha specific user account. and the server must keep track of the user's current directory as the user wanders about the remote directory tree.  Keeping track of this state information for each ongoing user serssion signigicantly constrains the total number of sessions that FTP can maintain simultameously.

kurose_320719_c02f14.gif

2.3.1 FTP Commandes and Replies