RFC 385 UNKNOWN FTP · FILE TRANSFER

FTP Comments: Comments on the File Transfer Protocol

Errata, clarifications and new commands for the 1972 File Transfer Protocol of RFC 354.

On rfc-editor.org ↗
PUBLISHED
August 1972
AUTHORS
A.K. Bhushan
STREAM
Legacy
BUILDS ON
RFC 354 — FTP
UPDATED BY
RFC 414 — File Transfer Protocol (FTP) status and further comments
MINIMUM SERVER TYPE AND MODE
ASCII (8-bit bytes), Stream
NEW REPLY CODE
454
EXPERIMENTAL REPLY CODES
900 to 999
DOI
10.17487/RFC0385

RFC text

Original text · RFC Editor View on rfc-editor.org ↗
NWG/RFC 385                                       Abhay K. Bhushan
NIC 11357                                                  MIT-MAC
Updates: RFC 354                                  August 18, 1972
RFC 354

            COMMENTS ON THE FILE TRANSFER PROTOCOL (RFC 354)
            ------------------------------------------------

   The following comments pertain to the File Transfer Protocol, NWG/RFC
   354.  The comments include errata, further discussion, emphasis
   points, and additions to the protocol.  I shall incorporate these
   comments into the main protocol document after we have had sufficient
   experience.

   1. Please note the following corrections:
       (i)    Page 2, line 15:  replace user-FTP by server-FTP.
       (ii)   Page 3, line 12:  replace III.A by III.C.
       (iii)  Page 15, last para, line 1:  replace user s by user is.
       (iv)   Page 28, line 21:  replace _CRCRLF_ by _CRLF_.
       (v)    Page 27, line 10:  replace 451,451 by 451.
       (vi)   Note that on Page 26, line 15 mode code is S|B|T|H.

   2. The language of RFC 354 reads that it is recommended for
      hosts to implement the default parameters.  The sense of the
      word recommended should be taken as required.  Thus the
      required minimum implementations for FTP servers is:

           Type - ASCII (8-bit bytes)
           Mode - Stream
           Structure - File
           Commands - RETR, STOR, USER (and PASS), SOCK and BYE

   3. The "Print File-ASCII" and "EBCIDIC Print File" types are
      incorrectly specified (pages 10 and 11, RFC 354).  The real
      problem with print files is of ASA (Fortran) vertical format
      control.  Instead of the two print file types, there should
      really be three types as described below:

           BCDIC - The sender transfers data using the EBCDIC
                    character code and 8-bit transfer byte size.
                    The _CRLF_ convention is used for vertical format
                    control.  This type will be used for efficient
                    transfer of EBCDIC files between systems which
                    use EBCDIC for their internal character
                    representation.

NWG/RFC 385 Page 2


           ASCII with ASA vertical format Control - This is the
                    "Print file-ASCII" defined in RFC 354.  The
                    server is to transform the data in accordance
                    with ASA (Fortran) vertical format control
                    procedures for printing on printers that
                    still use this standard.  The data is to be
                    transferred as 8-bit bytes.

           EBCDIC with ASA vertical format control - This is the
                    EBCDIC Print File defined in RFC 354.  The
                    server is to transform the data in accordance
                    with ASA (Fortran) vertical format control
                    standards but using the EBCDIC character code.
                    The data is to be transferred in 8-bit bytes.

      The new types are to be denoted by symbols E for EBCDIC, P
      for Print file-ASCII and F for Formatted (ASA standard)
      EBCDIC print file.  A discussion of the ASA vertical format
      control appears in NWG/RFC 189, Appendix C, and in
      Communications of the ACM, Vol 7, No. 10, p. 606, October
      1964.  According to the ASA vertical format control
      standards, the first character of a formatted record is not
      printed but determines vertical spacing as follows:

           Character    Vertical Spacing before printing
           ---------    --------------------------------
            Blank          One line
              0            Two lines
              1            To first line of next page
              +            No advance

      In addition to the above four, there are more characters
      (defined in Appendix C, RFC 189) which represent an IBM
      extension to the ASA standard.

   4. A comparison of "stream" and "text" modes is in order.  The
      advantages of "stream" mode are:
           1) The receiver need not scan the incoming bytes.
           2) It is usable with all data types.

      The disadvantages are:
           1) The EOF by closing the connection is not reliable.

           2) The EOR by ASCII _CRLF_ is unreliable as the _CRLF_
              really may be valid data rather than an EOR.  It is
              an EOR only if the sender and receiver have a _prior_
              agreement to that effect.

NWG/RFC 385 Page 2


   5. In the Block mode the protocol states that left-most bits not
      containing information should be zero.  It appears that some
      sites have difficulty sending null bytes in the beginning of
      a block.  Since it is really not necessary for these bytes to
      be zero, these bits are now defined to be "don't care" bits.

   6. In the use of block mode it is possible for two or more
      conditions requiring different descriptor codes (suspected
      errors and either end of record or end of file) to exist
      simultaneously.  Such a possibility may be handled by sending
      a separate EOR or EOF block with a zero byte count (this is
      allowed by the protocol).  Also it should be noted that an
      EOF is an implicit EOR.

   7. It needs to be emphasized again that the user-FTP must
      "listen" on the data socket prior to sending a command
      requiring a file transfer.  Specifically the user-FTP should
      not wait for a 255 reply (server data socket) before doing
      the "listen".  (The security check may be come later, as the
      data connection can be closed if connection is to a socket
      other than that specified by the 255 reply).  Although the
      protocol suggests that the 255 reply would be sent before
      making the connection, it does not guarantee that the 255
      reply would arrive before the initiating RFC at the user
      site.  The above argument also applies to receiving a a close
      (NCP-CLS) on the data connection before receiving a reply
      indicating the reason for the close (note assertion on page
      24, paragraph 3, RFC 354).

   8. Although the protocol does not restrict closing or leaving
      open the data connection in Block and Text modes, it should
      be emphasized that the closing of the data connection, if it
      is to be done at all, should be done immediately after the
      file transfer rather than just after a new transfer command
      is received.  This is because the server and user may have to
      test whether the data connection is open or not before doing
      a "listen" or an "init" respectively.

   9. It should be emphasized again that 'Type' supersedes 'Byte',
      and that the TYPE command should be sent before the BYTE
      command.

   10. It should be noted that both upper and lower case alphabetic
       characters are to be treated identically in the command
       syntax.  This applies also to the symbols for type, mode,
       and structure.  For example, 'A' and 'a' both indicate ASCII
       type.

NWG/RFC 385 Page 2


   11. It should be noted that in the 'LIST' command, the data
       transfer is over the data connection in type ASCII.

   12. The following reply code is to be added:

               454 FTP:  Cannot connect to your data socket.

       This is a fail response any of the commands requiring data
       transfer (including RETR, STOR, APPE, and LIST)

   13. Rather than use the append command for sending mail files, a
       new command 'MLFL' (for mail file) is defined.  The syntax
       of the mail file command is:

               MLFL <user>CRLF
               where
               <user> ::= <empty>| <NIC ident>| <sys ident>

       If the user field is empty or blank (one or more spaces),
       then the mail is destined for a printer or other designated
       place for site mail.  <NIC ident> refers to the standard
       identification described in the NIC Directory of Network
       Participant.  A serving host may keep a table mapping <NIC
       ident> into <sys ident>.  This would provide for uniform
       convenient usage.  <sys ident> is the user's normal
       identification at the serving HOST.  The use of <sys ident>
       would allow a network user to send mail to other users who
       do not have NIC identification but whose <sys ident> is
       known.

       The intent of this command is to enable a user at the user
       site to mail data (in form of a file) to another user at the
       server site.  It should be noted that the files to be mailed
       are transmitted via the data connection in ASCII type.
       These files should be appended to the destination user's
       mail by the server in accordance with serving Host mail
       conventions.  The mail my be marked as sent from the
       particular using HOST and the user specified by the 'USER'
       command.  The reply codes for the "MLFL" command are
       identical to that in the "APPE" command, as shown below:

              COMMAND         SUCCESS         FAIL
              -------         -------         ----
               MLFL            250             451,454,500-506
                Sec. reply     252             452,453

   14. The 'MLFL' command for network mail, though a useful and
       essential addition to the FTP command repertoire, does not

NWG/RFC 385 Page 2


       allow TIP users to send mail conveniently without using
       third hosts.  It would be more convenient for TIP users to
       send mail over the TELNET connection instead of the data
       connection as provided by the 'MLFL' command.  The following
       'MAIL' command is therefore defined to send mail via the
       TELNET connection:

               MAIL <user>CRLF

       the syntax of <user> is identical to that in the MLFL
       command described above.  After the 'MAIL' command is
       received, the server is to treat the following lines as text
       of the mail sent by the user.  The mail text is to be
       terminated by a line containing only a single period, that
       is the character sequence ".CRLF" in a new line.  The
       following new reply codes are defined to handle the mail
       command:

          350 Enter mail, terminate by a line with only a '.'
          256 Mail completed.

       The reply codes are:

              COMMAND         SUCCESS         FAIL
              -------         -------         ----
               MAIL            350             450,451,500-506
                Sec Reply      256

   15. An additional access control command called account (ACCT)
       is now defined to facilitate accounting in systems such as
       TENEX which require in addition to user and password, a
       separate account specification.  The 'ACCT' command is
       different from the 'PASS' command in that it is not
       necessarily related to the 'USER' command and may arrive at
       any time.  For example, a user may transfer different files
       using different accounts.  The 'ACCT' command has the same
       reply codes as the 'PASS' command (230 for success and 430-
       432,500-506 for fail).  Some servers may require that an
       account command must be sent before the user is "logged in".
       For suchcases the success reply to the 'PASS' command could
       be '330 Enter account'.

   16. Since password information is quite sensitive, it is
       desirable in general to "mask" it or suppress type out.  It
       appears that the server has really no fool-proof effective
       way to achieve this.  It is therefore the user-FTP process
       responsibility to hide the sensitive password information.

NWG/RFC 385 Page 2


   17. The FTP is an open-ended protocol designed for easy
       expandability.  Experimental commands may be defined by
       sites wishing to implement such commands.  These
       experimental commands should begin with the alphabetic
       character 'X'.  Standard reply codes may be used with these
       commands.  If new reply codes need to assigned, these
       should be chosen between 900 and 999.  If the experimental
       command is useful and of general interest, it shall be
       included in the FTP command repertoire.



       [ This RFC was put into machine readable form for entry ]
       [ into the online RFC archives by BBN Corp. under the   ]
       [ direction of Alex McKenzie.                      1/97 ]

AI ELI5

On this page
PROBLEMRFC 354 contained typos, ambiguous wording, and gaps such as unclear print file types and no way to send mail or supply an account.
MECHANISMSeventeen numbered comments fix errors, set a minimum server implementation, redefine print types, clarify data connection handling and add the MLFL, MAIL and ACCT commands.
WHY IT MATTERSThe author planned to fold these comments into the main protocol document after enough experience. The RFC was later updated by RFC 414.

§1Corrections and Minimum Server

These comments update RFC 354. The first lists six small corrections, such as replacing user-FTP by server-FTP on page 2 and _CRCRLF_ by _CRLF_ on page 28.

The second comment says the word recommended for default parameters should be read as required. A server therefore needs at least: type ASCII (8-bit bytes), mode Stream, structure File, and the commands RETR, STOR, USER (and PASS), SOCK and BYE. Case does not matter in command syntax or in the symbols for type, mode and structure, so A and a both mean ASCII.

The author fixes spelling slips and says which parts are not optional: a basic file server must do at least these few things.

§2Types, Modes and the Data Connection

The two print file types of RFC 354 are said to be incorrectly specified, because the real problem is ASA (Fortran) vertical format control. Three types are described instead, denoted E for EBCDIC, P for Print file-ASCII and F for formatted (ASA standard) EBCDIC print file. Under ASA control the first character of a record is not printed but sets spacing: blank for one line, 0 for two lines, 1 for the first line of the next page, and + for no advance.

Stream mode has the advantages that the receiver need not scan the bytes and that it works with all data types. Its disadvantages are that signalling end of file by closing the connection is not reliable, and that an end of record marked by CRLF is only valid if sender and receiver agree beforehand. In Block mode, unused left-most bits become "don't care" bits, and an end of file is an implicit end of record.

The user-FTP must listen on the data socket before sending a command that needs a transfer, and must not wait for the 255 reply. Any closing of the data connection should happen immediately after the transfer. A new reply, 454, means the server cannot connect to your data socket. Type supersedes Byte, so TYPE should be sent before BYTE.

The note explains how to mark the end of a page or a file, tells the receiving side to get its ears ready before the sender starts, and adds a new error message for when the connection cannot be made.

§3New Commands: MLFL, MAIL and ACCT

MLFL (mail file) replaces using the append command for mail files. The user field can be empty, a NIC identifier or a system identifier, and the mail file travels over the data connection in ASCII type. Its success reply is 250 or 252, and failures use 451, 452, 453, 454 and 500-506.

MAIL sends mail over the Telnet connection instead, which is easier for TIP users. After the command the server treats following lines as the mail text until a line containing only a single period. New replies are 350 (enter mail) and 256 (mail completed).

ACCT carries an account specification for systems such as TENEX. Unlike PASS it may arrive at any time. Because passwords are sensitive, masking them is the user-FTP process's responsibility, since the server has no fool-proof way to do it. Experimental commands should begin with X, with any new reply codes chosen between 900 and 999.

Three new buttons are added: one to send a letter as a file, one to type a letter directly, and one to say which account to charge. Anyone may try out their own new buttons if the name starts with X.

§4References