The 7-Layer OSI Framework
The OSI model divides network communications into seven conceptual layers. This separation isolates concerns, allowing engineers to build hardware or write software at a specific layer without needing to understand the implementation details of others.
From bottom to top, the layers are: Physical (L1), Data Link (L2), Network (L3), Transport (L4), Session (L5), Presentation (L6), and Application (L7).
Layers 1 to 4: Data Transport
Layer 1 (Physical) deals with raw bit streams over copper cables, fiber, or radio waves.
Layer 2 (Data Link) defines how adjacent devices communicate over local hardware (e.g. Ethernet MAC frames and switches).
Layer 3 (Network) manages logical addressing and global packet routing (IP, routers).
Layer 4 (Transport) coordinates end-to-end reliability, flow control, and multiplexing (TCP/UDP ports).
Layers 5 to 7: Application and Context
Layer 5 (Session) manages stateful communication channels between applications.
Layer 6 (Presentation) translates data shapes, handles encoding (character sets, JSON), and performs encryption (TLS/SSL).
Layer 7 (Application) hosts user-facing protocols like HTTP, DNS, SMTP, and SSH.
