As you saw in the previous section, e-mail has some obvious comparison points with snail mail. The next application, file transfer, does not compare directly with a noncomputing example, but it does work a little like a warehouse that a company might use to store goods. Imagine that a company has a bunch of stuff, and many people inside the company might need some of the stuff from time to time. Some of the stuff is big, and some of the stuff is small. So, the company leases warehouse space and puts its stuff in the warehouse. Then the company gives everyone a key, and anyone who needs some stuff can go get it when needed. Figure 8-9 shows the general concept. Figure 8-9. Warehousing Process for Transferring StuffAt Step 1, Keith fills the warehouse with widgets that his company has manufactured. Later, at step 2, Conner goes to get a widget so that he can deliver it to a customer. Now, in addition to putting things in the warehouse and getting them out again, other things have to happen. For instance
A file transfer application called File Transfer Protocol (FTP) works with the same general logic as the warehouse example. You can put things on the FTP server and get them off the FTP server, but you also need documentation as to where things are for FTP to be useful. Figure 8-10 shows the basic process. Figure 8-10. FTP Process for Transferring FilesWith FTP, everyone puts files on the server, as Keith did at Step 1 in the figure. Later, users can connect to the FTP server and get the files, as Conner did in Step 2. Also, if Conner didn't know the name of the file or in what directory it was stored, he might not find it, so Keith might have had to tell him where it was through some other means. Also note that Conner connects to the Internet using ISP2, whereas the FTP server sits inside Fredsco's enterprise network. Unlike e-mail protocols, FTP does not call for files to be distributed among various servers. One user simply puts the file on the server so that others can log in to the same server and get copies of the files. Warehouse Lingo and ProceduresFTP shares many of the same general concepts with applications like e-mail. Here are some of the similarities:
Despite the previous similarities, the details between FTP and e-mail are different. For instance, for FTP to be useful, files must exist on the FTP server. So, the first step involves a client connecting to the FTP server for the purpose of putting some files on the server, as in Figure 8-11. Figure 8-11. Stocking the FTP WarehouseThe following list describes what happens with each of the four messages Keith sends in the figure:
This entire process is a waste of time unless a couple of things are true. First, others must have the ability to authenticate to the server so that they can gain access to the files. They must also actually want to get to the files! Figure 8-12 shows Conner connecting to the FTP server and getting the file (called file1) that Keith put on the server. Figure 8-12. Copying Inventory (Files) from the FTP WarehouseConner repeats the same basic steps as Keith had in Figure 8-11. However, instead of issuing a PUT command, Conner issues a GET command. In FTP lingo, PUT means to copy a file from the client to the serverin other words, to put it on the server. GET refers to copying a file from the server to the clientin other words, getting the file from the server. The following list describes what happens with each of the four messages Conner sends in the figure:
You should also note that the PUT and the GET commands simply copy the file, but they do not delete the file. For example, when Keith puts the file on the server (Figure 8-11), he actually copies the file, but the file (file1) is still on Keith's PC's disk drive. Similarly, when Conner gets the file in Figure 8-12, Conner copies the file, but the file is still on the FTP server. Rules, Schmools for FTPMany standards exist for file transfer. However, the one I've been writing about here, called FTP, has one core RFC that defines the details: RFC 959. The FTP RFC defines the messages that FTP uses to send the username, password, GET, PUT, and many other commands. It also defines the process by which the actual file is transferred, as was shown in Figures 8-11 and 8-12. Interestingly, FTP uses a different underlying TCP connection for the control messages, versus the actual file transfer. Huh? Well, it's a small chicken-and-egg problem here: I can't tell you about TCP connections until you read the next chapter, but I want you to know now, when reading about FTP, that FTP uses two TCP connections. So, for now, just know that the process of controlling thingsauthentication, naming the file to be transferred, and so onis considered separate from the actual data transfer. The general idea works like using a shipping company. You might call the shipping company, schedule it to pick up a package, tell it where the package is going, and make sure it has directions to your house. You might even tell the shipping company if the package is an odd size or shape or if it's really heavy. That's the equivalent of a control connection. The person whom you talked to on the phone probably isn't the person who shows up to pick up your package. The driver of the truck keeps it simple; he puts your package on the truck and delivers it to the destination. Similarly, FTP keeps the processes separated; it sends control information over one connection or channel, and the data transfer happens on another. In summary, FTP works with clients connecting to a server, for the purpose of putting files on the server, and to get files from the server. The FTP server does not need to talk to other FTP servers; instead, each user who wants to get or put files connects to that one server. The server typically uses authentication, ensuring that each user has the right to get to the files on the server. |