ftp stands for File Transfer Protocol, which is a set of standard protocols for file transfer on the network, using client or server mode. It belongs to the application layer of the network transfer protocol.
Through the FTP protocol, we can perform file upload (Upload) or download (Download) actions with the FTP server on the Internet.
FTP is an 8-bit client-server protocol that can operate on any type of file without further processing, just like MIME or Unicode. However, FTP has extremely high latency, which means that the time between starting the request and receiving the required data for the first time will be very long; and some lengthy login processes must be performed from time to time.
FTP mode
FTP supports two modes: Standard (PORT mode, active mode), Passive (PASV, passive mode).
Active mode:
The FTP client first establishes a connection with the server's TCP 21 port to send commands. When the client needs to receive data, it uses this channel. Send PORT command. The PORT command contains the port used by the client to receive data. When transmitting data, the server connects to the client's designated port through its own TCP 20 port to send data. The FTP server must establish a new connection with the client to transfer data.
Passive mode:
Establishing a control channel is similar to active mode, but the Pasv command is sent after the connection is established. After receiving the Pasv command, the server opens a temporary port (the port number is greater than 1023 and less than 65535) and notifies the client of the request to transmit data on this port. The client connects to this port of the FTP server, and then the FTP server will transmit data through this port.
The default port of FTP
By default, the FTP protocol uses two TCP ports, 20 and 21, of which 20 is used Transmit data, 21 is used to transmit control information. However, whether to use 20 as the port for transmitting data is related to the transmission mode used by FTP.
If active mode is used, the data transmission port is 20; if passive mode is used, the final port to be used must be decided through negotiation between the server and the client.
The above is the detailed content of What does ftp mean in Chinese?. For more information, please follow other related articles on the PHP Chinese website!