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 or receive data
6 Presentation Encrypt, format and compress data for transmission
5 Session Initiate and terminate session with remote system
Bottom Layers 4 Transportation Break data stream in smaller segments and provide reliable or unreliable 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.

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 second types of programs are referred in application layer. It doesn’t mean that first types 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 required by network-aware applications to connect to 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 function 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 few examples of standards and protocols used in this layer.

The Session Layer

The session layer is the fifth layer of OSI model. This layer manages the dialog between computers. It does this by setting up, managing, and dismantling sessions between Presentation layer entities and keeping user data separate.

When an application makes any network request, this layer checks whether the required resources available in local system or in remote system. If required resource is available in remote system, it tests whether a network connection to access required resource from remote system is available or not. If network connection is not available, it sends an error message back to the application informing it 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 session layer.

The Transport Layer

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

Segmentation

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 exact same 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.

Multiplexing

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 the network. Logical address is known as IP address.

Once logical address and other related information are added in segment, it becomes packet. This layer also decides whether the packet is intended for local system or remote system. If packet is intended for remote system, this layer also specifies the standards for devices and protocols which are used to move data packet between different 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 function 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 function 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 standards for any device, media and technology those are used to move 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 standards used in this layer.

Since bottom layers are highly tested in networking exams and interviews, I will explain the functionality of each layer in detail with examples individually in next parts of this tutorial. This tutorial is the second part of the article "OSI Model and TCP/IP Model explained with layers". Other parts of this tutorial are following.

OSI Model Advantages and Basic Purpose Explained

This tutorial is the first part of the article. It explains why the OSI Model and the TCP/IP Model were created along with the purposes of OSI model and TCP/IP model.

That’s all for this tutorial. In next part of this tutorial we will understand how data is processed through the each layer in OSI model. 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