Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just want to check if my understanding of ftp is correct. An ftp server listens at port 21. A client establishes a connection to the ftp server using a local ephemeral port that connects to the ftp server's port 21. When the ftp server sends a file to the client, it sends it from port 20, to an ephemeral port on the client's computer that is different from the one used to connect to port 21.

Is that correct? Also, what happens if multiple computers try to contact the ftp server at the same time? Do they all connect to port 21? Is there a limit to the number of simultaneous connections that can be open at a port?

share|improve this question

1 Answer 1

up vote 14 down vote accepted

Your understanding is correct.

A server port can always be accessed by multiple clients, because a TCP session is identified by 4 elements: client IP address + client port + server IP address + server port, not by the server port only.

There is also an FTP passive mode, in which it is the client that initiates the data connection to an ephemeral port on the server. This allows passing FTP traffic through some firewall or NATting devices.

share|improve this answer
1  
I found slacksite.com/other/ftp.html the best site to help understand the difference between active and passive FTP. You're recommended to read it. –  Lekensteyn Feb 21 '11 at 16:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.