OSI Model
In short: A 7-layer reference model that describes how network communication is broken down into clearly separated areas of responsibility — from physical transmission (layer 1) up to the application (layer 7).
In more detail: The layers from bottom to top: physical, data link, network, transport, session, presentation, application. Each layer only communicates with the layer directly above/below it and encapsulates the details of the other layers. In practice the internet follows the leaner TCP/IP model (4 layers) more closely, but the OSI model still serves as a teaching reference model for assigning network problems to a particular level (e.g. “broken cable” = layer 1, “wrong routing” = layer 3).
In Depth
The seven layers at a glance
7. Application - HTTP, SMTP, SSH, DNS (what the application wants to "say")
6. Presentation - encryption, compression, character encoding (format)
5. Session - setting up, tearing down and managing sessions
4. Transport - TCP, UDP (reliability, order, ports)
3. Network - IP, routing (how the packet gets to the target network)
2. Data link - Ethernet, MAC addresses, switches (transmission within the local segment)
1. Physical - cables, radio, voltage levels, light pulses (raw bits)
A practical mnemonic for remembering the order (from bottom to top) is “Please Do Not Throw Sausage Pizza Away” (physical, data link, network, transport, session, presentation, application).
Encapsulation: how data passes through the layers
When sending, a data packet passes through all seven layers from top to bottom, with each layer “wrapping” its own control information as an additional header (and sometimes footer) around the data of the layer above — a process called encapsulation. The transport layer, for example, packs the application data into a TCP segment with port information, the network layer in turn packs this segment into an IP packet with address information, and finally the data link layer packs the whole thing into an Ethernet frame with MAC addresses. At the recipient the process runs exactly the other way round (decapsulation): each layer removes “its” header, reads the relevant information and passes the rest upwards, until in the end only the actual application data remains.
Why separating layers makes sense
The point of dividing things into layers: each layer can be developed independently as long as it keeps to its clearly defined interface with the neighbouring layers — switching from copper to fibre cable (layer 1), for example, affects none of the layers above, because layer 2 only expects a clean interface to layer 1, regardless of the specific physical medium behind it. This principle allows completely different technologies to exist interchangeably side by side on the same layer (Wi-Fi and Ethernet at layers 1/2, TCP and UDP at layer 4), without the layers above or below having to change at all.
OSI vs. the real TCP/IP model
In practice the actual internet uses the leaner TCP/IP model with only four layers (network interface, internet, transport, application), which combines several OSI layers — session and presentation don’t exist as separate layers in the TCP/IP model; their tasks are taken over directly by the application layer or by individual protocols (e.g. TLS practically takes over the tasks of the classic presentation layer). The OSI model nevertheless remains in use as a more precise, vendor-neutral teaching and diagnostic tool, among other things because it lets network problems be assigned clearly to a particular level and thus structures troubleshooting: “broken cable or no connection” points to layer 1, “wrong IP address/routing” to layer 3, “port not reachable” to layer 4. Experienced network engineers traditionally work through the layers systematically from bottom to top when troubleshooting (“check the cable and link light first before debugging application code”) — an approach that derives directly from the OSI way of thinking and in practice often leads to the cause faster than searching in the application layer straight away.
See also: OSI layer: application, OSI layer: transport, Physical structure, TCP, Header