One of the oldest of the TCP/IP stack protocols used on the Internet is the File Transfer Protocol (FTP) . FTP is used to send and receive files over a TCP/IP network, regardless of the operating systems used on the computers sending and receiving the data.
FTP supplies the user interface and the various functions of the Application, Presentation, and Session layers of the OSI model. Although FTP is considered a protocol in the TCP/IP stack, it is also a full-blown application used on the Internet to send and receive files.
FTP uses TCP (which we discussed in Chapter 5, when we looked at the entire TCP/IP stack) at the Transport layer, so a real-time connection is set up between the sending and receiving computers on the Internet. IP addressing provided at the Network layer of the OSI model by the Internet Protocol provides the mechanism used by FTP to identify different nodes on the Internet (DNS plays a role in identifying computers on the Internet and is discussed in "Understanding DNS," in Chapter 12, "TCP/IP Network Administration").
To use FTP to send and receive files on the Internet, you need two things: an FTP server and an FTP client. FTP is a good example of a client/server environment, where the software needed to transfer files is split between the server and the client. Let's take a look at FTP on the server side first.
An FTP server is a computer that allows other computers on the network to connect to it. Therefore, FTP servers can be large network servers found on corporate networks and the Internet that have been configured with server software that allows them to share files with computers using an FTP client (FTP servers were extremely important to the ARPAnet for sharing files between different sites). FTP servers can also be client computers that are running some kind of FTP server software.
A number of different software packages are available for FTP servers on company networks or the Internet. Linux server distributions provide the FTP server function, as do Microsoft Windows Server platforms such as Windows Server 2003. Each of these network operating systems use different utilities to configure Web services such as FTP. Figure 14.1 shows the Default FTP Site Properties dialog box of the Internet Information Services snap-in tool that is used to configure and monitor Web sites, FTP sites, and newsgroups on a server running Windows Server 2003.
Figure 14.1. Windows Server 2003 uses the Default FTP Site Properties dialog box of the IIS snap-in to configure FTP sites.
Novell NetWare also provides the software and the utilities to configure and manage an FTP server. NetWare 6x uses the Apache2 Server to deploy Web and FTP sites on a NetWare server. Figure 14.2 shows the NetWare Web Manager, which provides support for configuring Web and FTP sites.
Figure 14.2. NetWare provides the NetWare Web Manager.
A number of third-party software companies provide FTP server software, which can be used to turn just about any computer running any operating system into an FTP server. These add-on software products are just fine for setting up an FTP server that will be used to share files with co-workers or with friends over the Internet. Some client operating systems, such as Windows XP Professional and the Mac OS, also provide you with the ability to configure an FTP server using a service built into the OS.
In production environments (a fancy way of saying on a large corporate intranet or a server on the Internet), FTP sites can experience a large number of "hits." So, in most cases you will want to run your FTP site on a server machine (a computer with all the hardware muscle typically found on a server) rather than a client computer.
Once the FTP server software is installed or the FTP service built in to the NOS is activated, the directories that will be accessed by users need to be created. A root directory provides the holding tank for the directories that will be created (in essence they are subdirectories of the FTP root). These directories are then populated with the files that will be available to your FTP clients .
FTP provides a file-sharing environment that can control access to the file server by requiring a logon name and password. This means that the FTP server must validate a user and her password before she can access files on the server.
On the Internet, many public FTP sites allow an anonymous logon. This means that anyone can log on to the FTP site using a username of "anonymous." The password for an anonymous logon is often your email address. A site allowing anonymous logons is often referred to as an anonymous FTP site . Figure 14.3 shows Caldera.com's anonymous FTP site (Caldera is another flavor of Unix), which has been accessed using the Internet Explorer Web browser.
Figure 14.3. Anonymous FTP sites are quite common on the Internet.
Notice that on a Linux-based computer the directories on the FTP site appear in the Web browser window the same as local directories would (these directories would appear the same in Internet Explorer on a computer running Windows). You are potentially accessing files that reside on a computer clear across the world, but the computer's connection to the Internet makes the directories and files appear as if they are local.
As you've already read in the discussion of anonymous FTP sites, Web browsers such as Netscape Navigator and Microsoft Internet Explorer can act as FTP clients. You can actually download files from an FTP site by locating them in the browser window and then using the copy command. Files can also be uploaded to an FTP site (that is, if the site allows uploads; many sites are "read only," meaning you can copy files from the site but cannot upload files to the site).
You can also use an FTP client to connect to FTP sites. There are FTP clients for just about any operating system. FTP clients can take the form of add-on software, such as WS_FTP, which is shown in Figure 14.4. The local drives and directories are shown on the left side of the FTP client window, and the remote or FTP directories are shown on the right side.
Figure 14.4. FTP clients provide a way to move files from a local computer to an FTP site, and vice versa.
Many operating systems, such as Microsoft Windows and Linux-based systems, also allow you to connect to an FTP server from the command line. Figure 14.5 shows the command-line commands used to connect to a local FTP server (on the company intranet) from a Microsoft Windows client computer.
Figure 14.5. Connections to an FTP server can also be established using command-line commands.
The actual connection to the FTP server is established either by specifying the IP address of the FTP server or by using the fully qualified domain name (FQDN), or friendly name , of the server. The role of FQDNs is covered in the section, "Understanding DNS," in Chapter 12.
Once the connection is established, file directories on the FTP server can be viewed by the client. Files can then be downloaded or uploaded as binary files or in ASCII text format. One of the most compelling reasons for using FTP is that it supplies you with the ability to move files easily between different types of operating systems.