Building a Centralized Warehouse: File Transfer


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 Stuff


At 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

  • Keith probably put the widgets in the right place in the warehouse so that others could know where to find them.

  • Conner has access to the documentation that told him where to find Keith's widgets inside the warehouse.

  • Without the ability to find the widgets and keep track of the inventory, the warehouse would soon be useless.

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 Files


With 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 Procedures

FTP shares many of the same general concepts with applications like e-mail. Here are some of the similarities:

  • Like e-mail, FTP uses client software on the end user computer.

  • Like e-mail, the FTP client software has both user interface details, as well as code that implements application layer protocols.

  • Like e-mail clients, FTP clients need to connect to a server to do anything useful.

  • Like e-mail, the client must identify itself to the server before doing anything useful.

  • Like e-mail TCP/IP standards, the FTP TCP/IP standard defines messages and headers that FTP uses to do something useful.

  • Like e-mail server software, FTP server software runs on a physical server.

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 Warehouse


The following list describes what happens with each of the four messages Keith sends in the figure:

1.

Keith first sends the server his username, using the FTP USER command. This command allows Keith's FTP client software to supply a username to the FTP server for authentication.

2.

Next, Keith's FTP client uses the FTP PASS command to supply a corresponding password to the FTP server. At this point, the FTP server can decide whether Keith is a valid user of the FTP server. When the FTP server replies with an "FTP OK" message, it means that Keith has been authenticated.

3.

Next, Keith's FTP client uses the FTP PUT command to tell the server that Keith will send the contents of the file in the upcoming messages, and that the file's name is file1.

4.

Finally, Keith sends the actual contents of the file.

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 Warehouse


Conner 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:

1.

Conner first sends the server his username, using the FTP USER command. This command allows Conner's FTP client software to supply a username to the FTP server for authentication.

2.

Next, Conner's FTP client uses the FTP PASS command to supply a corresponding password to the FTP server. At this point, the FTP server can decide whether Conner is a valid user of the FTP server. When the FTP server replies with an "FTP OK" message, it means that Conner has been authenticated.

3.

Next, Conner's FTP client uses the FTP GET command to tell the server that Conner wants to get a copy of the file called file1.

4.

Finally, the FTP server sends the actual contents of the file to Conner.

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 FTP

Many 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.




Computer Networking first-step
Computer Networking First-Step
ISBN: 1587201011
EAN: 2147483647
Year: 2004
Pages: 173
Authors: Wendell Odom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net