Skip to main content

Sequencing of Commands and Replies, 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 of 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
PASS 230 430-432,500-505
BYE 231,232 430-432,500-505
BYTE 200 500-506
SOCK 200 500-506
TYPE 200 500-506
MODE 200 500-506
RETR 250 450,451,500-506
Secondary Reply 252 452
STOR 250 451,451,500-506
Secondary Reply 252 452,453
APPE 250 451,451,500-506
Secondary Reply 252 452,453
RNFR 200 450,451,500-506
RNTO 253 450,451,500-505
DELE 254 450,451,500-506
LIST 250 450,453,500-506
Secondary Reply 252 452
ALLO 200 500-506
STAT 100,150,151 450,451,500-506
REST 200 500-506
ABOR 201,202 500-505

Spontaneous 0xx,300,301 400,401,434-436
Replies 251,255

V.D. Tyical FTP Scenarious​

  1. TIP User wanting o transfer file from FOST 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 and can thus use
local TIP editing such as character delete.
  1. 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 parenthesis, ----> 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 DoeCRLF ---->
<---- 330 passwordCRLF
password mumble CR PASS mumbleCRLF ---->
<---- 230 Doe logged in.CRLF
retrieve (local type ASCIICR
(local pathname) test 1 CR USER-FTP open local file in ASCII.
(for. pathname) test.pl1CR RETR test.pl1 CRLF ---->
<---- 255 SOCK 1233CRLF
Server makes data connection to (U+4).
<---- 250 File transfer startsCRLF
<---- 252 File transfer completeCRLF
type imageCR TYPE |CRLF ---->
<---- 200 Command OKCRLF
byte 36CR BYTE 36CRLF ---->
<---- 200 Command OKCRLF
store (local type) ImageCR
(local pathname) file dumpCR User-FTP opens local file in Image.
(for. pathname) >udd>cn>fdCR STOR >udd>cn>fdCRLF ---->
<---- 451 Access deniedCRLF
terminate BYECRLF
<---- 231 Doe logged outCRLF
Server closes all connections.