Monday, December 10, 2007

TCP/IP Works

TCP/IP protocol layers

The OSI model

How TCP/IP protocols interact

TCP/IP is a system (or suite) of protocols, and a protocol is a system of rules and procedures. For the most part, the hardware and software of the communicating computers carry out the rules of TCP/IP communications—the user does not have to get involved with the details. Still, a working knowledge of TCP/IP is essential if you want to navigate through the configuration and troubleshooting problems you'll face with TCP/IP networks.

This hour describes the TCP/IP protocol system and shows how the components of TCP/IP work together to send and receive data across the network.

At the completion of this hour, you will be able to

Describe the layers of the TCP/IP protocol system and the purpose of each layer

Describe the layers of the OSI protocol model and explain how the OSI layers relate to TCP/IP

Explain TCP/IP protocol headers and how data is enclosed with header information at each layer of the protocol stack

Name the data package at each layer of the TCP/IP stack

Discuss the TCP, UDP, and IP protocols and how they work together to provide TCP/IP functionality
The TCP/IP Protocol System
Before looking at the elements of TCP/IP, it is best to begin with a brief review of the responsibilities of a protocol system.

A protocol system such as TCP/IP must be responsible for the following tasks:

Dividing messages into manageable chunks of data that will pass efficiently through the transmission medium.

Interfacing with the network adapter hardware.

Addressing: The sending computer must be capable of targeting data to a receiving computer. The receiving computer must be capable of recognizing a message that it is supposed to receive.

Routing data to the subnet of the destination computer, even if the source subnet and the destination subnet are dissimilar physical networks.

Performing error control, flow control, and acknowledgment: For reliable communication, the sending and receiving computers must be able to identify and correct faulty transmissions and control the flow of data.

Accepting data from an application and passing it to the network.

Receiving data from the network and passing it to an application.

To accomplish the preceding tasks, the creators of TCP/IP settled on a modular design. The TCP/IP protocol system is divided into separate components that theoretically function independently from one another. Each component is responsible for a piece of the communication process.

The advantage of this modular design is that it lets vendors easily adapt the protocol software to specific hardware and operating systems. For instance, the Network Access layer (as you'll learn in Hour 3, "The Network Access Layer") includes functions relating to a specific LAN architecture, such as token ring or ethernet. Because of TCP/IP's modular design, a vendor such as Microsoft does not have to build a completely different software package for token ring TCP/IP (as opposed to ethernet TCP/IP) networks. The upper layers are not affected; only the Network Access layer must change.

The TCP/IP protocol system is subdivided into layered components, each of which performs specific duties (see Figure 2.1). This model, or stack, comes from the early days of TCP/IP, and it is sometimes called the TCP/IP model. The official TCP/IP protocol layers and their functions are described in the following list.

Figure 2.1. The TCP/IP model's protocol layers.


Compare the functions in the list with the responsibilities listed earlier in this section, and you'll see how the responsibilities of the protocol system are distributed among the layers.

By the Way

The four-layer model shown in Figure 2.1 is a common model for describing TCP/IP networking, but it isn't the only model. The ARPAnet model, for instance, as described in RFC 871, describes three layers: the Network Interface layer, the Host-to-Host layer, and the Process-Level/Applications layer. Other descriptions of TCP/IP call for a five-layer model, with Physical and Data Link layers in place of the Network Access layer (to match OSI). Still other models might exclude either the Network Access or the Application layer, which are less uniform and harder to define than the intermediate layers.

The names of the layers also vary. The ARPAnet layer names still appear in some discussions of TCP/IP, and the Internet layer is sometimes called the Internetwork layer or the Network layer.

This book uses the four-layer model, with names shown in Figure 2.1.



Network Access layer— Provides an interface with the physical network. Formats the data for the transmission medium and addresses data for the subnet based on physical hardware addresses. Provides error control for data delivered on the physical network.

Internet layer— Provides logical, hardware-independent addressing so that data can pass among subnets with different physical architectures. Provides routing to reduce traffic and support delivery across the internetwork. (The term internetwork refers to an interconnected, greater network of LANs, such as what you find in a large company or on the Internet.) Relates physical addresses (used at the Network Access layer) to logical addresses.

Transport layer— Provides flow control, error control, and acknowledgment services for the internetwork. Serves as an interface for network applications.

Application layer— Provides applications for network troubleshooting, file transfer, remote control, and Internet activities. Also supports the network Application Programming Interfaces (APIs) that enable programs written for a particular operating environment to access the network.

Part II, "The TCP/IP Protocol System," provides more detailed descriptions of the activities at each of these TCP/IP protocol layers.

When the TCP/IP protocol software prepares a piece of data for transmission across the network, each layer on the sending machine adds a layer of information to the data that will be relevant to the corresponding layer on the receiving machine. For instance, the Internet layer of the computer sending the data adds a header with some information that is significant to the Internet layer of the computer receiving the message. This process is sometimes referred to as encapsulation. At the receiving end these headers are removed as the data is passed up the protocol stack.

By the Way

The term layer is used throughout the computer industry for protocol component levels such as the ones shown in Figure 2.1. Header information is applied in layers to the data as it passes through the components of the protocol stack. (You'll learn more about this later in this hour.) When it comes to the components themselves, however, the term layer is somewhat metaphorical.

Diagrams such as Figure 2.1 are meant to show that the data passes across a series of interfaces. As long as the interfaces are maintained, the processes within one component are not affected by the processes in other components. If you turned Figure 2.1 sideways, it would look more like an assembly line, and this is also a useful analogy for the relationship of the protocol components. The data stops at each point in the line and, as long as it arrives at each point as specified, the components can operate independently.
TCP/IP and the OSI Model
The networking industry has a standard seven-layer model for network protocol architecture called the Open Systems Interconnection (OSI) model. The OSI model represents an effort by ISO, an international standards organization, to standardize the design of network protocol systems to promote interconnectivity and open access to protocol standards for software developers.

TCP/IP was already on the path of development when the OSI standard architecture appeared and, strictly speaking, TCP/IP does not conform to the OSI model. However, the two models did have similar goals, and there was enough interaction among the designers of these standards that they emerged with a certain compatibility. The OSI model has been very influential in the growth and development of protocol implementations, and it is quite common to see the OSI terminology applied to TCP/IP. Figure 2.2 shows the relationship between the four-layer TCP/IP standard and the seven-layer OSI model. Note that the OSI model divides the duties of the Application layer into three layers: Application, Presentation, and Session. OSI splits the activities of the Network Interface layer into a Data Link layer and a Physical layer. This increased subdivision adds some complexity, but it also adds flexibility for developers by targeting the protocol layers to more specific services.

Figure 2.2. The seven-layer OSI model.


The seven layers of the OSI model are as follows:

Physical layer— Converts the data into the stream of electric or analog pulses that will actually cross the transmission medium and oversees the transmission of the data.

Data Link layer— Provides an interface with the network adapter; maintains logical links for the subnet.

Network layer— Supports logical addressing and routing.

Transport layer— Provides error control and flow control for the internetwork.

Session layer— Establishes sessions between communicating applications on the communicating computers.

Presentation layer— Translates data to standard format; manages encryption and data compression.

Application layer— Provides a network interface for applications; supports network applications for file transfer, communications, and so forth.

It is important to remember that the TCP/IP model and the OSI model are standards, not implementations. Real-world implementations of TCP/IP, do not always map cleanly to the models shown in Figures 2.1 and 2.2, and the perfect correspondence depicted in Figure 2.2 is also a matter of some discussion within the industry.

Notice that the OSI and TCP/IP models are most similar at the important Transport and Internet (called Network in OSI) layers. These layers include the most identifiable and distinguishing components of the protocol system, and it is no coincidence that protocol systems are sometimes named for their Transport and Network layer protocols. As you'll learn later in this book, the TCP/IP protocol suite is named for TCP, a Transport layer protocol, and IP, an Internet/Network layer protocol.
Data Packages
The important thing to remember about the TCP/IP protocol stack is that each layer plays a role in the overall communication process. Each layer invokes services that are necessary for that layer to perform its role. As an outgoing transmission passes down through the stack, each layer includes a bundle of relevant information called a header along with the actual data. The little data package containing the header and the data then becomes the data that is repackaged at the next lower level with the next lower layer's header. This process is shown in Figure 2.3. The reverse process occurs when data is received on the destination computer. As the data moves up through the stack, each layer unpacks the corresponding header and uses the information.

Figure 2.3. At each layer, the data is repackaged with that layer's header.


As the data moves down through the stack, the effect is a little like the nested Russian wooden dolls you might have seen; the innermost doll is enclosed in another doll, which is then enclosed in another doll, and so on. At the receiving end, the data packages will be unpacked, one by one, as the data climbs back up the protocol stack. The Internet layer on the receiving machine will use the information in the Internet layer header. The Transport layer will use the information in the Transport layer header. At each layer, the package of data takes a form that will provide the necessary information to the corresponding layer on the receiving machine. Because each layer is responsible for different functions, the form of the basic data package is very different at each layer.

By the Way

The networking industry has as many analogies as it has acronyms, and the Russian doll analogy, like any of the others, illustrates a point, but must not be taken too far. It is worth noting that on a physical network such as ethernet, the data is typically broken into smaller units at the Network Access layer. A more accurate analogy would call for this lowest layer to break the concentric doll system into smaller pieces, encapsulate those pieces into tinier dolls, then grind those tiny dolls into a pattern of ones and zeros. The ones and zeros will be received, reconstituted into tiny dolls, and rebuilt into the concentric doll system. The complexity of this scenario causes many to eschew the otherwise-promising analogy of the dolls.



The data packet looks different at each layer, and at each layer it goes by a different name. The names for the data packages created at each layer are as follows:

The data package created at the Application layer is called a message.

The data package created at the Transport layer, which encapsulates the Application layer message, is called a segment if it comes from the Transport layer's TCP protocol. If the data package comes from the Transport layer's UDP protocol, it is called a datagram.

The data package at the Internet layer, which encapsulates the Transport layer segment, is called a datagram.

The data package at the Network Access layer, which encapsulates and may subdivide the datagram, is called a frame. This frame is then turned into a bitstream at the lowest sublayer of the Network Access layer.

You'll learn more about the data packages for each layer in Part II.

No comments: