The OSI model is a seven-layer reference model from the International Organization for Standardization that describes how computers communicate over a network. The layers are Physical, Data Link, Network, Transport, Session, Presentation and Application, and data passes down the stack when sent and up the stack when received.
Key takeaways
- The OSI model has seven layers: Physical, Data Link, Network, Transport, Session, Presentation and Application.
- Each layer adds its own header in a process called encapsulation, and the receiving side strips each header in reverse.
- Use the model to troubleshoot from the bottom up: check cables first, then switching, routing, transport and finally the application.
When a website will not load, is it the cable, the Wi-Fi, the router, the firewall, or the website itself? The OSI model gives you a way to answer that in order, instead of guessing. It is the map every network engineer carries in their head.
What is the OSI model?
The OSI model, short for Open Systems Interconnection, is a conceptual framework that explains how computers communicate over a network. It divides networking into seven layers, each with a specific job, and data passes through each layer in turn.
The model was developed in the 1970s and 1980s under the International Organization for Standardization (ISO) and first published in 1984. It was never a product you install. It is a reference: a shared vocabulary so that two engineers, or two vendors, can describe exactly where a problem or a feature lives.
Real networks run the TCP/IP model, which has four layers. The OSI model is still taught and used because it is more detailed — it splits TCP/IP's application layer into three layers, and it separates physical cabling from local delivery. PhoenixNAP's OSI model guide covers the same seven layers with examples for each one.
What are the 7 layers of the OSI model?
The seven layers, from lowest to highest, are Physical, Data Link, Network, Transport, Session, Presentation and Application. The lowest layer is closest to the wire; the highest is closest to the user.
| Layer | Name | Data unit | Job | Examples |
|---|---|---|---|---|
| 7 | Application | Data | Network services for apps | HTTP, DNS, SMTP, FTP |
| 6 | Presentation | Data | Format, encryption, compression | TLS, JPEG, ASCII |
| 5 | Session | Data | Start, manage, end sessions | NetBIOS, RPC |
| 4 | Transport | Segment | Reliable delivery between hosts | TCP, UDP, ports |
| 3 | Network | Packet | Addressing and routing | IP, routers, ICMP |
| 2 | Data Link | Frame | Local delivery between neighbours | Ethernet, MAC, switches |
| 1 | Physical | Bits | Raw bits over a medium | Cables, Wi-Fi radio, hubs |
A useful mnemonic from the top down is "All People Seem To Need Data Processing". From the bottom up, many students use "Please Do Not Throw Sausage Pizza Away".
What is Layer 1, the Physical layer?
The Physical layer transmits raw bits over a physical medium. It defines cables, connectors, radio signals, voltage levels and data rates — the actual hardware that carries the signal.
Devices at this layer include network cables, fibre, hubs, repeaters and network interface cards. If a cable is unplugged, damaged or the wrong type, nothing above it can work, which is why troubleshooting starts here.
Common Layer 1 problems are a loose Ethernet cable, a dead switch port, Wi-Fi interference, or a cable run that is too long. The fix is physical: reseat, replace or move the connection, then test again.
What is Layer 2, the Data Link layer?
The Data Link layer moves data between two directly connected nodes on the same local network. It packages data into frames, adds the sender and receiver MAC addresses, and handles error detection on the local link.
Switches live here. A switch reads the destination MAC address in a frame and forwards it only to the right port, unlike a hub, which repeats traffic to every port. This layer also controls who may speak on a shared medium, which matters on Wi-Fi and older Ethernet.
Typical Layer 2 faults include a MAC address conflict, a wrong VLAN, a duplex mismatch, or a switch loop. If two devices on the same network cannot see each other but the cables are fine, look here.
What is Layer 3, the Network layer?
The Network layer handles addressing and routing between networks. It is where IP addresses live, and where routers decide the next hop for each packet.
When your computer sends data to a website, Layer 3 wraps it in a packet with a source and destination IP address. Routers along the path read the destination address and forward the packet toward it, one hop at a time, until it reaches the destination network.
Layer 3 problems include a wrong default gateway, a bad subnet mask, a routing error, or an IP address conflict. The classic test is ping: if you can ping your gateway but not the internet, the fault is probably at or beyond Layer 3. You can check how your own connection is seen with our free IP checker.
What is Layer 4, the Transport layer?
The Transport layer delivers data between hosts and makes sure it arrives in order, or tells you it did not. Its two main protocols are TCP and UDP, and it uses port numbers to direct data to the right application.
TCP is reliable: it sets up a connection, numbers each segment, retransmits lost pieces and delivers them in order. That is why web browsing, email and file transfers use it. UDP is faster and simpler: it sends datagrams without a connection or retransmission, which suits live video, voice calls and DNS lookups, where a late packet is worse than a lost one.
Port numbers are Layer 4 addresses for applications. HTTPS uses TCP port 443, HTTP uses port 80, and DNS usually uses UDP port 53. A firewall that blocks a port is a Layer 4 problem, even though the network itself is fine.
What do Layers 5, 6 and 7 do?
The top three layers serve the application. The Session layer establishes, maintains and ends sessions between applications. The Presentation layer translates data formats, and handles encryption and compression. The Application layer is the interface applications use to reach network services.
- Layer 5, Session: opens a session, keeps it alive, checkpoints it, and closes it cleanly. Think of a login session or a video call that must stay connected.
- Layer 6, Presentation: converts data into a form the application can use — character encoding, image formats, compression — and encrypts or decrypts it. TLS encryption happens here in the OSI view.
- Layer 7, Application: provides the protocols applications actually use, such as HTTP for the web, SMTP for email, DNS for name lookup and FTP for file transfer.
In real TCP/IP systems these three layers are merged into one application layer, which is why you will rarely see a separate "presentation layer" product. The split is still useful for security: encryption at Layer 6 protects data even if lower layers are intercepted, and authentication at Layer 7 decides who may use a service.
How does data flow through the OSI model?
When you send data, it travels down the stack from Layer 7 to Layer 1. Each layer adds its own header — and sometimes a trailer — in a process called encapsulation. The Physical layer then turns the result into bits on the wire.
When data arrives, the process reverses. The Physical layer receives bits, the Data Link layer checks the frame, the Network layer checks the packet address, the Transport layer reassembles the segments, and the upper layers hand the data to the application.
Here is a web request in OSI terms: your browser (Layer 7) asks for a page over HTTP; TLS (Layer 6) encrypts it; a session (Layer 5) is maintained; TCP (Layer 4) splits it into numbered segments on port 443; IP (Layer 3) addresses each packet; Ethernet (Layer 2) frames it for the local network; and the cable or Wi-Fi radio (Layer 1) sends the bits. The web server does the same steps in reverse.
Security tools map to layers too. A firewall can filter by IP at Layer 3 and by port at Layer 4. TLS protects data at Layer 6. A web application firewall inspects HTTP at Layer 7. Knowing the layer tells you which tool can see the attack.
OSI model vs TCP/IP model: what is the difference?
The TCP/IP model has four layers: Link, Internet, Transport and Application. It is the model the internet actually runs on, and it is simpler because it merges OSI Layers 5, 6 and 7 into a single Application layer, and merges Layers 1 and 2 into a Link layer.
| OSI layer | TCP/IP layer | Typical protocols |
|---|---|---|
| 7 Application | Application | HTTP, DNS, SMTP |
| 6 Presentation | Application | TLS, JPEG |
| 5 Session | Application | NetBIOS |
| 4 Transport | Transport | TCP, UDP |
| 3 Network | Internet | IP, ICMP |
| 2 Data Link | Link | Ethernet, Wi-Fi |
| 1 Physical | Link | Cables, radio |
Use TCP/IP when you are describing how the internet works. Use OSI when you are learning, troubleshooting, or explaining where a security control sits. Both are correct; they are different maps of the same territory. Our guide to zero trust remote access shows how modern access controls sit above these layers.
How do you troubleshoot with the OSI model?
Work from the bottom up. Start at Layer 1 and prove each layer before moving to the next. Skipping ahead is how a loose cable becomes a two-hour firewall investigation.
- Layer 1: is the cable plugged in, is the link light on, is Wi-Fi connected?
- Layer 2: can the device see its neighbours? Check the switch port and MAC address.
- Layer 3: can it ping its gateway, and does it have the right IP address and subnet?
- Layer 4: can it reach the service port? Test with a port check, not just a ping.
- Layer 7: does the application itself answer? Check DNS, TLS and the application logs.
Each "yes" rules out a whole set of causes. Each "no" tells you exactly where to look next. That is the model's real value: it turns "the network is down" into a testable claim about one layer.
Where does security fit in the OSI model?
Every layer has its own attacks and its own defenses. Physical theft and cable tapping sit at Layer 1. MAC spoofing and ARP poisoning sit at Layer 2. IP spoofing and routing attacks sit at Layer 3. Port scanning and SYN floods sit at Layer 4. Session hijacking sits at Layer 5. Downgrade attacks on encryption sit at Layer 6. Phishing, SQL injection and cross-site scripting sit at Layer 7.
That is why defense in depth works: a control at one layer cannot see an attack at another. A firewall at Layers 3 and 4 will not stop a phishing email at Layer 7, and a web application firewall at Layer 7 will not stop someone unplugging a cable at Layer 1. You can test the name side of the stack with our free DNS lookup.
For home networks, the same thinking applies. Our guide on how to secure your Wi-Fi covers the Layer 1 and 2 controls — strong Wi-Fi encryption and a good router password — that protect everything above them.
The bottom line
The OSI model is seven layers: Physical, Data Link, Network, Transport, Session, Presentation and Application. Data goes down the stack when sent and up the stack when received, gaining and losing a header at each step.
Learn the layers, learn the data unit at each one, and troubleshoot from the bottom up. That habit alone will solve most network problems faster than any single tool. Start by checking what your own connection looks like with the free DNS lookup.
Akamai's introduction to the OSI networking model is a good next read if you want the full layer-by-layer detail.
Frequently asked questions
What is the OSI model in simple terms?
It is a seven-layer map of how computers talk over a network. Each layer handles one job, such as cables, local delivery, routing between networks, reliable delivery, sessions, data format and the application itself.
What are the 7 layers of the OSI model?
From bottom to top they are Physical (Layer 1), Data Link (Layer 2), Network (Layer 3), Transport (Layer 4), Session (Layer 5), Presentation (Layer 6) and Application (Layer 7).
What is the difference between the OSI model and the TCP/IP model?
The OSI model has seven layers and is mainly a teaching and troubleshooting reference. The TCP/IP model has four layers and describes how the internet actually works, merging the top three OSI layers into one application layer.
Which layer is TCP?
TCP lives at Layer 4, the Transport layer. It provides reliable, ordered delivery between hosts, using port numbers to direct data to the right application.
Which OSI layer is a router?
A router works mainly at Layer 3, the Network layer, because it forwards packets between networks using IP addresses. A switch works mainly at Layer 2, using MAC addresses.
Is the OSI model still used today?
Yes, as a shared vocabulary and a troubleshooting framework. Real networks run TCP/IP, but engineers still describe faults as Layer 1, Layer 2 or Layer 3 problems, and exams and certifications still test the model.
What is encapsulation in the OSI model?
Encapsulation is the process where each layer adds its own header to the data from the layer above as data travels down the stack. The receiving computer strips each header in reverse order as the data travels back up.
How do I remember the OSI layers?
A common mnemonic from the top down is All People Seem To Need Data Processing, for Application, Presentation, Session, Transport, Network, Data Link and Physical. From the bottom up, it reads Please Do Not Throw Sausage Pizza Away.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against ISO's OSI reference model as described by Akamai, PhoenixNAP and NetworkTraining, including the seven layers, data units and encapsulation.
How we write and fact-check →