We have already learned about various protocols in the networking ecosystem that perform various functions. The File Transfer Protocol (FTP) is an important networking protocol that enables the communication and transfer of files between two computers.
This transfer occurs on the Internet which belongs to the Transmission Control Protocol/ Internet Protocol (TCP/IP) suite. The FTP protocol is active in the Application Layer of the TCP/IP protocols.
There are two important counterparts in a typical FTP transaction, the local host and the remote host. The local host is usually the computer of an end-user who either wants to transfer, upload or download a file from the server. The server is referred to as the remote host that allows the transfer, upload and download of the files. This transaction of files occurs only if the user has been granted access to do so!
As we have already learned about the Hyper Text Transfer Protocol (HTML) whose function is similar to the FTP protocol which is to transfer files in a hypertext form. These files could be audio, video, or image.
In this blog, we will learn about the key features of the FTP protocol followed by the working of the FTP protocol. We will also cover how to use this protocol.
Note: If you haven’t read the previous blog of our CCNA 200-301 series, I highly recommend you do so.
Without any further delay, let us begin!
What is FTP?
The File Transfer Protocol (FTP) is a standard network protocol that is used to upload, download or transfer files from one computer to another. It allows expansive file transfer across various IP networks.
The following are the key features of the FTP protocol:
- FTP is a standard Internet protocol that provides the sharing of files.
- It transfers data with better control, quality, and reliability than HTML web services or email.
- FTP uses a client-server model.
- The FTP is most commonly used by Network Engineers in the process of upgrading an operating system of a network device.
- The FTP protocol can also be used to download the newer version of iOS from a server and then reboot the device with the new iOS image.
- FTP was standardized in 1971. This is even before the TCP/IP, therefore, FTP is a very old protocol.
- The TCP ports used by FTP are 20 and 21.
- There is no encryption in FTP similar to HTTP. Everything is sent in plain text including the username and password that is used for authentication.
- FTPS (FTP over SSL/TLS) can be used for better security. Please note that the FTPS is an upgrade to FTP.
- SSH File Transfer Protocol (SFTP) can also be used for greater security.
- FTP does not only allow file transfers, but it also allows clients to look for file directories, add and remove directories, list files, etc.
- The client sends FTP commands to the server to perform the above-mentioned functions.
How Does the FTP Work?
For the FTP protocol to work, the FTP client plays a very important role. It is a computer application that connects the user to remote servers using FTP protocol. The FTP client has the following three parts:
- The user interface
- Control process
- Data transfer process
The server, on the other hand, has two major parts:
- Control process
- Data transfer process
For an FTP connection to be established, there are two unique communication channels:
- Command channel:
This channel is responsible for initiating the instructions and response.
- Data channel:
The data channel facilitates the distribution of the data.
The FTP uses two types of connections:
- FTP Control Connection (TCP21):
- It is established and used to send FTP commands and replies.
- The client sends commands when it wants to perform an action, such as retrieving a file from the server, and then the server sends replies to acknowledge.
- The actual data transfer does not occur using this FTP connection.
- FTP Data Connection (TCP20):
- When files and data are to be transferred, separate FTP data connections to TCP port 20 are established and terminated as required.
Now, all we need is an actual data connection to transfer the data. There are 2 different modes that can be used to establish an FTP data connection. These are:
- Active Mode:
- It is the default method of establishing FTP data connections.
- In such a mode, the server initiates the TCP connection.
- After the TCP connection is set up, the FTP data connection is established and the data can be exchanged.
Note: The FTP control connection is maintained throughout the whole process.
- Passive Mode:
- The client initiates the data connection in the FTP passive mode.
- This is often the case when the client is behind a firewall which could block the incoming connection from the server.
- The firewall permits the server’s replies but it would block the message if the server itself tries to TCP connection.
How to Use FTP?
There are mainly three approaches to how we can establish and use the FTP connection. These are:
- Command-Line FTP:
- This is the simplest method of establishing a TCP connection.
- A command prompt is used.
- This method is commonly used by Developers to transfer files.
- Web browser:
- We can also use a web browser to talk to the FTP server.
- Sometimes, a user wants to access large directories on the server. This is where the web browser works the best.
- However, this method is less reliable and slow.
- FTP client:
- This is the most popular method to use FTP.
- It is easier to manage than the other methods.
- It is also more powerful.
- It gives more freedom than the FTP commands and web browser method.
- It allows users to send large files.
This marks the end of our FTP blog of CCNA course series. In this blog, we have learned what is FTP and how it works. Then, we also learned how to use the FTP connection. The bottom line is that the FTP is used to transfer files from one computer to another.
Stay tuned for learning more Protocols such as TFTP protocol in the CCNA series