What is OSI Model

History Of OSI Model

History of the OSI Model

The OSI Model (Open Systems Interconnection Model) was developed to create a standard framework for communication between different computer systems and networks.

In the 1970s, many companies had their own networking systems that could not easily communicate with each other. To solve this problem, the International Organization for Standardization (ISO) started developing a standard network model.

In 1984, ISO officially introduced the OSI Model, which divides network communication into seven layers. These layers help different hardware and software systems communicate in a structured and standardized way.

The OSI model became an important reference model for network design, learning, and troubleshooting, even though modern networks mainly use the **TCP/IP protocol suite.

The Seven Layers of OSI

  1. Physical Layer
  2. Data Link Layer
  3. Network Layer
  4. Transport Layer
  5. Session Layer
  6. Presentation Layer
  7. Application Layer

Purpose:
The OSI model helps standardize network communication and makes it easier to understand how data moves through a network.

Why Do We Need the OSI Model?

The OSI Model (Open Systems Interconnection Model) is needed to standardize how different computer systems communicate over a network. It divides network communication into seven layers, which makes network design, development, and troubleshooting easier.

Main Reasons for Using the OSI Model

1. Standardization
The OSI model provides a standard framework so that devices from different manufacturers can communicate with each other.

2. Easy Network Design
By dividing networking into layers, engineers can design and develop network systems more easily.

3. Troubleshooting
The layered structure helps identify and fix network problems quickly because each layer has specific functions.

4. Interoperability
It allows different hardware and software systems to work together, even if they are developed by different companies.

5. Learning and Understanding
The OSI model helps students and engineers understand how data moves through a network step by step.

Physical Layer (Layer 1)

The Physical Layer is the lowest layer of the OSI model. It deals with the physical transmission of raw bits (0s and 1s) over a communication medium like cables, fiber optics, or wireless signals. This layer defines the electrical, optical, or radio signals, voltages, pin configurations, connectors, and cabling standards. It does not understand data; it only ensures that signals are sent and received correctly.

Example: When your computer sends an HTTP request, the Ethernet NIC converts bits into electrical signals and sends them over the LAN cable to the switch.


Data Link Layer (Layer 2)

The Data Link Layer provides node-to-node communication within the same network (LAN). It encapsulates data into frames and adds MAC addresses for source and destination devices. It also provides error detection using mechanisms like Frame Check Sequence (FCS). Switches operate at this layer to forward frames within a LAN.

Example: Your PC’s frame has SRC MAC AA:AA:AA:AA:AA:AA and DST MAC BB:BB:BB:BB:BB:BB (router). A switch reads the destination MAC and forwards it to the correct port.


Network Layer (Layer 3)

The Network Layer is responsible for routing data across different networks. It uses logical addressing (IP addresses) to identify source and destination devices globally. Routers operate at this layer to determine the best path to forward packets. It may also handle fragmentation of large packets to fit the maximum transmission unit (MTU).

Example: Your PC sends a packet with SRC IP 192.168.1.10 and DST IP 93.184.216.34 (example.com). The router reads the IP address and forwards the packet towards the Internet.


Transport Layer (Layer 4)

The Transport Layer ensures end-to-end delivery of data between applications. It segments data from the application layer and adds port numbers to identify the sending and receiving processes. This layer provides either reliable delivery (TCP) with error checking, sequencing, and retransmission, or fast but unreliable delivery (UDP).

Example: When your browser requests a webpage, TCP at Layer 4 creates a segment with SRC port 50000 and DST port 80 to ensure that the HTTP response is delivered correctly.


Session Layer (Layer 5)

The Session Layer manages and controls the dialogue between two devices. It establishes, maintains, and terminates sessions or connections. This layer also handles synchronization, ensuring that communication resumes correctly if interrupted.

Example: While you stay logged into a web application, the session layer maintains your active session ID so the server recognizes you without asking for credentials again.


Presentation Layer (Layer 6)

The Presentation Layer acts as a translator between the application and network formats. It handles data encryption/decryption, compression, and format conversion. This layer ensures that the data sent by the application layer of one system can be understood by the application layer of another system.

Example: HTTPS encrypts your HTTP request before sending it over the network, or it converts a document from ASCII to Unicode for proper interpretation.


Application Layer (Layer 7)

The Application Layer is the topmost layer and interacts directly with end-user applications. It provides services such as web browsing, email, file transfer, and DNS. This layer initiates network communication by creating requests that will be passed down through the other layers for delivery.

Example: When you type http://example.com in your browser, the Application Layer generates an HTTP GET request to fetch the web page. Similarly, DNS queries are created at this layer to resolve domain names into IP addresses.

Summary Table

LayerFunctionExample
7 ApplicationProvides network services to applicationsBrowser sends HTTP request
6 PresentationFormats, encrypts, or compresses dataHTTPS encryption
5 SessionManages communication sessionsMaintains login session
4 TransportEnd-to-end delivery using portsTCP segment, port 50000→80
3 NetworkRouting and addressingIP packet, SRC=192.168.1.10, DST=93.184.216.34
2 Data LinkNode-to-node delivery using MACEthernet frame SRC MAC→DST MAC
1 PhysicalTransmits raw bits over mediumElectrical signals in cable

What is data encapsulation?

To understand the OSI model, you must first understand what data encapsulation is. Let’s explore the following example. Imagine you want to send a letter to a friend who lives in another city to invite him to your wedding. What if you send the letter without an envelope, with any information, such as the sender’s and recipient’s names, addresses, and postcodes? What if you simply write the letter and drop it in the mailbox at the post office? 

Let’s examine the following two examples: a letter without an envelope (on the left) and one placed inside an envelope with all required information written on top (on the right). If you put those two into your mailbox, which one will reach its intended recipient and which one won’t?

It is pretty obvious, right? If you send a letter with no envelope and no additional information, such as sender and recipient details, the postal service won’t know where to deliver it. The letter won’t reach anyone. Your friend won’t show up at your wedding.

To ensure that the information (the letter) is delivered to the correct recipient, we must include additional information alongside the letter, so that the postal service knows how to handle it (we encapsulate the data).

The envelope that encapsulates the letter contains the following information, which helps the postal service deliver the letter correctly:

  • Stamp and postcard
  • Sender’s name
  • Sender’s address
  • Sender’s postcode
  • Recipient’s name
  • Recipient’s address
  • Recipient’s postcode

Optionally, the envelope may include:

  • Return address (if different from the sender’s address)
  • Date and time stamp
  • Subject or reference line inside the letter (in formal letters)

The main idea is that sending letters equals sending information by utilizing the postal service as the medium. Sending emails is the same—it’s still a process of sending information, but through a computer network. The key point is that in both cases, you can’t send just the information alone; you need to include extra details that tell the transporting medium how to deliver the information.

Data Encapsulation in Networking

Computer networks function similarly to the postal service. The difference is that they move digital information instead of paper letters. However, you can’t just send raw data onto the network and expect it to reach the destination, just like you can’t drop a plain letter into a mailbox and expect it to be delivered. The data must be encapsulated with additional information first, as shown in the diagram below.

Imagine a device (like your laptop) wants to send data onto the network. Let’s say you’re sending a Facebook message to a friend. As you type the message and hit enter, the data goes from the web browser (where you have Facebook opened), to the Operating System (OS), to the NIC, and out to the network. Many processes add their own additional information called headers. These headers contain important details, like:

  • Who the data is for.
  • Where did it come from?
  • How it should be delivered.
  • What type of data is it?

In the end, the simple Facebook message “Hey! What’s up?” looks like a network packet encapsulated with multiple headers, as shown in the diagram below.

This added information helps network devices (like routers and switches) understand how to handle and forward the data correctly to the correct recipient – one of the Facebook servers.

Encapsulation is the process of adding additional information to the data (payload) so that network devices know where to deliver the message.

At the destination, the data undergoes the reverse process of removing headers before the it is presented to the correct application.

Why do we need the OSI model?

The process of data encapsulation is not simple. It involves many different protocols, headers, and steps. Each part of a network—like applications, network devices, and physical mediums—needs to know what to do with the data and how to handle it correctly.

In the early days of networking, different companies built their own systems, using their own encapsulation methods. These systems often couldn’t work together because they didn’t follow the same rules. For example, one vendor might add certain headers in a unique order that another vendor’s device couldn’t understand. This made it hard to send data between different networks or even between devices from the same company.

Additionally, to achieve the ultra-high speeds of today’s networks, network devices must precisely locate the information they need, without examining headers that are irrelevant, as shown in the diagram below.

To fix this, engineers realized that the industry needed a standard framework. They needed a common way to describe how data should be prepared, sent, and received. That’s where the OSI model comes in.

The OSI model gives a step-by-step structure for how data encapsulation should work:

  • Each layer has a specific job, like adding source and destination addresses or checking for errors.
  • Each layer uses specific protocols that follow agreed-upon rules.
  • Each layer adds its own header (and sometimes trailer) to the message, so the receiving system knows how to process it.

In short, the OSI model helps manage the complexity of data encapsulation by providing a clear, standard method that everyone in networking can use. This ensures interoperability, consistency, and easier troubleshooting.

The OSI model helps us understand and explain how data is wrapped up layer by layer (encapsulation), and how it’s unwrapped at the other end (de-encapsulation).

What is the OSI model?

The OSI model, or Open Systems Interconnection model, is a framework that breaks down the encapsulation process into seven layers. Each layer has a specific role and handles a part of the encapsulation, such as data formatting, logical addressing, routing, physical addressing, or error checking.

The following example shows how data moves through the OSI layers and gets wrapped at each step before being sent over the network to the next device. Notice that each layer adds its own specific header with relevant information for the network function.

The primary goal of the OSI model is to establish a standard and vendor-agnostic data encapsulation framework. It helps different devices and systems work together by following the same set of rules and standards. 

The following diagram illustrates each layer, with a brief description and the protocols that operate at that layer. Notice that in general, different network devices operate at different layers of the OSI model. This means that a network device cares only for the headers up to a particular layer and doesn’t care about the rest of the headers in the message. For example, a switch only cares about the data link (layer 2) header, which consists of the source and destination MAC addresses. A router cares only about the layer 2 and layer 3 headers, and so on.

Note also that we refer to the data at each layer of the OSI model with a different term. For example, at layer 4, we refer to a TCP message as a segment. At layer 3, we refer to it as a packet. At layer 2, we refer to it as a frame.

The OSI model vs. TCP/IP model

The OSI model, with its seven layers, is a well-structured and useful way to understand how data encapsulation works. However, network engineers quickly notice that layers 5, 6, and 7 are not directly related to most networking tasks. These layers focus more on how software applications handle data, which is usually outside the scope of networking.

As a result, network professionals, through practice and real-world experience, began using a simpler model that focuses on the aspects that matter most to networking—Layers 1 through 4. This led to the development of the TCP/IP model, which has fewer layers and is more aligned with how networks actually operate.

The following diagram shows a comparison of the OSI model (with 7 layers), the first version of TCP/IP (which had 4 layers), and the modern version of the TCP/IP model (with 5 layers).

The modern 5-layer TCP/IP model uses the same names as the OSI model for the lower layers, and their jobs are very similar. So, when reading about networks or talking to others in the field, you can think of the lower four layers as being the same in both models- OSI and TCP/IP.

For this course, make sure you understand how the 5-layer TCP/IP model maps to the 7-layer OSI model (as shown in both ends of the diagram above). Also, remember that when people refer to “Layer 7,” they typically mean the top layer in both models, which handles applications.

KEY NOTE: The CCNA exam no longer focuses on the OSI and TCP/IP models; however, understanding them remains important. Network engineers often discuss networking using the layers of the OSI model.

For example, you will often hear one of the following phrases that you must understand:

  •  “Do you need a layer 2 or a layer 3 port?”
  •  “Is this a layer 2 or layer 3 switch?”
  •  “The problem is at layer 2.”

Although networks today use TCP/IP, many people still refer to OSI layer numbers. For example, people call an application protocol a “Layer 7 protocol,” even though TCP/IP combines some of those OSI layers (application, presentation, and session) into just one.

When packets arrive at a device, the port numbers in the Layer 4 header help the device determine which application should receive the data. Each process that runs on the server “listens” for incoming data on a specific TCP/UDP port, as shown in the output below. For example, the Web Server listens on port 80, while the FTP Server listens on port 21.

				
					Microsoft Windows [Version 11.0.25621.5339]
(c) Microsoft Corporation. All rights reserved.

C:\> netstat -a -n

Active Connections
  Proto  Local Address          Foreign Address        State
  TCP    1.2.3.4:21             0.0.0.0:0              LISTENING
  TCP    1.2.3.4:80             0.0.0.0:0              LISTENING
  TCP    1.2.3.4:443            0.0.0.0:0              LISTENING
  UDP    1.2.3.4:6703           0.0.0.0:0              LISTENING
				
			
				
					Microsoft Windows [Version 11.0.25621.5329]
(c) Microsoft Corporation. All rights reserved.

C:\> netstat -a -n

Active Connections
 Proto  Local Address          Foreign Address        State
 TCP    10.1.1.1:53000         1.2.3.4:80        ESTABLISHED
				
			

OSI model in practice

OSI MODEL Slide