File Transfer Protocol (FTP) is used to transfer files between computers over a local area network and the Internet. This technology is one of the most popular and allows both downloading and uploading the necessary data to remote servers.
To use the protocol, the user needs to install a special client program that will connect to a remote computer. To make a connection, the user needs to specify the data of the server with which the connection is made. If the data was specified successfully, the program window displays the directories open for viewing by the server.
Using the interface elements of the application used, you can either move the folders on the server to your computer, or upload data to this server from your file system. Operations with files carried out via FTP clients practically do not differ from similar ones when working with a computer system. For example, you can copy, cut and delete various folders and selected documents.
When an attempt is made to connect to a remote server through the program, a separate network port opens, through which the necessary request for connection and file exchange is transmitted. Usually port 21 and a separate ftp: // protocol are used to establish a connection, which is specified when configuring the client. The program also announces to the server the need to use a specific active or passive connection type, on which the server's response and connection establishment depends on the exchange of information.
With an active connection, the server automatically opens a specific port for the user, through which data is exchanged. All information from the server is transmitted over the created connection. In the active mode of data exchange, port 20 is usually selected, however, the remote machine can select an arbitrary value that does not exceed 1024. In passive mode, the server selects any port, the numerical value of which exceeds 10000. After that, the machine associates the connection with the current session and sends the necessary instructions and values to the client computer, which starts using the port allocated by the server for connecting and transferring information.
It is worth noting that most modern FTP clients prefer to establish a passive connection when trying to transfer data from the server. Once the connection is established, file exchange is possible. Thus, the client computer determines the type of connection, and the server informs whether it is capable of transferring data on the specified conditions.