OSI Seven Layers Model Explained with Examples
The OSI (Open System Interconnection) reference model is a comprehensive set of standards and rules for hardware manufacturers and software developers. By following these standards, they can build networking components and software applications that work in any environment. It was published in 1984 by ISO (International Organization for Standardization).
The OSI model provides a framework for developing and implementing networking standards, devices, and internetworking schemes. Its modular structure facilitates both comprehension and troubleshooting of network operations.
Seven layers of the OSI Model
The OSI model consists of seven layers, organized into two groups. The table below lists each layer along with its corresponding name and number.
| Group | Layer Number | Layer Name | Description |
| Top Layers | 7 | Application | Provides a user interface for data transmission and reception. |
| 6 | Presentation | Encrypts, formats, and compresses data before transmission. | |
| 5 | Session | Initiates and terminates sessions with remote systems. | |
| Bottom Layers | 4 | Transport | Divides the data stream into smaller segments and manages both reliable and unreliable data delivery. |
| 3 | Network | Provides logical addressing for network communication. | |
| 2 | Data Link | Prepares data for transmission across the network. | |
| 1 | Physical | Transfers data between network devices. |

The Application Layer
This is the last and topmost layer of the OSI model. This layer provides an interface between the local system and the application program running on the network. If an application wants to use the resources available on the remote system, it interacts with this layer. Then, this layer provides the protocols and services that the application needs to access those resources.
There are two types of application programs: Network-aware and Network-unaware. An application program is considered network-aware if it can make any network request. If an application program cannot make any network requests, it is considered network-unaware.
Network-aware programs are further divided into two types.
- Programs that are primarily built to run on a local system. This type of program occasionally accesses the network for particular reasons such as updates, documentation, and troubleshooting. MS Word, Adobe Photoshop, and VLC Player are examples of this type of program.
- Programs that are primarily designed to work with a remote system. This type of program provides a platform for accessing resources on a remote system. This type of program only works if the system is connected to the network. SSH, FTP, and TFTP are examples of this type of program.
The Application layer primarily addresses programs of the second type. However, this does not prevent programs of the first type from utilizing the Application layer. They are not explicitly documented for this. If necessary, these programs can also establish network connections through the Application layer.
The application layer, the top layer of the OSI model, provides the protocols and services that enable network-aware applications to connect to the network. Examples of standards and protocols at this layer include FTP, TFTP, POP3, SMTP, and HTTP.
The Presentation Layer
The Presentation layer is the sixth layer of the OSI model. Applications on the local system may not inherently recognize the data formats used for network transmission. The Presentation layer functions as a translator. It converts data from the Application layer into a format suitable for network transmission and, upon receiving data from the Session layer, reconverts it into a format comprehensible to the application.
On the sending computer, the Presentation layer performs conversion, compression, and encryption. On the receiving computer, it handles reconversion, decompression, and decryption. Examples of standards and protocols at this layer include ASCII, BMP, GIF, JPEG, WAV, AVI, and MPEG.
The Session Layer
The session layer is the fifth layer of the OSI model. It is responsible for setting up, managing, and terminating sessions between source and destination, as well as for providing dialogs between them.
When an application makes a network request, this layer checks whether the requested resource is available locally or on a remote system. If the requested resource is available on a remote system, it tests whether a network connection to that system is available. If a network connection is unavailable, it sends an error message back to the application.
If a network connection is available, it establishes a session with the remote system. For each request, it uses a separate session. This allows multiple applications to send or receive data simultaneously. When data transmission is complete, the session terminates.
The session layer is responsible for establishing, managing, and terminating communications between two computers. Examples of protocols operating at this layer include RPCs and NFS.
The Transport Layer
The transport layer is the fourth layer of the OSI model. It provides the following functionalities:-
Segmentation
On the sending computer, the data stream is broken into smaller pieces. Each piece is called a segment, and the process of breaking the data stream into smaller pieces is called segmentation. On the receiving computer, it joins all segments to recreate the original data stream.
Data transportation
This layer establishes a logical connection between the sending and receiving systems and uses it to provide end-to-end data transport. This process uses two protocols: TCP and UDP.
The TCP protocol is used for reliable data transportation. TCP is a connection-oriented protocol. UDP protocol is used for unreliable data transportation. UDP is a connectionless protocol.
The main difference between a connectionless and a connection-oriented protocol is that a connection-oriented protocol provides reliable data delivery. For reliable data delivery, it uses mechanisms such as the three-way handshake, acknowledgments, sequencing, and flow control.
Multiplexing
Using port numbers, this layer also provides connection multiplexing. Connection multiplexing allows multiple applications to send and receive data simultaneously.
The primary functions of the Transport layer include segmentation, data transportation, and connection multiplexing. For data transport, it utilizes TCP and UDP. TCP, as a connection-oriented protocol, ensures reliable data delivery.
The Network Layer
The third layer of the OSI model is the Network Layer. This layer takes the data segment from the Transport layer and adds a logical address to it. A logical address has two components: network partition and host partition. The Network partition groups networking components, while the host partition uniquely identifies a system on the network. A logical address is called an IP address. Once the logical address and other related information are added to the segment, the resulting structure becomes a packet.
This layer decides whether the packet is intended for the local system or a remote system. It also specifies the standards and protocols for moving data packets across networks. To move data packets between two different networks, a device known as a router is used. Routers use the logical address to make the routing decision. Routing is the process of forwarding data packets to their destination.
The main functions of the Network layer are to assign logical addresses and determine the optimal path to the destination. Routers operate at this layer, where routing occurs. Examples of protocols at this layer include IP, IPX, and AppleTalk.
The Data Link Layer
The Data Link Layer is the second layer of the OSI model. This layer defines how networking components access the media and what transmission methods they use. This layer has two sub-layers: MAC and LLC.
MAC (Media Access Control)
This sub-layer defines how the data packets are placed in the media. It also provides physical addressing. The physical address is known as the MAC address. Unlike logical addresses, which need to be configured, physical addresses are preconfigured in the NIC. The MAC address uniquely identifies a host on a local network.
LLC (Logical Link Control)
This sub-layer identifies the network layer protocol. On the sending computer, the Network Layer protocol information is encapsulated in the LLC header, which the Data Link layer receives. On the receiving computer, the LLC header is checked to obtain information about the network-layer protocol. This way, a data packet is always delivered to the same network layer protocol from which it was sent.
The primary functions of the Data Link layer include defining physical addresses, identifying hosts on the local network, and specifying media access standards and methods. Switching occurs at this layer, with switches and bridges operating here. Examples of protocols at this layer include HDLC, PPP, and Frame Relay.
The Physical Layer
The Physical Layer is the first layer of the OSI model. This layer specifies the standards for devices, media, and technologies that are used in moving the data across the network, such as:-
- Type of cable used in connecting the devices
- Patterns of pins used on both sides of the cable
- Type of interface card used in the networking device
- The type of connector used to connect the cable to the network interface
- Encoding of digital signals received from the Data Link layer based on the attached media type, such as electrical for copper, light for fiber, or a radio wave for wireless.
On the sending computer, it converts digital signals received from the Data Link layer into analog signals and loads them on the physical media. On the receiving computer, it receives analog signals from the media, converts them to digital signals, and passes them to the Data Link layer for further processing.
The Physical Layer primarily defines standards for media and devices used to transmit data across the network. Examples of standards at this layer include 10BaseT, 10Base100, CSU/DSU, DCE, and DTE.
This tutorial is part of the tutorial series "Networking reference models explained in detail with examples". Other parts of this series are the following.
Chapter 1 What is a Networking Model Explained
Chapter 2 OSI Model Advantages and Basic Purpose Explained
Chapter 3 Difference between original and modern TCP/IP models
Chapter 4 Similarities and Differences between the OSI and TCP/IP models
Chapter 5 Adjacent-layer and same-layer interactions
Chapter 6 Data Encapsulation and De-encapsulation Explained
Chapter 7 OSI Seven Layers Model Explained with Examples
Chapter 8 TCP/IP Reference Model Explained
Chapter 9 Application layer in the OSI and TCP IP layers models
Chapter 10 Presentation layer and Session layer of the OSI model
Chapter 11 The Transport Layer Explained
Chapter 12 Segmentation Explained with TCP and UDP Headers
Chapter 13 Connection Multiplexing Explained with Examples
Chapter 14 TCP Features and Functions Explained with Examples
Chapter 15 The Network Layer Explained
Chapter 16 The Data Link and Physical layers Explained
Conclusion
The OSI reference model remains a foundational framework in networking, providing a structured approach to understanding and designing network systems. Dividing network communication into seven distinct layers enables interoperability, simplifies troubleshooting, and clarifies the roles of various protocols and devices. Mastery of the OSI model equips professionals with the insights needed to build, manage, and secure complex networks effectively in today's interconnected world.
By ComputerNetworkingNotes Updated on 2026-02-26