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

2.3.1 FTP Commands and Replies

The commands, from client to server, and replies, from server to client, are sent across the control connection is 7-bit ASCII format.  Like HTTP commands, FTP commands are readable by poeple.  In order to delineate successive commands, a carraigae return and line feed end each command.  Each command consists of four uppercase ASCII characters, some with optional arguments.
 
Some of the most common commands are:
  • USER username: Used to sent the user identifiaction to the server.
  • PASS password: U:sed to sent the user password to the servver.
  • LIST: Used to ask the user to send back a list of all the files in the current remote directory.
  • RETR filename: Used to retrieve a file from the current directoryof the remote host.
  • STOR filename: Used to store a file into the current directory of the remote host.

There is typically a one-to-one correspondence between the command that hthe suer issue and the FTP command sent across the control connection.  Each command is followed by a reply, sent from server to client.  The replies are three-digit numbers, with optional message following the number.  This is similar in structure to the status code and phrase in the status line of the HTTP response mseeage; the inventors of HTTP intnetionally included this similarity in the HTTP response message.