File Transfer Protocol uses two TCP ports,one for control and one for data transfer.It transfer Files in a Heterogeneous Host Environment. it has two modes -
1)Active mode FTP :=Client connect from a random unprivileged port (n > 1023) to the server command port (21) and sends port command to tell server to connect to n+1 port. The server connects from it’s data port (20) to the client data port (n+1) .
2)Passive mode FTP := Client opens two random unprivileged ports ( n > 1023 and n+1; ex 1026 and 1027) and connects the first port (n) to server command port 21 and issues a pasv command ; client connects to servers specified data port, server completes connection.
Data is transmitted as streams,block or in compressed form..Data transmission depends upon following factors like frequency, bandwidth, size of packet and network traffic..
While transferring data over the network, four data representations can be used:-
1) ASCII mode: used for text. Data is converted, if needed, from the sending host’s character representation to “8-bit ASCII” before transmission, and (again, if necessary) to the receiving host’s character representation. As a consequence, this mode is inappropriate for files that contain data other than plain text.
2) Image mode (commonly called Binary mode): the sending machine sends each file byte for byte, and the recipient stores the bytestream as it receives it.
3)EBCDIC mode: use for plain text between hosts using the EBCDIC character set. This mode is otherwise like ASCII mode.
4)Local mode: Allows two computers with identical setups to send data in a proprietary format without the need to convert it to ASCII.