⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rfc354.txt

📁 RFC 的详细文档!
💻 TXT
📖 第 1 页 / 共 4 页
字号:
          the server socket for data connection.
300 Connection greeting message, awaiting input.
301 Current command incomplete (no CRLF for long time).
330 Enter password (may be sent with hide-your-input).
400 This service not implemented.
401 This service not accepting users now, goodbye.
430 Log-on time or tries exceeded, goodbye.
431 Log-on unsuccessful. User and/or password invalid.
432 User not valid for this service.



                                                               [Page 19]

The File Transfer Protocol                                  July 8, 1972


434 Log-out forced by operator action. Phone site.
435 Log-out forced by system problem.
436 Service shutting down, goodbye.
450 FTP: File not found.
451 FTP: File access denied to you.
452 FTP: File transfer incomplete, data connection closed.
453 FTP: File transfer incomplete, insufficient storage space.
500 Last command line completely unrecognized.
501 Syntax of last command in incorrect.
502 Last command incomplete, parameters missing.
503 Last command invalid (ignored), illegal parameter combination.
504 Last command invalid, action not possible at this time.
505 Last command conflicts illegally with previous command(s).
506 Requested action not implemented by the server.

V. DECLARATIVE SPECIFICATIONS

V.A. Connections

    The server-FTP process at the server site shall "listen" on
Socket 3, via its server-TELNET. The user or user-FTP process at the
user site shall initiate the full-duplex TELNET connections via its
user-TELNET performing the ARPANET standard initial connection protocol
(ICP) to server socket 3. The TELNET connections shall be closed by the
user site upon completion of use.

    The user site shall "listen" on the specified data socket or
sockets (a send and/or a receive socket). The server site shall initiate
the data connection using the specified data socket and byte size. The
direction of data connection and the data socket used shall be
determined by the FTP service command. The server shall send a reply to
the user indicating the server data socket so that the user may ensure
the security of data transfer. This can be done at any time prior to the
first transfer of data over a data connection.

    The data connection shall be closed by the server site under
the conditions described is Section III.A. The server should in general
send a reply before closing the data connection to avoid problems at the
user end.

V.B. Commands

    The commands are ASCII character strings transmitted over
the TELNET connections as described in section IV.A. The command
functions and semantics are described in sections IV.A.1, IV.A.2,
IV.A,3, and IV.A.4. The command syntax is specified here.





                                                               [Page 20]

The File Transfer Protocol                                  July 8, 1972


    The commands begin with a command code followed by an
argument field. The command codes are four of less ASCII alphabetic
characters. Upper and lower case alphabetic characters are to be treated
identically. Thus any of the following may represent the retrieve
command:

    RETR Retr retr ReTr rETr

The command codes and the argument fields are separated by one or more
spaces.

    The argument field consists of a variable length ASCII
character string ending with the character sequence CRLF (Carriage
Return immediately followed by Line Feed). In the following section on
syntax it should be stressed that all characters in the argument field
are ASCII characters. Thus a decimal integer shall mean an ASCII
represented decimal integer.

    The following are all the currently defined FTP commands:

         USER <user name> CRLF
         PASS <password> CRLF
         BYTE <byte size> CRLF
         SOCK <HOST-socket> CRLF
         TYPE <type code> CRLF
         STRU <structure code> CRLF
         MODE <mode code> CRLF
         RETR <pathname> CRLF
         STOR <pathname> CRLF
         APPE <pathname> CRLF
         RNFR <pathname> CRLF
         RNTO <pathname> CRLF
         DELE <pathname> CRLF
         LIST <pathname> CRLF
         ALLO <decimal integer> CRLF
         REST <marker> CRLF
         STAT <pathname> CRLF
         ABOR <empty> CRLF
          Bye <empty> CRLF

    The syntax of the above argument fields (using BNF notation
where aplicable) is:

     <username> ::= <string>
     <password> ::= <string>
     <string> ::= <empty> | <char> | <char><string>
     <char> ::= any of the 128 ASCII characters except CR and LF.
     <marker> ::= <pr string>



                                                               [Page 21]

The File Transfer Protocol                                  July 8, 1972


     <pr string> ::= <empty> | <pr char> | <pr char><pr string>
     <pr char> ::= any ASCII code 33 through 126.
     <byte size> ::= any decimal integer 1 through 255.
     <HOST-socket> ::= <socket> | <HOST number>,<socket>
     <HOST number> ::= a decimal integer specifying an ARPANET HOST.
     <socket> ::= decimal integer between o and (2**32)-1
     <type code> ::= A|I|L|P|E
     <structure code> ::= F|R
     <mode code> ::= S|B|T|H
     <pathname> ::= <string>
     <decimal integer> ::= <digit> | <digit><decimal integer>
     <digit> ::= 0|1|2|3|4|5|6|7|8|9|
     <empty> ::= the null string (specifies use of default).

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



                                                               [Page 22]

The File Transfer Protocol                                  July 8, 1972


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.





                                                               [Page 23]

The File Transfer Protocol                                  July 8, 1972


2. 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.

















                                                               [Page 24]

The File Transfer Protocol                                  July 8, 1972


ACKNOWLEDGEMENTS

    The work on file transfer protocol has involved many people.
This document reports the work of a group rather than the author
alone. The author gratefully acknowledges the conributions of
the following:

          Bob Braden         UCLA-CCCN
          Arvola Chan        MIT-MAC
          Bill Crowther      BBN-TIP
          Eric Harslem       RAND
          John Heafner       RAND
          Chuck Holland      UCSD
          Alex McKenzie      BBN (NET)
          Bob Metcalfe       XPARC
          Jon Postel         UCLA
          Neal Ryan          MIT-MAC
          Bob Sundberg       HARVARD
          Ray Tomlinson      BBN (TENEX)
          Dick Watson        SRI-ARC
          Jim White          SRI-ARC
          Richard Winter     CCA


       [ This RFC was put into machine readable form for entry ]
       [ into the online RFC archives by Gottfried Janik 9/97  ]

























                                                               [Page 25]


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -