OSI Model - 7 Layers of Networking
Master the OSI reference model with interactive visualizations. Understand how data flows through each layer, from Application to Physical.
OSI 7-Layer Model
Application
DataHTTP, FTP, SMTP, DNS, SSH
Presentation
DataSSL/TLS, JPEG, MPEG, ASCII
Session
DataNetBIOS, RPC, SIP, PPTP
Transport
SegmentTCP, UDP, SCTP, QUIC
Network
PacketIP, ICMP, OSPF, BGP
Data Link
FrameEthernet, Wi-Fi, ARP, STP
Physical
BitsEthernet, USB, Fiber, DSL
Packet Encapsulation
Application Layer
Application creates data (e.g., HTTP request). This is the original user data that will be transmitted.
Packet Structure
Common Protocols by Layer
Application Layer
Application-level data
Provides network services directly to end-user applications
Application Gateways, Web Application Firewalls, Proxy Servers
The language and content of a letter you're writing
OSI vs TCP/IP
TCP/IP model has 4 layers and combines OSI layers 5-7 into Application layer.
Common Ports
Memory Aids
Top to Bottom (7→1)
"All People Seem To Need Data Processing"
Bottom to Top (1→7)
"Please Do Not Throw Sausage Pizza Away"
Troubleshooting Tips
OSI vs TCP/IP Model
Understanding the differences between the theoretical OSI model and the practical TCP/IP model used on the internet.
| OSI Layer | # | PDU | TCP/IP Layer | Key Protocols |
|---|---|---|---|---|
7 Application | 7 | Data | 4 Application | HTTP DNS FTP SMTP |
6 Presentation | 6 | Data | SSL/TLS JPEG ASCII | |
5 Session | 5 | Data | NetBIOS RPC SIP | |
4 Transport | 4 | Segment | 3 Transport | TCP UDP QUIC |
3 Network | 3 | Packet | 2 Internet | IPv4 IPv6 ICMP |
2 Data Link | 2 | Frame | 1 Network Access | Ethernet Wi-Fi ARP |
1 Physical | 1 | Bits | USB Fiber DSL |
OSI Model
7 Layers | Theoretical
- Created by ISO in 1984
- Reference/conceptual model
- Separates Presentation & Session layers
- Used for education & troubleshooting
- Protocol independent
TCP/IP Model
4 Layers | Practical
- Developed by DARPA in the 1970s
- Practical implementation model
- Combines OSI layers 5-7 into Application
- Used on the actual Internet
- Built around TCP/IP protocols
Layer Mapping Visualization
What is the OSI Model?
The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes how different computer systems communicate over a network. Created by the International Organization for Standardization (ISO) in 1984, it divides network communication into seven distinct layers, each with specific functions and responsibilities.
Think of it like the postal system: when you send a letter, multiple steps occur - you write the content, put it in an envelope, add an address, the post office sorts it, trucks transport it, and finally someone delivers it. Each step is handled by different people with different responsibilities. The OSI model works similarly for digital data. You can see this in action with our interactive encapsulation demo.
Seven Layers
From Physical (Layer 1) to Application (Layer 7), each layer has a specific role in transmitting data.
Encapsulation
Data is wrapped with headers at each layer when sent, and unwrapped when received. Use our diff checker tool to see how headers change the data.
Standardization
Enables different vendors' equipment to communicate using common protocols, like those defined in various IETF RFCs.
Why 7 Layers?
Separation of Concerns
Each layer handles a specific aspect of communication. This modularity means that changes to one layer don't affect others. For example, you can upgrade from Wi-Fi to Ethernet (Layer 1-2) without changing how HTTP works (Layer 7).
Easier Troubleshooting
When network problems occur, the OSI model helps isolate the issue. Can't ping? Check Layer 3. Link light off? It's a Layer 1 problem. Application won't connect? Start at Layer 7 and work down.
Layer Categories
Application, Presentation, Session - handle data manipulation and user interaction.
Connects host and media layers, handles end-to-end connections and reliability.
Network, Data Link, Physical - handle data transmission over the network medium.
History of the OSI Model
1970s - The Problem
Different computer vendors used proprietary protocols that couldn't communicate, leading to the "protocol wars".
1977 - ISO Begins Work
The International Organization for Standardization started developing a universal reference model to promote interoperability.
1984 - OSI Published
The OSI model was officially published as ISO 7498, defining the 7-layer architecture.
Today - Educational Standard
While the TCP/IP model dominates the internet, the OSI model remains the standard teaching framework for networking concepts.
OSI vs TCP/IP at a Glance
OSI Model (7 Layers)
- Theoretical reference model
- Created by ISO (1984)
- Protocol independent
- Best for teaching and troubleshooting
TCP/IP Model (4 Layers)
- Practical implementation model
- Created by DARPA (1970s)
- Built around the TCP/IP protocol suite
- The model used on the actual Internet
OSI Layers Explained in Depth
A comprehensive breakdown of each layer's function, protocols, and real-world applications.
Application Layer
The closest layer to the end user - provides network services to applications.
What It Does
This layer is NOT the application itself but the protocols applications use to communicate. When you open a web browser, the browser uses HTTP/HTTPS protocols at this layer. Email clients use SMTP, POP3, or IMAP. File transfers use FTP or SFTP.
Real-World Example
When you type "google.com" in your browser, Layer 7 protocols first perform a DNS lookup to find the IP address, then send an HTTP GET request to fetch the webpage.
Presentation Layer
The translator layer - handles data formatting, encryption, and compression.
What It Does
Acts as a translator between the application and network. Converts data into a format the receiving system can understand. Handles character encoding (e.g. ASCII, Unicode), data encryption (TLS/SSL), and compression (JPEG, MPEG).
Real-World Example
When you visit a banking website, TLS at this layer encrypts your credit card information before transmission. You can check any website's certificate with our SSL checker. Images on websites are compressed using JPEG to reduce bandwidth.
Session Layer
The connection manager - establishes, maintains, and terminates sessions.
What It Does
Like a phone operator who connects your call, keeps it active, and disconnects when done. Manages dialog control (who talks when), synchronization points (checkpoints for recovery), and authentication handshakes.
Real-World Example
When you login to a website, a session is created to keep you logged in as you browse different pages. This session is managed at Layer 5, often using cookies handled by HTTP headers.
Common Protocols
PDU
Data
Transport Layer
The delivery service - provides end-to-end data transfer with reliability options.
What It Does
Like choosing between registered mail (TCP - guaranteed delivery with tracking) or standard mail (UDP - faster but no guarantee). Handles segmentation, flow control, error detection, and port-based multiplexing.
TCP vs UDP
TCP: Reliable, ordered, connection-oriented. Used for web, email, file transfer.
UDP: Fast, connectionless, no guarantee. Used for video streaming, gaming, VoIP, and DNS queries.
Network Layer
The routing layer - handles logical addressing and path determination.
What It Does
Like writing the destination address on an envelope. Uses IP addresses to route packets across different networks. Routers at this layer determine the best path for data to travel from source to destination.
Real-World Example
When you send an email to someone in another country, routers use IP addresses to forward your data through multiple networks until it reaches the destination server. You can trace this path with our ping and traceroute tool.
Data Link Layer
The framing layer - handles physical addressing and local delivery.
What It Does
Like the envelope with sender/recipient names for local postal delivery. Uses MAC addresses for node-to-node delivery within a network. Handles framing, error detection (CRC), and media access control.
Real-World Example
Your laptop's Wi-Fi card uses MAC addresses to communicate with your wireless router. Switches use MAC address tables to forward frames to the correct port.
Physical Layer
The hardware layer - deals with the actual transmission of bits.
What It Does
Like the roads and vehicles that physically carry your mail. Defines electrical signals, cable specifications, connectors, and data rates. Converts digital bits to physical signals (electrical, optical, or radio waves).
Real-World Example
The Ethernet cable (Cat5e/Cat6) connecting your computer to the router, or the fiber optic cables that carry data across continents at the speed of light.
Technologies
PDU
Bits
Real-World Scenarios
See how OSI layers work together in everyday networking tasks.
Web Browsing
Loading a web page involves all 7 layers: DNS resolution, HTTP request, TLS encryption, TCP connection, IP routing, and physical transmission.
Sending Email
Email uses SMTP for sending, with TLS encryption. MX records in DNS determine the destination mail server.
Video Calling
Real-time video uses UDP for low latency. RTP carries media while SIP handles signaling. QoS prioritizes packets.
VPN Tunnel
VPN encrypts and encapsulates traffic. IPsec operates at Layer 3, while OpenVPN uses TLS at higher layers.
File Transfer
SFTP uses SSH for secure transfers. TCP ensures reliable delivery of every byte. Large files are segmented.
DNS Resolution
Translates domain names to IP addresses. Queries traverse root servers, TLD servers, and authoritative servers.
Troubleshooting by Layer
Start from Layer 1 and work up when diagnosing network issues.
Check cables, link lights, physical connections
Verify MAC, duplex, VLAN settings (ethtool, arp)
Test IP connectivity (ping, traceroute, ip route)
Check ports and firewall (netstat, telnet, nc)
Verify sessions, TLS certificates (openssl)
Test application (curl, nslookup, app logs)
Network Troubleshooting by Layer
Systematic approach to diagnosing network issues using the OSI model - start from the bottom and work your way up.
Bottom-Up Troubleshooting Approach
Layer 1: Physical
Check cables, link lights, and physical connections.
ip link show ethtool eth0Layer 2: Data Link
Verify MAC addresses with our tool, check VLANs, and switch port settings.
arp -a ip -s linkLayer 3: Network
Test IP connectivity with our ping tool, check routing, and gateway reachability.
Layer 4: Transport
Check port connectivity, firewall rules, and services.
telnet host 80 ss -tlnp nc -zv host portPhysical Layer
Check cable, try different port/NIC
Verify cable category (Cat5e/Cat6)
EMI interference, loose connections
Data Link Layer
High collisions, slow speeds
Can't reach devices on same switch
Ports blocked unexpectedly
Network Layer
Missing route, wrong gateway
Duplicate IP addresses
Large packets fail, VPN issues
Transport Layer
Service not running, firewall
Firewall dropping, server overload
Too many TIME_WAIT connections
Presentation Layer
Version/cipher mismatch. Use our TLS checker.
Expired, name mismatch, untrusted. Validate with our SSL checker.
Garbled text, charset problems. Check with our encoder/decoder.
Application Layer
Check DNS servers with our lookup tool, try 8.8.8.8
Server issues, auth problems. Check with our status checker.
Check headers, credentials, format. Use our headers tool.
Quick Diagnostic Commands
ss -tlnp nc -zv host 443