Friday, March 8, 2013

Difference between Active & Passive FTP

FTP is an unusual protocol in that it uses two ports 

TCP PORT 20 ( DATA PORT) 
TCP PORT 21 (CONTROL PORT)


 (FTP is superior to HTTP for transferring large files because it uses different ports for command and data) 

Active FTP :- The client initiates a connection on the server’s command port. The server then initiates a connection with the client from its data port.

Passive FTP:-  The client initiates both connections with the server, which remains “passive”.

Active FTP may cause problems if your client is behind a firewall. From the firewall’s point of view, the FTP server that is trying to initiate a connection with your client looks like an intruder and is usually blocked. This is why many users have difficulty using FTP to download files from behind a firewall.


The sequence of events for active FTP is:
  1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as 'ls' and 'get' are sent over this connection.
  2. Whenever the client requests data over the control connection, the server initiates data transfer connections back to the client from port 20 of the server, and the destination port is a high port (greater than 1024) on the client.
  3. Thus the ls listing that you asked for comes from port port 20 of server to high port on client (not on the port 21 on which the client made request).

Passive FTP works differently:
  1. Your client connects to the FTP server by establishing an FTP control connection to port 21 of the server. Your commands such as ls and get are sent over that connection.
  2. Whenever the client requests data over the control connection, the client initiates the data transfer connections to the server. The source port of these data transfer connections is always a high port on the client with a destination port of a high port on the server.

ACTIVE FTP is default in WINDOWS
PASSIVE FTP is default in LINUX

Voip Troubleshooting--Wireshark




Visit the below link for a very good description of Wireshark for analyzing Voip Calls.
http://wiki.voipinnovations.com/Wireshark.ashx

tcpdump -w -p -n -s 0
-w = output file
-p=dont start in promiscuous mode
-n=no name resolution
-s 0=Full Frame, not only first bytes (its zero)