File transfer protocol is used to transfer files between a client and a server.
FTP uses 2 basic channels to operate.
- Command Channel
- Data Channel
Command Channel is used by the server or the client to send commands and receive replies. The Data Channel transmits the actual data requested.
FTP can operate either in passive mode or active mode
In active mode, the client requests data by connecting to the server on a port by default its port 21. The client also specifies which port the server should use to transmit data on the data channel by default it’s 20.
Often this mode gets blocked by firewall because the server is connecting to a port not specified by it.
Passive mode provides that workaround. Instead of providing the port the client requests a port from the server to connect to for data transfer.