Dear John, How Do I... Understand Internet Protocol Layers?

The Internet is a system by which a growing number of different computer networks can communicate. The Internet manages this diversity through a series of layers called protocols. Like the social protocols we observe in everyday life, the Internet protocols let each layer know what to expect. Figure 7-1 shows how some of the most important protocols are arranged.

The transport layer marks the boundary of where your application ends and the Internet begins. This layer consists of the User Datagram Protocol (UDP) and Transmission Control Protocol (TCP). These two protocols determine the way in which applications send and receive data over the Internet—specifically, they decide how the connection is made and how the data is packaged.

You can use UDP or TCP for direct communication over the Internet. For example, you might want to send some application-defined data format or transmit a simple message to multiple machines. Because they operate at a lower level, UDP and TCP don't incur the overhead that is present in application-level protocols such as HTTP or FTP.

Figure 7-1. The protocol layers help manage the complexity of Internet communication.

As mentioned at the beginning of this chapter, the Winsock control provides direct access to the UDP and TCP protocols, and the Internet Transfer control provides direct access to the FTP and HTTP protocols. The WebBrowser control interprets FTP and HTTP data, formatting it as it would appear in IE. The control you choose depends on the type of application you wish to create, as described in the following sections.