MHB FTP Port 21: Client/Host Usage & Alternatives

  • Thread starter Thread starter tmt1
  • Start date Start date
Click For Summary
The standard port for FTP is indeed 21, which the server uses to listen for incoming connections. The client, however, typically uses an arbitrary port number, usually in the 5000+ range, for its connection. When a connection is established, the server creates a new socket on a different port in the same range to handle the communication, ensuring that port 21 remains available for new connections. This behavior can be observed using the netstat command-line utility.
tmt1
Messages
230
Reaction score
0
I'm reading a text that is saying that the standard port for ftp is 21.

Do both the client/host use port 21? And what is the port is already being used, does it go to a different port?
 
Technology news on Phys.org
tmt said:
I'm reading a text that is saying that the standard port for ftp is 21.

Do both the client/host use port 21? And what is the port is already being used, does it go to a different port?

Hi tmt,

The server listens on port 21.
Locally the client gets assigned an arbitrary port number, usually in the 5000+ range.
When a connection is made, the server usually spawns off a new socket on a new port, also in the 5000+ range.
That way port 21 on the server remains reserved for listening to new connections.

You can see this when you run the command line utility [m]netstat[/m] with the appropriate parameters.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K