search
HomeCommon ProblemWhat is the difference between ftp port numbers 20 and 21?

The difference between ftp port numbers 20 and 21 is: one is the data port and the other is the control port. The control port is generally 21, but the data port is not necessarily 20. This is related to the application mode of FTP. If it is Active mode should be 20. If it is passive mode, it is determined by negotiation between the server and the client.

What is the difference between ftp port numbers 20 and 21?

The operating environment of this tutorial: Windows 7 system, Dell G3 computer.

One is the data port and the other is the control port. The control port is generally 21, while the data port is not necessarily 20. This is related to the FTP application mode. If it is active mode, it should be 20. If it is passive Mode, determined by negotiation between the server and the client

FTP Port mode and FTP Passive mode

When you troubleshoot an FTP problem, the first question you have to ask is to use Is it in port mode or passive mode. Because these two behaviors are very different, the problems caused by these two modes are also different; in the past, the client defaulted to active (port) mode; recently, due to the security issues of Port mode, many client FTP applications defaulted to Passive model.

 >>2.1 FTP Port mode

The FTP steps in Port mode are as follows:

1. The client sends a TCP SYN (TCP synchronization) packet to the server segment. FTP control port 21, the client uses the temporary port as its source port;

2. The server sends a SYN ACK (synchronization confirmation) packet to the client, the source port is 21, and the destination port is the client The temporary port used on the server;

3. The client sends an ACK (confirmation) packet; the client uses this connection to send FTP commands, and the server uses this connection to send FTP responses;

4. When the user requests a list request or initiates a request to send or receive a file, the client software uses the PORT command. This command contains a temporary port that the client hopes the server will use when opening a data connection. Temporary port; the PORT command also contains an IP address. This IP address is usually the client's own IP address, and FTP also supports third-party mode. In third-party mode, the client tells the server to open a connection with another host. Connection;

5. The server sends a SYN packet to the client's temporary port. The source port is 20. The temporary port is the temporary port number sent by the client to the server in the PORT command;

6. The client uses the source port as the temporary port and the destination port is 20 to send a SYN ACK packet;

7. The server sends an ACK packet;

8. The host sending the data uses This connection is used to send data, and the data is sent in the form of TCP segments (note: segment, PDU of layer 4) (some commands, such as STOR indicates that the client wants to send data, RETR indicates that the server segment sends data), these TCP segments require each other Perform ACK confirmation (Note: Because the TCP protocol is a connection-oriented protocol)

9. After the data transmission is completed, the host sending the data ends the data connection with a FIN command. This FIN command requires another The host confirms with ACK, and the other host also sends a FIN command. This FIN command also requires the host sending the data to confirm with ACK;

10. The client can send more commands on the control connection. This Additional data connections can be opened and closed; sometimes after the client ends, the client uses the FIN command to close a control connection, and the server uses an ACK packet to confirm the client's FIN. The server also sends its FIN, and the client uses ACK to confirm.

For more computer-related knowledge, please visit the FAQ column!

The above is the detailed content of What is the difference between ftp port numbers 20 and 21?. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
deepseek web version official entrancedeepseek web version official entranceMar 12, 2025 pm 01:42 PM

The domestic AI dark horse DeepSeek has risen strongly, shocking the global AI industry! This Chinese artificial intelligence company, which has only been established for a year and a half, has won wide praise from global users for its free and open source mockups, DeepSeek-V3 and DeepSeek-R1. DeepSeek-R1 is now fully launched, with performance comparable to the official version of OpenAIo1! You can experience its powerful functions on the web page, APP and API interface. Download method: Supports iOS and Android systems, users can download it through the app store; the web version has also been officially opened! DeepSeek web version official entrance: ht

In-depth search deepseek official website entranceIn-depth search deepseek official website entranceMar 12, 2025 pm 01:33 PM

At the beginning of 2025, domestic AI "deepseek" made a stunning debut! This free and open source AI model has a performance comparable to the official version of OpenAI's o1, and has been fully launched on the web side, APP and API, supporting multi-terminal use of iOS, Android and web versions. In-depth search of deepseek official website and usage guide: official website address: https://www.deepseek.com/Using steps for web version: Click the link above to enter deepseek official website. Click the "Start Conversation" button on the homepage. For the first use, you need to log in with your mobile phone verification code. After logging in, you can enter the dialogue interface. deepseek is powerful, can write code, read file, and create code

How to solve the problem of busy servers for deepseekHow to solve the problem of busy servers for deepseekMar 12, 2025 pm 01:39 PM

DeepSeek: How to deal with the popular AI that is congested with servers? As a hot AI in 2025, DeepSeek is free and open source and has a performance comparable to the official version of OpenAIo1, which shows its popularity. However, high concurrency also brings the problem of server busyness. This article will analyze the reasons and provide coping strategies. DeepSeek web version entrance: https://www.deepseek.com/DeepSeek server busy reason: High concurrent access: DeepSeek's free and powerful features attract a large number of users to use at the same time, resulting in excessive server load. Cyber ​​Attack: It is reported that DeepSeek has an impact on the US financial industry.

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment