Skip to main content

Declarative Specifications

Minimum Implementation​

In order to make FTP workable without needless error messages, the following minimum implementation is required for servers:

TYPE - ASCII Non-print
MODE - Stream
STRUCTURE - File
Record
BYTE - 8
COMMANDS - USER, BYE, SOCK,
TYPE, BYTE, MODE, STRU,
for the default values
RETR, STOR,
NOOP.

The initial default values for transfer parameters are:

TYPE - ASCII Non-print
BYTE - 8
MODE - Stream
STRU - File

All Hosts must accept the above as the standard defaults.

Connections​

The server protocol interpreter shall "listen" on Socket 3. The user or user protocol interpreter shall initiate the full-duplex TELNET connections performing the ARPANET standard initial connection protocol (ICP) to server Socket 3. Server- and user- processes should follow the conventions of the TELNET protocol as specified in NIC #7104. Servers are under no obligation to provide for editing of command lines and may specify that it be done in the user Host. The TELNET connections shall be closed by the server at the user's request after all transfers and replies are completed.

The user-DTP must "listen" on the specified data sockets (send and/or receive); these may be the default user sockets (U+4) and (U+5) or a socket specified in the SOCK command. The server shall initiate the data connection from his own fixed sockets (S+2) and (S+3) using the specified user data socket and byte size (default - 8 bits). The direction of the transfer and the sockets used will be determined by the FTP service command.

When data is to be transferred between two servers, A and B (refer to Figure 2), the user-PI, C, sets up TELNET connections with both server-PI's. He then sends A's fixed sockets, S(A), to B in a SOCK command and B's to A; replies are returned. One of the servers, say A, is then sent a PASV command telling him to "listen" on his data sockets rather than initiate an RFC when he receives a transfer service command. When the user-PI receives an acknowledgment to the PASV command, he may send (in either order) the corresponding service commands to A and B. Server B initiates the RFC and the transfer proceeds. The command-reply sequence is listed below where the messages are vertically synchronous but horizontally asynchronous:

User-PI - Server A                User-PI - Server B
------------------ ------------------

C->A : ICP C->B : ICP
C->A : SOCK HOST-B, SKT-S(B) C->B : SOCK HOST-A, SKT-S(A)
A->C : 200 Okay B->C : 200 Okay
C->A : PASV
A->C : 200 Okay
C->A : STOR C->B : RETR

The data connection shall be closed by the server under the conditions described in the Section on Establishing Data Connections. If the server wishes to close the connection after a transfer where it is not required, he should do so immediately after the file transfer is completed. He should not wait until after a new transfer command is received because the user-process will have already tested the data connection to see if it needs to do a "listen"; (recall that the user must "listen" on a closed data socket BEFORE sending the transfer request). To prevent a race condition here, the server sends a secondary reply (257) after closing the data connection (or if the connection is left open, a "file transfer completed" reply (252) and the user-PI should wait for one of these replies before issuing a new transfer command.