The What, Why, & How of FTP servers

What is FTP?

FTP was invented to solve the problem of transferring files over a network more than 50 years ago before the internet as we know it even existed. Fun fact, it was invented by the same MIT student who also works on the early version of emails. He named this invention short for “File Transfer Protocol” and that became over time the standard millions of people still use today.

The protocol has evolved throughout the years with many different versions of the protocol coming to life. Just to cite an example, the secure extension of FTP named FTPS in the same way HTTPS is the secure extension of HTTP with both leveraging the same underlying technology

How to access your FTP server?

Assuming you have an FTP server somewhere you know either its IP address or have a domain name, you can access such server through a tool called an FTP client. Depending on what you are trying to do, you will find different types of clients:

screenshot of Filestash when uploading

The role of those clients is to talk to your server using the FTP protocol and perform the action you want to do on that server. For example, if you are hosting WordPress and want to change your theme, you will be able to use that client to update some data on your server.

How do FTP works?

FTP is a standard that has evolved over time to take advantage of technological advances we’ve had over the last 50 years. In its currently used format, the protocol is an entirely TCP based service without any UDP components. What makes FTP different is how it uses 2 connections, a first one for the control exchange which runs typically on port 21 and another one for data exchange which is typically using port 20 and random port > 1024.

The model as described in RFC959:

                                            ||   User  ||    --------
                                            ||Interface|<--->| User |
                                            |\----^----/|    --------
                  ----------                |     |     |
                  |/------\|  FTP Commands  |/----V----\|
                  ||Server|<---------------->|   User  ||
                  ||  PI  ||   FTP Replies  ||    PI   ||
                  |\--^---/|                |\----^----/|
                  |   |    |                |     |     |
      --------    |/--V---\|      Data      |/----V----\|    --------
      | File |<--->|Server|<---------------->|  User   |<--->| File |
      |System|    || DTP  ||   Connection   ||   DTP   ||    |System|
      --------    |\------/|                |\---------/|    --------
                  ----------                -------------

                  Server-FTP                   USER-FTP 

- PI: "protocol interpreter"
- DTP: "data transfer process"

If you want to know more about all the intricacies of FTP, its mode and commands, a good starting point is RFC959. If you feel like a historian, you might want to read the very first RFC114 and if that’s still not enough you want to dig through RFC 697, RFC 765, RFC 1579, RFC 1635, RFC 1639, RFC 1738, RFC 2228, RFC 2389, RFC 2428, RFC 2577, RFC 2640, RFC 3659, RFC 5797, RFC 7151.

FTPS vs SFTP: FTPS and SFTP both enabled secure file exchange over a network but the way they work under the hood are completely different in the same way apples and oranges taste very different despite both being fruits.