← Back to articles

OSI and TCP/IP Models Explained Simply

18 Jul 2025 • Network • 10 min read

When people talk about networking, they often mention "layers" and models like OSI or TCP/IP. It sounds complicated, but it's actually a pretty simple idea. Let's break it down.

Think of network models like a pizza delivery system. To get a pizza from the restaurant to your door, multiple steps happen: the chef makes it, someone boxes it, a driver picks it up, follows a route, and delivers it. Each step is a "layer" with its own job. Network models work the same way!


Why Do We Need Network Models?

Imagine if every computer manufacturer invented their own way to communicate. Chaos! Nothing would work together.

Network models are like a common language. They define rules and standards so that any device can talk to any other device, no matter who made it.

Network models split communication into layers. Each layer has one specific job and doesn't care about what the other layers do.


The OSI Model: 7 Layers

The OSI model (Open Systems Interconnection) was created in 1984. It has 7 layers, from physical cables at the bottom to applications at the top.

Memory trick: "Please Do Not Throw Sausage Pizza Away"

Physical, Data Link, Network, Transport, Session, Presentation, Application

Layer 1: Physical

This is the actual hardware: cables, Wi-Fi signals, electrical pulses, light in fiber optics.

  • What it does: Transmits raw bits (0s and 1s)
  • Examples: Ethernet cables, fiber optics, radio waves
  • Analogy: The road that delivery trucks drive on

Layer 2: Data Link

This layer handles communication between devices on the same network. It uses MAC addresses (unique hardware IDs).

  • What it does: Packages bits into frames, error detection
  • Examples: Ethernet, Wi-Fi (802.11), switches
  • Analogy: The delivery truck moving packages within a city

MAC Address: A unique identifier burned into your network card. Example: 00:1A:2B:3C:4D:5E

Layer 3: Network

This layer handles communication between different networks. It uses IP addresses and finds the best path to the destination.

  • What it does: Routing, IP addressing
  • Examples: IP, routers, ICMP (ping)
  • Analogy: The GPS that plans the route across multiple cities

Layer 4: Transport

This layer ensures data arrives correctly. It can guarantee delivery (TCP) or send fast without guarantees (UDP).

  • What it does: Segmentation, flow control, error recovery
  • Examples: TCP, UDP, port numbers
  • Analogy: The tracking system that confirms delivery

TCP vs UDP:

  • TCP = Reliable. Checks if data arrived. Used for web pages, emails.
  • UDP = Fast. No checking. Used for video streaming, gaming.

Layer 5: Session

This layer manages connections between applications. It starts, maintains, and ends conversations.

  • What it does: Session establishment, synchronization
  • Examples: NetBIOS, RPC
  • Analogy: The phone call setup before you start talking

Layer 6: Presentation

This layer translates data into a format applications can understand. It handles encryption and compression.

  • What it does: Encryption, compression, data formatting
  • Examples: SSL/TLS, JPEG, ASCII
  • Analogy: A translator converting languages

Layer 7: Application

This is what you actually interact with. Web browsers, email clients, and apps live here.

  • What it does: User interface, application services
  • Examples: HTTP, FTP, SMTP, DNS
  • Analogy: The pizza itself that you eat!

The OSI Layers at a Glance

Layer Name Function Example
7 Application User interface HTTP, FTP, DNS
6 Presentation Data translation SSL, JPEG
5 Session Manage connections NetBIOS
4 Transport Reliable delivery TCP, UDP
3 Network Routing IP, ICMP
2 Data Link Local delivery Ethernet, Wi-Fi
1 Physical Raw bits Cables, signals

The TCP/IP Model: 4 Layers

The TCP/IP model is what the internet actually uses. It's simpler than OSI with only 4 layers.

TCP/IP was developed in the 1970s by the US Department of Defense. It became the foundation of the modern internet.

TCP/IP Layer OSI Equivalent Examples
Application Application + Presentation + Session HTTP, FTP, SMTP, DNS
Transport Transport TCP, UDP
Internet Network IP, ICMP, ARP
Network Access Data Link + Physical Ethernet, Wi-Fi

Why is TCP/IP More Common?

  • Practical: It was built for real-world use, not just theory
  • Simpler: 4 layers are easier to work with than 7
  • The Internet runs on it: Every device online uses TCP/IP

How Data Travels Through the Layers

When you send a message, it goes down through the layers on your device, travels across the network, then goes up through the layers on the destination device.

Sending Data (Encapsulation)

  1. Application: You write an email
  2. Transport: Email is split into segments with port numbers
  3. Network: Segments become packets with IP addresses
  4. Data Link: Packets become frames with MAC addresses
  5. Physical: Frames become electrical/light signals

It's like putting a letter in an envelope, then in a package, then in a shipping container. Each layer adds its own "envelope" of information.

Receiving Data (Decapsulation)

The reverse happens. Each layer strips off its header until you get the original message.


Real-World Example: Loading a Webpage

You type www.example.com and press Enter. Here's what happens layer by layer:

  1. Layer 7 (Application): Browser creates an HTTP request
  2. Layer 6 (Presentation): Data is encrypted with TLS (HTTPS)
  3. Layer 5 (Session): A session is established with the server
  4. Layer 4 (Transport): TCP splits data into segments, adds port 443
  5. Layer 3 (Network): IP adds source and destination addresses
  6. Layer 2 (Data Link): Ethernet adds MAC addresses
  7. Layer 1 (Physical): Bits travel through your cable or Wi-Fi

The server receives it, processes up the layers, sends a response, and your browser displays the page!


Troubleshooting with Layers

When something breaks, think in layers. Start from the bottom:

Layer Problem Check
Physical No connection Is the cable plugged in? Wi-Fi enabled?
Data Link Can't reach local devices Check switch, MAC address table
Network Can't reach internet Check IP address, gateway, run ping
Transport Connection refused Check if port is open, firewall rules
Application App not working Check app config, DNS settings

Useful Commands

# Check physical/data link connectivity
ping 192.168.1.1

# Check if you can reach the internet
ping 8.8.8.8

# Check DNS (application layer)
nslookup google.com

# Check route to destination
traceroute google.com

# Check open ports
netstat -tuln

OSI vs TCP/IP: Which One to Use?

  • OSI: Great for learning and understanding concepts
  • TCP/IP: What you'll actually use in the real world

Think of OSI as the textbook and TCP/IP as the actual exam.


Summary

Key takeaways:

  1. OSI has 7 layers, TCP/IP has 4 layers
  2. Each layer has a specific job and doesn't worry about other layers
  3. Data goes down the layers when sending, up when receiving
  4. When troubleshooting, start from the bottom (Physical) and work up
  5. The internet runs on TCP/IP, but OSI helps you understand the concepts

Now when someone asks "at what layer does that happen?", you'll know exactly what they mean!