What the OSI Model Is For
The OSI (Open Systems Interconnection) model was developed by the International Organization for Standardization (ISO) in the late 1970s and published in 1984. Its purpose was to create a universal framework for how different networking technologies could interoperate — a common language for describing what happens at each stage of network communication.
Real networks do not literally implement the OSI model as a protocol stack; they use TCP/IP. But OSI remains the dominant conceptual vocabulary in networking. When a vendor says their product operates at "Layer 7," when a firewall is described as "stateful Layer 4 inspection," or when a network engineer troubleshoots "starting from Layer 1 and working up," they are all using OSI terminology. Understanding OSI gives you a framework for reasoning about any networking problem.
The model's core principle: each layer provides services to the layer above it and uses services from the layer below. A change in one layer's implementation should not require changes in any other layer. This modularity allowed Wi-Fi to replace Ethernet at Layer 1 and 2 without changing IP at Layer 3 or TCP at Layer 4.
All 7 Layers
| Layer | Name | What It Does | Protocols / Examples |
|---|---|---|---|
| 7 | Application | End-user protocols and interfaces; where application data is created | HTTP, HTTPS, FTP, SMTP, DNS, SSH |
| 6 | Presentation | Data translation, encryption, compression; ensures data is in usable format | TLS/SSL, JPEG, MPEG, ASCII, Unicode |
| 5 | Session | Establishes, manages, and terminates sessions between applications | NetBIOS, RPC, PPTP, SIP (session establishment) |
| 4 | Transport | End-to-end communication, segmentation, flow control, error recovery | TCP, UDP, SCTP |
| 3 | Network | Logical addressing and routing between networks | IP (IPv4, IPv6), ICMP, OSPF, BGP |
| 2 | Data Link | Framing, MAC addressing, error detection within a local network segment | Ethernet, Wi-Fi (802.11), ARP, PPP |
| 1 | Physical | Transmission of raw bits over a physical medium | Ethernet cables, fiber optic, radio waves, USB |
Layer by Layer: What Each One Actually Does
Layer 1 — Physical: The Physical layer deals with the actual transmission of raw binary data — ones and zeros — over a physical medium. It defines the electrical voltage levels, cable specifications, connector types, radio frequencies, and timing of bit transmission. Ethernet cables (Cat5e, Cat6), fiber optic cables, Wi-Fi radio signals, and Bluetooth all operate at Layer 1. This layer knows nothing about addresses or protocols — it just puts bits on the wire and reads bits from the wire.
Layer 2 — Data Link: The Data Link layer takes the raw bits from Layer 1 and organizes them into frames — logical units with a defined start, payload, and end. It adds MAC (Media Access Control) addresses to identify devices within a local network segment. Ethernet frames, Wi-Fi frames, and ARP (Address Resolution Protocol) operate here. Switches are Layer 2 devices — they read MAC addresses and forward frames within a local network. Layer 2 includes error detection (via CRC checksums in frame trailers) but not error correction.
Layer 3 — Network: The Network layer adds logical (IP) addressing and routing between different networks. It defines how packets are addressed and how routers forward them across multiple network hops. IP (IPv4 and IPv6), ICMP, and routing protocols like OSPF operate at Layer 3. Routers are Layer 3 devices. Layer 3 provides best-effort delivery — it does not guarantee that packets arrive or arrive in order.
Layer 4 — Transport: The Transport layer provides end-to-end communication between applications on different hosts. TCP adds reliability — connection establishment, ordering, retransmission of lost packets, and flow control. UDP provides fast, connectionless delivery without these guarantees. Port numbers live at Layer 4, allowing multiple applications on the same host to communicate simultaneously. The Transport layer segments large data into chunks and reassembles them at the destination.
Layers 5, 6, 7 — Session, Presentation, Application: In practice, the TCP/IP model collapses these three OSI layers into a single Application layer. The Session layer manages the setup and teardown of communication sessions. The Presentation layer handles encoding, encryption, and compression — TLS encryption lives conceptually here. The Application layer is where end-user protocols operate: HTTP, SMTP, DNS, SSH, FTP. Most modern protocol implementations blend all three functions without clean separation.
How to Use OSI for Troubleshooting
The OSI model gives you a systematic framework for diagnosing network problems. The classic approach is to start at Layer 1 and work up, or start at Layer 7 and work down. Starting from Layer 1: is the cable plugged in? Is the link light on? (Layer 1). Does the device have an IP address and can it ping the default gateway? (Layer 3). Can it reach port 443 on the destination? (Layer 4). Does the HTTPS handshake complete? (Layer 6). Does the application respond correctly? (Layer 7). Isolating which layer fails points directly to the category of problem — physical, addressing, routing, firewall, or application.
OSI Model vs TCP/IP Model
The TCP/IP model (also called the Internet model) has four layers — Link, Internet, Transport, and Application — compared to OSI's seven. TCP/IP's Link layer corresponds to OSI Layers 1 and 2. TCP/IP's Internet layer corresponds to OSI Layer 3. TCP/IP's Transport layer corresponds to OSI Layer 4. TCP/IP's Application layer encompasses OSI Layers 5, 6, and 7. The TCP/IP model reflects how the internet actually works; OSI provides finer-grained conceptual distinctions that are useful for analysis and documentation even when not directly reflected in implementation.
Frequently Asked Questions
How many layers are in the OSI model?
The OSI model has 7 layers: Physical (1), Data Link (2), Network (3), Transport (4), Session (5), Presentation (6), and Application (7). Each layer has a specific role and communicates only with the layers directly above and below it.
What is Layer 3?
Layer 3 is the Network layer — responsible for logical addressing and routing between networks. IP (IPv4 and IPv6) and ICMP operate at Layer 3. Routers are Layer 3 devices that forward packets based on IP destination addresses.
What layer does HTTP operate at?
HTTP operates at Layer 7, the Application layer — the topmost layer where end-user protocols like HTTP, HTTPS, FTP, SMTP, DNS, and SSH live.
What is Layer 2?
Layer 2 is the Data Link layer. It handles framing, MAC addressing, and error detection within a single network segment. Ethernet, Wi-Fi (802.11), and network switches operate at Layer 2.
What mnemonic helps remember the OSI layers?
Bottom-up (Physical to Application): "Please Do Not Throw Sausage Pizza Away." Top-down (Application to Physical): "All People Seem To Need Data Processing." Both cover all 7 layers in order.
Do real networks use the OSI model?
Real networks use TCP/IP as their protocol stack, not OSI. The OSI model is a conceptual framework used for teaching, documentation, and troubleshooting. However, OSI layer numbers are universally used in networking — "Layer 3 switch," "Layer 7 firewall" — even though the underlying implementation is TCP/IP.