F5 GLOSSARY

Passive Mode (FTP)

What is Passive Mode (FTP)?

Passive mode, also referred to as "PASV mode," is one of the operational modes of FTP (File Transfer Protocol), which is used to transfer files between two computers.

In FTP, the client initiates a connection to the server, authenticates the user via login credentials, and performs file transfers such as uploading files to the server or downloading files from the server. FTP operates using two TCP connections:

  • Control Connection: Used for transmitting control commands and responses. The server listens for connection requests on TCP port 21, which are always initiated by the client.
  • Data Connection: Used for transferring files. This connection can be initiated either by the client or the server. When the server initiates the data connection, it works in Active Mode; when the client initiates it, the mode is referred to as Passive Mode.

In Active Mode, the server sets up a data connection from its TCP port 20 to a random port on the client side. This data connection is then used for exchanging file data. Conversely, in Passive Mode, the server informs the client via the control connection about the port it will use for the data connection. The client then uses this information to establish the data connection to the server.

Passive mode is commonly used when uploading files to web servers provided by hosting or cloud providers. Most clients connect to the internet through firewalls or NAT systems, which block incoming connections initiated from the server. Passive mode resolves this by ensuring the client initiates the data connection.