Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Active mode and passive mode of FTP

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "active mode and passive mode of FTP". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "active mode and passive mode of FTP".

FTP is an abbreviation for File Transfer Protocol (File transfer Protocol), which is used to transfer files between two computers. It is much more complicated than the HTTP,FTP protocol.

The reason for the complexity is that the FTP protocol uses two TCP connections, one is the command link, which is used to pass commands between the FTP client and the server, and the other is the data link, which is used to upload or download data.

FTP is a TCP-only service and does not support UDP. What is different is that FTP uses two ports, a data port and a command port (also known as a control port). Generally speaking, these two ports are 21 (command port) and 20 (data port). But the way FTP works, the data port is not always 20. This is the biggest difference between active and passive FTP.

FTP protocol has two working modes: PORT mode and PASV mode, which means active and passive in Chinese.

The PORT (active) connection process is that the client sends a connection request to the server's FTP port (default is 21), and the server accepts the connection and establishes a command link. When it is necessary to transmit data, the client uses the PORT command on the command link to tell the server, "I have opened the XXXX port, you come and connect me". So the server sends a connection request from port 20 to the client's XXXX port and establishes a data link to transmit data.

The PASV (passive) connection process is that the client sends a connection request to the server's FTP port (the default is 21), and 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 have opened the XXXX port, you come and connect to me." So the client sends a connection request to the server's XXXX port and establishes a data link to transmit data.

As can be seen from the above, the command link connection methods of the two modes are the same, while the data link establishment methods are completely different. And that's the complexity of FTP.

All connections are initiated by the client. The client port number selects a random port number greater than 1024, and the server port number is 20 (transfer data) and 21 (control information).

Note: active mode is generally not used in networks with firewalls, while half of them use passive mode when there is a firewall.

Active passivity is relative to the server, the server is established for data transmission, that is, passive, conversely, active

Thank you for your reading, the above is the content of "active mode and passive mode of FTP". After the study of this article, I believe you have a deeper understanding of the active mode and passive mode of FTP, and the specific use needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report