V.C-V.D Command Sequencing and Typical Scenarios
V.C Sequencing of Commands and Replies
The communication between the user and server is intended to be an alternating dialogue. As such, the user issues an FTP command and the server responds with a prompt primary reply. The user should wait for this initial primary success or failure response before sending further commands.
A second type of reply is sent asynchronously with respect to user commands. These replies may, for example, report on the progress or completion of file transfer and as such are secondary replies to file transfer commands.
The third class of replies are informational and spontaneous replies which may arrive at any time. These replies are listed below as spontaneous.
COMMAND-REPLY CORRESPONDENCE TABLE
COMMAND SUCCESS FAIL
------- ------- ----
USER 230,330 430-432,500-505,507
PASS 230,331 430-432,500-507
ACCT 230 430-432,500-507
REIN 232,233 401,436,500-507
Secondary Reply 300
BYE 231,232 430-432,500-505,507
BYTE 200,331 500-507
SOCK 200,331 500-505,507
LSTN 255,331 500-507
TYPE 200,331 500-507
FORM 200,331 500-507
STRU 200,331 500-507
MODE 200,331 500-507
RETR 250,331 433,450,451,454,455,500-505,507,550
Secondary Reply 252 452
STOR 250,331 433,451,454,455,457,500-505,507,550
Secondary Reply 252 452,453
APPE 250,331 433,451,454,455,457,500-507,550
Secondary Reply 252 452,453
ALLO 200,331 500-507
REST 200,331 500-507
RNFR 200,331 433,450,451,455,500-507,550
RNTO 253,331 433,450,451,455,456,500-505,507,550
ABOR 201,202,331 500-507
DELE 254,331 433,450,451,455,500-507,550
LIST 250,331 433,450,451,454,455,457,500-507,550
Secondary Reply 252 452
NLST 250,331 433,450,451,454,455,457,500-507
Secondary Reply 252 452
STAT 100,110,150, 450,451,454,455,500-507,550
151,331
HELP 000,030,050, 500-507
331
MLFL 250,331 433,450,451,454,455,457,500-507
Secondary Reply 252 452,453
MAIL 331,350 433,450,451,455,500-507
Secondary Reply 256
NOOP 200 500-505,507
QUOT 200,331 500-507
NQUO 200 500-505,507
Spontaneous 0xx,300,301 400,401,434-436
Replies 251,255
V.D Typical FTP Scenarios
- TIP User wanting to transfer file from HOST X to local printer:
a) TIP user opens TELNET connections by ICP to HOST X, socket 3.
b) The following commands and replies are exchanged:
TIP HOST X
--- ------
USER username CRLF ---------->
<----------330 Enter Password CRLF
PASS password CRLF ---------->
<----------230 User logged in CRLF
SOCK 65538 CRLF ---------->
<----------200 Command received OK CRLF
RETR this.file CRLF ---------->
<----------255 SOCK 5533 CRLF
(HOST X initiates data connection to
TIP socket 65538, i.e., PORT 1 receive)
<----------250 File transfer started
BYE CRLF ----------------->
<----------252 File transfer completed
c) HOST X closes the TELNET and data connections.
Note: The TIP user should be in line mode.
- User at HOST U wanting to transfer files to/from HOST S:
In general the user would communicate to the server via a mediating user-FTP process. The following may be a typical scenario. The user-FTP prompts are shown in parentheses, '---->' represents commands from HOST U to HOST S, and '<----' represents replies from HOST S to HOST U.
Local Commands by User Action Involved
---------------------- ---------------
ftp (host) multics CR ICP to HOST S, socket 3,
establishing TELNET connections.
username Doe CR USER Doe CRLF ---->
<---- 330 password CRLF
password mumble CR PASS mumble CRLF ---->
<---- 230 Doe logged in. CRLF
retrieve (local type) ASCII CR
(local pathname) test 1 CR User-FTP opens local file in ASCII.
(for.pathname) test.p11 CR RETR test.p11 CRLF
<---- 255 SOCK 1233 CRLF
Server makes data connection to (U+4).
<---- 250 File transfer starts CRLF
<---- 252 File transfer complete CRLF
type ImageCR TYPE I CRLF ---->
<---- 200 Command OK CRLF
byte 36CR BYTE 36 CRLF ---->
<---- 200 Command OK CRLF
store (local type) image CR
(local pathname) file dump CR User-FTP opens local file in Image.
(for.pathname) >udd>cn>fd CR STOR >udd>cn>fd CRLF ---->
<---- 451 Access denied CRLF
terminate <---- 231 Doe logged out CRLF
Server closes all connections.
[ This RFC was put into machine readable form for entry ] [ into the online RFC archives by Via Genie 03/00 ]