Skip to main content

FTP Active vs. Passive Mode

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 to communicate in active mode:


1. A Command Port on Port 21
2. A Data Port on Port 20

Active mode is the default FTP Communication mode and starts with the FTP Client selection of two ports: n and n+1. The FTP Client will use port n to initiate a connection with the Server on port 21. On server response, the FTP Client sends the port command, this commands instruct the server on which port to use for data communication.

It is the server that initiates the data communication from port 20 to the FTP clients data port (n+1).


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

When using passive mode, the client initiates communications on the command and data ports.












Popular posts from this blog

Artificial neural network (ANN)

An  artificial neural network (ANN) , usually called "neural network" (NN), is a  mathematical model  or  computational model  that tries to simulate the structure and/or functional aspects of  biological neural networks . It consists of an interconnected group of  artificial neurons  and processes information using a  connectionist  approach to  computation . In most cases an ANN is an  adaptive system  that changes its structure based on external or internal information that flows through the network during the learning phase. Modern neural networks are  non-linear statistical   data modeling  tools. They are usually used to model complex relationships between inputs and outputs or to  find patterns  in data. Ref:  http://en.wikipedia.org/wiki/Artificial_neural_network