FTP PASV (passive) mode

Ftp clients tell us to switch to PASV mode if you are behind firewall. Why so?

The answer lies in the way FTP protocol works between client and server.

There are 2 channels created between client and server: 1 for commands and 2nd for data.
Let's take this example:
You wanna receive a file from server. Client sends the command to server to receive a file through first channel. Now the 2nd channel has to be established to transfer the file from server to client.
In normal mode, client starts listening on a port (act as server) and tells the server its ip and the port. Now server connects to client at the specified port and sends file.
When there is firewall on client, it might block server to connect to client and that's the reason PASV (passive) mode is required. In passive mode, client tells the server to enter passive mode in response to that server listens on a port and sends the port number to client where client connects to the server at the specified port and receives the file.

Comments

Popular posts from this blog

Asp.Net concurrent requests from same session