The Open Systems Interconnect (OSI) Model

Table of Contents

Introduction

The Open Systems Interconnection (OSI) Model is a conceptual framework used to understand and standardize the functions of a communication system or network. Developed by the International Organization for Standardization (ISO), the OSI model breaks down network communication into 7 distinct layers, each with its own specific role and functionality. This layered architecture allows for the division of complex network functions into smaller, manageable parts, making it easier for developers and engineers to create interoperable and flexible systems.

The 7 layers of the OSI model are:

7 – Application Layer: Provides network services directly to the user’s applications, such as web browsers, email clients, and file transfers
6 – Presentation Layer: Translates data between the application layer and the network, handling encryption, compression, and data format conversion
5 – Session Layer: Manages and controls connections between computers, establishing, maintaining, and terminating communication sessions
4 – Transport Layer: Ensures end-to-end communication, providing reliable data transfer with mechanisms such as error correction, flow control, and packet sequencing
3 – Network Layer: Handles the routing of data packets across networks and ensures they reach the correct destination
2 – Data Link Layer: Ensures reliable transmission of data frames between two nodes connected by a physical layer
1 – Physical Layer: Concerned with the transmission of raw data bits over a physical medium (e.g., cables, wireless)

Each of these layers is independent from every other in its purpose and responsibilities and interacts with the layer directly above and below it. The primary goal is: ensure that the data transmitted from one system can be properly received and understood by another, even if different types of hardware, software, and communication protocols are used.

OSI Model Concept

Image: OSI Model Concept

Following the movement of data through the OSI model is easy. When two devices want to communicate with each other (see image above), data will be sent from the Application (7) layer of the source computer or device. The data, in the form of a packet, continues down the layers of the OSI model until it reaches the Physical (1) layer. From there, it begins its journey as electrical impulses, representing 1 and 0, onto the physical network.

The Physical (1) layer is where data joins with the transmission media and is transmitted over cables or through the air. The transfer physically occurs as an electrical signal, modulated light, or radio waves. When the data reaches the destination device, it travels back through the OSI model until it is fully processed and usable in the Application (7) layer.

The OSI model is important in the world of networking for the following reasons:

  • Standardization: By defining the functions of network communication into 7 layers, the OSI model provides a universal set of standards that manufacturers and developers can follow. This ensures that devices and technologies from different vendors can work together seamlessly.
  • Interoperability: The OSI model enables different network protocols and hardware from different manufacturers to communicate with one another, promoting vendor neutrality. For example, a Cisco router can communicate with a Juniper router because both follow the standards defined by the OSI model.
  • Modular Design: The layered structure of the OSI model simplifies the design and troubleshooting of networks. Engineers can focus on specific layers when diagnosing problems, which helps them to identify and resolve issues more efficiently. For instance, if there is a problem with the transmission of signals, attention would be focused on the Physical Layer; if there’s an issue with routing, the Network Layer becomes the focus.
  • Flexibility in Development: The OSI model enables changes in one layer without affecting the other layers. For example, upgrading a physical medium (such as from copper wire to fiber optics) does not necessarily require changes in the software running at higher layers, such as the Transport Layer or Application Layer.
  • Educational Tool: The OSI model is often used as a foundational teaching tool for networking students and professionals. By breaking down complex processes into manageable pieces, it helps learners understand the different aspects of data communication.
  • Protocol Development: The OSI model serves as a guide for protocol development. Protocols like TCP/IP, HTTP, and SMTP map to specific layers within the OSI model. This helps ensure that new protocols developed today can interoperate with existing protocols.

Go back

OSI Model

The OSI model is a conceptual framework used to describe how data is transmitted and received over a network. It divides networking tasks into 7 layers, starting from the physical transmission of data to its application to end-users. These layers work in a sequential manner, where each layer depends on the services of the layer beneath it and provides services to the layer above it.

Each layer handles specific tasks and communicates with the layers directly above and below it to ensure proper data flow. Data encapsulation occurs when a layer adds its own information (e.g., headers) to the data from the layer above before passing it down the stack for transmission. The reverse process, de-encapsulation, occurs when the data is received at the destination, and each layer removes its respective headers and processes the data.

OSI Reference Model

Image: OSI Reference Model

This image above represents the OSI (Open Systems Interconnection) Reference Model, made of 7 distinct layers, each of which is responsible for a specific function. The image visually presents each layer with its data unit and how encapsulation and de-encapsulation work in transmitting and receiving data over a network. The table below contains a detailed explanation of each part.

Layer
Number
Layer
Name
Function Data
Representation
Encapsulation De-encapsulation Data
Units
Type
7 Application The Application layer is where communication directly interacts with the end-user applications, such as web browsers, email clients, or file transfer programs. It allows user interaction with the network, providing services like HTTP, FTP, SMTP, etc. Raw application data (e.g., HTTP requests and responses) The data from the application layer is passed to lower layers for further encapsulation The application at the receiving end interprets the data and presents it to the end-user Data Host
6 Presentation The Presentation layer is responsible for translating, encrypting, and compressing data from the application layer. It ensures that the data sent by the application layer of one system can be understood by the application layer of another system, despite differences in data formats Encrypted or compressed data This layer adds encryption and data transformation to protect the data At the receiving end, it decrypts and decompresses the data, passing it to the Application layer Data Host
5 Session The Session layer manages and controls the sessions between two communicating devices. This includes setting up, maintaining, and tearing down connections. It can manage multiple sessions and synchronize them Raw application data that is passed to the Presentation layer The session protocol data unit is simply data from the application Receives the data and manages it according to the session state Data Host
4 Transport The Transport layer provides end-to-end communication control, ensuring complete and accurate data delivery. This layer can provide either reliable transport (using TCP) or faster, unreliable transport (using UDP). The TCP/UDP segment contains a header that handles flow control, error checking, and reassembly of data Segments for TCP and datagrams for UDP are the data units used at this layer Adds TCP/UDP headers to the data, ensuring the data is properly sequenced, acknowledged, or timed out if needed Extracts the data from the segment, removing the TCP/UDP header Segments (TCP) or Datagrams (UDP) Host
3 Network The Network layer is responsible for routing data across different networks (inter-networking). It decides the best path for the data to reach its destination, using logical addressing (like IP addresses). This layer adds an IP header containing the source and destination IP addresses Packets are data units that travel across different networks. The packet structure contains the IP header that helps in determining the routing path Adds an IP header to the data Removes the IP header once the packet reaches the target network Packets Media
2 Data Link The Data Link layer ensures reliable transmission of data across the physical link. It provides error detection, correction, and manages access to the shared media (e.g., determining who can send data at a given time). It adds a MAC header to the data that includes addressing information for devices on the same network Frames represent the structured data used for communication between nodes on the same network Adds a MAC header, framing the data Removes the MAC header at the receiving end and forwards the data to the Network layer Frames Media
1 Physical The Physical layer is responsible for the transmission and reception of raw bit streams over a physical medium such as copper wires, fiber optics, or wireless signals. This layer deals with the physical connection between devices and how signals are transmitted and received In the image, bits (ones and zeros) are depicted as the data unit that travels over copper, fiber, or wireless mediums Physical layer sends the raw bit stream When data is received, it’s converted back into signals that higher layers can interpret Bits Media

In the OSI (Open Systems Interconnection) model, the 7 layers are typically implemented as a combination of software (SW) and hardware (HW), depending on their roles in managing communication. The higher layers (3-7) are mostly software-based, while the lower layers (1-2) involve hardware components, with some software for managing protocols and error checking.

You can easily remember the names of the layers with the mnemonicAll People Seem To Need Data Processing.” I would certainly get used to referring to each layer by its number because this is how real-world network technicians use the OSI [4].

Go back

Data Encapsulation

When a user wants to communicate with another computer, the user’s computer must request conversation with the destination computer. As part of its request (and any subsequent messages), it needs to add the
information for the recipient computer to understand how to process the information. The process of adding information to data as it passes through the layers is known as encapsulation.

As the data moves down through the OSI layers, header and trailer information is added to the packet. The packet header describes the packet, including the source and destination computers and something about what the packet contains. The trailer identifies the end of the packet and usually includes data that helps identify transmission errors when they occur. The data inside the packet does not change during the encapsulation process. At the destination device, the header and trailer information is put through a process sometimes referred to as decapsulation, leaving just the original data.

OSI Model Data Encapsulation

Image: OSI Model Data Encapsulation
Credit: [1]

The main terms related to data encapsulations are explained below:

  • Encapsulation: the process by which header and trailer information is appended to a data packet as it passes from computer to computer over a network.
  • Header: the set of information that is added to the beginning of a data packet.
  • Trailer: information that is added to the end of a data packet.
  • Decapsulation: the process by which the header and trailer information is stripped from a data packet.

Go back

7 – Application Layer

The Application layer is the 7th and topmost layer of the OSI (Open Systems Interconnection) model. Its primary role is to provide the end user with a way to interact with the network by offering a suite of utilities that support various application programs. However, it is important to note that the Application layer is not the application itself (e.g., a web browser or email client), but the protocols and services that these applications rely on to communicate over the network.

Protocols operating at the Application layer enable the direct interface between the user’s software applications and the underlying network infrastructure. These protocols ensure that data generated by the applications can be properly sent, received, and processed across a network. The Application layer provides an essential gateway to the network by managing the data exchange between user-facing applications and the transport mechanisms beneath.

OSI Model - 7 Application Layer

Image: OSI Model – 7 Application Layer

Although there are many services that the Application layer provides, 5 major categories are commonly encountered in most networked environments, including the Internet:

File Services

File services allow users to store, retrieve, and manipulate files on remote systems as if they were on a local computer.

When you use File Transfer Protocol (FTP) to upload or download files from an FTP server, you are utilizing file services provided by the Application layer. Similarly, Network File System (NFS) and Server Message Block (SMB) are file-sharing protocols that allow you to access shared folders and files on another system within your local network or over the Internet.

E-mail Services

E-mail services allow users to send and receive electronic messages over a network.

When you send an email using Simple Mail Transfer Protocol (SMTP), your email client (such as Gmail, Outlook, or Thunderbird) communicates with the mail server to route the message to the recipient’s server. To receive messages, protocols like Post Office Protocol 3 (POP3) or Internet Message Access Protocol (IMAP) are commonly used. These protocols work at the Application layer, ensuring seamless email communication across different mail systems.

Network Printing Services

Network printing services enable users to print documents over a network, allowing printers to be shared across multiple computers.

In an office environment, you may use Internet Printing Protocol (IPP) or Line Printer Daemon (LPD) to send a print job from your computer to a shared network printer. The Application layer provides the communication interface between your computer and the printer, ensuring that your print jobs are properly handled and managed.

Application Services

Application services provide the network support needed for software applications to operate efficiently. These services are often used by business software and custom enterprise applications.

If you’re using a cloud-based business application like Google Docs or Salesforce, the Application layer enables the necessary data exchange between the client (your web browser) and the cloud service’s servers. Protocols like HTTP (Hypertext Transfer Protocol) or HTTPS (secure HTTP) allow you to access web-based services, ensuring proper formatting and transmission of data between the application server and your web browser.

Database Services

Database services allow networked applications to access and manage data in a remote database system.

When an online e-commerce platform retrieves product information from a remote SQL database, the Application layer uses protocols like ODBC (Open Database Connectivity) or JDBC (Java Database Connectivity) to query, retrieve, and manipulate data. Applications like CRM (Customer Relationship Management) and ERP (Enterprise Resource Planning) systems rely on these database services to access business-critical information.

Web Browsers

Image: Web Browsers
Credit: Google

One common misconception about the Application layer is to assume that it directly correlates with the application programs themselves, like Microsoft Word or Adobe Photoshop. However, the Application layer is not the software itself but the set of network services that these applications may use.

For example, Microsoft Word, a word processing software does not run on the Application layer itself, but it can utilize Application layer services such as network printing (to send documents to a network printer) or email services (to attach and send documents via SMTP).

Similarly, a video conferencing tool such as Zoom or Microsoft Teams leverages Application layer protocols like SIP (Session Initiation Protocol) for managing voice and video calls. Although these tools operate at the application level from a user perspective, they rely heavily on the Application layer’s network protocols for seamless communication.

In conclusion, the Application layer plays a vital role in making sure that users can interact with the network in a meaningful way, whether they are sending emails, browsing the web, or accessing shared files. Its protocols provide the necessary foundation for applications to work over a network, enabling various services like file transfer, web browsing, email, and database access. Understanding the Application layer and its protocols is critical for any network professional, as it forms the final interface between users and the powerful network systems they rely on daily.

Go back

6 – Presentation Layer

The Presentation layer (Layer 6) of the OSI model is responsible for translating data between the application layer and the session layer. It ensures that the data being sent is properly formatted, compressed, and encrypted so that it can be correctly interpreted by the recipient system. Essentially, the Presentation layer serves as the translator and data manipulator for network communications. It prepares the data for presentation to the user while accommodating the differences between various data formats, character sets, or data structures.

The Presentation layer performs three key functions:

  • Data Presentation
  • Data Compression
  • Data Encryption
OSI Model - 6 Presentation Layer

Image: OSI Model – 6 Presentation Layer

Data Presentation ensures that the data sent from one device can be understood by the receiving device. Different devices, operating systems, and applications may use different data formats (e.g., character encoding formats like ASCII or Unicode, multimedia formats like JPEG or MPEG). The Presentation layer acts as a bridge, converting this data into a format that can be understood by the receiving system.

For example, let’s imagine that a user on a Windows machine sends a text file to another user on a macOS machine. The Presentation layer ensures that both systems can correctly interpret the text. Windows might use a different character encoding format than macOS, but the Presentation layer handles this conversion to ensure that the text appears correctly on the destination system.

Similarly, if a Windows user is sending a video file in MP4 format to a macOS user who uses QuickTime, the Presentation layer may handle conversions or provide compatibility so that the recipient can view the video without any errors or corruption.

Data Compression is the process of reducing the size of the data to allow faster transmission over the network. Large amounts of data can be compressed to reduce bandwidth usage and minimize delays.

For example, think about a scenario where a user is uploading a large image file to a cloud server. The image file is originally in a high-resolution format and is quite large. To optimize network performance, the Presentation layer compresses the file—perhaps converting a large bitmap image into a compressed JPEG format before sending it over the network.

At the receiving end, the Presentation layer decompresses the file so that the recipient can view it in its original resolution. This process ensures that large data files, such as high-definition videos or large documents, can be transmitted more quickly while minimizing the consumption of network resources.

In another example, consider a VoIP (Voice over IP) call. The audio data is compressed during transmission to ensure real-time communication with minimal lag. Once the compressed audio reaches the recipient, the Presentation layer decompresses the data for playback in real time, ensuring smooth voice communication.

Data Encryption is the process of converting plain data into an encoded format that can only be decrypted by authorized parties. Encryption ensures that sensitive information is protected from unauthorized access during transmission.

For example, let’s imagine that you’re logging into an online banking system to check your account balance. Your login credentials (username and password) are encrypted at the Presentation layer using a secure encryption algorithm (such as AES or RSA) before being transmitted over the network. Even if an attacker intercepts the data during transmission, they will not be able to understand it because it’s encrypted. Only the authorized bank server, which holds the decryption key, can decode the credentials and authenticate your login.

Encryption is also crucial when transmitting sensitive business information, like financial reports or personal identification data. The Presentation layer plays a key role in applying encryption algorithms to ensure that unauthorized users cannot access confidential data during transmission.

In summary, the Presentation layer is essential for making sure that the data being sent over a network is both usable by the recipient and secure from unauthorized access. Whether it’s converting text formats, compressing large files for faster transmission, or encrypting sensitive information, the Presentation layer ensures that network communications are efficient, reliable, and secure.

Go back

5 – Session Layer

The Session layer (Layer 5) of the OSI model is responsible for managing and controlling the dialogues (sessions) between computers. It ensures that the communication between two systems is properly established, maintained, and terminated, and that the data being exchanged is organized correctly.

The primary functions of the Session layer include:

  • Session Initiation, Maintenance, and Termination
  • Dialog Control
  • Session Recovery (Resynchronization)
  • Session Accounting
  • Dialog Separation

Let’s break down each of these roles in more detail, using practical examples to illustrate how the Session layer operates in real-world networking.

OSI Model - 5 Session Layer

Image: OSI Model – 5 Session Layer

Session Initiation, Maintenance, and Termination: Managing the Connection Lifecycle

The Session layer is responsible for starting, maintaining, and terminating communication sessions between two devices or systems. A session can be thought of as a conversation or interaction that happens between computers, much like a phone call:

  • Session initiation: involves setting up a session by establishing parameters such as authentication, permissions, and any required services (e.g., file transfer or security checks).
  • Session maintenance: ensures that the session stays alive while the communication is ongoing, even if there are interruptions or delays in data transmission.
  • Session termination: ends the session in an orderly fashion once communication is complete, ensuring that resources are freed up for other processes. It also provides a mechanism to abort a session prematurely in case of errors or if the session is no longer needed.

For example, imagine that you are logging into an online banking application. As soon as you enter your username and password and press “login,” the Session layer is activated. It authenticates your credentials, starts a session, and allows you to perform secure transactions. Once you’re done with your banking activities and click “logout,” the Session layer closes the session to prevent unauthorized access. If there is a sudden network disruption, the Session layer can temporarily suspend the session and resume it once the connection is restored.

Dialog Control: Managing Who Talks and When

The Session layer also manages dialog control, which is responsible for determining the flow of data between devices and controlling the sequence in which data is sent and received. In other words, it governs which device in the communication is allowed to transmit data at a given time. There are three types of communication managed by the Session layer:

  • Simplex: Data flows in one direction only, like a one-way street. This is typical in broadcast communication (e.g., TV or radio).
  • Half duplex: Data can flow in both directions, but only one device can send data at a time. This is similar to a walkie-talkie, where one person talks while the other listens, then they switch.
  • Full duplex: Data can flow in both directions simultaneously. Think of a telephone conversation where both parties can speak and listen at the same time.

As example, when you’re using a VoIP (Voice over IP) service like Skype or Zoom, the Session layer ensures full-duplex communication so both participants can talk and listen at the same time. If you were using a walkie-talkie instead, the Session layer would switch to half-duplex communication, where one person speaks while the other listens, and then they take turns.

For Simplex communication, consider a satellite broadcasting a live event on TV – data flows only from the satellite to the television, with no communication back from the viewer to the satellite.

Session Recovery: Handling Interruptions and Resynchronization

Network interruptions can occur due to a variety of reasons, such as packet loss, network congestion, or hardware failure. The Session layer ensures that communication can recover from such interruptions by using resynchronization mechanisms. It does this by inserting markers, or checkpoints, into the data stream, so that if an interruption occurs, the session can be resumed from the last checkpoint.

For example, consider an FTP (File Transfer Protocol) session where a large file is being transferred from a server to a client. If the network connection drops during the transfer, the Session layer can use the markers to pick up the transfer from where it left off once the connection is restored, rather than starting over from the beginning. This saves time and bandwidth.

Session Accounting: Monitoring and Billing

The Session layer also supports session accounting, which tracks the usage of a session for billing purposes. This is particularly important in networks where users or organizations are charged based on session duration or the volume of data transferred.

As example, in some Wide Area Network (WAN) connection methods, such as those used by Internet Service Providers (ISPs), billing is based on the amount of data transmitted during a session or the duration of the session. The Session layer tracks the start and end of each session to ensure the correct amount is billed to the appropriate user. For example, if you’re using a mobile data network to download files, your ISP may charge you based on the total data usage during the session.

Dialog Separation: Organizing the Data Stream

The Session layer also handles dialog separation, which involves inserting markers or “boundaries” into the data being transmitted. These markers help keep the data organized and allow for recovery in case packets are lost or arrive out of order. They help the session understand where one part of the conversation ends and another begins, ensuring that the conversation can be reconstructed accurately even if some data is lost.

Example: think of a video conference session. While you’re streaming video and audio to another participant, the Session layer inserts markers to separate different parts of the data stream. If packets are lost during transmission due to network congestion, the markers allow the system to identify which parts of the stream need to be retransmitted. This ensures that the conversation can continue smoothly without significant interruptions.

Similarly, when downloading a large file over HTTP, the Session layer ensures that the file is split into smaller segments that can be reassembled at the destination, even if some packets are lost along the way.

Practical Example: Session Layer in a VoIP Call

A typical VoIP (Voice over IP) call is a great example of how the Session layer functions in real life:

  1. Session initiation: You open a VoIP app like Skype and dial a number. The Session layer sets up the connection by establishing parameters such as authentication, encryption, and media type (audio, video, or both).
  2. Session maintenance: As the conversation continues, the Session layer maintains the connection. It ensures that both parties can send and receive data in real time, allowing for full-duplex communication. If there’s a brief network outage, the Session layer might pause the conversation temporarily and resume it when the network is restored.
  3. Session termination: When you hang up the call, the Session layer cleanly closes the session, ensuring that no more data is transmitted and that any resources allocated for the session (such as bandwidth or processing power) are freed up.
  4. Dialog control: During the call, the Session layer manages the flow of data, allowing both participants to talk simultaneously (full duplex) while handling any interruptions gracefully.
  5. Billing: If you’re using a paid VoIP service, the Session layer tracks the duration of the call to ensure that you’re charged for the correct amount of usage.

In conclusion, the Session layer plays a critical role in managing, controlling, and recovering communication sessions between devices. Whether it’s a file transfer, a VoIP call, or a web-based application, the Session layer ensures that the interaction is smooth, reliable, and efficient. By handling dialog control, session recovery, and even billing, the Session layer keeps the network communication organized and flowing without interruptions.

Go back

4 – Transport Layer

The Transport layer (Layer 4) of the OSI model is responsible for ensuring that data is transmitted efficiently, reliably, and accurately across a network. Its primary role is to manage the flow of data between systems by breaking it down into smaller units known as segments, handling flow control, and ensuring that the data arrives at the destination in the correct order and without errors.

To understand the Transport layer’s functions in more depth, we’ll explore the key mechanisms it uses, such as flow control, windowing, and acknowledgments, and examine real-world examples of how it works in practical networking scenarios.

OSI Model - 4 Transport Layer

Image: OSI Model – 4 Transport Layer

Before data from higher layers can be transmitted over the network, the Transport Layer breaks it down into smaller pieces called segments. This segmentation is crucial because network devices cannot handle large chunks of data all at once, especially over unreliable or slower network connections.

As an example, think of sending a large file (like a high-definition video) over email. The Transport layer breaks that video into smaller, manageable segments that can be sent across the network and reassembled at the destination. If this segmentation didn’t happen, sending such large files would be inefficient and error-prone, especially over slower connections.

Before two devices can communicate, the Transport layer sets up a virtual circuit. A virtual circuit is essentially a temporary, logical connection that ensures data is exchanged between devices reliably. This process happens through connection-oriented communication, where a connection is established before the actual data transfer begins.

When you visit a website (via HTTP over TCP), the Transport layer first sets up a virtual circuit between your device and the web server, ensuring that data is reliably transmitted and received. Without a virtual circuit, data might get lost or corrupted along the way, leading to broken web pages or failed downloads.

Flow Control: Managing Data Transmission

One of the most critical functions of the Transport layer is flow control, which ensures that the sending system doesn’t overwhelm the receiving system by sending too much data at once. If the receiving system becomes overwhelmed, it can ask the sender to pause transmission until it can process more data. This is especially important when devices have mismatched network speeds, such as a high-speed broadband connection communicating with a slower dial-up modem.

Source Quench Message: When the receiving device can’t process incoming data quickly enough, it sends a source quench message to the sender, telling it to stop transmitting temporarily. This gives the receiving device time to catch up.

OSI Model - Transport Layer - Flow Control

Image: OSI Model – Transport Layer – Flow Control
Credit: [4]

Example: Imagine you’re downloading a file from a fast server, but your internet connection is slow. Without flow control, the server might send data too quickly for your device to process, leading to packet loss or corrupted files. With flow control, the Transport Layer on your device can tell the server to slow down, ensuring the data arrives without issues.

Windowing: Controlling the Flow of Segments

Windowing is a technique used by the Transport layer to control the amount of data that can be sent before the sender must wait for an acknowledgment from the receiver. The window size is the amount of data (in segments) that can be transmitted before requiring an acknowledgment from the receiving system. As the data is transmitted, the window “slides” open and closed, ensuring a steady and controlled flow of data.

Sliding Window Protocol: This dynamic windowing process allows the window to expand or contract based on network conditions, allowing for more efficient use of the network.

OSI Model - Transport Layer - Windowing

Image: OSI Model – Transport Layer – Windowing
Credit: [4]

Example: suppose you are watching a video stream on a platform like YouTube. The video data is streamed in segments, and the Transport Layer manages the flow using windowing. If the network connection is stable and fast, the window can expand, allowing more segments to be sent before waiting for an acknowledgment. However, if the connection slows down, the window will shrink, reducing the number of segments sent at once to prevent buffer issues or video freezing.

Acknowledgments: Ensuring Reliable Data Delivery

Another crucial feature of the Transport layer is acknowledgment, where the receiving system confirms that it has successfully received data segments. After receiving a specific number of segments, the receiver sends an acknowledgment (ACK) back to the sender, confirming that the data arrived intact and in the correct order. If the acknowledgment is not received within a certain time frame, the sender will retransmit the data.

OSI Model - Transport Layer - Acknowledgement

Image: OSI Model – Transport Layer – Acknowledgement
Credit: [4]

Example: when you send an email, the Transport layer ensures that every segment of the email message reaches the recipient’s email server. After each segment is received, the server sends an acknowledgment to the sender’s email client. If any segment gets lost in transit, the sender’s Transport layer will resend the missing segment until the entire email has been transmitted successfully.

The Three-Way Handshake: Establishing a Reliable Connection

Before any data can be exchanged using a reliable, connection-oriented protocol like TCP (Transmission Control Protocol), the Transport layer establishes a connection using the three-way handshake. This handshake ensures that both devices are ready to communicate and have agreed on the parameters of the session.

The three steps of the handshake are:

  • SYN (Synchronize): The sender sends a synchronization packet to the receiver, requesting to establish a connection.
  • SYN-ACK (Synchronize Acknowledgment): The receiver responds with a SYN-ACK, acknowledging the request and agreeing to establish the session.
  • ACK (Acknowledgment): The sender sends an acknowledgment, and the connection is established, allowing data to flow.

OSI Model - Transport Layer - Three Way Handshake

Image: OSI Model – Transport Layer – Three Way Handshake
Credit: [4]

Example: When you open a web page, the Transport layer on your device initiates a three-way handshake with the web server. Once the connection is established, your device starts receiving data (like HTML files, images, etc.) from the server. If the handshake is incomplete, the connection will not be established, and the page will fail to load.

Protocols in the Transport Layer

The Transport Layer uses various protocols to manage data transmission, with the two most commonly used being TCP (Transmission Control Protocol) and UDP (User Datagram Protocol).

TCP (Transmission Control Protocol): Reliable and Connection-Oriented

TCP is a reliable, connection-oriented protocol. It ensures that data is transmitted in the correct order and without errors by using acknowledgments, flow control, and windowing. TCP also uses the three-way handshake to establish a connection before any data is sent. Many common Internet services use TCP, including HTTP/HTTPS (for web browsing), FTP (for file transfer), and Telnet (for remote terminal access).

Example: When you log into an online banking portal using HTTPS, the Transport Layer relies on TCP to establish a secure, reliable connection. Every time you perform an action, like checking your balance or transferring money, TCP ensures that all data is sent and received accurately and in the correct order, preventing errors in transactions.

UDP (User Datagram Protocol): Connectionless and Faster

Unlike TCP, UDP is a connectionless protocol that sends data without establishing a connection or checking whether the data has arrived safely. UDP is used when speed is more important than reliability, and where occasional data loss is acceptable. UDP is used by services such as DNS (Domain Name System) for quick lookup of website addresses, TFTP (Trivial File Transfer Protocol) for simple file transfers, and VoIP (Voice over IP) for real-time communication.

Example: In a live video streaming scenario (like watching a sports game), UDP is often preferred because it’s more important for the stream to be fast than perfectly reliable. Even if some data packets are lost, the stream will continue without much noticeable effect. However, if TCP were used, the lost packets would be retransmitted, causing delays and interruptions in the stream.

Why Use UDP? Although UDP does not guarantee delivery like TCP, it is much more efficient in terms of bandwidth usage and speed. In situations where real-time data delivery is essential and occasional packet loss can be tolerated, UDP is the preferred choice. For example, in a video conference call, where real-time communication is crucial, using UDP allows the conversation to flow without noticeable delays. Even if some data packets are lost (which may cause minor glitches in the audio or video), the overall communication remains fluid. Using TCP in this scenario would introduce too much overhead and delay due to its retransmission mechanisms.

In summary. the Transport layer plays a vital role in ensuring that data is transmitted effectively and reliably between devices. By managing flow control, acknowledgments, and error recovery, the Transport layer ensures that communication is efficient, regardless of network conditions. Whether using TCP for reliability or UDP for speed, the Transport layer is crucial for enabling the vast range of applications and services that we rely on in today’s interconnected world.

Go back

3 – Network Layer

The Network layer, also known as Layer 3 in the OSI model, is responsible for determining how data is transferred from one device to another across multiple networks. It handles the logical addressing of devices, tracks their locations, and determines the best route for data packets to travel. Unlike lower layers, which focus on point-to-point communication, the Network Layer ensures that data can move between devices that are not locally attached, often through several intermediary devices such as routers.

OSI Model - 3 Network Layer

Image: OSI Model – 3 Network Layer

Device Addressing and Routing

At the core of the Network layer is the ability to route data between devices, even if they are on different networks. Routers, which are Layer 3 devices, are tasked with forwarding data packets between networks by using information from their routing tables.

Example: imagine you’re sending an email from your home network in New York to a server in London. The Network layer in your computer communicates with the router on your local network, which examines the destination IP address and determines that the email needs to be sent outside your home network. The router consults its routing table and forwards the email packet to another router closer to its destination. This process continues until the packet reaches its final destination—perhaps passing through multiple routers across cities and continents.

Routing Process: How Data is Forwarded

When a router receives a packet, it first checks the destination IP address to see if the packet is meant for itself. If not, it looks up the destination network in its routing table, which contains a list of network addresses and the corresponding exit interfaces to use for forwarding. Once the appropriate interface is chosen, the packet is sent out on the local network to its next hop (which could be another router or the destination device).

If a router cannot find an entry for the destination network in its routing table, it will drop the packet. This is necessary to prevent packets from wandering aimlessly in the network and potentially overloading it.

Example: when you browse the internet, your device sends a request to load a webpage. Your local router will examine the packet’s destination IP address and check its routing table to decide where to send the packet next. If the packet is for a network the router doesn’t know about, it might send the packet to a default gateway (another router that has more extensive routing knowledge). This way, the packet can eventually reach the right destination, even if it means hopping through several networks.

Data Packets vs. Route Update Packets

There are two main types of packets used at the Network layer:

  • Data Packets: These carry user data (e.g., emails, web pages) through the network. The protocols responsible for routing these packets are called routed protocols. Examples of routed protocols include IP and IPv6. These protocols assign unique logical addresses to devices (IP addresses), ensuring that data reaches the right device on the network.
  • Route Update Packets: These packets are used to update routers with new network information. Routers periodically exchange routing updates to keep their routing tables accurate and up to date. The protocols that send route updates are known as routing protocols. Common examples include RIP (Routing Information Protocol), EIGRP (Enhanced Interior Gateway Routing Protocol), and OSPF (Open Shortest Path First).

Example: let’s say you’re watching a YouTube video. The data packets carrying the video are routed through multiple networks and routers. Each router uses its routing table to forward the packets toward the destination. Meanwhile, the routers continuously update their tables using route update packets, ensuring that if a link goes down, they can quickly find an alternative route to send your video packets.

The Routing Table: A Router’s Map

The routing table is crucial to the functionality of a router. It contains:

  • Network Addresses: these are protocol-specific addresses (such as IP or IPv6) that represent networks (NET). Routers must maintain different routing tables for each protocol in use on the network. Think of these network addresses as street signs in different languages, guiding data to the right location.
  • Exit Interface: this is the path or network interface (INT) a router uses to forward a packet to its next hop.
  • Metric: this is a value that helps the router determine the best route to a destination. Different routing protocols calculate metrics in various ways. For example, RIP uses hop count (the number of routers a packet passes through), while OSPF considers factors like bandwidth and delay.

OSI Model - Network Layer - Routing table used in a router

Image: OSI Model – Network Layer – Routing table used in a router
Credit: [5]

Example: Imagine a router as a GPS system for data packets. When you ask the GPS for directions, it calculates the best route based on distance, traffic, and road conditions. Similarly, a router uses its routing table to determine the optimal path based on metrics like hop count or bandwidth, ensuring that data travels quickly and efficiently.

Routing Protocols and Their Use

Each protocol has its strengths and weaknesses, and network administrators choose the appropriate one based on the size and complexity of the network.

  • RIP (Routing Information Protocol): Uses hop count to determine the shortest path between two networks. It’s simple but less efficient for large networks.
  • EIGRP (Enhanced Interior Gateway Routing Protocol): Uses a more advanced algorithm, taking into account factors like bandwidth, delay, and reliability, to calculate the best route.
  • OSPF (Open Shortest Path First): A widely used protocol that breaks networks into areas and calculates the shortest path using link-state information.

Example: consider a corporate network with multiple offices. Each office has its own local network, but they need to communicate with each other efficiently. The routers between these offices might use OSPF to constantly update their routing tables and calculate the most efficient routes for sending data between offices, taking into account the speed and congestion of various links.

Routers and Network Segmentation

One of the key functions of routers is to segment networks. Routers break up broadcast domains, which prevents broadcast traffic (like ARP requests) from overwhelming the network by confining it to a single segment. By default, routers do not forward broadcast packets, which helps manage network congestion and improve security.

Routers also break up collision domains, though this can also be done using Layer 2 switches. Each interface on a router represents a separate network, and each network must be assigned a unique address. This segmentation allows routers to manage traffic more effectively and prevents network issues from spreading across large areas.

Example: in a large office building, different departments (such as HR, finance, and IT) may be on separate network segments. The router connects these segments and ensures that broadcast traffic from one department doesn’t flood the entire network. If an HR employee sends a broadcast request (e.g., for an IP address), the router ensures that it stays within the HR network and doesn’t reach finance or IT.

Key Features of Routers

To summarize, here are some critical features of routers (Layer 3 devices):

  • Broadcast Control: routers do not forward broadcast or multicast packets by default, limiting unnecessary traffic on the network.
  • Logical Addressing: routers use the logical address (like an IP address) in a packet’s header to determine where to forward it.
  • Access Control: network administrators can create access control lists (ACLs) on routers to filter traffic and enhance network security. These lists can block or allow certain types of packets from entering or leaving an interface.
  • Layer 2 Bridging: routers can provide Layer 2 bridging functions when necessary, allowing them to connect different types of networks, such as Ethernet and Token Ring.
  • VLAN Interconnection: routers can connect virtual LANs (VLANs), allowing devices on different VLANs to communicate while maintaining isolation.
  • Quality of Service (QoS): routers can provide QoS for specific types of network traffic, prioritizing critical services like VoIP or video streaming over less time-sensitive data.

Example: if your office uses VoIP for phone calls, the router can be configured with QoS rules to prioritize voice traffic over regular data traffic. This ensures that your calls remain clear and uninterrupted, even when the network is busy with other activities, like file downloads or web browsing.

In conclusion, the Network layer is essential for ensuring data can travel across complex, interconnected networks. It handles the logical addressing of devices, determines the best route for data, and ensures that packets reach their destination even if they must pass through multiple networks. Routers play a critical role at this layer by making intelligent decisions about how to forward packets and keep networks efficient, secure, and scalable.

Go back

2 – Data Link Layer

The Data Link layer (Layer 2) plays a crucial role in ensuring that data can be transmitted across a physical link without errors. It manages the interaction between the physical transmission circuit in the Physical Layer (Layer 1) and transforms this raw communication link into a more reliable channel, free from transmission errors (at least as far as the upper layers are concerned). This layer is responsible for error detection, correction, and the framing of data.

OSI Model - 2 Data Link Layer

Image: OSI Model – 2 Data Link Layer

In simpler terms, while the Physical layer transmits the raw bits over the network medium, the Data Link layer organizes these bits into manageable chunks, called frames, and ensures that they are transmitted error-free to the destination. Functions of the Data Link layer:

  • Error Detection and Correction: the Data Link layer implements mechanisms to detect errors that may occur during transmission and, in some cases, correct them. If the errors cannot be corrected, the layer ensures that the data is retransmitted.
  • Framing: before sending data, the Data Link layer wraps the data packet in a frame, adding necessary control information such as the source and destination Layer 2 addresses. A frame is the basic unit of data at this layer, and it contains not only the actual data (payload) but also metadata for error detection, flow control, and addressing.

The Data Link layer is divided into two sublayers: the Logical Link Control (LLC) sublayer and the Media Access Control (MAC) sublayer. Each sublayer has distinct responsibilities, and together they enable efficient communication over a variety of network mediums.

OSI Model - Data Link Layer - IEEE Standards

Image: OSI Model – Data Link Layer – IEEE Standards
Credit: [5]

Logical Link Control (LLC) sublayer

The LLC sublayer is responsible for handling communication between the upper layers of the OSI model (such as the Network and Transport layers) and the lower layers (such as the MAC sublayer). It essentially acts as a bridge, ensuring that data can flow smoothly between different protocols.

The LLC sublayer supports two types of communication services:

  • Connectionless Service (LLC Type 1): In this mode, the LLC assumes that the data has been transmitted correctly and does not wait for an acknowledgment from the destination. This method is lightweight, fast, and commonly used when the underlying layers provide reliable transmission. For instance, Ethernet primarily uses this type of service since error detection and retransmission are handled at higher layers.
  • Connection-Oriented Service (LLC Type 2): This service ensures that data is transmitted correctly by establishing a connection between the source and destination devices. It checks for acknowledgments and ensures error-free transmission. However, since higher layers (like the Transport layer) also provide reliable delivery services, LLC Type 2 is not commonly used.

Example: Think of a connectionless service like sending a letter through regular mail: you drop it in a mailbox and assume it will arrive at its destination. In contrast, a connection-oriented service is more like using a courier service that requires a signature upon delivery. The courier will confirm that the letter arrived safely.

Media Access Control (MAC) sublayer

The MAC sublayer manages how data is transmitted to and from the physical medium. It is responsible for adding the device’s MAC address (also known as the physical address) to the data frame. The MAC address plays a critical role in ensuring that the data can be directed to the correct device once it reaches the local network.

The role of MAC addresses: a MAC address is a unique identifier assigned to every network interface card (NIC) by the manufacturer. It is a 48-bit address (typically written as six pairs of hexadecimal digits), and no two devices in the world share the same MAC address. The first three pairs of the MAC address are assigned by the manufacturer, identifying the vendor, while the last three pairs are unique to the specific device.

When a device sends data, the MAC sublayer inserts both the source and destination MAC addresses into the frame. Once the frame reaches its destination, the receiving device uses this address to determine whether it should process the data.

Example: imagine sending a package to a friend. You include both the recipient’s street address and your return address on the label. The delivery service uses this information to make sure the package reaches the correct house. Similarly, the MAC sublayer adds the source and destination MAC addresses to the data frame, ensuring it reaches the correct device on the local network.

Why is a MAC Address Necessary? While the IP address (used by the Network Layer) helps route data between networks, the MAC address is necessary for locating the specific device within the destination network. When a data packet reaches the local network, routers or switches use the MAC address to determine which exact device should receive the data.

Framing: Converting Packets into Frames

At the Data Link layer, framing is the process of encapsulating the data packet from the Network layer into a frame. This frame includes not just the payload (the actual data), but also important control information like the MAC addresses, error-checking bits (e.g., CRC – Cyclic Redundancy Check), and frame delimiters.

This image below illustrates the structure of an Ethernet Type II frame, which is a data packet encapsulated at the Data Link layer (Layer 2) of the OSI model

Ethernet Type 2 Frame

Image: Ethernet Type 2 Frame

Let’s break down each part of the frame:

  1. Preamble (7 bytes): the preamble consists of 7 bytes (56 bits), all set to the pattern 10101010. It’s used to synchronize communication between devices. The alternating pattern helps the receiving device lock onto the signal, preparing it for the upcoming data.
  2. SFD (Start Frame Delimiter) (1 byte): the SFD (Start Frame Delimiter) is a 1-byte field (10101011 or D5 in hexadecimal) that marks the end of the preamble and the beginning of the actual Ethernet frame. It signals the receiver that the next bit will start the frame.
  3. Destination MAC Address (6 bytes): this field is the MAC address of the intended recipient. It is 6 bytes (48 bits) long and is used to ensure that the frame is delivered to the correct device on the network. In the image, the destination MAC address is 80:00:20:7A:3F:3E.
  4. Source MAC Address (6 bytes): this is the MAC address of the sending device, also 6 bytes (48 bits) long. It indicates which device sent the frame. In the image, the source MAC address is 80:00:20:21:3A:AE.
  5. EtherType (2 bytes): the EtherType field is 2 bytes long and identifies the protocol encapsulated in the payload. For example: 0x0800 represents IPv4 and 0x0806 represents ARP (Address Resolution Protocol). In this example, the EtherType field is 0x0800, indicating that the frame carries an IPv4 packet.
  6. Payload (Data) (46-1500 bytes): this is the actual data being transmitted. The payload can vary in size from 46 bytes to 1500 bytes, depending on the amount of data that needs to be sent. This could be an IP packet, ARP message, or any other data.
  7. CRC Checksum (4 bytes): the Cyclic Redundancy Check (CRC) field is used for error detection. It’s a 4-byte value calculated based on the contents of the frame. The receiving device will calculate its own CRC value to verify that the data has not been corrupted during transmission. If the CRC values don’t match, the receiver will discard the frame and request a retransmission.
  8. Interframe Gap (IFG): the Interframe Gap is a small idle time (minimum of 12 bytes worth of time) inserted between frames. This ensures there is enough time for devices to process the frame before the next one arrives, preventing collisions or buffer overflows.

Ethernet Frames Example: consider Ethernet, one of the most widely used networking technologies. When you send an email, for example, the data is encapsulated into an Ethernet frame before being transmitted across your local network. The frame includes your device’s MAC address as the source, the destination MAC address, and the email content (payload). If there’s an error during transmission, the receiving device can detect it and request a retransmission, thanks to the error-checking bits included in the frame.

Error Detection and Correction

Error detection is one of the most critical functions of the Data Link layer. When a frame is transmitted across a network, it might become corrupted due to interference or signal degradation. To address this, the Data Link layer uses techniques such as Cyclic Redundancy Check (CRC) to detect errors. When a frame arrives at its destination, the receiving device checks the frame’s CRC value. If the calculated value matches the transmitted value, the frame is considered error-free. If not, the frame is discarded, and the sender may be asked to retransmit the data.

Wi-Fi Communication Example: When you connect to a Wi-Fi network and download a file, the data is transmitted in frames. Due to the nature of wireless communication, there might be interference that corrupts the frames. The Data Link Layer on your device will check each incoming frame for errors using CRC. If a corrupted frame is detected, the device will request that the corrupted frame be resent, ensuring that you receive the file without errors.

In summary, the Data Link layer transforms a raw physical transmission medium into a reliable data communication link by framing data, detecting and correcting errors, and addressing devices using MAC addresses. This ensures that data can be successfully transmitted across a network with minimal errors.

Go back

1 – Physical Layer

The Physical layer (Layer 1) of the OSI model is responsible for the physical connection between network devices. It establishes the rules and specifications that govern how raw data is converted into signals and physically transmitted across different types of network media. This includes determining the physical aspects of the network such as:

  1. Voltage levels for data signals.
  2. Timing of signals or clocking rates (bit rate).
  3. Cable types (e.g., coaxial, fiber optic, twisted pair).
  4. Connectors and interfaces used to link devices.
OSI Model - 1 Physical Layer

Image: OSI Model – 1 Physical Layer

Key Functions of the Physical Layer

  1. Data Transmission: the Physical layer defines how data in the form of bits (0s and 1s) is converted into electrical or optical signals that can be transmitted over physical media (e.g., copper cables, fiber optics, or radio waves in wireless communication).
    • Electrical signals: For wired networks using copper cables like Ethernet, the data is transmitted as voltages where a specific voltage level represents a binary 1 or 0.
    • Optical signals: In fiber optic cables, light pulses are used to represent binary data.
    • Radio waves: For wireless communication, radio waves transmit the binary data using different modulation techniques.
  2. Transmission Rates: the Physical layer specifies how fast the data is transmitted. The bit rate (measured in bits per second, or bps) determines how many bits can be sent across the medium in a given time. For example:
    • Ethernet (IEEE 802.3) standards specify speeds such as 10 Mbps, 100 Mbps, 1 Gbps, and even up to 10 Gbps.
    • Wi-Fi (IEEE 802.11) specifies different speeds, depending on the version of the standard being used (e.g., 54 Mbps for 802.11g, or several Gbps for newer versions like 802.11ax).
  3. Network Interface Card (NIC) functionality: the NIC (Network Interface Card) operates at the Physical layer. It converts digital data from the higher layers into the corresponding physical signals based on the type of network connection.
    • For Ethernet, the NIC converts data into electrical signals.
    • For Wi-Fi, the NIC converts data into radio waves.
    • For fiber optic connections, it converts data into light pulses.
  4. Physical Media and Connectors: the Physical layer defines the specifications for physical media and the type of connectors used. This includes whether the network uses:
    • Coaxial cables (used in older Ethernet networks and cable TV connections).
    • Twisted pair cables (used in modern Ethernet connections, such as Cat5e, Cat6 cables).
    • Fiber optic cables for high-speed, long-distance transmission.
    • Wireless communication for radio signals.
    • the connectors used to link these media to devices, such as RJ45 connectors for twisted-pair Ethernet, are also part of the Physical layer standards.
  5. Transmission Standards: a wide range of standards are used to define specific characteristics of network types. These standards are maintained by organizations such as the IEEE (Institute of Electrical and Electronics Engineers). Here are some commonly used standards:
    • 802.3 (Ethernet): This is the most commonly used wired networking standard. Ethernet supports data transmission speeds ranging from 10 Mbps to 10 Gbps and is widely used in LAN (Local Area Network) environments. Example: When you plug your computer into a network using an Ethernet cable, the Physical layer handles the electrical signals sent over the cable to transfer data.
    • 802.5 (Token Ring): Originally developed by IBM, Token Ring was used primarily on IBM mainframe networks. While it is rarely used today, Token Ring is still employed in certain niche applications like industrial automation. Example: In a Token Ring network, devices pass a “token” around to control who can send data. The Physical layer would define how this token is transmitted across the ring of devices.
    • 802.11 (Wi-Fi): The Wi-Fi family of standards defines how wireless devices communicate using radio frequencies. The most commonly used standards include 802.11b and 802.11g, though modern networks use newer standards like 802.11ac and 802.11ax. Example: When connecting your phone or laptop to a Wi-Fi network, the Physical layer deals with the transmission of radio waves between the device and the router.
Network Interface Card (NIC) - Ethernet

Image: Network Interface Card (NIC) – Ethernet

Example of Data Flow at the Physical Layer: Suppose you’re uploading a file over the network from your computer to a server. The Physical layer of your NIC converts the digital bits of your file into electrical signals and sends them through an Ethernet cable to a switch or router. This device, operating at the Physical layer, will read the signals and forward them to the next device on the network. As the file moves across different devices, the Physical layer ensures that each step in the process adheres to the necessary electrical or signaling standards.

Let’s take a simple home network with a wired and wireless connection as an example.

Wired Connection

When you connect your computer to the router using an Ethernet cable, the Physical layer is responsible for ensuring that the electrical signals representing the data are properly transmitted over the copper wires inside the Ethernet cable. The NIC converts the binary data from your computer into electric pulses that travel across the copper wires to the router.

The RJ45 connector at the end of the cable ensures a proper physical connection, and the router interprets the pulses using the Ethernet standard to ensure the correct data rate and timing.

Ethernet RJ45 Connector

Image: Ethernet RJ45 Connector

Wireless Connection

When your smartphone connects to the same router over Wi-Fi, the Physical layer converts the data into radio waves using the 802.11 Wi-Fi standard. The router and the phone’s NIC must be synchronized to send and receive these waves on the correct frequency and modulation scheme.

Different Wi-Fi standards, such as 802.11g or 802.11ax, dictate how fast data can be transmitted over this radio connection, with newer standards allowing faster speeds.

In both cases, the Physical layer handles the crucial task of converting data into signals that can travel over the chosen medium (wired or wireless) and then converting those signals back into data for higher layers to process. By managing the low-level transmission of data, the Physical layer ensures that the network operates efficiently and reliably, whether you’re using a cable or wireless signals.

Go back

Computer network

This image bellow illustrates how the OSI (Open Systems Interconnection) model works by showing the data flow between a browser (client) and a web server, with a switch and router facilitating the communication. This transmission involves a browser (client) and web server on their respective hosts, a switch, and a router. As you follow the red line from browser to web server, notice the sending host encapsulates the payload in headers and a trailer before sending it, much like an assistant would place the boss’s business letter in an envelope before putting it in the mail [7].

OSI Layer Example for Browser and Web Server

Image: OSI Layer Example for Browser and Web Server
Credit: [7]

In the reverse order, the receiving host removes the headers and trailer before the message reaches the web server application, just as the receiver’s assistant would remove the letter from the envelope before handing it to the recipient. Removing a header and trailer from a lower layer’s PDU is called decapsulation [7].

The table below contains the steps through the OSI layers during a browser-to-web server transmission [7].

Sending host (browser)
  1. The browser, involving the Application, Presentation, and Session layers, creates an HTTP message, or payload, on the source computer and passes it down to the Transport layer.
  2. The Transport layer (TCP, which is part of the OS) encapsulates the payload by adding its own header and passes the segment down to the Network layer.
  3. IP at the Network layer in the OS receives the segment (depicted as two yellow boxes in the figure), adds its header, and passes the packet down to the Data Link layer.
  4. The Data Link layer on the NIC firmware receives the packet (depicted as three yellow boxes in the figure), adds its header and trailer, and passes the frame to the Physical layer.
  5. The Physical layer on the NIC hardware puts bits on the network.
Switch
  1. The network transmission is received by the switch, which passes the frame up to the Data Link layer (firmware on the switch), looks at the destination MAC address, and decides where to send the frame.
  2. The pass-through frame is sent to the correct port on the switch and on to the router.
Router
  1. The router has two NICs, one for each of the two networks to which it belongs. The Physical layer of the first NIC receives the frame and passes it up to the Data Link layer (NIC firmware), which removes the frame header and trailer and passes the packet up to IP at the Network layer (firmware program or other software) on the router.
  2. This Network layer IP program looks at the destination IP address, determines the next node en route for the packet, and passes the packet back down to the Data Link layer on the second NIC. The Data Link layer adds a new frame header and trailer appropriate for this second NIC’s LAN, including the MAC address of the next destination node. It passes the frame to its Physical layer (NIC hardware), which sends the bits on their way.
Destination host (web server)
  1. When the frame reaches the destination host NIC, the Data Link layer NIC firmware receives it, removes the frame header and trailer, and passes the packet up to IP at the Network layer, which removes its header and passes the segment up to TCP at the Transport layer.
  2. TCP removes its header and passes the payload up to HTTP at the Application layer. HTTP presents the message to the web server.

In this example, the encapsulation process adds necessary information at each OSI layer, allowing the data to move smoothly across different devices and networks, while the decapsulation process removes these headers/trailers as the data moves toward the Application Layer.

Go back

Troubleshooting

Using the OSI model as a troubleshooting guide is an effective way to pinpoint and resolve network problems. This layered approach allows you to systematically check each part of the network, ensuring that no issue is overlooked. The key decision is determining how to approach the OSI stack when troubleshooting: either from top-down, bottom-up, or using the divide-and-conquer method.

Here’s a detailed explanation of each troubleshooting method with practical examples:

  1. Bottom-Up Approach:
    • This method starts at the lowest layer of the OSI model (Physical) and works upwards. It is often the recommended starting point because many network issues stem from physical layer problems, such as faulty cables or misconfigurations at lower levels.
    • Example: Imagine you’re troubleshooting a slow or non-functioning network connection. Starting with the physical components, you check if cables are plugged in correctly or if the Ethernet port is working. This saves time compared to diagnosing application-related problems first, when the issue could simply be a loose or damaged cable.
  2. Top-Down Approach:
    • This method begins at the top of the OSI stack (Application layer) and works its way down. It is typically used when there are obvious issues with applications, like web pages not loading or email services being unresponsive.
    • Example: If a user reports that their email is not working, starting at the Application layer, you can check if the email client is configured correctly or if the mail server is reachable. If the application checks out fine, you move down to check the network or physical connections.
  3. Divide-and-Conquer:
    • This method involves focusing on the layer where you suspect the problem might be and working either up or down from that point, depending on the issue.
    • Example: If you notice that a router is not forwarding packets correctly, you might start at Layer 3 (Network) to check IP addressing, routing tables, and network advertisements. If everything looks correct, you can move up to the Transport layer or down to check the Data Link or Physical layers.

Detailed Bottom-Up Troubleshooting Example

Let’s walk through the bottom-up method step by step, addressing each OSI layer with practical examples of troubleshooting tasks.

  • Layer 1 – Physical layer:
    • The Physical layer includes the physical transmission of data, such as cables, switches, routers, and network interfaces. Problems here are often hardware-related.
    • Common issues:
      • Loose or damaged cables: Check that all cables are securely connected and inspect them for wear or damage. Bent cable ends can prevent a stable connection.
      • Port and speed settings: Ensure that the Ethernet port is set to the correct speed (e.g., 100 Mbps or 1 Gbps). A mismatch in speed between devices can cause communication failures.
      • Power issues: Verify that the network device (switch, router, etc.) has power and is operational. An amber or red light might indicate a problem, while a green light usually signals a proper connection.
    • Example: If a workstation is not connecting to the network, you check the physical Ethernet cable and discover that it has come loose. Reconnecting it solves the issue.
  • Layer 2 – Data Link layer:
    • The Data Link layer is responsible for data transfer between adjacent nodes and handles MAC addressing and error detection.
    • Common issues:
      • Incorrect protocols: Ensure that the correct data link protocol is being used (e.g., Ethernet, PPP, or HDLC). If the protocols don’t match on both ends, data won’t be properly transmitted.
      • Switch issues: Check for any configuration problems or MAC address filtering on the switch that might be blocking communication.
    • Example: You may notice that a switch is not forwarding data between devices. Upon investigation, you find that the wrong protocol (e.g., HDLC instead of Ethernet) has been configured on one of the interfaces, causing the network to fail.
  • Layer 3 – Network layer:
    • The Network layer handles the logical addressing (IP addresses) and routing of data across multiple networks.
    • Common issues:
      • Incorrect IP addressing: Check that the correct IP address, subnet mask, and default gateway are configured on the devices.
      • Routing issues: Verify that the routing tables on routers are correctly configured to forward packets to the right destinations. You can use commands like traceroute to track the path packets take.
    • Example: A device is unable to reach a remote server. Upon checking the IP configuration, you discover that the device has an incorrect IP address and subnet mask, preventing it from communicating with other networks. Correcting the IP settings resolves the issue.
  • Layer 4 – Transport layer:
    • The Transport layer ensures reliable data transfer through protocols like TCP (connection-oriented) or UDP (connectionless). It handles error recovery and flow control.
    • Common issues:
      • Wrong transport protocol: If an application expects TCP but UDP is being used, or vice versa, data may not be properly transmitted.
      • Port configuration: Verify that the correct ports are open and not blocked by firewalls. For example, HTTP traffic uses port 80, and HTTPS uses port 443.
    • Example: You’re troubleshooting a web server that is unresponsive. After confirming that the server is reachable, you check the firewall settings and find that port 80 is blocked. Unblocking the port restores web access.

It’s worth noting that some network issues might span across multiple layers. For example, a problem classified as Layer 4 might actually have root causes in Layer 3. Similarly, some Layer 2 issues might originate from Layer 1. Instead of focusing on strict boundaries between layers, it’s more important to apply a systematic troubleshooting process and look for clues at each layer.

By using this layered troubleshooting approach, you can efficiently diagnose and resolve network issues, whether they stem from faulty cables, protocol mismatches, or incorrect configurations at higher layers.

Go back

Specific terms

In order to understand technical literature, it’s important to understand the technical terms related to the OSI Model. The table below contains the main terms used in each layer with their corresponding description [1].

Technical term Description
Encapsulation The process by which header and trailer information is appended to a data packet as it passes from computer to computer over a network.
Header The set of information that is added to the beginning of a data packet.
Trailer Information that is added to the end of a data packet.
Decapsulation The process by which the header and trailer information is stripped from a data packet.
Vertical relationship Communication from one layer to the layer above or below on the same device.
Horizontal relationship Communication from one device to another on the same layer.
Peer layer communication Another name for horizontal relationships.
Application layer The network layer that houses the applications that allow users to access the network.
Presentation layer The network layer that makes data viewable by the user.
Data presentation Formatting data so that it is readable by the recipient.
Data compression Resizing the data to speed transmission.
Data encryption Making data unreadable by unintended recipients.
Session layer The network layer that controls the communication between computers.
Session initiation The process that sets up the parameters of the connection between computers.
Session termination The process that closes down the connection between computers.
Session accounting The process that handles billing for sessions.
Dialog control The service responsible for determining which computer is sending and which is receiving at any given time throughout the session.
Simplex Data flows in only one direction.
Half duplex Data flows in both directions, but only in one direction at a time.
Full duplex Data flows in both directions at the same time.
Data separation The process of bookmarking packets to allow for sessions to be recovered.
Transport layer The network layer responsible for moving data, ensuring that it is received without errors.
Flow control The process that limits the number of transmissions sent at one time to avoid overloading the receiving device.
Connection-oriented
transmissions
Transmissions that require an acknowledgement of receipt from the receiving computer.
Ack Acknowledgement message sent by the receiving computer in a connection-oriented transmission.
Reliable transport
method
A transmission that ensures the error-free receipt of packets.
Connectionless
transmissions
Transmissions in which no response from the receiver is required.
Network layer The layer that handles routing of packets from one computer to another.
Datagrams Another name for the packets of data that are moved around the network.
Routing The process of determining the path required to deliver packets to their destination.
Physical address The unique identifier of the network card attached to a computer.
Logical address The unique network identifier assigned to a computer.
Source routing A routing technique in which the routing information is included in the packet being routed.
Hop The intervening routers in a path of routers through a network.
Routing table An internal table that routers use to determine the best path to send a packet to its destination.
Routing protocol The protocol used by routers to define how the routing path is chosen.
Data link layer The layer of the OSI model responsible for transmitting data over the network cable.
Transmission circuit The physical conduit over which data travels within a network.
Frames The data packet combined with its header and trailer information.
LLC type 1 Connectionless service on the LLC sublayer.
LLC type 2 Connection-oriented service on the LLC sublayer.
MAC address The unique identifier of the network interface card attached to a computer.
Physical layer The layer that controls the rules for data transmission, including electrical currents, types of cables, and transmission speed.

Go back

Abbreviations

The table below contains a list of the main abbreviations used in the OSI Model.

Abbreviation Long Name Description
100BASE-T1 Fast Ethernet Over Single Twisted Pair Ethernet standard for automotive networks using a single twisted pair cable for data transmission at 100 Mbps.
100BASE-TX Fast Ethernet Over Twisted Pair Ethernet standard that uses twisted pair cabling for data transmission at 100 Mbps.
ARP Address Resolution Protocol A protocol used to map an IP address to a MAC address within a local area network.
CRC Cyclic Redundancy Check An error-detection technique used to identify data transmission errors.
DHCP Dynamic Host Configuration Protocol A protocol used to automatically assign IP addresses to devices on a network.
DNS Domain Name System A system that translates domain names into IP addresses, allowing browsers to load Internet resources.
DoIP Diagnostics Over Internet Protocol A protocol used for automotive diagnostics over IP-based networks.
FTP File Transfer Protocol A protocol used for transferring files between a client and a server over a network.
HDLC High-Level Data Link Control A bit-oriented data link layer protocol used to transmit data between network points.
HTTP Hypertext Transfer Protocol The primary protocol used for transmitting web pages and other data over the Internet.
HTTPS Hypertext Transfer Protocol Secure A secure version of HTTP that uses encryption to secure data transmission.
ICMP Internet Control Message Protocol A protocol used by network devices to send error messages and operational information.
IMAP Internet Message Access Protocol A protocol used for accessing email on a remote server from a local client while leaving emails on the server.
IP Internet Protocol A protocol responsible for addressing and routing packets between networks on the Internet.
LLC Logical Link Control A sublayer of the Data Link layer that provides flow and error control over the physical medium.
MAC Media Access Control A sublayer of the Data Link layer responsible for addressing and controlling access to the network medium.
MIME Multipurpose Internet Mail Extensions A standard for formatting non-text attachments to email messages, such as images or video.
NAT Network Address Translation A method for modifying IP address information in packet headers to allow multiple devices to share a single public IP address.
NetBIOS Network Basic Input/Output System A program that allows applications on different computers to communicate within a local network.
NIC Network Interface Card A hardware device that enables a computer to connect to a network and communicate with other devices.
NTP Network Time Protocol A protocol used to synchronize clocks on computers and other devices over a network.
PIP Named Pipe A method of inter-process communication between processes on the same machine or over a network.
PPTP Point-to-Point Tunneling Protocol A protocol used to implement virtual private networks (VPNs) by creating a secure connection between two points.
PPP Point-to-Point Protocol A data link protocol used to establish a direct connection between two nodes, often for WAN connections.
PLC Power Line Communication A communication method that uses power lines as the medium.
POP3 Post Office Protocol 3 An email protocol used to retrieve email from a remote server to a local client, typically downloading it to the local device.
SFD Start Frame Delimiter A byte used in Ethernet frames to indicate the start of the frame’s data.
SNMP Simple Network Management Protocol A protocol used for managing devices on IP networks, including routers, switches, and servers.
SOCKS Socket Secure An Internet protocol that routes network packets between a client and server through a proxy server.
SOME/IP Scalable service-Oriented MiddlewarE over IP A middleware solution for Ethernet-based in-vehicle networks, providing service-oriented communication.
SSH Secure Shell A protocol used to securely connect to remote devices over a network, commonly used for remote administration.
SSL/TLS Secure Sockets Layer / Transport Layer Security Protocols used to provide encryption and secure communication over a network.
TCP Transmission Control Protocol A connection-oriented protocol that provides reliable, ordered, and error-checked delivery of data.
Telnet Telecommunication Network A protocol used for remote communication with another device, typically over TCP/IP, often for network device management.
UDP User Datagram Protocol A connectionless protocol used for fast, but unreliable, transmission of data.
VLAN Virtual Local Area Network A logical grouping of network devices that are segmented into different broadcast domains, independent of their physical location.
VoIP Voice over Internet Protocol A technology that allows voice calls to be made over the Internet instead of traditional telephone lines.
Wi-Fi Wireless Fidelity A technology for wireless local area networking using radio waves to connect devices to the Internet.

Go back

Summary

The table below contains the summary of the ISO/OSI Model with the mention of some protocols used at every layer.

Layer number Layer name Protocols
7 Application Telnet, FTP, HTTP, DNS, DHCP, NTP, DoIP, SoME/IP, …
6 Presentation (Data Abstraction) MIME, XDR, …
5 Session SOCKS, Named Pipe, NetBIOS, PPTP, TLS/SSL, …
4a Transport (Control Oriented) TCP/IP
4b Transport (Connectionsless) UDP/IP
3 Network IP
2 Data Link Ethernet (MAC)
1 Physical PLC, 100BASE-T1, 100BASE-TX, …

Go back

References

[1] Networking Basics, 2nd Edition, Patrick Ciccarelli et. al., John Wiley & Sons, 2013.
[2] Architecture of Network Systems, Dimitrios Serpanos, Tilman Wolf, Elsevier, 2011.
[3] TCP/IP Illustrated, Volume 1, The Protocols, 2nd Edition, Kevin R. Fall, W. Richard Stevens, Addison-Wesley, 2012.
[4] Cisco CCNA in 60 Days, Paul Browning, et. al., Reality Press, 2014.
[5] CCNA Data Center, Introducing Cisco Data Center Networking, Study Guide, Todd Lammle and John Swartz, John Wiley & Sons, 2013.
[6] Internet Infrastructure, Networking, Web Services and Cloud Computing, Richard Fox, Wei Hao, CRC Press, 2018.
[7] Network+ Guide to Networks, 8th Edition, Jill West, Jean Andrews, Tamara Dean, Cengage Learning, 2019.
[8] Packet Guide to Core Network Protocols, Bruce Hartpence, O’Reilly Media, 2011.
[9] Parctical Packet Analysis, 2nd Edition, Chris Sanders, No Starch Press, 2011.

Leave a Reply

Ad Blocker Detected

Dear user, Our website provides free and high quality content by displaying ads to our visitors. Please support us by disabling your Ad blocker for our site. Thank you!

Refresh