For FTP there is two channel, data channel and command channel.
Data channel uses 20 and command channel uses 21 protocol.
What is Active mode FTP ?
1. A user connects from a random port on a file transfer client to port 21 on the server.
It sends the PORT command, specifying what client-side port the server should connect to. This port will be used later on for the data channel and is different from the port used in this step for the command channel.
2. The server connects from port 20 to the client port designated for the data channel. Once connection is established, file transfers are then made through these client and server ports.
What is passive mode FTP ?
1. The client connects from a random port to port 21 on the server and issues the PASV command. The server replies, indicating which (random) port it has opened for data transfer.
2.The client connects from another random port to the random port specified in the server’s response. Once connection is established, data transfers are made through these client and server ports.
Some time users can’t connect to FTP server, it is because the client machine’s firewall is blocking the connection. We can use passive type connection for avoiding those type of issues.