FTP stands for File Transfer Protocol. It is an application layer protocol that moves the required files between local file systems and remote file systems. Like HTTP, it runs on top of TCP. To transfer a file, FTP uses two TCP connections in parallel:
- Control connection (on port 21).
- Data connection (on port 20).
History of FTP: On 16 April 1971, the original documentation for the FTP was written by Abhay Bhushan and published as RFC 114. Until 1980, FTP ran on NCP, which was the predecessor of TCP/IP. A TCP/IP version replaced the protocol later, in June 1980 RFC 765 and in October 1985 RFC 959, which is the current specification.
Types of FTP connection :
Active FTP Connection :
The active one is the older one as compared to the passive one. Active FTP was introduced in the early days of computing when mainframes were widespread and information security attacks were not as common.
Let’s see an explanation of how an active mode connection is established in two steps
- A user connects from a random port of a file transfer client to FTP port 21 of the server. He sends the command PORT, which specifies which port on the client side the server should connect to. This port will be used later for the data channel and is different from the port used for the command channel in this step.
- The server establishes a connection from port 20 to the client port intended for the data channel. Once the data connection is established, file transfers will take place through these client and server ports.
Passive FTP Connection :
In passive, the client continues to initiate a control connection to the server. However, instead of the PORT command, it sends the PASV command, which is essentially a request for a server port to connect to for data transfer. When the FTP server responds, it specifies the number of the data port it has opened for the subsequent data transfer.
- The client connects to port 21 of the server from a random port and issues the PASV command. The server responds, indicating which (random) port it has opened for data transmission
- The client connects from another random port to the random port mentioned in the server’s response. Once the connection is established, the data transmission takes place through these ports of the client and server.
Features of FTP :
- It provides security to File Transfer.
- It gives its users well-maintained Access Control.
- It provides multiple Access Methods for File Transfer
- It hides the details of an individual’s computer system
Advantages of FTP :
- FTP allows you to transfer multiple files along with multiple directories.
- FTP provides the ability to resume the interrupted file transfer.
- FTP gives the ability to add items to an upload/download queue.
- FTP is simple to use and implement.
- FTP is a connection-oriented protocol; Hence, it uses resilient control commands.
- FTP also allows backup facilities.
Disadvantages of FTP :
- Lack of Security
- Vendor Equality is challenging to gain
- FTP possesses Vulnerability to Attack
- Monitoring of activity is quite difficult.
- FTP has a high latency rate because it’s a connection-oriented protocol.
- FTP does not always support TLS 1.2 over HTTPS.
Unlock the Power of Placement Preparation!
Feeling lost in OS, DBMS, CN, SQL, and DSA chaos? Our Complete Interview Preparation
Course is the ultimate guide to conquer placements. Trusted by over 100,000+ geeks, this course is your roadmap to interview triumph.
Ready to dive in? Explore our Free Demo Content and join our Complete Interview Preparation