OSI & TCP/IP Models

💤0
Lv 10 XP
← 🧱 Foundations · Networking Basics

OSI & TCP/IP Models

Beginner ⭐ 50 XP ⏱ 16 min #networking#osi#tcp-ip

A mental map of how network communication is layered, from cables to applications.

📖Theory

Networking is layered so each layer only worries about its own job and talks to the layers above and below it. The OSI model has 7 layers; the practical TCP/IP model collapses them into 4. Data is encapsulated as it goes down the stack (each layer adds a header) and decapsulated on the way up.

The layers you reference most in operations:

  • L7 Application — HTTP, DNS, SSH (what apps speak)
  • L4 Transport — TCP/UDP, ports (reliable streams vs. fast datagrams)
  • L3 Network — IP, routing (addressing across networks)
  • L2 Data Link — MAC, switches (the local segment)

When you troubleshoot, you walk the layers: cable/link → IP → routing → DNS → application.

graph TD
  A["L7 Application — HTTP, DNS, SSH"] --> B["L6 Presentation — TLS, encoding"]
  B --> C["L5 Session"]
  C --> D["L4 Transport — TCP / UDP, ports"]
  D --> E["L3 Network — IP, routing"]
  E --> F["L2 Data Link — MAC, switches"]
  F --> G["L1 Physical — cables, radio"]
OSI layers and where common protocols live
✍️Hands-On Exercise
  1. List which layer each protocol belongs to: HTTP, IP, TCP, Ethernet.
  2. Explain what “encapsulation” adds at each layer going down the stack.
  3. Map the 7 OSI layers onto the 4 TCP/IP layers.
  4. Given “the website loads but is slow”, name two layers you’d investigate.
🧾Cheat Sheet
OSI LayerExampleUnit
7 ApplicationHTTP, DNSData
4 TransportTCP, UDPSegment
3 NetworkIPPacket
2 Data LinkEthernet, MACFrame
1 PhysicalCable, Wi-FiBits
💬Common Interview Questions
Why is networking organized into layers?

Layering separates concerns: each layer has a single job and a clean interface to its neighbors, so protocols can change independently and troubleshooting is systematic.

At which layers do TCP and IP operate?

TCP is Layer 4 (Transport); IP is Layer 3 (Network). TCP provides reliable ordered delivery; IP provides addressing and routing between networks.

📚Official Documentation

📝 My notes on this topic

Auto-saves as you type