By Kailin Acheson
In Part I of The Seven Layers of Networking blog, John began a discussion about the layers of the Open Systems Interconnection (OSI) model. The first four layers, which you can read about in that blog, are the Physical layer, the Data Link layer, the Network layer, and the Transport layer. In network discussions, you'll most often encounter the first four layers. The final three layers, the Session layer, the Presentation layer, and the Application layer, are not as commonly discussed but are still essential to a network. This blog will cover those three layers and the encapsulation process that occurs when one host communicates with another. Then you'll have to stay tuned for Part III, which will cover a related-yet-different layered model, the Transmission Control Protocol/Internet Protocol (TCP/IP) model.
Two main reasons data networks are organized into layered models such as the OSI model are 1) to simplify communication between two network devices and 2) to facilitate vendor interoperability. To simplify communication, each layer is dedicated to a particular set of functions and is a framework that helps us learn, analyze, and discuss those functions. To facilitate vendor interoperability, each layer acquires services from the layer below and exposes a consistent service interface to the layer above.
Figure 1 below shows all seven layers of the OSI model and represents, at the very basic level, one computer communicating with another one.
Figure 1 - The OSI Model
The following is a basic summary of the four layers discussed in the previous blog:
- The Physical layer, or Layer 1, defines that which can be seen and measured in the physical world; a Layer 1 problem might be related to cables or connectors that link devices together. The Protocol Data Unit (PDU), or what the information is called at each layer, is the binary digit (bit) at Layer 1.
- The Data Link layer, or Layer 2, deals with Media Access Control (MAC) addresses and the movement of data from one device to another device within the same network; a Layer 2 problem might be related to configuration errors such as link speed and duplex setting. The PDU at Layer 2 is the frame.
- The Network layer, or Layer 3, deals with Internet Protocol (IP) addresses and the movement of data from one network to another; a Layer 3 problem might be related to router configuration or configuration errors in IP addresses. The PDU at Layer 3 is the packet.
- The Transport layer, or Layer 4, provides services used by applications at higher levels and can provide either connection-oriented communication or connectionless communication. A Layer 4 problem might be related to access control lists (ACLs) or firewalls blocking or redirecting the ports needed by a particular service. The PDUs at Layer 4 are the segment (for connection-oriented communications) and the datagram (for connectionless communications).
Now that you have a summary of the first four layers, let's continue the discussion with the final three layers. In keeping with Part I of this series, I won't go into an exhaustive discussion of each layer; what you see here will be a brief discussion of each layer so that the next time you hear someone say that Device X operates at Layer Y, or that a certain problem is a Layer Z issue, you'll have a better idea of what that person means.
The Session Layer
The Session layer is responsible for establishing, maintaining, and terminating communication sessions between applications or devices. These sessions include service requests and responses, which can be sent back and forth between two parties. Common protocols that operate at the Session layer, also known as Layer 5, include Session Control Protocol (SCP), Remote Procedure Call (RPC), and Zone Information Protocol (ZIP).
The Presentation Layer
The Presentation layer is responsible for ensuring that information that is passed between devices is readable by both devices and is responsible for converting data into formats that the Application layer can accept. For example, it can translate character codes from ASCII to EBCDIC and vice versa. The Presentation layer, also known as Layer 6, can encrypt and decrypt a message. Some of the formats used at the Presentation layer include MP3, Joint Photographic Experts Group (JPEG), and Graphics Interchange Format (GIF).
The Application Layer
It is through the Application layer that users and application processes access network services. The Application layer, also known as Layer 7, is responsible for interacting directly with a software application and moving data between a computer and a server. This layer is closest to you, the user. Some things that happen at the Application layer include determining resource availability and synchronizing communication. The Application layer provides support for file transfers, browsing the Internet, sending electronic messages, and access to remote files and printers. Common protocols that operate at the Application layer include Telnet, Domain Name System (DNS), Simple Mail Transfer Protocol (SMTP), and Hypertext Transfer Protocol (HTTP). On a device that has lost connectivity to a network, you can troubleshoot at the Application layer by examining or restarting network applications on the device.
Encapsulation Within Layers
Each of the seven layers in the OSI model passes information and data up or down the stack in a way that each layer can understand and interpret the data. During any given communication session, a layer can interact with three layers: the layer directly above it, the layer directly below it, and the layer across from it on a network device. When information is passed down the OSI layers, each layer encapsulates the information with its own formatting and passes it to the next-lower layer; eventually, the information is transmitted as bits at the Physical layer. When information is passed up the OSI layers, each layer removes its formatting, or de-encapsulates the information, and organizes the information so that it can be interpreted by the next-higher layer. The PDU changes as it moves through the layers.
The functions that are handled at each layer of the OSI model are standardized so that hardware components, applications, and protocols can be designed to interoperate easily. Troubleshooting is also simplified because of how data is handled at each layer of the OSI model.
Encapsulation can be explained and demonstrated in the following ways; the tables show encapsulation from the top down and from the bottom up:
From the Top Down
When the payload is passed down through the Application layer, it is encapsulated and the Layer 7 header is added before the payload is forwarded to the Presentation layer.
When the payload is passed down through the Presentation layer, it is encapsulated and the Layer 6 header is added before the payload is forwarded to the Session layer.
When the payload is passed down through the Session layer, it is encapsulated and the Layer 5 header is added before the payload is forwarded to the Transport layer.
When the payload is passed down through the Transport layer, it is encapsulated and the Layer 4 header is added before the payload is forwarded to the Network layer.
When the payload is passed down through the Network layer, it is encapsulated and the Layer 3 header is added before the payload is forwarded to the Data Link layer.
When the payload is passed down through the Data Link layer, it is encapsulated and the Layer 2 header is added before the payload is forwarded to the Physical layer.*
When the payload is passed through the Physical layer to the physical devices on the network, it is transferred as bits and forwarded to the next hop in the network.
*The Frame Check Sequence (FCS) field at the end of the payload at the Data Link layer is used to verify that a frame was received without error.
From the Bottom Up
When the payload is passed to the Data Link layer from the Physical layer, it is passed as bits from the physical devices on the network.
When the payload is passed to the Network layer from the Data Link layer, the Layer 2 header is removed before the payload is delivered.
When the payload is passed to the Transport layer from the Network layer, the Layer 3 header is removed before the payload is delivered.
When the payload is passed to the Session layer from the Transport layer, the Layer 4 header is removed before the payload is delivered.
When the payload is passed to the Presentation layer from the Session layer, the Layer 5 header is removed before the payload is delivered.
When the payload is passed to the Application layer from the Presentation layer, the Layer 6 header is removed before the payload is delivered.
When the payload is passed to the network application from the Application layer, the Layer 7 header is removed before the payload is delivered as data.
Now that you've seen the basics of the OSI model and its seven layers, you'll have to stay tuned for Part III to find out how the TCP/IP model with its four layers is different from but similar to the OSI model.
If you'd like to learn more about the OSI model, Cisco's Open System Interconnection Protocols page is a good resource that provides a lot of additional detail. Another resource you'll want to know about is our Cisco Courseware from Boson. In addition to more complete coverage of the OSI model than both John and I were able to provide in these blogs, this courseware covers all of the ICND1 and ICND2 topics you'll need to master as you prepare for your CCNA certification.