Skip to main content

Declarative Specifications

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.

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