OSI Model Explained

Mohit Sharma
5 min readDec 27, 2023

--

OSI Model

The OSI model is a conceptual framework that describes the functions of a networking or telecommunication system. It consists of seven layers, each of which corresponds to a specific network function. The seven layers are:

Physical Layer

Responsible for transmitting raw bits over a communication channel. It defines the electrical and physical specifications for devices and cables.

Protocols used are Ethernet, Token Ring, FDDI

Data-link Layer

Responsible for transmitting data frames over a communication channel between two adjacent nodes on a network. It provides error detection and correction mechanisms. The Data link layer is divided into two sublayers:

  1. Logical Link Control (LLC) sublayer: This sublayer provides services to the Network layer and communicates with the upper layers of the OSI model. It is responsible for error checking and flow control.
  2. Media Access Control (MAC) sublayer: This sublayer provides services to the Physical layer and communicates with the lower layers of the OSI model. It is responsible for controlling access to the physical medium and addressing.

Some examples of protocols that use the Data link layer are:

  1. Ethernet: This is a widely used LAN protocol that uses the MAC sublayer of the Data link layer.
  2. Point-to-Point Protocol (PPP): This is a protocol used for establishing a direct connection between two nodes on a network. It uses both the LLC and MAC sublayers of the Data link layer.
  3. High-Level Data Link Control (HDLC): This is a bit-oriented protocol used for communication between two nodes on a network. It uses both the LLC and MAC sublayers of the Data link layer.

Network Layer

It is responsible for the following functions:

  1. Logical addressing: Logical addressing to identify devices on a network. This addressing scheme is independent of the physical addressing scheme used by the Data link layer.
  2. Routing: Routing packets between networks. It uses routing protocols to determine the best path for packets to travel from the source device to the destination device.
  3. Fragmentation and reassembly: Responsible for breaking up large packets into smaller packets that can be transmitted over a network. It also reassembles these packets at the destination device.
  4. Some of the protocols used are IP, ICMP, ARP, RARP

Transport Layer

Responsible for providing end-to-end communication services and error recovery. It is responsible for the following functions:

  1. Segmentation and reassembly: For breaking up large data streams into smaller segments that can be transmitted over a network. It also reassembles these segments at the destination device.
  2. Connection-oriented communication: Can establish a connection between two devices before transmitting data. This ensures that data is transmitted reliably and in order.
  3. Flow control: Responsible for controlling the rate at which data is transmitted between devices to prevent congestion on the network.
  4. Error recovery: Provides mechanisms for detecting and recovering from errors that occur during transmission.

Some of the protocols used are TCP, UDP

Session Layer

Responsible for establishing, managing, and terminating sessions between applications. It is responsible for the following functions:

  1. Session establishment: Establishes a session between two applications on different devices.
  2. Session management: Manages the session by synchronizing data exchange between the two applications.
  3. Session termination: Terminates the session when the data exchange is complete.
  4. The Session layer provides services to the Presentation layer and receives services from the Transport layer.

Some examples of protocols that use the Session layer are:

  1. Remote Procedure Call (RPC): This is a protocol used for communication between applications on different devices. It uses the Session layer to establish and manage sessions between applications.
  2. AppleTalk: This is a protocol suite used by Apple devices for communication over networks. It uses the Session layer to establish and manage sessions between applications.

Presentation Layer

Responsible for data translation and code formatting. It is responsible for the following functions:

  1. Data translation: Translates data from the format used by the application layer into a format that can be transmitted over the network.
  2. Code formatting: Formats data into a standard format that can be understood by the receiving device.

Application Layer

  1. Responsible for providing network services to applications. It is responsible for the following functions:
  2. Network virtual terminal: The Application layer provides a virtual terminal to the application that allows it to communicate with other applications on the network.
  3. File transfer, access, and management (FTAM): The Application layer provides services for file transfer, access, and management.
  4. Mail services: The Application layer provides services for sending and receiving mail.
  5. The Application layer provides services to the Presentation layer.

Difference between Network layer and Transport layer

The Network layer is responsible for routing data between different networks. It provides logical addressing and determines the best path for data to travel between networks. Logical addressing means that each device on the network has a unique address that identifies it. The Network layer uses this address to determine where to send data. The Network layer also determines the best path for data to travel between networks. This is important because there may be multiple paths that data can take, and some paths may be faster or more reliable than others.

The Transport layer is responsible for ensuring that data is transmitted reliably between devices. It provides error detection and correction and ensures that data is transmitted in the correct order. Error detection and correction means that the Transport layer checks to make sure that the data has been transmitted correctly. If there are any errors, the Transport layer can request that the data be retransmitted. Ensuring that data is transmitted in the correct order means that the Transport layer makes sure that the data arrives at its destination in the same order that it was sent.

In simpler terms, the Network layer is like a map that helps data get from one network to another. It tells the data where to go and how to get there. The Transport layer is like a delivery person that makes sure the data gets to where it needs to go safely and on time.

TCP vs UDP (Transport Layer)

TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are two different protocols used in computer networking. They are both used to transmit data over a network, but they do it in different ways.

TCP is a connection-oriented protocol. This means that it establishes a connection between two devices before transmitting data. It provides reliable transmission of data, which means that it ensures that all data is transmitted correctly and in the correct order. TCP also provides flow control, which means that it regulates the amount of data that is sent at any given time to prevent congestion on the network.

UDP is a connectionless protocol. This means that it does not establish a connection before transmitting data. It provides unreliable transmission of data, which means that it does not ensure that all data is transmitted correctly or in the correct order. UDP does not provide flow control, which means that it can send data as fast as it can without regard for the state of the network.

In simpler terms, TCP is like a phone call where you establish a connection before talking. You can hear everything the other person says and you can ask them to repeat something if you didn’t hear it correctly. UDP is like sending a letter in the mail. You don’t establish a connection beforehand and you don’t know if the letter will arrive or not.

--

--