The OSI reference model

🧩 CompTIA Network+ (1.1) – The OSI Model Explained Simply

The OSI Model (Open Systems Interconnection) is a framework that explains how data moves through a network — step by step, from one device to another.

It has 7 layers.
Each layer has a different job in making network communication work.

Think of it like a team of 7 IT workers, each doing their own part before passing the data to the next one.

🧩 OSI Model — What It Really Is

✅ The OSI Model is a reference model — not a protocol that devices actually use.
It’s a theoretical guide created by ISO (International Organization for Standardization) to help understand, design, and troubleshoot how data moves across networks.


💡 What It Means

  • Real devices (like routers, switches, PCs) mostly use the TCP/IP model — that’s what the internet runs on.
  • The OSI model is used by network engineers and IT technicians to describe or locate problems during network communication.

🧱 Layer 1 – Physical Layer

What it does:
This layer is about hardware and signals — the things you can touch and see.

Main job: Move bits (1s and 0s) through cables, connectors, and wireless signals.

Examples:

  • Ethernet cables (Cat6, Cat7)
  • Fibre optic cables
  • Network switches and hubs
  • Wi-Fi radio signals
  • RJ45 connectors

In real life:
When you plug a network cable into a switch and see the green light — that’s Layer 1 working!


🔗 Layer 2 – Data Link Layer

What it does:
This layer handles communication between devices on the same network (same LAN).
It uses MAC addresses (unique hardware IDs) to identify devices.

Main job: Create and manage frames (packets with MAC address info).

Examples:

  • Switches (operate at Layer 2)
  • Network Interface Cards (NIC)
  • MAC addresses (e.g., 00:1A:2B:3C:4D:5E)
  • VLANs (Virtual LANs)

In real life:
When your laptop sends data to a nearby printer or switch in the same office network — Layer 2 makes sure it reaches the correct device using its MAC address.


🌍 Layer 3 – Network Layer

What it does:
Handles routing — moving data between different networks (LAN to LAN or LAN to WAN).
It uses IP addresses.

Main job: Create packets and decide the best path to send them.

Examples:

  • Routers (Layer 3 devices)
  • IP addresses (IPv4, IPv6)
  • Subnets (e.g., 192.168.1.0/24)
  • Protocols like ICMP (ping), IP, ARP

In real life:
When you open google.com, your router uses Layer 3 to send your request through the internet — hopping between many routers until it reaches Google’s servers.


🚚 Layer 4 – Transport Layer

What it does:
Controls how data is sent and received — reliable or fast.
It decides whether to use TCP (reliable) or UDP (faster but no checking).

Main job: Breaks large data into segments and makes sure they arrive correctly.

Examples:

  • TCP (Transmission Control Protocol)
  • UDP (User Datagram Protocol)
  • Port numbers (e.g., TCP 80 for HTTP, UDP 53 for DNS)

In real life:

  • When you watch YouTube → uses UDP (speed matters more).
  • When you log in to a website → uses TCP (accuracy and reliability matter).

💬 Layer 5 – Session Layer

What it does:
Creates and maintains sessions (temporary connections) between devices.
It keeps track of who is talking to whom and for how long.

Main job: Start, control, and end communication sessions.

Examples:

  • Remote Desktop (RDP)
  • Video calls or file transfers that stay connected
  • Login sessions on websites

In real life:
When you connect to your office server through RDP, the Session Layer keeps that session active so you don’t have to reconnect every second.


🧠 Layer 6 – Presentation Layer

What it does:
Makes sure data is in the right format for the receiving device.
It also handles encryption and compression.

Main job: Translate data between software and network format.

Examples:

  • Encryption (SSL/TLS for HTTPS)
  • File formats (.jpg, .mp4, .pdf)
  • Data compression (ZIP files)

In real life:
When you open a secure website (HTTPS) — Layer 6 encrypts the data so no one can read it during transmission.


🌐 Layer 7 – Application Layer

What it does:
This is the layer users interact with directly — it provides network services to applications.

Main job: Enable apps to send or receive data over the network.

Examples:

  • Web browsers (HTTP/HTTPS)
  • Email (SMTP, IMAP)
  • File transfer (FTP)
  • DNS lookups

In real life:
When you type www.learntechfromzero.com in Chrome — your browser (Layer 7) uses DNS (to find the IP), HTTPS (to connect securely), and then shows you the page.


🧩 Summary Table

LayerNameFunctionReal Devices / Examples
7ApplicationUser access & network appsWeb browsers, DNS, FTP
6PresentationEncryption, format, compressionSSL/TLS, JPEG, MP4
5SessionConnection controlRDP, login session
4TransportReliable delivery (TCP/UDP)TCP, UDP, port numbers
3NetworkRouting, IP addressingRouter, IP, ICMP
2Data LinkMAC addressing, framesSwitch, NIC, VLAN
1PhysicalHardware & signalsCable, Wi-Fi, connector

Easy way to remember (bottom → top):

“Please Do Not Throw Sausage Pizza Away”

P = Physical
D = Data Link
N = Network
T = Transport
S = Session
P = Presentation
A = Application


🧠 Quick Add-on (Optional — still part of 1.1)

These are the data names at each layer):

LayerData Unit NameExample
7–5 (App, Pres, Sess)Data“Email message”
4 (Transport)SegmentTCP segment, UDP datagram
3 (Network)PacketIP packet
2 (Data Link)FrameEthernet frame
1 (Physical)Bits1s and 0s over cable/wireless

1 frame = thousands of bits (often ~12,000 bits for Ethernet).

⚙️ Real-life example

When your computer sends data to a switch:

  1. The network card builds a frame — for example, 1,500 bytes long.
  2. That frame is turned into 12,000 bits of electrical or wireless signals.
  3. The Physical Layer sends those bits, one after another, through the cable.
  4. The switch collects the bits back into the original frame and reads the MAC address to know where to forward it.

🔍 Summary

  • Bit = smallest single piece of data (1 or 0)
  • Frame = full Layer 2 package made of many bits
  • So → many bits = 1 frame, not the other way around ✅

🎬 Example: Your Friend Sends You a Video Over the Internet

Let’s say your friend sends you a video file (e.g., funny.mp4) from their laptop to yours using the network.

We’ll go through each OSI layer (1–7) and see what happens to that video during sending and receiving.


🧠 Step 1 – Big Picture

When your friend sends the video:

  • The data travels down the OSI layers (Application → Physical)
  • Across the network cables or Wi-Fi
  • Then travels up your OSI layers (Physical → Application)

🔽 Sending Side (Your Friend’s Laptop)

OSI LayerWhat HappensExample
Layer 7 – ApplicationThe app (e.g., WhatsApp, Email, or Google Drive) prepares the video for sending. It talks to the network using a protocol like HTTP, SMTP, or FTP.WhatsApp prepares to upload funny.mp4.
Layer 6 – PresentationThe video data is compressed and encrypted (for security and faster transfer).Data is encrypted using TLS/SSL and compressed.
Layer 5 – SessionA session (connection) is created between your friend’s device and yours — it keeps track of this specific transfer.WhatsApp keeps the session active until the video is fully uploaded.
Layer 4 – TransportThe data is broken into segments. Each segment gets a port number (e.g., TCP port 443 for HTTPS). TCP ensures all parts arrive correctly and in order.TCP assigns port 443 and numbers each segment.
Layer 3 – NetworkEach segment is wrapped in an IP packet with source and destination IP addresses.Source: 192.168.1.10 → Destination: 192.168.1.20
Layer 2 – Data LinkEach IP packet is placed inside a frame with MAC addresses (sender and receiver). The switch uses these to deliver locally.Source MAC: A1:B2:C3:D4:E5 → Dest MAC: F6:G7:H8:I9:J0
Layer 1 – PhysicalThe frame is turned into electrical signals or Wi-Fi radio waves — 1s and 0s moving through the medium.1100110010110… sent through the cable or Wi-Fi.

🔼 Receiving Side (Your Laptop)

Now your computer does the reverse — decapsulation (unwrapping each layer).

OSI LayerWhat HappensExample
Layer 1 – PhysicalYour network card receives the bits (1s and 0s) from the cable/Wi-Fi.Electrical or radio signals → bits.
Layer 2 – Data LinkYour NIC rebuilds the frame and checks the MAC address — if it matches yours, it keeps it.Confirms it’s your device’s MAC.
Layer 3 – NetworkThe IP address is read — your router/computer confirms it’s for your IP, then removes the IP header.Destination IP matches yours.
Layer 4 – TransportThe TCP layer reorders all the segments, checks for missing ones, and reassembles the data.Rebuilds all segments in order.
Layer 5 – SessionThe session between the two devices stays active until the transfer is complete.Connection remains open until download ends.
Layer 6 – PresentationThe data is decrypted and decompressed back into readable format.The encrypted MP4 is decoded.
Layer 7 – ApplicationThe app (WhatsApp, Google Drive, etc.) finally displays the video — ready to play.You watch the video on your screen.

🧩 Summary Flow

Your Friend’s Device (Encapsulation)
Application → Presentation → Session → Transport → Network → Data Link → Physical
                    ↓
            Internet / Wi-Fi
                    ↓
Your Device (Decapsulation)
Physical → Data Link → Network → Transport → Session → Presentation → Application

⚙️ Real Protocols Involved

LayerCommon Protocols / Devices
7 – ApplicationHTTP, HTTPS, SMTP, FTP, WhatsApp
6 – PresentationSSL/TLS, MPEG, JPEG, MP4
5 – SessionRDP, NetBIOS, RPC
4 – TransportTCP, UDP, Port numbers
3 – NetworkIP, ICMP (Ping)
2 – Data LinkEthernet, ARP, MAC
1 – PhysicalCables, Wi-Fi, fiber signals

In short:

When your friend sends a video, it’s broken down into small binary packets that move through the OSI layers, travel across the network as bits, and are then reassembled and decoded by your device layer by layer — until the video plays perfectly on your screen.


@learntechfromzero

CompTIA Network+ (plus), N10-009, Full course. 1.1 OSI reference model #comptia #comptianetworkplus #ccna #osi #tcp

♬ this is bachata – prod. regvila

Leave a Reply

Your email address will not be published. Required fields are marked *

Buy Me a Coffee