After the control connection to port 21 is created, the FTP server sends the 220 (service ready) response on the control connection.
The client sends the USER command.
The server responds with 331 (user name is OK, a password is required).
The client sends the PASS command.
The server responds with 230 (user login is OK).
The client issues a passive open on an ephemeral port for the data connection and sends the PORT command (over the control connection) to give this port number to the server.
The server does not open the connection at this time, but prepares itself for issuing an active open on the data connection between port 20 (server side) and the ephemeral port received from the client. It sends the response 150 (data connection will open shortly).
The client sends the TYPE command.
The server responds with the response 200 (command OK).
The client sends the STRU command.
The server responds with 200 (command OK).
The client sends the STOR command.
The server opens the data connection and sends the response 250.
The client sends the file on the data connection. After the entire file is sent, the data connection is closed. Closing the data connection means end-of-file.
The server sends the response 226 on the control connection.
The client sends the QUIT command or uses other commands to open another data connection for transferring another file. In our example, the QUIT command is sent.
The server responds with 221 (service closing) and it closes the control connection.
in point 14.
- The client sends the file on the data connection. After the entire file is sent, the data connection is closed. Closing the data connection means end-of-file.
does the client close the data connection?
if so how does it do that. just disconnects! or sends a disconnect command using the control connection?