knowledge

Overview

The Open Systems Interconnection (OSI) Model provides a standardized 7-layer framework for network communication, defining how devices send, receive, and interpret data. It allows interoperability between different systems and technologies by assigning specific responsibilities to each layer.


Terminology

TermDefinition
EncapsulationProcess of adding header/control information to data as it passes down the OSI layers before transmission
DecapsulationProcess of stripping header/control information from data as it passes up the OSI layers after receipt
FrameLayer 2 unit of data; contains MAC addressing but no IP information
PacketLayer 3 unit of data; contains IP addressing for routing
SegmentLayer 4 unit of data; contains port and reliability information
PDU (Protocol Data Unit)Generic term for the data unit at each OSI layer

Core Concepts

The 7 Layers

OSI With Protocols OSI With TCP/IP Protocols

LayerNameData UnitResponsibilityExample Protocols
7ApplicationDataUser-facing protocols and interactionsHTTP, FTP, DNS, SMTP
6PresentationDataData translation, encryption, compressionSSL/TLS, JPEG, ASCII
5SessionDataConnection management, checkpoints, session uniquenessNetBIOS, RPC
4TransportSegmentReliable/unreliable transmission, flow controlTCP, UDP
3NetworkPacketRouting, IP addressing, reassemblyIP, ICMP, OSPF, RIP
2Data LinkFramePhysical addressing via MAC, error detectionEthernet, PPP
1PhysicalBitsElectrical/optical signal transmission, hardwareCables, switches, hubs

Layer Responsibilities In Detail

Layer 7 — Application

  • Provides protocol rules for user-facing applications
  • May include GUI interactions
  • Examples: web browsers, email clients, FTP clients

Layer 6 — Presentation

  • Standardizes data format between systems
  • Handles encryption and decryption
  • Handles compression for efficient transmission

Layer 5 — Session

  • Opens, maintains, and closes communication sessions
  • Implements checkpoints for data synchronization
  • Ensures session uniqueness between communicating devices

Layer 4 — Transport

  • TCP — connection-oriented; guarantees delivery and order
  • UDP — connectionless; faster but no delivery guarantee
  • Manages flow control and error recovery

Layer 3 — Network

  • Routes packets between different networks
  • Assigns and reads IP addresses
  • Routers operate at this layer
  • Handles physical addressing using MAC addresses
  • Detects transmission errors
  • Switches operate at this layer (also Layer 3 for managed switches)

Layer 1 — Physical

  • Transmits raw bits over a physical medium
  • Covers cables, connectors, voltage levels, and signal timing

Encapsulation & Decapsulation

Encapsulation Example

  • Encapsulation — as data travels down the layers, each layer adds its own header (and sometimes trailer) before passing to the next
  • Decapsulation — as data travels up the layers on the receiving end, each layer strips its header before passing upward
  • Each layer only processes the information relevant to it

  • Packet Analysis

References / Images

  • OSI With Protocols
  • OSI With TCP/IP Protocols
  • Encapsulation Example
  • RFC 1122
  • Networking textbooks and vendor documentation