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

📄 rfc354.txt

📁 RFC 的详细文档!
💻 TXT
📖 第 1 页 / 共 4 页
字号:






Network Working Group                                     Abhay Bhushan
Request for Comments: 354                                       MIT-MAC
NIC: 10596                                                 July 8, 1972
Categories D.4, D.5, D.7
Obsoletes: RFC 264 and 265


                       THE FILE TRANSFER PROTOCOL


I. INTRODUCTION

    The File Transfer Protocol (FTP) is a protocol for file
transfer betweet HOSTs (including terminal IMPs), on the ARPA
Computer Network (ARPANET). The primary function of FTP is to
transfer files efficiently and reliably among HOSTs and to allow
the convenient use of remote file storage capabilities.

    The objectives of FTP are 1) to promote sharing of files
(computer programs and/or data), 2) fo encourage indirect or
implicit (via programs) use of remote computers, 3) to shield a
user from variations in file storage systems among HOSTs, and
4) to transfer data reliably and efficiently. FTP, though usable
directly by user at a terminal, is designed mainly for use by
programs.

    The attempt in this specification is to satisfy the diverse
needs of users of maxi-HOSTs, mini-HOSTs, TIPs, and the
Datacomputer, with a simple, elegant, and easily implemented
protocol design.

    This paper assumes knowledge of the following protocols:

         1) The HOST-HOST Protocol (NIC #8246)

         2) The initial Connection Protocol (NIC #7101)

         3) The TELNET Protocol (NWG/RFC #318, NIC #9348)

II. DISCUSSION

    In this section, the terminology and the FTP model are
discussed. The terms defined in this section are only those that
have special significance in FTP.







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


11.A. Terminology

ASCII               The USASCII character set as defined in NIC
                    #7104. In FTP, ASCII characters are defined
                    to be the lower half of an eight bit code set
                    (i.e., the most significant bit es zero).

access controls     Access controls define users' access
                    privileges to the use of a system, and to the
                    files in that system. Access controls are
                    necessary to prevent unauthorized or
                    accidental use of files. It is the
                    prerogative of a user-FTP process to provide
                    access controls.

byte size           The byte size specified for the transfer of
                    data. The data connection is opened with
                    this byte size. Data connection byte size is
                    not necessarily the byte size in which data
                    is to be stored in a system, and may not be
                    related to the structure of data.

data connection     A simplex connection over which data is
                    transferred, in a specified byte size, mode
                    and type. The data transferred may be a part
                    of a file, an entire file or a number of
                    files. The data connection may be in either
                    direction (server-to-user or user-to server).

data socket         The socket on which a User-FTP process
                    "listens" for a data connection.

EOF                 The end-of-file conidition that defines the
                    end of a file being transferred.

EOR                 The end-of-record condition that defines the
                    end of a record being transferred.

error recovery      A procedure that allows a user to recover
                    form certain errors such as failure of either
                    Host system or transfer process In FTP,
                    error recovery may involve restarting a file
                    transfer at a given checkpoint

FTP commands        A set of commands that comprise the control
                    information flowing from the user-FTP to the
                    server-FTP process.




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


file                An ordered set of computer data (including
                    programs) of arbitrary length uniquely
                    identified by a pathname.

mode                The mode in which data is to be transferred
                    via the data connection. The mode defines
                    the data format including EOR and EOF. The
                    transfer modes defined in FTP are described
                    in Section III.A.

NVT                 The Network Virtual Terminal as defined in
                    the ARPANET TELNET Protocol.

NVFS                The Network Virtual File System. A concept
                    which defines a standard network file system
                    with standard commands and pathname
                    conventions. FTP only partially embraces the
                    NFS concept at this time.

pathname            Pathname is defined to be the character
                    string which must be input to a file system
                    by a user in order to identify a file.
                    Pathname normally contains device and/or
                    directory names, and file name specification.
                    FTP does not yet specify a standard pathname
                    convention. Each user must follow the file
                    naming conventions of hte file systems he
                    wishes to use.

record              A sequential file may be structured as a
                    number of contiguous parts called records.
                    Record structures are supported by FTP but
                    are not mandatory.

reply               A reply is an acknowledgment (positive or
                    negative) sent from server to user via the
                    telnet connections in response to FTP
                    commands. The general form of a reply is a
                    completion code (including error codes)
                    followed by an ASCII text string. The codes
                    are for use by programs and the text is for
                    human users.

server-FTP process  A process or set of processes which perform
                    the function of file transfer in cooperation
                    with a user-FTP process. The server-FTP
                    process must interpret and respond to user
                    commands and initiate the data connection.



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


server site         A HOST site wich has a server-FTP process.

server-TELNET       A TELNET process which listens on a specified
                    socket for an ICP initiated by a user-TELNET,
                    and perform in accordance with the ARPANET
                    TELNET Protocol.

TELNET connections  The full-duplex communication path between a
                    user-TELNET and a server-TELNET. The TELNET
                    connections are established via the standard
                    ARPANET initial Connection Protocol (ICP).

type                The data representation type used for data
                    transfer and storage. Type implies certain
                    transformations between the time of data
                    storage and data transfer. The
                    representation types defined in FTP are
                    described in Section III.B.

user                A process on behalf of a human being or a
                    human being wishing to obtain file transfer
                    service.

user site           A HOST site satisfying any of the following
                    conditions: 1) The site where a user is
                    located, 2) a site where a user-FTP process
                    is located, 3) a site to which a data
                    connection is made by a server. In the
                    normal case, the sites defined by 1, 2, and 3
                    are the same site, but nothing in FTP
                    requires that this be so.

user-FTP process    A process or set of precesses which perform
                    the function of file transfer in cooperation
                    with a server-FTP process. The user-FTP
                    process 1) initiates the ICP (via a
                    user-TELNET, 2) initiates FTP commands and
                    3) "listens" on the data socket for the data
                    connection. In some obvious cases (use from
                    TIPs and other mini-HOSTs) a user-FTP process
                    will be subsumed under the term "user".

user-TELNET         A TELNET process which initiates an ICP to a
                    specified server-TELNET socket, and performs
                    in accordance with the ARPANET TELNET
                    protocol.





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


II.B. The FTP Model

    With the above definitions in mind, the following model
(shown in Figure 1) may be diagrammed for an FTP service.


                            TELNET
                          connections
File      Server    Server<------------ User     User      File
Systems<->  FTP  <->TELNET FTP Commands TELNET<->FTP    <->System
          Process         ------------>          Process

                                                  Data
                 <------------------------------>Socket
                        Data Connection(s)         |
                                                   |
                                                  USER




Notes:  1. The data connection may be in either direction.

        2. The data connection need not exist all of the time.

        3. The distinctions between user-FTP and user-TELNET,
           and between server-FTP and server-TELNET may not
           be as clear-cut as shown above. For example, a user-
           TELNET may be directly driven by the user.



                FIGURE 1 Model for FTP Use


    In the model described in Figure 1, the user-TELNET
initiates the TELNET connection. Standard FTP commands are then
generated by the user and transmitted to the server site via the TELNET
connections. FTP commands are in ASCII, in accordance with NVT
conventions and the TELNET protocol. Note that commands may be initiated
by the user directly through the user-TELNET or via a user-FTP process.
Standard replies are sent from the server to the user in response to the
commands over the TELNET connections.

    The FTP commands specify the parameters for teh data
connection (data socket, byte size, transfer mode, and representation
type), and the nature of file system operation (store, retrieve, append,
delete, etc.). The user-FTP process or its designate should "listen" on



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


the specified data socket, and it is the server's responsibility to
initiate the data connection and data transfer in accordance with the
specified data connection parameters. It should be noted that the data
socket need not be in the same HOST that initiates the FTP commands via
the TELNET connection, but the user or his user-FTP process must ensure
a "listen" on the specified data socket. A practical example of such
file transfer to third HOSTs is a maxi-HOST user (who may actually be a
TIP user) whishing to transmit a file to or from an I/O device attached
to a TIP. It should also be noted that two data connections, one for
send and the other for receive, may exist simultaneously.

    The protocol requires that the TELNET connections be open
while data transfer is in progress. It is the responsibility of the user
to close the TELNET connections when finished using the FTP service. The
server may abort data transfer if the TELNET connections are closed.

III. DATA TRANSFER FUNCTIONS

    Data and files are transferred only via the data connection.
The data transfer of data is governed by FTP data transfer commands
received on the TELNET connections. The data transfer functions include
establishing the data connection to the specified data socket in the
specified HOST (using the specified byte size), transmitting and
receiving data in the specified representation type and transfer mode,
handling EOR and EOF conditions and error recovery (where applicable).

III.A Establishing Data Connection

    The user site shall "listen" on the specified data socket.
The FTP request command determines the direction of data transfer, and
the socket number (odd or even) which is to be used in establishing the
data connection. The server on receiving the appropriate store or
retrieve request shall initiate the data connection to the specified
user data socket in the specified byte size (default byte size is 8
bits) and send a reply indicating that file transfer may proceed. Prior
to this the server should send a reply indicating the server socket for
the data connection. The user may use this server socket information to
ensure the security of his data transfer. The server may send this reply
either before of after initiating the data connection.

    The byte size for the data connection is specified by the
TYPE (ASCII is 8 bits), or TYPE and BYTE commands. It is not required by
the protocol that servers accept all possible byte size. The user of
various byte size is for efficiency in data transfer and servers may
implement only those byte size for which their data transfer is
efficient. It is however recommended that servers implement at least the
byte size of 8 bits.




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


    After the data transfer is completed, it is the server's
responsibility to close the data connection except when the user is
sender of data. The data connection shall be closed under any of the
following conditions:

    1) server receives an abort command form user.

    2) EOF in stream mode indicated by closing data connection.

⌨️ 快捷键说明

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