What exactly is FTP and how does it work?

To begin with, FTP stands for File Transfer Protocol. It is a TCP/IP application-layer protocol for transferring file data from one computer to another over a network.

As with all Internet protocols, the assumption is that FTP uses the Transmission Control Protocol (TCP) to transport packets over an Internet Protocol (IP) network.

FTP is for moving files from one machine to another. And of all the file transfer protocols out there (and there are quite a few), FTP is one of the simplest

FTP uses two ports for communications -- by default port 20 for data transfers and port 21 for commands. All communications are normally done over TCP, which provides a reliable channel -- something that is highly desirable when you're moving data around.

It is important to know that you usually interact with FTP through something called a Protocol Interpreter that is part of your FTP client. This component communicates with the Protocol Interpreter on the remote server. When you actually move data around, your Protocol Interpreter is working with your local Data Transfer Process (DTP) and through the remote Protocol Interpreter working with the remote DTP. The two DTPs then interact and perform the file transfer.

When your FTP client creates a session with a server, the server responds with a status message along the lines of "220 servername FTP server." It is worth noting that the only constant part of this transaction is the code "220" -- everything else in the message is implementation-dependent.

At this point, the server will usually ask you for a name and a password. If anonymous access is allowed, then the server will offer you a default name. For the password it is the convention to use your e-mail address. If a real logon is required, you will need to know the details of a valid account on the server.