Proposed Extension
FTP could be modified to support server-server interaction by:
-
making the establishment of data connections symmetric, or;
-
providing a mechanism for instructing a server to establish its end of a data connection as if it were a user.
The second alternative probably requires fewer changes to the existing protocol.
The following proposed extension to FTP uses the second method. It involves the addition of a single new command (LSTN) and minor modifications to several existing commands (SOCK, APPE, RETR, STOR):
a. The LSTN (Listen) command requests the FTP server to allocate a socket for use as a data connection. To establish the corresponding data connection the server is to "listen" on the socket allocated when an appropriate transfer command is given.
syntax:
LSTN <direction> CRLF
where <direction> is either "S" for send or "R" for receive.
The server responds to LSTN by:
-
refusing to allocate such a socket, or:
-
sending the user the number of the socket allocated (the 255 FTP server data socket reply could be used for this purpose).
b. Receipt of an appropriate STOR, RETR or APPE command following a successful LSTN command causes the server to "listen" for an RFC for the socket allocated. Data transfer may proceed after the server receives an RFC for the socket and responds with a matching RFC. Once established, a data connection corresponding to a successful LSTN command has the same duration as one established in the usual way.
c. The user may insure the security of his data transfer by using the SOCK command to instruct the server to accept an RFC for the listening socket only if it is from a specified host and socket.
d. The SOCK command is modified in two ways:
-
On success the reply must be the 255 FTP server data socket reply; that is, the 255 reply can not be deferred until receipt of a data transfer command. (This is to allow the user to transmit the server's response to the program at the third site; see the example below.)
-
After a LSTN command the SOCK command is to be interpreted by the server as specification of the acceptable RFC for subsequent data transfer command that use the allocated socket.