Difference between Active ftp and passive ftp
FTP have two types :
1. Active FTP and
2. Passive FTP.
Ftp session is a TCP session made up of two steps, the first connection on TCP port 21 known as a control connection and the second connection known as a data connection usually on TCP port 20. The issue arises when the second port is selected at random by applications and this data port is not always port 20.
Active FTP session:
In an Active FTP session the following steps occurs.
==> The client initiates the session from a random source port (Port X >1023) to the FTP server on TCP port 21.
2. The TCP Handshake will occur.
3. The client then sends the “FTP” port command from a source port (Port X+1) to the FTP server.
4.The server will then connect back from its local data port 20 to the client port (X+1)
Firewall issues for Active FTP session occurs on the client side as the FTP server tries to connect back to the client on TCP port 20 which is often blocked by the client Firewall.
Passive FTP Session:
In a passive FTP session the following steps occurs.
1. The client initiates the session from a random source port (Port X >1023) to the FTP server on TCP port 21.
2. The TCP Handshake will occur.
3. The client then sends the “PASV” port command from a source port (Port X+1) to the FTP server.
4. The server will then open one of its random ports (X >1023) and send this port X back to the client.
5. The client will then perform data transfer from its source port (PortX+1) to the FTP server port X.
Firewall issues for Passive FTP session occurs on the server side as the FTP server requires connection to a random data port instead of port 20 and the server side firewall will block this traffic.