Skip to main content

8. CONNECTION ESTABLISHMENT

The FTP control connection is established via TCP between the user process port U and the server process port L. This protocol is assigned the service port 21 (25 octal), that is L=21.

Control Connection​

The control connection follows the Telnet protocol. At the initiation of the user, standard FTP commands are generated by the user-PI and transmitted to the server process via the control connection. FTP replies are sent from the server to the user in response to the commands. Whenever multiple replies are sent, they must be easily distinguished.

The user and server both use the Telnet protocol on the control connection and the end of a command is denoted by the Telnet EOL character sequence. The reply is similarly terminated. The character sequence is Carriage Return followed by Line Feed (CRLF).

Data Connection​

The data connection is established for the transfer of data between a user-DTP and a server-DTP (or two server-DTP's). The direction of data transfer and the specifics of the data connection are determined by the command which opens the data connection. The data connection uses the same protocol, either TCP or UDP, as the control connection.

The default data connection port is the adjacent port to the control connection port (i.e., L-1). However, the user may specify some other port if desired, using the PORT command. If the server is to be connected to another server, then it is possible that the second server will specify the data port.