Previous Page
Next Page

2.2. Layering

Layering is an important conceptual tool that helps us to organize, understand, and deal with the complexity of network architecture. The idea is to divide the network's functions into layers. Each layer makes use of the services of the layer below it to provide a set of specific services for the layer above it. Adjacent layers communicate with each other through a well-defined interface, so that in principle, we could change one layer or even completely rewrite it without affecting the others.

Together, the layers are said to constitute a stack. The TCP/IP stack comprises four layers, as shown in Figure 2.1.

Figure 2.1. The TCP/IP Stack


Listed to the right of the stack are some of the protocols that operate in each layer.

The four layers and their functions are:

  1. The interface layer comprises the operating system device driver and associated network interface hardware. This layer handles the details of getting the bits from the network layer's datagrams onto the wire. Typical examples of protocols at this layer are Ethernet, Token Ring, Fiber Distributed Data Interface (FDDI), and the Point-to-Point Protocol (PPP). The interface layer is sometimes called the link or datalink layer.

  2. The network layer is primarily concerned with routing IP datagrams through the Internet. It also carries Internet Control Message Protocol (ICMP) messages, which contain error and control information about the network, and Internet Group Management Protocol (IGMP) messages, which help with the management of multicast messaging. Because the network layer's most important task is to handle IP datagrams, it is sometimes called the Internet layer.

  3. The transport layer is concerned with end-to-end communications. Whereas the network layer is concerned with moving an IP datagram from one host or router to the next, the transport layer is concerned with communication between the two ultimate destinations, as illustrated in Figure 2.2. As shown in that figure, the transport layer views itself as logically directly connected to its peer transport layer on the destination host. The two most important transport-layer protocols are TCP and the User Datagram Protocol (UDP).

    Figure 2.2. Communication Between Corresponding Layers


  4. The application layer is where the applications reside. Typical examples are such standard TCP/IP applications as ftp, ssh, and email, as well as user-written applications. As with the transport layer, the application layer is logically directly connected to its peer layer on the destination host.

It is common to find references to the seven-layer Open Systems Interconnection (OSI) reference model [International Standards Organization 1984] in networking literature. In that model, the network, transport, and application layers are numbered 3, 4, and 7, respectively. To avoid confusion between the two models, we will always refer to layers by their names rather than their numbers. When numbers are used in networking literature, they almost always refer to the OSI model. Thus, for example, layer 4 refers to the transport layer. See Tip 14 in ETCP for more on the OSI model and how it relates to the TCP/IP stack.

Beginners are often confused about the difference between the network and transport layers. Figure 2.2 makes the distinction clear. The network layer carries on a conversation with its peer network layer on the next hop, whereas the transport layer carries on a conversation with its peer layer on the final destination. To put it another way, the transport layer behaves as if it were directly connected to its peer layer and is unaware of the actual path that its data takes through the network. The network layer, on the other hand, is concerned with choosing the path that the data takes and, as such, is involved with processing at each hop. Note from the figure that routers do not necessarily even have transport layers.


Previous Page
Next Page