Author: iamlaosong
Download data from the data downloading server at the Headquarters. However, you can only download files by using commands at the command prompt. You can use cuteftp or other tools to access the directories, but you cannot download the data, cuteftp stops there.
After checking data and tests on the internet, find the problem. The original connection mode is incorrect. FTP has two transmission modes: Active Mode and passive mode, change PASV mode to PORT mode, which is the setting interface of cuteftp (menu: Edit-> global settings ):
The problem has been solved, but I still need to know why, so I found the following information and reorganized it:
Two types of connections are required for a complete FTP file transfer. One is a file transfer command called a control connection, and the other is a real file transfer called a data connection.
1. Control connection
When the client wants to establish an upload/download data transmission with the FTP server, it first initiates a connection establishment request to the TCP port 21 of the server. The FTP Server accepts requests from the client, after the connection is established, the connection is called an FTP control connection.
2. Data Connection
After the FTP control connection is established, you can start transferring files. The file transfer connection is called an FTP data connection. FTP data connection is the process of FTP data transmission. It has two transmission modes.
The PORT connection process is as follows:
The client sends a connection request to the FTP port (21 by default) of the server. The server accepts the connection and establishes a command link. When data needs to be transmitted, the client uses the PORT command on the command link to tell the server: "I opened PORT XXXX and you came to connect to me ". The server sends a connection request from Port 20 to port XXXX of the client and establishes a data link to transmit data.
The PASV (passive) connection process is as follows:
The client sends a connection request to the FTP port (21 by default) of the server. The server accepts the connection and establishes a command link. When data needs to be transmitted, the server uses the PASV command on the command link to tell the client: "I opened port XXXX, and you came to connect to me ". Therefore, the client sends a connection request to port XXXX of the server and establishes a data link to transmit data.
To put it simply, the PORT (active) method is that the client opens a PORT to connect the server, and The PASV (passive) method is the opposite.