How Does an FTP Program Work?
-
Introduction
-
FTP is short for File Transfer Protocol. It is the protocol used for transferring files over the Internet. The Internet is run by the TCP/IP protocol, and FTP (along with email, Telnet and HTTP) is part of the TCP/IP suite. A FTP program uses the protocol to transfer files from a client computer to a server computer and vice versa. Using a client program, users can create new and manipulate existing files and directories sitting on the server computer. In this article, we will learn how FTP client programs work.
The Two Types of FTP
-
FTP is the only protocol that works in two different ports; one is just for commands while the other is for data. Some deem FTP a superior protocol over HTTP when it comes to transferring large files because of its two ports. Having two ports has its own difficulties, which is why there are two types of FTP: Active and Passive.
The first to be invented is Active FTP. It was created to initiate the connection to the servers command port. Then, the server uses the data port to initiate the connection to the client computer. Active FTP raised problems for clients that sit behind a firewall. Firewalls usually blocks any requests made by the FTP server. Firewalls can't decipher between a FTP server request and a request made by an intruder; this is why the connection requests are considered potential threats.
Passive FTP was created to solve the problems presented by the previous version. With Passive, the client is responsible for initiating both connections requests, to and from the server. The server remains "passive" and doesn't send out any requests that can potentially blocked by the firewall. This type of FTP isn't a fan favorite with firewall administrators because of the increased threat to FTP server security. The server is busy listening to an immense amount of ports and the firewall's defenses are weakened to make provisions for this.
-
Connecting to FTP Server with a Client Program
-
FTP programs can login to a server in an anonymous or secured way. For FTP to work, two computers are required; one on the FTP server and another on the client side. After a user logs into a FTP program on the client side, a connection is made between the two computers using Passive FTP. An Active connection can be made, but it will have to be requested. While the connection (or session) is open, the user can use the program to carry out FTP commands to affect the files that sit on the server side. Depending on permissions, files can be deleted, renamed or moved to other directories. Other commands are used to move files from the server (download), send files to the server (upload), make new directories, delete existing directories or change permissions on files and directories.
-