OSI Model
OSI Model
The OSI model explains how data travels through a network. It splits this process into **seven layers**. Each layer has its own job — from moving raw bits to showing a website.
Understanding the OSI model helps break down complex systems, and shows where tools, attacks, or failures happen.
OSI Layer Overview
The OSI model goes from Layer 1 (bottom) to Layer 7 (top). Each layer works with the ones above and below it.
Layer | Number | What it does | Example |
---|---|---|---|
Application | 7 | Talks directly with user apps | HTTP (web), DNS |
Presentation | 6 | Translates and encrypts data | TLS, JPEG |
Session | 5 | Keeps communication open | NetBIOS, RPC |
Transport | 4 | Sends data fully and in order | TCP, UDP |
Network | 3 | Routes packets between networks | IP, ICMP |
Data Link | 2 | Sends frames on the local network | Ethernet, ARP |
Physical | 1 | Moves bits through cables or air | Wi-Fi, fiber, ethernet cables |
Easy Breakdown by Layer
Layer 1 – Physical
Moves raw data (0s and 1s) over wires or radio. Involves: cables, Wi-Fi signals, connectors.
Layer 2 – Data Link
Sends frames between devices on the same network. Uses: MAC addresses, switches, ARP.
Layer 3 – Network
Chooses the best path for data across networks. Uses: IP addresses, routers, ICMP.
Layer 4 – Transport
Breaks data into smaller parts and reassembles it. TCP ensures reliability, UDP focuses on speed.
Layer 5 – Session
Keeps a connection open and manages how long systems talk. Used for: remote access, file sharing.
Layer 6 – Presentation
Changes how data looks — like converting text or encrypting. Handles: encoding, compression, TLS.
Layer 7 – Application
Where programs like browsers and email clients connect to the network. Talks via: HTTP, FTP, DNS, SMTP.
What You Can Do with It
Understanding the OSI layers helps you:
- Know where a tool or attack operates
- Analyze traffic at the right level
- Identify weak points or misconfigurations
- Work smarter with packet captures, scans, or payloads
Protocols by Layer
Layer | Number | Function Summary | Common Protocols |
---|---|---|---|
Application | 7 | Interfaces with apps like browsers and mail | HTTP, FTP, DNS, SMTP |
Presentation | 6 | Formats, encrypts, and compresses data | TLS/SSL, Base64, JPEG |
Session | 5 | Manages connections and sessions | NetBIOS, PPTP, SMB |
Transport | 4 | Ensures reliable or fast delivery | TCP, UDP |
Network | 3 | Routes packets between networks | IP, ICMP, IPsec |
Data Link | 2 | Sends frames on the local network | Ethernet, ARP |
Physical | 1 | Transfers raw bits via cables or air | Wi-Fi (802.11), Ethernet (cabling) |