File Transfer Protocol

File Transport Protocol is a program that allows users and computers to send and receive large portions of data through a private or public network. It can also be used to send configuration files to network devices, such as switches and routers.

File Transfer Protocol Defined

File Transport Protocol, or FTP, is an open protocol standard that is widely used to transport and receive large files. It can also be used to send configuration files and software updates for network switches and routers. FTP uses ports for communications and also uses encryption to protect the information being received and sent. In this lesson, we will go over these topics so that you can be familiar with FTP and what it has to offer.

Making a Connection

ftp1
This image shows the generic operation of how a client accesses an FTP server. The FTP server listens to Port 21 for connection requests, and it sends data from its Port 20. Let's look more in-depth at the process, starting with establishing the FTP connection using Port 21 on the FTP server.
The FTP client opens a random port on itself to initiate the request. In this case, the FTP client chooses Port 1. The FTP client will then forward its requests for FTP connection from its own Port 1 to the FTP server that is listening on Port 21. Once the FTP server receives the FTP connection requests on its Port 21, the FTP server will then send an acknowledgment back to the FTP client using its address of Port 1 saying that the connection is now established and download may commence.
At this point, the connection is only established between the FTP client and the FTP server. The FTP server uses Port 21 only for connection setup and receiving commands from the FTP client. The next step is downloading data from the FTP server to the FTP client.
The FTP client will now send a data request signal to the FTP server. In this data request, the FTP client tells the FTP server 'Hey, send me the data I want to download. Use Port 2 as my delivery address!' Now that the FTP server knows to send the data to Port 2 on the FTP client, The FTP server will now open a new port, which is Port 20. Port 20 is solely used to send the data to the FTP client, nothing more. Now, using its Port 20, the FTP server will send the data to the client, using the client's Port 2 as its delivery address. Once the download is complete, the client will tear down the connection if the download is successful.

Significance of Port 20 and 21

So why Port 20 and 21? Because it is the standard that servers listen to for FTP requests and sending data. You can configure the server to use a different port number if desired; however, the client needs to know which port number so that its FTP request gets processed correctly. If the client requests FTP access from a port that the FTP server is not listening to, the request will be dropped.
Here's an example. Everyone knows to call 911 when there is an emergency. But what happens if the police changed the 911 number to something different and have not told anyone? People would still call 911 for help, but the police would not know because they are listening to a different number. People who try to call the police will just keeping calling and calling without being aware that the phone number changed. This is the same concept with FTP and its ports.

TCP and UDP

FTP uses two protocols for sending and receiving files:
FTP that is using the TCP (Transport Control Protocol) provides assurance that the information being sent will be complete, and if not, FTP and TCP will try to accomplish the mission of being complete. This adds overhead to the information being sent and is slower than using the UDP protocol.
FTP that is using the UDP (User Datagram Protocol) does not provide error checking, validation, or verify if the data was sent correctly, unlike the TCP protocol. FTP that is using the UDP protocol is called the Simple File Transfer Protocol (SFTP).

Post a Comment

0 Comments