FTP Active Mode vs. Passive Mode

by Michal Rogozinski 8. August 2009 10:07

FTP is based on Transmission Control Protocol (TCP) and has a connection. It has no connectionless User Datagram Protocol (UDP) component. FTP requires two ports for communication: a command port and a data port. Port 21 is typically the command port at the server; port 20 is the typical data port then using active mode FTP.

Active mode FTP communications is the default mode and starts with the client selection of two ports: n and n+1. The client will use port n to initiate communications to port 21 of the server. When the server responds, the client sends a port command. This command instructs the server which port to use for data communications. It is the server that initiates data communications from port 20 to the client’s data port (n+1). If the client has a firewall installed, the server may be blocked from initiating communications to the client on the data port.

Passive mode FTP communications can be used to correct the problem with active mode communications. Passive mode starts with the client selection of two ports: n and n+1. The client uses port n to initiate communications to port 21 of the server. When the server responds, the client sends a pasv command to the server, the server selects a random port p to use for data communications and sends the port (n+1) to the server’s data port (p).

Notice than when using passive mode, the client initiates communications on the command and data ports. This fixes the problem of the client having a firewall installed that blocks the server’s request to initiate communications on the data port.

Tags:

Software Development

Comments

3/7/2010 2:30:50 PM #

get rid of acne scars

You're soooo talented in writing. God is really utilizing you in tremendous methods. You're doing a excellent job! This was a wonderful blog!

get rid of acne scars People's Republic of China | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Michal Rogozinski

Michal Rogozinski

 

 

Contact me via email  E-mail    My status  Skype me

My ScheduleFree/Busy schedule

 

Profile for microg