Passa al contenuto principale

V.C-V.D Sequenza dei comandi e scenari tipici

V.C Sequenza di comandi e risposte​

La comunicazione tra utente e server è intesa come un dialogo alternato. Pertanto, l'utente emette un comando FTP e il server risponde con una pronta risposta primaria. L'utente dovrebbe attendere questa iniziale risposta primaria di successo o di fallimento prima di inviare ulteriori comandi.

Un secondo tipo di risposta viene inviato in modo asincrono rispetto ai comandi dell'utente. Queste risposte possono, per esempio, riferire sull'avanzamento o sul completamento del trasferimento di file e come tali sono risposte secondarie ai comandi di trasferimento di file.

La terza classe di risposte è costituita da risposte informative e spontanee che possono arrivare in qualsiasi momento. Queste risposte sono elencate di seguito come spontanee.

TABELLA DI CORRISPONDENZA COMANDO-RISPOSTA

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 Scenari FTP tipici​

  1. Utente TIP che vuole trasferire un file dall'HOST X a una stampante locale:

a) L'utente TIP apre connessioni TELNET tramite ICP verso l'HOST X, socket 3.

b) Vengono scambiati i seguenti comandi e risposte:

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) L'HOST X chiude le connessioni TELNET e dati.

Nota: L'utente TIP dovrebbe essere in modo riga.

  1. Utente all'HOST U che vuole trasferire file verso/da l'HOST S:

In generale l'utente comunicherebbe con il server tramite un processo User-FTP intermediario. Il seguente può essere uno scenario tipico. I prompt dello User-FTP sono mostrati tra parentesi, «---->» rappresenta i comandi dall'HOST U all'HOST S e «<----» rappresenta le risposte dall'HOST S all'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.

[ Questa RFC è stata resa in forma leggibile da macchina da Via Genie nel marzo 2000 per l'inserimento negli archivi RFC online ]