The OSI model has seven layers and is a conceptual reference framework from ISO, while the TCP/IP model has four layers and describes the protocol suite that actually runs the internet. OSI layers 5, 6 and 7 fold into TCP/IP's Application layer, layers 4 and 3 match Transport and Internet, and layers 2 and 1 become Network Access. Use TCP/IP to describe real traffic and OSI to pinpoint where a problem sits.
Key takeaways
- OSI is a 7-layer reference model for teaching and troubleshooting; TCP/IP is the 4-layer model of the protocols that run the internet.
- The top three OSI layers map to one TCP/IP Application layer, and the bottom two map to one Network Access layer.
- Security controls sit at specific layers: firewalls at Layer 3-4, TLS at Layer 6, and web application firewalls at Layer 7.
Every packet on the internet makes the same journey, but engineers describe it with two different maps. The OSI model slices the trip into seven layers. The TCP/IP model slices it into four. Neither is wrong — they just serve different jobs.
What is the OSI model?
The OSI (Open Systems Interconnection) model is a seven-layer conceptual framework created by the International Organization for Standardization (ISO) and formally published in 1984. It describes what network communication must do, without specifying the protocols that do it.
OSI is a reference model, not a protocol suite. Cisco Press draws the distinction clearly: a reference model describes the functions that must be completed at each layer but does not say exactly how to accomplish them, while a protocol model like TCP/IP describes the functions of a specific set of protocols.
The seven layers, from bottom to top, are Physical (1), Data Link (2), Network (3), Transport (4), Session (5), Presentation (6) and Application (7). A common mnemonic is "Please Do Not Throw Sausage Pizza Away".
Each layer has one job and talks only to the layers directly above and below it. That separation is what makes OSI so useful for troubleshooting: when something breaks, you can test one layer at a time.
What is the TCP/IP model?
The TCP/IP model is a four-layer description of the protocol suite that runs the internet: Application, Transport, Internet and Network Access (also called Link). The protocols came first, and the model was written down later.
The IP and TCP specifications both date from September 1981, prepared for the US Defense Advanced Research Projects Agency (DARPA). The four-layer model itself was set out in RFC 1122 in October 1989, which covers the link, IP and transport layers for internet hosts.
Unlike OSI, TCP/IP is tied to real protocols: HTTP, DNS and SMTP at the Application layer, TCP and UDP at Transport, IP and ICMP at Internet, and Ethernet and Wi-Fi at Network Access.
That is why network engineers reach for TCP/IP when they look at a packet capture. It matches what is actually on the wire.
OSI model vs TCP/IP model: the comparison table
The headline difference is simple: OSI has seven layers and TCP/IP has four. The deeper differences are about origin, purpose and how strictly the layers are separated.
| OSI model | TCP/IP model | |
|---|---|---|
| Layers | 7 | 4 (RFC 1122); 5 in many textbooks |
| Origin | ISO reference model, published 1984 | DARPA/ARPANET protocols, 1970s-80s |
| Nature | Conceptual, technology-neutral | Practical, tied to real protocols |
| Protocols defined? | No — functions only | Yes — TCP, UDP, IP, HTTP, DNS |
| Session and presentation | Separate layers 5 and 6 | Folded into Application layer |
| Physical and data link | Separate layers 1 and 2 | Combined as Network Access |
| Layer boundaries | Strict, each layer independent | Looser, layers more integrated |
| Used for | Teaching, design, troubleshooting | Real internet traffic, packet analysis |
| Implemented as a stack? | Never widely implemented | Runs the internet |
One practical consequence: when a vendor says "Layer 7 firewall" or "Layer 3 switch", it is using OSI numbering, even though the device itself runs TCP/IP. The OSI numbers became the industry's shared vocabulary.
What are the 7 layers of the OSI model?
Each OSI layer adds something to the data as it travels down the stack on the sender's side, and strips it away on the receiver's side. Here is what each one does, with the protocols and devices that live there.
Layer 7 — Application
The layer closest to the user. It provides network services to applications: web browsing (HTTP/HTTPS), email (SMTP, IMAP), file transfer (FTP) and name lookup (DNS).
Layer 6 — Presentation
Formats, encrypts and compresses data so the application can use it. TLS encryption, data encoding and compression live here. This is the layer most people forget — until a certificate problem breaks it.
Layer 5 — Session
Opens, manages and closes sessions between applications, including checkpoints and recovery. In practice, much of this work is now done inside applications themselves rather than as a separate layer.
Layer 4 — Transport
Moves data end to end between devices, segmenting it and reassembling it. TCP provides reliable, ordered delivery with retransmission; UDP provides fast, connectionless delivery without guarantees. Port numbers live here.
Layer 3 — Network
Routes packets between networks using logical addresses — IP addresses. Routers operate here, and so do routing protocols such as OSPF and BGP.
Layer 2 — Data Link
Moves frames between devices on the same local network using MAC addresses. Switches operate here, as do Ethernet and Wi-Fi framing and ARP.
Layer 1 — Physical
The actual bits on the wire: cables, radio signals, connectors and electrical signaling. A cut cable or a dead port is a Layer 1 problem.
What are the 4 layers of the TCP/IP model?
The TCP/IP model groups the same work into four layers. The mapping is exact enough that you can translate any OSI description into TCP/IP terms in seconds.
- Application: OSI layers 7, 6 and 5 combined — HTTP, HTTPS, DNS, SMTP, SSH, DHCP and TLS.
- Transport: OSI layer 4 — TCP (reliable, connection-oriented) and UDP (fast, connectionless).
- Internet: OSI layer 3 — IP addressing and routing, plus ICMP, which powers ping.
- Network Access: OSI layers 2 and 1 — Ethernet, Wi-Fi, ARP and the physical media.
RFC 1122 calls the bottom layer the Link layer and describes it alongside the IP and transport layers, with the application layer covered in its companion RFC 1123. Some textbooks add a fifth layer by splitting Link into Physical and Data Link, which is why you will see both 4-layer and 5-layer versions.
For exams and interviews, use the version your course uses — but know that the RFC defines four.
Where does each protocol sit? A protocol map
Knowing which layer a protocol belongs to tells you which tool to use when it breaks. DNS failing is an application-layer problem; a TCP handshake failing is transport; no route to the host is network.
| Protocol | OSI layer | TCP/IP layer | What it does |
|---|---|---|---|
| HTTP / HTTPS | 7 | Application | Web pages and APIs |
| DNS | 7 | Application | Names to IP addresses |
| SMTP / IMAP | 7 | Application | Sending and reading email |
| TLS / SSL | 6 | Application | Encryption in transit |
| TCP | 4 | Transport | Reliable delivery, ports |
| UDP | 4 | Transport | Fast delivery, no guarantee |
| IP (v4 / v6) | 3 | Internet | Addressing and routing |
| ICMP | 3 | Internet | Ping and error messages |
| ARP | 2 | Network Access | IP to MAC address lookup |
| Ethernet / Wi-Fi | 2 and 1 | Network Access | Local frames and bits |
You can check the application layer yourself: our free DNS lookup shows what DNS returns for any domain.
The SSL checker verifies the TLS certificate that protects the connection, and Cisco Press explains the two models in its networking course material.
How does security map to the OSI layers?
Security controls are usually described by layer, because an attack at one layer needs a control at that layer. A firewall cannot fix a phishing email, and email authentication cannot fix a rogue Wi-Fi access point.
- Layer 7: web application firewalls, email authentication (SPF, DKIM, DMARC) and application patching. See our guide to what DMARC is.
- Layer 6: TLS certificates and encryption in transit.
- Layer 4: firewalls that filter by port, and VPNs that encrypt transport traffic.
- Layer 3: network segmentation, router access lists and IP allowlists.
- Layer 2: switch port security, 802.1X authentication and ARP inspection.
- Layer 1: locked server rooms, controlled cabling and physical access.
When a breach is reported, the first useful question is often "which layer?" — it narrows the search from the whole network to one set of controls.
How do you troubleshoot with the OSI model?
Troubleshooting with OSI means working through the layers in order, from the bottom up, and stopping at the first layer that fails. It sounds slow, but it prevents the common mistake of reinstalling software when the cable is unplugged.
- Layer 1: Is the cable plugged in? Is the Wi-Fi signal present? Do link lights show?
- Layer 2: Can the device reach its gateway? Does ARP resolve the gateway's MAC address?
- Layer 3: Can you ping the gateway, then a public IP such as 8.8.8.8? If the IP works but names do not, the problem is higher up.
- Layer 4: Can you reach the service port? A connection refused on port 443 points at the server or firewall, not the network.
- Layer 7: Does DNS resolve the name? Does the site load in a browser? Check the certificate and the DNS records.
This bottom-up method is the main reason OSI is still taught. TCP/IP tells you what is happening; OSI tells you where to look. Our guide to securing your Wi-Fi covers the Layer 1 and 2 checks for a home network.
Which model should you use, and when?
Use TCP/IP when you are describing real traffic, reading a packet capture, configuring a server or writing code. Use OSI when you are learning, troubleshooting, writing documentation or talking to other engineers about where a problem sits.
For certifications and interviews, expect OSI. CompTIA, Cisco and most security exams frame questions in OSI terms, and interviewers routinely ask candidates to walk through the layers or to place a protocol at its layer.
For day-to-day engineering, expect TCP/IP. Nobody configures a "Layer 6 device"; they configure TLS on a web server, which happens to be OSI Layer 6 and TCP/IP Application.
The honest summary is that you need both, and you need to be able to translate between them without thinking. That translation — seven into four — is the whole comparison.
The bottom line
OSI gives you seven precise layers for thinking and troubleshooting. TCP/IP gives you four practical layers that match the protocols running the internet. Learn the mapping, not just the lists, and both models start working for you.
Put the mapping to work on a real domain: run our free DNS lookup to see the application-layer records behind any site.
Then check its TLS certificate with the SSL checker, and read RFC 1122 for the authoritative description of the TCP/IP layers.
Frequently asked questions
What is the main difference between the OSI model and the TCP/IP model?
OSI is a seven-layer conceptual reference model created by ISO to describe network functions, while TCP/IP is a four-layer model built around the protocols that actually run the internet. OSI is used mainly for teaching and troubleshooting; TCP/IP describes real traffic.
Is the TCP/IP model 4 or 5 layers?
Four, according to RFC 1122, which names the layers Application, Transport, Internet and Link. Many textbooks split the Link layer into Physical and Data Link, giving a five-layer version. Both describe the same stack; the four-layer version is the one the RFC defines.
Which OSI layers map to the TCP/IP Application layer?
OSI layers 7 (Application), 6 (Presentation) and 5 (Session) all map to the TCP/IP Application layer. That is where HTTP, DNS, SMTP and TLS live in TCP/IP terms, even though OSI separates formatting, encryption and session management into their own layers.
Does the internet use OSI or TCP/IP?
The internet runs on TCP/IP. OSI was never widely implemented as a protocol stack. It survives because its seven numbered layers give engineers a shared vocabulary for describing problems, such as a Layer 3 routing fault or a Layer 7 application attack.
What layer is a firewall?
It depends on the firewall. A packet-filtering firewall works mainly at Layer 3 (Network) and Layer 4 (Transport), deciding on IP addresses and ports. A next-generation firewall and a web application firewall also inspect Layer 7, looking at the application traffic itself.
What layer does TLS work at?
In OSI terms, TLS sits at Layer 6, the Presentation layer, because it encrypts and formats data for the application. In TCP/IP terms it is part of the Application layer. Either way, it protects data between the transport layer and the application using it.
Which model should I learn first?
Learn TCP/IP first if you want to understand real traffic, packet captures and the internet. Learn OSI alongside it, because job interviews, vendor documentation, certifications and troubleshooting conversations all use OSI layer numbers as shorthand.
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 Cisco Press network communication models, IETF RFC 1122 and the ISO OSI reference model.
How we write and fact-check →