The OSI Model: Layers to Understand Networking

Listen to this Post

The OSI (Open Systems Interconnection) model is a framework used to understand how data travels across a network. It consists of seven layers, each with specific functions:

  1. Physical Layer – Deals with cables, signals, and raw bit transmission.
  2. Data Link Layer – Handles MAC addresses, switches, and error detection.
  3. Network Layer – Manages IP addressing and routing (Routers operate here).
  4. Transport Layer – Ensures data delivery via TCP (reliable) or UDP (fast).
  5. Session Layer – Establishes, maintains, and terminates connections.
  6. Presentation Layer – Translates, encrypts, and compresses data.
  7. Application Layer – Provides user interfaces like HTTP, FTP, and SMTP.

Mnemonic: “Please Do Not Throw Sausage Pizza Away” (Physical, Data, Network, Transport, Session, Presentation, Application).

You Should Know:

  1. Physical Layer (Layer 1) – Cables & Bits

– Commands to check network interfaces (Linux):

ip link show  List all network interfaces
ethtool eth0  Check Ethernet interface details

– Windows:

Get-NetAdapter  List network adapters
  1. Data Link Layer (Layer 2) – MAC & Switching

– View MAC address (Linux):

ip addr show  Shows MAC (ether) and IP

– ARP table (Windows):

arp -a  Display ARP cache
  1. Network Layer (Layer 3) – IP & Routing

– Check routing table (Linux):

ip route show  Display routing table

– Windows:

route print  Show routing table
  1. Transport Layer (Layer 4) – TCP/UDP & Ports

– Check open ports (Linux):

netstat -tuln  List listening ports
ss -tuln  Faster alternative

– Windows:

Test-NetConnection -Port 80 -ComputerName google.com  Test port connectivity

5. Session Layer (Layer 5) – Connection Control

  • Linux tools for session management:
    who  Show logged-in users
    netstat -anp  Active sessions
    
  1. Presentation Layer (Layer 6) – Encryption & Formatting

– OpenSSL commands for encryption:

openssl enc -aes-256-cbc -in file.txt -out encrypted.enc  Encrypt file
  1. Application Layer (Layer 7) – HTTP, FTP, DNS

– Test HTTP (Linux):

curl -I https://example.com  Fetch HTTP headers

– Windows:

Invoke-WebRequest -Uri "https://example.com"  Fetch webpage

What Undercode Say:

The OSI model is fundamental for troubleshooting networks. Understanding each layer helps diagnose issuesβ€”whether it’s a faulty cable (Layer 1), a misconfigured IP (Layer 3), or a firewall blocking a port (Layer 4). Mastering these concepts ensures efficient network management.

Expected Output:

  • A structured breakdown of OSI layers with practical commands.
  • Enhanced troubleshooting skills for network engineers.
  • Clear distinction between TCP (reliable) and UDP (fast) usage.

References:

Reported By: Sumit Kashyap – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass βœ…

Join Our Cyber World:

πŸ’¬ Whatsapp | πŸ’¬ TelegramFeatured Image