What is the OSI model?
The OSI (Open Systems Interconnection) model, standardized by the ISO in 1984, splits network communication into seven layers so that equipment and software from different vendors can interoperate. It's less a protocol stack implemented exactly as drawn and more a conceptual map for understanding and troubleshooting how data actually moves: as data travels down through the sending device's layers, each layer adds its own header (encapsulation); on the receiving end, each layer is stripped off in reverse (decapsulation) as the data climbs back up to layer 7.
Layer 1: Physical
Layer 1 covers how bits (0s and 1s) get converted into an actual signal β electrical voltage over copper, light pulses over fiber, or radio waves over Wi-Fi. Cables, connectors, hubs, and repeaters live here; this layer moves signals but has no concept of addresses or meaning at all.
Layer 2: Data Link
Layer 2 delivers data β organized into frames β to another device on the same local network using MAC addresses. Ethernet and Wi-Fi standards operate here, and a switch reading its MAC address table to forward a frame to the right port is a Layer 2 operation; this layer checks for transmission errors but has no way to route data to a distant network.
Layer 3: Network
Layer 3 finds a path across different networks using IP addresses, moving data in units called packets. IP itself and routers are the classic Layer 3 building blocks β a router reads the destination IP address, checks its routing table, and decides where to forward the packet next. ICMP (the protocol behind ping) also lives here.
Layer 4: Transport
Layer 4 is where TCP and UDP operate, using port numbers to let multiple applications on the same device communicate independently and taking responsibility for reliable delivery. TCP guarantees ordering and retransmits lost data; UDP trades away that reliability for speed.
Layer 5: Session
Layer 5 is responsible for opening, maintaining, and closing a conversation between two devices. In modern internet protocols, this conceptual role has largely been absorbed into TLS or into application-level session management (cookies, session tokens), so it rarely appears as its own distinct implementation layer anymore.
Layer 6: Presentation
Layer 6 formats, encrypts, and compresses data into a form the application layer can use β think character encoding conversion, JPEG/MP4 compression, and SSL/TLS encryption in concept. In practice, modern stacks don't implement it as its own clean layer; TLS, for instance, actually sits right above the transport layer rather than in a distinct presentation layer.
Layer 7: Application
Layer 7 is the top layer, where the software people actually use β browsers, email clients, messaging apps β communicates. HTTP/HTTPS, SMTP/IMAP, FTP, and DNS all operate here. Because it's the layer closest to the user, everyday complaints like 'it's slow' often actually trace back to a problem several layers lower, like routing (Layer 3) or signal quality (Layer 1).
OSI vs. TCP/IP
The actual internet runs on the simpler, four-layer TCP/IP model rather than a literal seven-layer OSI stack: network access (roughly layers 1β2), internet (layer 3), transport (layer 4), and application (layers 5β7 combined). Standards documents mostly reference TCP/IP's four layers, but OSI's finer breakdown is still widely used in education and troubleshooting.