Parse the Ftp protocol's two working modes-Linux Enterprise Application-Linux server application information. The following is a detailed description. Two Ftp working modes: active and passive
FTP is a data transmission Protocol. It has two connection modes: active and passive ).
The following describes how FTP connections are established:
In active mode (General preset mode ):
The FTP client enables a randomly selected TCP port to call the port 21 request of the FTP server to establish a connection. After Three-Way Handshake is completed, the connection is established successfully, but this is only the establishment of the Command Channel.
When the two ends need to transmit data, the client uses a port command to tell the server through the command channel, and the client can use another TCP port as the data channel.
Then the server uses port 20 to establish a data connection with the TCP port just described by the client. Note: The connection direction is from the server to the client, and a SYN flag exists in the TCP group.
Then the client returns an ACK flag validation group and completes another Three-Way Handshake process. At this time, the data connection can be successfully established. Start data transmission.
In passive mode:
The FTP client enables a randomly selected TCP port to call the port 21 request of the FTP server to establish a connection and complete the establishment of the Command Channel.
When the two ends need to transmit data, the client sends a PASV command to the server through the command channel, and requests to enter the passive transmission mode.
Then the server selects a TCP port as in step 2nd of the preceding normal mode and uses the command channel to tell the client.
Then the client uses another TCP port to call the TCP port that the server just told to establish a data channel. In this case, the group contains SYN flag.
Server Returns An ACK group after confirmation. Complete the handshake process and establish a data channel.
Start data transmission. In actual use, the active mode is used to log on to some FTP servers that are not installed with a firewall on the host, or FTP servers that are deployed on the client side! Passive mode (PASV for short) is used to log on to the FTP server that is set up under firewall protection and opened on the host!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service