DEV Community

Cover image for The OSI 7-Layer Reference Model Explained: Encapsulation, PDUs & Real-World Networking
Binary Dose
Binary Dose

Posted on Originally published at binarydose.in

The OSI 7-Layer Reference Model Explained: Encapsulation, PDUs & Real-World Networking

Whenever two computing devices exchange data across a network, they do so through a standardized abstraction hierarchy. The Open Systems Interconnection (OSI) model, standardized by ISO in 1984, defines communication across seven distinct layers.

1. The 7 Layers of OSI

  1. Application Layer (Layer 7): Provides network services directly to user applications (HTTP, SMTP, DNS, SSH).
  2. Presentation Layer (Layer 6): Handles syntax, character encoding (ASCII/Unicode), data compression, and cryptographic translation (TLS/SSL).
  3. Session Layer (Layer 5): Manages communication sessions, token management, and dialogue synchronization checkpoints.
  4. Transport Layer (Layer 4): Guarantees end-to-end transport, port-to-port multiplexing, flow control, and reliability (TCP, UDP).
  5. Network Layer (Layer 3): Provides logical addressing (IPv4, IPv6) and path determination across heterogeneous subnets (Routers).
  6. Data Link Layer (Layer 2): Packages packets into frames, handles physical MAC addressing, medium access, and CRC error detection (Switches).
  7. Physical Layer (Layer 1): Transmits raw unstructured bit streams across physical transmission media (cables, radio waves, optical fibers).

2. Data Encapsulation & PDUs

As data descends the stack on the transmitting host:

  • Layer 7-5: Application Data
  • Layer 4: Segment (TCP header added)
  • Layer 3: Packet (IP header added)
  • Layer 2: Frame (MAC header and CRC trailer appended)
  • Layer 1: Bits (encoded into physical voltages or light signals)

Explore our full interactive Computer Networks curriculum on Binary Dose.

Top comments (0)