OSI Seven Layers Model Explained with Examples

This tutorial explains OSI Reference model step by step. Learn the seven layers of OSI model; Application, Presentation, Session, Transport, Network, Data Link and Physical in detail along with their functions.

The OSI (Open System Interconnection) Reference Model is the comprehensive set of standards and rules for hardware manufacturers and software developers. By following these standards, they can build the networking components and software applications which work in dissimilar environments. In 1984, the ISO (International Organization for Standardization) published this Model.

The OSI model not only provides a framework for creating and implementing networking standards, devices, and internetworking schemes but also explains the networking from a modular perspective, making it easier to understand and troubleshoot.

Seven layers of OSI Model

The OSI model has seven different layers, divided into two groups.

Group Layer Number Layer Name Description
Top Layers 7 Application Provide user interface to send and receive the data
6 Presentation Encrypt, format and compress the data for transmission
5 Session Initiate and terminate session with remote system
Bottom Layers 4 Transport Break data stream in smaller segments and provide reliable and unreliable data delivery
3 Network Provide logical addressing
2 Data Link Prepare data for transmission
1 Physical Move data between devices

seven layers of OSI model

Let’s understand each layer in detail.

This tutorial is the second part of the article "Networking reference models explained in detail with examples". This article explains following CCNA topic.

Compare and contrast OSI and TCP/IP models

Other parts of this article are following.

OSI Model Advantages and Basic Purpose Explained

This tutorial is the first part of the article. It briefly explains the reasons why OSI model was created along with the advantages.

Similarities and Differences between OSI and TCP/IP Model

This tutorial is the third part of the article. It compares OSI reference model with TCP/IP model and lists the similarities and differences between both models.

TCP/IP Reference Model Explained

This tutorial is the fourth part of the article. It explains the five layers of TCP/IP model in detail.

Data Encapsulation and De-encapsulation Explained

This tutorial is the fifth part of the article. It explains how data is encapsulated and de-encapsulated when it passes through the layers.

The Application Layer

This is the last and the topmost layer of the OSI model. This layer provides an interface between application programs running in system and network. If any application needs to access any resource that is available in remote system, it interacts with this layer. Then this layer encompasses the protocols and services that the application will employ to access that resources.

There are two types of application programs; network-aware and network-unaware. An application program is considered as network-aware when it can make any sort of network request. If an application program can’t make any kind of network request, it is considered as network-unaware program.

Network-aware programs are further divided in two categories;

  1. Programs which are mainly created to work in local system but if require can connect with remote system such as MS-Word, Adobe-Photoshop, VLC Player, etc.
  2. Programs which are mainly created to work with remote system such as SSH, FTP, TFTP, etc.

Only the programs which fall in second type are referred in application layer. It doesn’t mean that first type of programs can’t take the advantage of application layer. It simply means that, they are not documented in application layer. But if require, they can also connect with the network through the application layer.

Top layer of OSI model is application layer. It provides the protocols and services that are required by the network-aware applications to connect with the network. FTP, TFTP, POP3, SMTP and HTTP are the few examples of standards and protocols used in this layer.

The Presentation Layer

The sixth layer of OSI model is the Presentation layer. Applications running in local system may or may not understand the format that is used to transmit the data across the network. The presentation layer works as the translator in OSI model. When receiving data from application layer, it converts that data in such a format that can be sent over the network. When receiving data from session layer, it reconverts that data in such a format that the application which will use the incoming data can understand.

Convert, compress and encrypt are the main functions which presentation layer performs in sending computer while in receiving computer there are reconvert, decompress and decrypt. ASCII, BMP, GIF, JPEG, WAV, AVI, and MPEG are the few examples of standards and protocols which work in this layer.

The Session Layer

The session layer is the fifth layer of OSI model. It is responsible for setting up, managing, and dismantling sessions between presentation layer entities and providing dialogs between computers.

When an application makes a network request, this layer checks whether the requested resource is available in local system or in remote system. If requested resource is available in remote system, it tests whether a network connection to access that resource is available or not. If network connection is not available, it sends an error message back to the application informing that connection is not available.

If network connection is available, it establishes a session with remote system. For each individual request, it uses a separate session. This allows multiple applications to send or receive data simultaneously. When data transmission is completed, it terminates the session.

The session layer is responsible establishing, managing, and terminating communications between two computers. RPCs and NFS are the examples of the session layer.

The Transport Layer

The transport layer is the fourth layer of OSI model. It provides following functionality: -


On sending computer, it breaks data stream into smaller pieces before transmission. Each piece is known as segment and the process of breaking data into smaller pieces is known as segmentation. On receiving computer, it joins all segments back in data stream. So the upper layers receive data in the format in which it was sent.

Data transportation

This layer establishes a logical connection between sending system and receiving system and uses that connection to provide end-to-end data transportation. For data transportation, it mainly uses two protocols; TCP and UDP.

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 connection-less protocol.

Main difference between a connection-less and connection-oriented protocol is that a connection-oriented protocol provides reliable data delivery. For reliable data delivery, it uses several mechanisms such as, three way handshake process, acknowledgments, sequencing and flow control.


Through the use of port numbers, this layer also provides connection multiplexing. Connection multiplexing allows multiple applications to send and receive data simultaneously.

Main functionalities of transport layer are segmentation, data transportation and connection multiplexing. For data transportation, it uses TCP and UDP protocols. TCP is a connection-oriented protocol. It provides reliable data delivery.

The Network Layer

The third layer of OSI model is the Network Layer. This layer takes data segment from transport layer and adds logical address to it. A logical address has two components; network partition and host partition. Network partition is used to group networking components together while host partition is used to uniquely identity a system on a network. Logical address is known as IP address. Once logical address and other related information are added in segment, it becomes packet.

This layer decides whether the packet is intended for local system or remote system. It also specifies the standards and protocols which are used to move the data packets across the networks.

To move data packet between two different networks, a device known as router is used. Router uses logical address to take routing decision. Routing is a process of forwarding data packet to its destination.

Defining logical addresses and finding the best path to reach the destination are the main functions of this layer. Router works in this layer. Routing also takes place in this layer. IP, IPX and AppleTalk are the examples of this layer.

The Data Link Layer

The Data Link Layer is the second layer of 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 media. It also provides physical addressing. Physical address is known as MAC address. Unlike logical addresses which need to be configured, physical addresses are pre-configured in NIC. MAC address is used to uniquely identify a host in local network.

LLC (Logical Link Control)

This sub layer identifies the network layer protocol. On sending computer, it encapsulates the information of the Network Layer protocol in LLC header from which the Data Link layer receives the data packet. On receiving computer, it checks the LLC header to get the 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.

Defining physical addresses, finding host in local network, specifying standards and methods to access the media are the primary functions of this layer. Switching takes place in this layer. Switch and Bridge work in this layer. HDLC, PPP and Frame Relay are the examples of this layer.

The Physical Layer

The Physical Layer is the first layer of OSI model. This layer specifies the standards for devices, media and technologies which are used in moving the data across the network such as:-

  • Type of cable used in connecting the devices
  • Patterns of pin used in both sides of cable
  • Type of interface card used in networking device
  • Type of connector used to connect the cable with 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 sending computer, it converts digital signals received from the Data Link layer, in analog signals and loads them in physical media. On receiving computer, it picks analog signals from media and converts them in digital signals and transfers them to the Data Link layer for further processing.

The Physical Layer mainly defines standards for media and devices that are used to move the data across the network. 10BaseT, 10Base100, CSU/DSU, DCE and DTE are the few examples of the standards used in this layer.

That’s all for this tutorial. In next part of this article I will compare OSI model with TCP/IP model and explains the similarities and differences between both models. If you like this tutorial, please don’t forget to share it with friends.

ComputerNetworkingNotes CCNA Study Guide OSI Seven Layers Model Explained with Examples