OSI Model:Layers explained

Working of OSI Model

OSI Model:Layers explained

Why do we read OSI Model?

Web developers need to understand the OSI Model because it provides a framework for understanding how web applications communicate with each other over networks. Web applications rely on a wide range of network protocols, such as HTTP, TCP and IP, which operate at different layers of the OSI model. By understanding how these protocols interact with each other and with the underlying hardware and software systems, web developers can design more efficient and secure applications that work seamlessly with other systems. Additionally, the OSI model provides a common language and terminology that developers can use to communicate with other stakeholders in the development process, such as network administrators and software engineers.

What is OSI Model?

The Open Systems Interconnection (OSI) Model is an International Standard Organisation(ISO) standard that covers all aspects of network communication. It is a reference model developed in 1984 by the International Organization for Standardization that specifies how information from one computer's software application passes through physical media to another computer's software application.

The OSI model is a conceptual framework consisting of seven layers, each with a specific function that governs how computer systems communicate with each other over networks. By providing a standardized approach to network design, the OSI model enables interoperability between different types of computer systems, regardless of their underlying architecture and protocols. This ensures that data can be transmitted reliably and efficiently across a wide range of networks and systems, from local area networks(LANs) to the Internet.

Layers of OSI Model

The OSI model consists of 7 separate but related layers, each of which defines a part of the process of moving information across a network.

These seven layers are again broadly categorized into two groups: hardware layers and software layers.

The top three layers of the OSI model are commonly referred to as the software layer, while the bottom three layers are typically referred to as the hardware layer. Among these layers, the transport layer is considered to be the crucial component of the OSI model. Data is transmitted from the sender's end through the physical layer and is then passed up to the application layer. Conversely, at the receiver's end through the physical layer and is then passed up to the application layer and then sent down through the physical layer.

Basic Principle of dividing layers in the OSI Model

The OSI model is designed to break down the complex process of network communication into smaller, more manageable parts, which are organized into seven distinct layers.

Each layer of the OSI model is responsible for a specific aspect of network communication, such as data transmission, addressing, error correction, and flow control. By dividing the process of network communication into these distinct layers, the OSI model enables hardware and software manufacturers to develop products that adhere to a standardized approach to network communication.

The layering approach of the OSI model also allows network engineers to isolate and troubleshoot network problems more easily. Network Engineers can diagnose issues in specific layers instead of examining the entire network infrastructure.

The layers defined in the OSI model provide a standardized framework for network communication, which enables devices and applications from different vendors to communicate with each other seamlessly, while also providing a structured approach to network troubleshooting and maintenance.

OSI Model Layers: Devices and Protocols

Let's understand the layers of the OSI model.

Physical Layer

It is the bottom layer of the OSI model. It facilitates the transmission of raw and unstructured data over the physical medium. Its primary function is to establish and manage the physical connection between devices, which includes activation, maintenance, and deactivation. The physical utilizes various protocols and standards to ensure that data is transmitted at the appropriate speed and sequence. It is also responsible for detecting and correcting errors that may occur during transmission through different mechanisms.

This layer transforms the data bits into signals that can be transmitted over a physical medium, such as copper wires, optical fibres, or wireless channels.

The physical layer also sets the voltage levels, light speeds, or other physical characteristics of the signals for transmission. The data rate, or the number of bits transmitted per second, is also determined by the physical layer.

The physical layer has the following main features.

  1. Convert raw data into signals that can be transmitted over a physical medium.

  2. Transmit the signals over the medium.

  3. Amplify the signals to ensure they reach their destination.

  4. Control the speed of data transmission

There are several protocols and devices used in the physical layer of a communication system.

Protocols:

  1. Ethernet

    A widely used protocol for wired local area networks(LANs).

  2. Wifi

    A wireless networking protocol is used for local and wide area networks.

  3. Bluetooth

    A wireless protocol is used for short-range communication between devices.

Devices:

  1. Transmitter

    A device that converts electrical signals into optical or radio waves for transmission over the physical medium.

  2. Receiver

    A device that converts optical or radio waves back into electrical signals for processing by the higher layers of the protocol stack.

  3. Modem

    A device that converts digital signals from a computer into analog signals for transmission over telephone lines.

The data link layer is responsible for providing error-free communication between two nodes on the same network. It achieves this by breaking the data frames and adding header and trailer information to each frame. This information includes source and destination addresses, as well as error detection and correction codes to ensure the integrity of the data.

In addition to error detection and correction, the data link layer also provides flow control mechanisms to prevent a fast sender from overwhelming a slower receiver. The data link layer also performs channel access control, determining which node has the right to transmit data over the shared communication channel.

Functions of data link layer:

  1. Framing

    The data link layer breaks the data received from the network layer into smaller units called frames. These frames include header and trailer information, which helps in identifying the start and end of each frame.

  2. Physical addressing

    The data link layer adds physical addresses to each frame so that it can be delivered to the correct destination.

  3. Error control

    The data link layer includes error detection and correction mechanisms in the frames to ensure that the data is transmitted without errors.

  4. Flow control

    The data link layer provides flow control mechanisms to manage the flow of data between nodes on the network. This helps to prevent a fast sender from overwhelming a slower receiver.

Let's see some examples of protocols and devices used in the data link layer.

Protocol:

  1. Point-to-Point Protocol (PPP)

    It is used to establish a direct connection between two nodes over a serial link.

Devices:

  1. Network Interface Card (NIC)

    A hardware component that connects a computer to a network and provides the physical and data link layer functionality needed for communication over the network.

  2. Switch

    A networking device operates at the data link layer and is used to forward data between nodes on a network.

  3. Bridge

    A device that connects two separate network segments and operates at the data link layer to manage the flow of data between the segments.

Network Layer

The network layer is responsible for providing communication between hosts on different networks. It achieves this by dividing the data received from the transport layer into packets and adding routing information to each packet. This routing information is used to direct packets to their destination across different networks.

Network layer:communication-types

The network layer also provides two modes of communication: connection-oriented and connectionless. In connection-oriented communication, a virtual circuit is established between the sender and receiver before data transmission begins. This provides a reliable and ordered delivery of packets. In connectionless communication, each packet is sent independently and may take different paths to reach its destination. This provides a more flexible and efficient mode of communication.

The functions of the network layer are:

  1. Logical addressing

    The network layer provides logical addressing to identify devices on different networks. This logical address is typically an IP address, which is used to route packets to their destination.

  2. Routing

    The network layer uses routing algorithms and protocols to determine the best path for a packet to travel from the source to the destination. This involves selecting the next hop or router that the packet should be sent to on its journey.

  3. Packet fragmentation and reassembly

    The network layer is responsible for breaking large packets into smaller units, called fragments, to facilitate transmission across different networks. The network layer at the receiving end reassembles these fragments into their original packets.

  4. Error handling

    The network layer handles errors in packet delivery by using mechanisms such as error detection and retransmission.

Protocols:

  1. Internet Protocol (IP)

    The primary network layer protocol is used for routing packets across the internet and other networks.

  2. Internet Control Message Protocol (ICMP)

    A protocol used for error reporting and diagnostic purposes on IP networks.

  3. Address Resolution Protocol (ARP)

    A protocol is used to map an IP address to a physical address (such as a MAC address) on a local network.

Devices:

  1. Router

    A networking device that operates at the network layer and is used to forward packets between different networks.

Transport Layer

The transport layer is the fourth layer of the OSI model which is responsible for the process to process delivery of data. The main aim of the transport layer is to maintain order so that the data must be received in the same sequence as it was sent by the sender. The transport layer provides two types of services namely connection-oriented and connectionless.

The transport layer performs the following operations.

  1. Segmentation and reassembly

    The transport layer divides data received from the application layer into smaller units called segments, and adds a header with sequence numbers, to ensure that data is delivered in the correct order. At the receiving end, the transport layer reassembles the segments back into their original data.

  2. Flow control

    The transport layer is responsible for controlling the flow of data between the sender and the receiver from being overwhelmed with too much data too quickly.

  3. Error control

    The transport layer provides mechanisms to detect and correct errors that may occur during data transmission.

  4. Multiplexing/demultiplexing

    It allows multiple applications to share the same network connection, by providing a way to identify which data belongs to which application. This is done through port numbers.

  5. Connection-oriented and connectionless services

    It provides two types of services:connection-oriented, where a virtual circuit is established between the sender and receiver before data transmission begins, and connectionless, where each segment is sent independently and may take different paths to reach its destination.

Protocols:

  1. Transmission Control Protocol (TCP)

    A connection-oriented protocol that provides reliable, ordered delivery of data, flow control and error control.

  2. User Datagram Protocol (UDP)

    A connectionless protocol that provides fast, but unreliable delivery of data.

Devices:

  1. Load balancers

    Devices that distribute network traffic between multiple servers, operate at the transport layer to balance the load between different connections.

Session Layer

The session layer is the fifth layer of the OSI model, responsible for establishing, managing, and terminating sessions between applications running on different hosts. A session is a logical connection between two applications, and the session layer ensures that this connection is maintained throughout the session.

The functionality of the session layer is:

  1. Session establishment:

    The session layer is responsible for establishing, maintaining and terminating sessions between applications. It provides mechanisms for initiating sessions, authenticating users and exchanging session parameters.

  2. Session management:

    Once a session has been established, the session layer manages the session by coordinating the exchange of data between applications. It provides mechanisms for controlling the flow of data, synchronizing data transfer and ensuring that data is sent and received in the correct order.

  3. Session security:

    The session layer provides mechanisms for securing sessions, such as encrypting data, authenticating users, and controlling access to shared resources.

  4. Session recovery:

    The session layer provides mechanisms for recovering from errors and interruptions in a session. It can save the current state of a session, allowing it to be resumed later if the session is interrupted.

The session layer is primarily concerned with managing sessions between applications, rather than with specific devices or protocols. However, some common examples of devices and protocols that operate at the session layer include:

  1. Remote Procedure Call (RPC)

    RPC is a protocol that allows a client application to call a procedure on a remoter server as if it were a local procedure. The session layer provides mechanisms for establishing and managing these remote procedure calls.

  2. Telnet

    Telnet is a protocol that allows a user to connect to a remote computer and interact with it as if it were a local computer.

Presentation Layer

It is the sixth layer of the OSI model and is responsible for ensuring that data is presented in a format that can be understood by the receiving application. The main function of the Presentation Layer is to provide a standard representation of data that can be exchanged between different systems. This includes functions such as data compression, encryption and data conversion.

The Presentation layer takes data from the Application Layer and transforms it into a format that can be sent across the network. This may involve converting data into a common format that can be understood by both the sending and receiving systems, such as converting character data from one encoding to another. The Presentation Layer can also be used to compress data to reduce the amount of data that needs to be transmitted over the network, or to encrypt data to provide security for sensitive information.

The functions of the presentation layer:

  1. Data representation

    The presentation layer is responsible for converting data from one format to another so that it can be understood by the receiving application. This includes functions such as character encoding, data compression and data encryption.

  2. Syntax recognition

    The Presentation Layer is responsible for identifying the syntax of the data being transmitted so that it can be interpreted correctly by the receiving application.

  3. Encryption and decryption

    It provides encryption and decryption services to protect sensitive data as it is transmitted over the network.

  4. Compression and decompression

    The Presentation Layer can compress data to reduce the amount of data that needs to be transmitted over the network, and then decompress the data at the receiving end.

  5. Translation

    The Presentation Layer can translate data from one language or character set to another so that it can be understood by the receiving application.

Some of the protocols used in the Presentation layer include:

  1. AFP (Apple Filling Protocol)

    AFP is a protocol used by Apple computers to share files and resources over a network. It is used to transfer files, directories and metadata between computers running on Apple's Macintosh operating system.

  2. ICA (Independent Computing Architecture)

    ICA is a protocol used by Citrix to deliver remote desktop services to clients. It is used to transfer screen updates, keyboard and mouse inputs, and audio and video data between the server and the client.

  3. Citrix System Core Protocol (CSCP)

    CSCP is a protocol used by Citrix to manage user sessions and application delivery. It is used to transfer information about user sessions, applications and policies between servers and clients.

Application Layer

The Application Layer is the topmost layer in the OSI model and is responsible for providing services to end users. The Application Layer interacts with software applications running on a system and enables users to access network resources. It provides protocols and services that allow applications to exchange data over the network, regardless of the underlying hardware and software.

The main function of the Application layer is to provide a means for applications to communicate with each other and exchange data in a way that is transparent to the end users. This layer includes protocols for email, file transfer, remote logging and many other applications that users interact with daily.

The application layer includes a wide range of protocols and devices that enable applications to communicate over the network.

  1. HTTP (Hypertext Transfer Protocol)

    This is a protocol used for web browsing and enables clients to request web pages from servers.

  2. SMTP(Simple Mail Transfer Protocol)\

    This protocol is used for sending and receiving email messages over the network.

  3. FTP (File Transfer Protocol)

    This protocol is used for transferring files between systems over the network.

  4. DNS (Domain Name System)

    This is a protocol used for converting domain names into IP addresses.

Advantages of the OSI model

  1. The OSI model establishes a standard framework for network communication, allowing different vendors to create network devices and software that can communicate with each other.

  2. The seven-layer design of the OSI model allows for easier troubleshooting and problem diagnosis by providing a clear separation of network functions and responsibilities.

  3. By breaking down complex networks into smaller, more manageable components, the layered approach of the OSI model simplifies network design and maintenance.

  4. The interoperability between different network devices and software is enhanced by the OSI model, which allows for seamless communication between different networks and applications.

  5. Each layer of the OSI model has a specific function, which reduces complexity and allows for the development of specialized network equipment and software.

  6. The flexibility of the OSI model allows for the development of new protocols and technologies to meet the changing needs of network communications.

Disadvantages of the OSI model

  1. Complex

    The OSI model is complex and can be difficult to understand for beginners, which can make it challenging to implement and troubleshoot.

  2. Expensive

    Implementing the OSI model requires significant investment in specialized hardware and software, which can be expensive for organisations with limited budgets.

  3. Inefficient

    The OSI model involves a lot of overhead due to its layered approach, which can slow down network communication and make it less efficient.

  4. Limited applicability

    The OSI model was designed for use in traditional wired networks and may not be suitable for newer technologies such as wireless networks or the Internet of Things.

  5. Lack of adoption

    Despite its advantages, the OSI model has not been widely adopted in the industry, with many organizations using models such as the TCP/IP model.

Did you find this article valuable?

Support WebIndia by becoming a sponsor. Any amount is appreciated!