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.

7 Layers
Interactive
Educational
📡
Layer Stack
📦
Encapsulation
🔌
Protocols
🎯
Quiz Mode
Powered by orbit2x.com

OSI 7-Layer Model

Interactive
7

Application

Data

HTTP, FTP, SMTP, DNS, SSH

6

Presentation

Data

SSL/TLS, JPEG, MPEG, ASCII

5

Session

Data

NetBIOS, RPC, SIP, PPTP

4

Transport

Segment

TCP, UDP, SCTP, QUIC

3

Network

Packet

IP, ICMP, OSPF, BGP

2

Data Link

Frame

Ethernet, Wi-Fi, ARP, STP

1

Physical

Bits

Ethernet, USB, Fiber, DSL

Common Protocols by Layer

Click for details
HTTP
Port 80
Hypertext Transfer Protocol for web pages
HTTPS
Port 443
Secure HTTP with TLS encryption
DNS
Port 53
Domain Name System resolution
SSH
Port 22
Secure Shell for remote access
FTP
Port 21
File Transfer Protocol
SMTP
Port 25/587
Simple Mail Transfer Protocol
DHCP
Port 67/68
Dynamic IP address assignment
SNMP
Port 161
Network management protocol
7

Application Layer

PDU (Data Unit) Data

Application-level data

Function

Provides network services directly to end-user applications

Key Protocols
HTTP HTTPS DNS FTP
Devices

Application Gateways, Web Application Firewalls, Proxy Servers

Key Concepts
APIs Authentication Data Formatting
Security Threats
SQL Injection
XSS Attacks
💡
Real-World Analogy

The language and content of a letter you're writing

OSI vs TCP/IP

TCP/IP Equivalent Application

TCP/IP model has 4 layers and combines OSI layers 5-7 into Application layer.

Common Ports

80
HTTP
443
HTTPS
22
SSH
53
DNS

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

Check if the application service is running
Verify DNS resolution is working
Test with curl or wget for HTTP issues

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#PDUTCP/IP LayerKey Protocols
7
Application
7Data
4
Application
HTTP DNS FTP SMTP
6
Presentation
6Data
SSL/TLS JPEG ASCII
5
Session
5Data
NetBIOS RPC SIP
4
Transport
4Segment
3
Transport
TCP UDP QUIC
3
Network
3Packet
2
Internet
IPv4 IPv6 ICMP
2
Data Link
2Frame
1
Network Access
Ethernet Wi-Fi ARP
1
Physical
1Bits
USB Fiber DSL
OSI

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

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

OSI Model
7. Application
6. Presentation
5. Session
4. Transport
3. Network
2. Data Link
1. Physical
TCP/IP Model
4. Application
3. Transport
2. Internet
1. Network Access

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.

7

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

Host Layers (5-7) Software

Application, Presentation, Session - handle data manipulation and user interaction.

Transport Layer (4) Bridge

Connects host and media layers, handles end-to-end connections and reliability.

Media Layers (1-3) Hardware

Network, Data Link, Physical - handle data transmission over the network medium.

History of the OSI Model

1

1970s - The Problem

Different computer vendors used proprietary protocols that couldn't communicate, leading to the "protocol wars".

2

1977 - ISO Begins Work

The International Organization for Standardization started developing a universal reference model to promote interoperability.

3

1984 - OSI Published

The OSI model was officially published as ISO 7498, defining the 7-layer architecture.

4

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.

7

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.

Common Protocols

HTTP (80) HTTPS (443) DNS (53) FTP (21) SMTP (25) SSH (22)

PDU

Data

6

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.

Key Technologies

SSL/TLS JPEG MPEG ASCII Unicode

PDU

Data

5

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

NetBIOS RPC SIP PPTP

PDU

Data

4

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.

Common Protocols

TCP UDP QUIC SCTP

PDU

Segment (TCP) / Datagram (UDP)

3

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.

Common Protocols

IPv4 IPv6 ICMP OSPF BGP

PDU

Packet

2

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.

Common Protocols

Ethernet Wi-Fi ARP STP VLAN

PDU

Frame

1

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

1000BASE-T Fiber DSL USB Wi-Fi Radio

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.

Layers 7-1 all involved
HTTP/HTTPS, DNS, TCP, IP
📧

Sending Email

Email uses SMTP for sending, with TLS encryption. MX records in DNS determine the destination mail server.

SMTP, IMAP, POP3
DNS MX Records
📹

Video Calling

Real-time video uses UDP for low latency. RTP carries media while SIP handles signaling. QoS prioritizes packets.

UDP for speed over reliability
RTP, RTCP, SIP, WebRTC
🔒

VPN Tunnel

VPN encrypts and encapsulates traffic. IPsec operates at Layer 3, while OpenVPN uses TLS at higher layers.

Double encapsulation
IPsec, WireGuard, OpenVPN
📁

File Transfer

SFTP uses SSH for secure transfers. TCP ensures reliable delivery of every byte. Large files are segmented.

TCP for reliability
FTP, SFTP, SCP
🔍

DNS Resolution

Translates domain names to IP addresses. Queries traverse root servers, TLD servers, and authoritative servers.

Hierarchical resolution
UDP port 53, caching

Troubleshooting by Layer

Start from Layer 1 and work up when diagnosing network issues.

L1

Check cables, link lights, physical connections

L2

Verify MAC, duplex, VLAN settings (ethtool, arp)

L3

Test IP connectivity (ping, traceroute, ip route)

L4

Check ports and firewall (netstat, telnet, nc)

L5-6

Verify sessions, TLS certificates (openssl)

L7

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

1

Layer 1: Physical

Check cables, link lights, and physical connections.

ip link show ethtool eth0
2

Layer 2: Data Link

Verify MAC addresses with our tool, check VLANs, and switch port settings.

arp -a ip -s link
3

Layer 3: Network

Test IP connectivity with our ping tool, check routing, and gateway reachability.

4

Layer 4: Transport

Check port connectivity, firewall rules, and services.

telnet host 80 ss -tlnp nc -zv host port
5

Layer 7: Application

Verify DNS, HTTP responses, and application-level protocols.

1

Physical Layer

No Link

Check cable, try different port/NIC

Wrong Speed

Verify cable category (Cat5e/Cat6)

Intermittent

EMI interference, loose connections

2

Data Link Layer

Duplex Mismatch

High collisions, slow speeds

VLAN Issues

Can't reach devices on same switch

STP Blocking

Ports blocked unexpectedly

3

Network Layer

No Route to Host

Missing route, wrong gateway

IP Conflict

Duplicate IP addresses

MTU Issues

Large packets fail, VPN issues

4

Transport Layer

Connection Refused

Service not running, firewall

Connection Timeout

Firewall dropping, server overload

Port Exhaustion

Too many TIME_WAIT connections

6

Presentation Layer

TLS Handshake Failure

Version/cipher mismatch. Use our TLS checker.

Certificate Errors

Expired, name mismatch, untrusted. Validate with our SSL checker.

Encoding Issues

Garbled text, charset problems. Check with our encoder/decoder.

7

Application Layer

DNS Resolution Failure

Check DNS servers with our lookup tool, try 8.8.8.8

HTTP 4xx/5xx Errors

Server issues, auth problems. Check with our status checker.

API Failures

Check headers, credentials, format. Use our headers tool.

Quick Diagnostic Commands