Wednesday, April 4, 2012

Active FTP vs Passive FTP


Active FTP :   
     command : client >1024 -> server 21   
     data    : client >1024 <- server 20   
 
Passive FTP :   
     command : client >1024 -> server 21   
     data    : client >1024 -> server >1024



FTP operates on the application layer of the OSI model, and is used to transfer files using TCP/IP.[3] To do so, an FTP server has to be running and waiting for incoming requests.[3] The client computer is then able to communicate with the server on port 21.[3][4] This connection, called the control connection,[5] remains open for the duration of the session. A second connection, called the data connection,[2][5] can either be opened by the server from its port 20 to a negotiated client port (active mode), or by the client from an arbitrary port to a negotiated server port (passive mode) as required to transfer file data.[2][4] The control connection is used for session administration, for example commands, identification and passwords exchanged between the client and the server using a telnet-like protocol.[6] For example "RETR filename" would transfer the specified file from the server to the client. Due to this two-port structure, FTP is considered an out-of-band protocol, as opposed to an in-band protocol such as HTTP.[6]

Ref:ftp modes
wiki FTP
FTP session sequence

No comments:

Post a Comment