Active and Passive FTP modes

There are two File Transfer Protocol (FTP) connection methods--Active and Passive (PASV) mode. These modes determine whether the client or server establishes the data connection, and over which ports the transfer is made.

In Active mode, the client opens the listening port, and then tells the server on what IP address and port it is to connect for the transfer. First, the client sends the PORT command with several arguments that tell the server where to connect to the client. Because firewalls typically block incoming communication, a firewall connected to a client may block the server's attempt to connect, causing an unsuccessful transfer.

In Passive mode, the server opens the listening port, and then tells the client on which of its ports to connect for the transfer. First, the client sends the PASV command to the server to tell the client how it is to connect to the server. In response, the server sends the IP address and port to which the client should connect for the transfer. In this case, the client initiates the connections to the server, eliminating the client-side firewall problem caused when the server attempts to connect to the client.

When to use each mode