# The OSI Model

> The OSI (Open Systems Interconnection) model is a 7-layer conceptual framework that divides network communication into distinct responsibilities: Physical, Data Link, Network, Transport, Session, Presentation and Application. It is mainly a teaching and design tool, since real networks run on TCP/IP, but its layer terminology is still widely used in troubleshooting.

Canonical: https://devsunite.com/resources/core-subjects/computer-networks/osi-model
Last updated: 2026-11-22

Subject: Computer Networks · Category: OSI Models · 4 min read

The OSI (Open Systems Interconnection) model is a conceptual framework that divides network communication into seven distinct layers, each responsible for a specific part of getting data from one application to another across a network. It's primarily a teaching and design tool today, real-world networking uses TCP/IP in practice, but the OSI model's layered thinking still shapes how networking is understood and discussed.

## The seven layers, bottom to top

1. **Physical.** The actual physical transmission of raw bits, electrical signals, light pulses, radio waves, over cables or wireless media.
2. **Data Link.** Handles node-to-node data transfer on the same local network, and error detection at that level; this is where MAC addresses and switches operate.
3. **Network.** Handles logical addressing and routing of data between different networks; this is where IP addresses and routers operate.
4. **Transport.** Handles reliable (or unreliable) end-to-end delivery between the actual source and destination applications, this is where TCP and UDP operate.
5. **Session.** Manages the establishment, maintenance, and termination of a communication session between two devices.
6. **Presentation.** Handles data translation, encryption, and compression, ensuring data is in a usable format for the application layer.
7. **Application.** The layer applications directly interact with, providing services like HTTP, DNS, and email protocols.

A common way to remember the order (bottom to top) is the mnemonic "Please Do Not Throw Sausage Pizza Away."

## How data actually flows through the layers

When an application sends data, it passes down through each layer, and each layer adds its own header (encapsulation) containing information that layer needs. When the data arrives at the destination, it passes back up through the corresponding layers in reverse, and each layer strips off and processes its own header before handing the remainder up to the next layer.

## A worked example

Sending a web request: the Application layer generates an HTTP request. The Transport layer wraps it with a TCP header (adding source/destination port numbers and sequencing information). The Network layer wraps that with an IP header (adding source/destination IP addresses). The Data Link layer wraps that with a header containing MAC addresses for the next hop on the local network. The Physical layer converts all of this into actual electrical or optical signals sent over the wire. At the destination, this entire process runs in reverse, each layer stripping its own header before handing the data up, until the original HTTP request arrives intact at the destination application.

## Where this matters in real systems

Real-world networking runs on the TCP/IP model, not literally the 7-layer OSI model, but OSI's layered concepts map closely enough onto TCP/IP's own layers that engineers still use OSI's terminology constantly in practice, saying something is "a Layer 3 problem" (routing/IP) versus "a Layer 7 problem" (application-level) is genuinely common, precise shorthand in real troubleshooting conversations, even though no real device implements a literal, separate Session or Presentation layer the way OSI describes them.

## What interviewers actually ask about the OSI model

- **"Name the 7 layers of the OSI model in order."** Physical, Data Link, Network, Transport, Session, Presentation, Application (bottom to top).
- **"Which layer do IP addresses belong to? Which layer do MAC addresses belong to?"** IP addresses are Layer 3 (Network); MAC addresses are Layer 2 (Data Link).
- **"What does encapsulation mean in the context of the OSI model?"** Each layer adds its own header to the data as it passes down through the layers on the sending side, and each corresponding layer strips its header off on the receiving side as data passes back up.
- **"Is the OSI model actually used in real networks?"** Not literally, real networks run on the simpler TCP/IP model, but OSI's layer terminology (like "Layer 3" or "Layer 7") is still widely used in practice to describe where a networking problem sits.

## Key takeaways

- The OSI model divides network communication into 7 layers: Physical, Data Link, Network, Transport, Session, Presentation, Application.
- Data is encapsulated with a header at each layer going down, and de-encapsulated (headers stripped) going back up at the destination.
- IP addresses operate at Layer 3 (Network); MAC addresses operate at Layer 2 (Data Link).
- Real networks run on TCP/IP, not literal OSI, but OSI's layer terminology remains standard shorthand in real networking discussions.

## Related

- [Previous: How the Internet Actually Works](https://devsunite.com/resources/core-subjects/computer-networks/how-the-internet-works)
- [Next: The TCP/IP Model](https://devsunite.com/resources/core-subjects/computer-networks/tcp-ip-model)
- [More in OSI Models: IPv4 Addressing (Classes, Subnet Masks)](https://devsunite.com/resources/core-subjects/computer-networks/ipv4-addressing)
- [More in OSI Models: Network Protocols Overview](https://devsunite.com/resources/core-subjects/computer-networks/network-protocols)
- [More in OSI Models: ARP Protocol](https://devsunite.com/resources/core-subjects/computer-networks/arp-protocol)
- [More in OSI Models: ICMP Protocol](https://devsunite.com/resources/core-subjects/computer-networks/icmp-protocol)
- [All 101 Computer Networks interview questions](https://devsunite.com/resources/core-subjects/computer-networks)
