|  | 15.4 | Application Layer Examples
| 15.4.2 | File transfer protocol

File transfer protocol (FTP) is designed to download files (e.g. receive from the Internet) or upload files (e.g. send to the Internet). The ability to upload and download files on it is one of the most valuable features the Internet has to offer. This is especially helpful for those people who rely on computers for many purposes and who may need software drivers and upgrades immediately. Network administrators can rarely wait even a few days to get the necessary drivers that enable their network servers to function again. The Internet can provide these files immediately by using FTP. FTP is a client-server application just like e-mail and Telnet. It requires server software running on a host that can be accessed by client software.

An FTP session is established the same way in which a Telnet session is established. Just like Telnet, the FTP session is maintained until the client terminates it, or there is some sort of communication error. Once you establish a connection to an FTP daemon, you must supply a login ID and a password. Normally, you would use "anonymous" as the login ID, and your e-mail address as the password. This type of connection is known as anonymous FTP. Upon establishing your identity, a command link opens between your client machine and the FTP server. This is similar to a Telnet session, in which commands are sent and executed on the server and the results returned to the client. This feature allows you to create and change folders, erase and rename files, or execute many other functions associated with file management.

The main purpose of FTP is to transfer files from one computer to another by copying and moving files from servers to clients, and from clients to servers. When you copy files from a server, FTP establishes a second connection, a data link between the computers, across which the data is transferred. Data transfer can occur in ASCII mode or in binary mode. These two modes determine how the data file is to be transferred between the stations. After the file transfer has ended, the data connection terminates automatically. After you have completed the entire session of copying and moving files, you may log off, thus closing the command link, and ending the session. Another protocol that has the ability to download files is Hypertext Transfer Protocol (HTTP), which you will learn about in the next section. One limitation of HTTP is that you can only use it to download files, and not upload them.