FTP (File Transfer Protocol)
The FTP (File Transfer Protocol) is another important Application Layer protocol of the TCP/IP protocol suite. The FTP (File Transfer Protocol) is used to send and receive electronic files from one computer to another computer. Similar to TELNET, FTP was also evolved in early 1970s. The original specification for the FTP (File Transfer Protocol) was published by Abhay Bhushan as RFC 114 on 16 April 1971. The current specifications of FTP are published on October 1985, as RFC 959. FTP commands are used to control file transfer between two computers. The FTP (File Transfer Protocol) supports both binary and text files, of different sizes and different formats. Unlike TFTP (Trivial File Transfer Protocol), FTP (File Transfer Protocol) supports user authentication.
Unencrypted FTP Communication
Similar to TELNET, long back when FTP was designed, the internet was only at universities and research centers. There was no much security risk those days. One main point to remember is that, FTP (File Transfer Protocol) sends its traffic unencrypted. Unencrypted data transfer can cause leak of data and user authentication details.
Please visit following link to learn why plain FTP is not secure.
Types of FTP Connections
There are two different types of FTP connections. When you connect to an FTP Server from a FTP Client, two FTP connections over TCP are created. 1) FTP Connection (Control connection) and 2) FTP-DATA Connection (Data transfer connection).
1 - FTP Connection (Control connection)
When a user wants to transfer a file from a FTP Server, FTP creates a TCP connection to the FTP Server, for exchange of FTP control messages (mainly FTP Commands and FTP Response Codes). Initial connection is FTP Connection (Control connection) and user authentication data is exchanged via FTP Control connection. FTP allows anonymous connection also.
2 - FTP-DATA Connection (Data transfer connection)
Once the user is authenticated and file transfer is approved, FTP creates another TCP connection for the data transfer. The file transfer or directory listing is done over the data connection. FTP Control connection stays connected for the entire FTP session. But new TCP connection is established for each file transfer requests.
Types of FTP Connection modes
FTP (File Transfer Protocol) supports two types of connection modes; 1) FTP Active mode and 2) FTP Passive mode. In FTP Active mode, the TCP three-way handshake for the FTP-DATA Connection is initiated by the FTP Server. Inbound TCP three-way handshake to Client computers can cause connection drops at Client firewalls. In FTP Passive mode, a special FTP command called PASV is used to inform the FTP Server that the FTP Client wants to use FTP Passive mode. Then FTP Server opens a new TCP port and starts listening at the new TCP port for FTP-DATA Connection and FTP Client initiates TCP three-way handshake to FTP Server.
Please visit following link to learn more about FTP Active mode and Passive mode.