OSI Layer Interaction
The OSI (Open Systems Interconnection) model is a conceptual framework that describes how network communication is structured into seven distinct layers, each responsible for a specific aspect of data transmission, with each layer adding its own header during encapsulation.
The OSI (Open Systems Interconnection) model is a conceptual framework that describes how network communication is structured into seven distinct layers, each responsible for a specific aspect of data transmission, with each layer adding its own header during encapsulation.
The OSI model was developed by ISO in the 1980s as a standardization framework. While the actual internet runs on the TCP/IP model (which merges several OSI layers), OSI remains the universal reference model used to reason about network protocols, troubleshoot issues, and describe where specific technologies operate.
The Seven Layers (top to bottom):
- Layer 7 — Application: The protocol the application uses: HTTP, DNS, SMTP, FTP. This is what developers typically interact with. - Layer 6 — Presentation: Data encoding, compression, encryption. TLS/SSL operates here — encrypting application data before transport. - Layer 5 — Session: Session management, dialog control. TCP session establishment maps loosely here. - Layer 4 — Transport: TCP and UDP. Handles segmentation, reliability (TCP), and port addressing. - Layer 3 — Network: IP. Logical addressing and routing. Routers operate at this layer. - Layer 2 — Data Link: Ethernet, WiFi. MAC addressing and frame delivery on a local segment. Switches operate here. - Layer 1 — Physical: Cables, radio waves, optical fiber. Raw bit transmission.
Encapsulation: As data moves down the stack on the sender, each layer adds its own header (and sometimes trailer). At the receiver, each layer strips its header as data moves up. This is why protocols are described as "running over" lower layers: HTTP runs over TCP runs over IP runs over Ethernet.
The TLS Handshake operates at Layer 6/4, TCP Three-Way Handshake at Layer 4, and ARP at Layer 2.