🧩 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
| Layer | Name | Function | Real Devices / Examples |
|---|---|---|---|
| 7 | Application | User access & network apps | Web browsers, DNS, FTP |
| 6 | Presentation | Encryption, format, compression | SSL/TLS, JPEG, MP4 |
| 5 | Session | Connection control | RDP, login session |
| 4 | Transport | Reliable delivery (TCP/UDP) | TCP, UDP, port numbers |
| 3 | Network | Routing, IP addressing | Router, IP, ICMP |
| 2 | Data Link | MAC addressing, frames | Switch, NIC, VLAN |
| 1 | Physical | Hardware & signals | Cable, 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):
| Layer | Data Unit Name | Example |
|---|---|---|
| 7–5 (App, Pres, Sess) | Data | “Email message” |
| 4 (Transport) | Segment | TCP segment, UDP datagram |
| 3 (Network) | Packet | IP packet |
| 2 (Data Link) | Frame | Ethernet frame |
| 1 (Physical) | Bits | 1s 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:
- The network card builds a frame — for example, 1,500 bytes long.
- That frame is turned into 12,000 bits of electrical or wireless signals.
- The Physical Layer sends those bits, one after another, through the cable.
- 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 Layer | What Happens | Example |
|---|---|---|
| Layer 7 – Application | The 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 – Presentation | The video data is compressed and encrypted (for security and faster transfer). | Data is encrypted using TLS/SSL and compressed. |
| Layer 5 – Session | A 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 – Transport | The 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 – Network | Each 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 Link | Each 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 – Physical | The 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 Layer | What Happens | Example |
|---|---|---|
| Layer 1 – Physical | Your network card receives the bits (1s and 0s) from the cable/Wi-Fi. | Electrical or radio signals → bits. |
| Layer 2 – Data Link | Your 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 – Network | The IP address is read — your router/computer confirms it’s for your IP, then removes the IP header. | Destination IP matches yours. |
| Layer 4 – Transport | The TCP layer reorders all the segments, checks for missing ones, and reassembles the data. | Rebuilds all segments in order. |
| Layer 5 – Session | The session between the two devices stays active until the transfer is complete. | Connection remains open until download ends. |
| Layer 6 – Presentation | The data is decrypted and decompressed back into readable format. | The encrypted MP4 is decoded. |
| Layer 7 – Application | The 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
| Layer | Common Protocols / Devices |
|---|---|
| 7 – Application | HTTP, HTTPS, SMTP, FTP, WhatsApp |
| 6 – Presentation | SSL/TLS, MPEG, JPEG, MP4 |
| 5 – Session | RDP, NetBIOS, RPC |
| 4 – Transport | TCP, UDP, Port numbers |
| 3 – Network | IP, ICMP (Ping) |
| 2 – Data Link | Ethernet, ARP, MAC |
| 1 – Physical | Cables, 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.
