In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the difference between ftp port number 20 and 21, which is very detailed and has certain reference value. Friends who are interested must read it!
The difference between ftp port number 20 and 21 is: one is data port, the other is control port, the control port is generally 21, but the data port is not necessarily 20, which is related to the application mode of FTP, if it is active mode, it should be 20, if it is passive mode, it is decided by the negotiation between server and client.
The operating environment of this tutorial: windows7 system, Dell G3 computer.
One is the data port, the other is the control port, the control port is generally 21, but the data port is not necessarily 20, which is related to the application mode of FTP, if it is active mode, it should be 20, if it is passive mode, it is decided by the server and the client.
FTP Port mode and FTP Passive mode
When you troubleshoot a FTP question, the first question you need to ask is whether to use port mode or passive mode. Because the two behaviors are very different, the problems caused by the two modes are also different; in the past, the client defaulted to active (port) mode; recently, because of the security problems of Port mode, many client FTP applications default to Passive mode.
> 2.1 FTP Port mode
The FTP steps for Port mode are as follows:
1. The client sends a TCP SYN (TCP synchronization) packet to the well-known FTP control port 21 of the server segment, and the client uses a temporary port as its source port.
2. The server sends SYN ACK (synchronous acknowledgement) packet to the client. The source port is 21, and the destination port is the temporary port used on the client.
3. The client sends an ACK (acknowledgement) packet; the client uses this connection to send FTP commands, and the server uses this connection to send FTP responses
4. When a user requests a List request or initiates a request to send or receive files, the client software uses the PORT command, which contains a temporary port that the client wants the server to use when opening a data connection. The PORT command also contains an IP address, which is usually the customer's own IP address, and FTP also supports third-party (third-party) mode, where the client tells the server to open a connection to another host.
5. The temporary port on which the server sends a SYN packet to the client. The source port is 20, and the temporary port is the temporary port number that the client sends to the server in the PORT command.
6. The client sends a SYN ACK packet with the source port as the temporary port and the destination port as 20.
7. Send an ACK packet on the server side
8. The host that sends the data sends the data over this connection, and the data is sent in the form of a TCP segment (note: segment, layer 4 PDU) (some commands, such as STOR indicates that the client wants to send data, and RETR indicates that the server segment sends data). These TCP segments need ACK confirmation from the other party (note: because TCP protocol is a connection-oriented protocol)
9. When the data transfer is completed, the sending host ends the data connection with a FIN command, which requires another host to confirm with ACK, and another host to send a FIN command. This FIN command also requires the sending host to confirm with ACK.
10. The client can send more commands on the control connection, which can open and close other data connections; sometimes after the client ends, the client closes a control connection with the FIN command, the server confirms the client's FIN with ACK packets, the server also sends its FIN, and the client uses ACK to confirm.
The above is all the content of the article "what is the difference between ftp port number 20 and 21". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.