The Open Systems Interconnection (OSI) model is a conceptual framework that standardizes network communication into seven distinct layers. Developed by the ISO in 1984, it gives network engineers a common language for troubleshooting, design, and protocol development.
When a user loads a web page, data travels down through all seven layers on the sender's side, crosses the physical medium, and travels back up through all seven layers on the receiver's side. Each layer adds its own header (encapsulation) on the way down and strips it off (de-encapsulation) on the way up.
The mnemonic "Please Do Not Throw Sausage Pizza Away" maps to Physical, Data Link, Network, Transport, Session, Presentation, Application -- from Layer 1 to Layer 7.
| Layer | Name | PDU | Key Protocols | Devices |
|---|---|---|---|---|
| 7 | Application | Data | HTTP, FTP, SMTP, DNS, SSH | Software / Proxy |
| 6 | Presentation | Data | SSL/TLS, JPEG, ASCII, MPEG | -- |
| 5 | Session | Data | NetBIOS, RPC, PPTP | -- |
| 4 | Transport | Segment / Datagram | TCP, UDP | Load Balancer |
| 3 | Network | Packet | IP, ICMP, OSPF, ARP | Router |
| 2 | Data Link | Frame | Ethernet, Wi-Fi (802.11), PPP | Switch, Bridge |
| 1 | Physical | Bits | Ethernet (physical), USB, DSL | Hub, Repeater, Cable |
The physical layer handles raw bit transmission over a physical medium. It defines electrical signals, voltages, pin layouts, cable specifications, and data rates. This is where copper cables, fiber optics, and radio waves live.
The data link layer packages bits into frames and handles node-to-node delivery on the same network segment. It provides MAC addressing, error detection (CRC), and flow control. The layer is split into two sublayers: LLC (Logical Link Control) and MAC (Media Access Control).
Switches operate at Layer 2. They build a MAC address table by examining source MACs on incoming frames, then forward frames only to the correct port -- avoiding unnecessary traffic on other ports.
The network layer handles logical addressing (IP addresses) and routing. It determines the best path for data to travel across multiple networks. Routers operate at this layer, making forwarding decisions based on destination IP addresses.
The transport layer provides end-to-end communication between applications. TCP offers reliable, ordered delivery with error correction. UDP offers fast, connectionless delivery without guarantees. Port numbers identify specific applications.
Session Layer (5) manages dialogs between applications. It establishes, maintains, and terminates sessions. Think of a video call -- the session layer keeps the connection alive and handles re-establishment if it drops.
Presentation Layer (6) handles data formatting, encryption, and compression. When your browser receives TLS-encrypted data and decompresses a GZIP response, that is presentation layer work. Character encoding (ASCII, Unicode) also lives here.
Application Layer (7) is the interface between network services and end-user applications. HTTP defines how web browsers request pages. SMTP defines how email is sent. DNS translates domain names to IP addresses. This layer does not include the applications themselves -- it provides the protocols they use.
When you browse to https://hexworth.com, here is what happens at each layer:
The TCP/IP model (also called the Internet model) compresses the OSI's seven layers into four. In practice, most real-world protocols map to the TCP/IP model, but the OSI model remains the standard for teaching and troubleshooting.
| OSI Layers | TCP/IP Layer | Example |
|---|---|---|
| 7, 6, 5 -- Application, Presentation, Session | Application | HTTP, DNS, SMTP |
| 4 -- Transport | Transport | TCP, UDP |
| 3 -- Network | Internet | IP, ICMP |
| 2, 1 -- Data Link, Physical | Network Access | Ethernet, Wi-Fi |
The OSI model provides a systematic approach to diagnosing network problems. Start at Layer 1 and work up:
Most technicians use a "bottom-up" approach (start at Layer 1) for hardware problems and a "top-down" approach (start at Layer 7) for application problems. Knowing both strategies makes you effective at any level.