Network security

What Is the Purpose of the OSI Model? The 7 Layers Explained

The OSI model is the shared map of how networks work. Here is what each of its seven layers does, how data travels through them, and how to use the model to find faults.

Cysoro Security TeamPublished · 7 min read
NETWORK SECURITY THE OSI MODEL EXPLAINED Seven layers, one shared language for networks. 7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 Data link 1 Physical cysoro.com
Quick answer

The purpose of the OSI model is to give everyone a common language for how networks work. Published by ISO in 1984 as ISO 7498, now ISO/IEC 7498-1, it splits network communication into seven layers, from the physical cables that carry bits to the applications people use, so hardware and software from different vendors can interoperate and network problems can be traced to one layer.

Key takeaways

  • The OSI model splits network communication into seven layers so vendors can build interoperable hardware and software.
  • Each layer serves the one above it, talks only to its peers on the other device, and adds its own header to the data.
  • The real internet follows the simpler TCP/IP model, but OSI is still the standard tool for troubleshooting and teaching.

Every email, video call and web page you open crosses a stack of technologies built by different companies in different decades — and it works. The reason it works is a shared map drawn up in the 1980s: the Open Systems Interconnection model, better known as the OSI model.

What is the purpose of the OSI model?

The purpose of the OSI model is to give every maker of network hardware and software a common framework, so systems built by different vendors can communicate. Before it existed, each manufacturer built proprietary networking that locked customers into one supplier's equipment.

The model was published by the International Organization for Standardization in 1984 as ISO 7498, and the current edition is ISO/IEC 7498-1:1994. Its own abstract states the aim plainly: the model "provides a common basis for the coordination of standards development for the purpose of systems interconnection", and it is a conceptual framework, not an implementation specification. In other words, it tells standards writers where each job belongs, not how to build it.

That framing is the whole point. By splitting communication into seven layers, each with a defined job, the model lets one team standardize cables, another standardize routing and a third standardize web protocols — independently, yet compatibly. It also gives engineers a shared vocabulary: when someone says "a layer 3 problem", every network engineer knows the fault is in routing or addressing, not in the cable or the application.

What are the seven layers of the OSI model?

The seven layers, from bottom to top, are physical, data link, network, transport, session, presentation and application. The lower four move data between machines; the upper three serve the software people actually use.

LayerNameData unitJobTypical protocols
7ApplicationDataNetwork services for software: web, mail, file transferHTTP, SMTP, DNS, FTP
6PresentationDataTranslation, encryption, compressionTLS, JPEG, ASCII, UTF-8
5SessionDataOpens, manages and closes connectionsNetBIOS, RPC, SIP
4TransportSegmentReliable end-to-end delivery, flow controlTCP, UDP
3NetworkPacketAddressing and routing between networksIP, ICMP, BGP, IPsec
2Data linkFrameDelivery between devices on the same networkEthernet, Wi-Fi, ARP, PPP
1PhysicalBitsCables, radio waves, electrical signalsEthernet cabling, fiber, 802.11 radio

Each layer serves the layer above it and is served by the layer below. A layer only needs to understand its neighbors: layer 3 does not care whether the bits below it travel over copper, fiber or radio, and layer 7 does not care how the network below routes its data. That separation is what makes the model useful as a design tool and as a diagnostic one.

A handy way to remember the order is the mnemonic "Please Do Not Throw Sausage Pizza Away" — physical, data link, network, transport, session, presentation, application. Security teams often group the layers too: layers 1–3 are the media layers, and layers 5–7 are the host layers, with transport in between.

The seven layers of the OSI model7 ApplicationHTTP, SMTP, DNS — what apps see6 PresentationTLS, encoding, compression5 Sessionopens and closes connections4 TransportTCP, UDP — reliable delivery3 NetworkIP routing between networks2 Data linkEthernet frames, MAC addresses1 Physicalcables, fiber, radio — raw bitsEach layer serves the one above it and uses the services of the one below.
The seven OSI layers, from physical cables to applications. Illustration by Cysoro.

How does data flow through the seven layers?

Data travels down all seven layers on the sending device and back up all seven on the receiving device. At each layer the data is wrapped a little further, then unwrapped in reverse order at the other end.

Take an email. Your mail app hands the message to the application layer, which picks SMTP. The presentation layer compresses and encrypts it, the session layer opens the connection, and the transport layer chops it into segments. The network layer wraps each segment into a packet with IP addresses, the data link layer wraps packets into frames with MAC addresses, and the physical layer turns the frames into ones and zeros on the wire.

On the receiving computer the process reverses: bits become frames, frames become packets, packets become segments, and the segments are reassembled into the original message for the mail app. Cloudflare's walkthrough of this flow notes that the model is an abstract conceptualization — real networks sometimes blur the boundaries — but the down-and-up journey is the standard way to picture it.

What is encapsulation, and why does each layer add a header?

Encapsulation is the wrapping process: each layer adds a header (and sometimes a trailer) containing the information its counterpart layer on the other device needs. The header at layer 4 carries port numbers and sequence numbers; at layer 3 it carries IP addresses; at layer 2 it carries MAC addresses.

Headers are what let each layer talk to its peer without understanding the rest of the stack. A router only needs to read the layer 3 header to forward a packet, and it never looks at the email inside. That is also why the data unit changes name as it descends: data at the top becomes a segment at layer 4, a packet at layer 3, a frame at layer 2 and finally bits at layer 1.

For security, encapsulation has a direct consequence: each layer can only inspect what its own header and the layers above it expose. A network firewall sees IP addresses and ports but not the encrypted contents of a TLS session, which is why deep inspection has to happen higher up the stack, at layer 7.

OSI model vs TCP/IP model: what is the difference?

The OSI model has seven layers and is a reference framework; the TCP/IP model has four layers and describes the protocols the internet actually runs. The internet follows TCP/IP, not the OSI protocol suite — the OSI protocols themselves never caught on, and only a few, such as IS-IS routing, survived.

OSI layerTCP/IP layerWhat lives there
7 Application, 6 Presentation, 5 SessionApplicationHTTP, DNS, SMTP, TLS
4 TransportTransportTCP, UDP
3 NetworkInternetIP, ICMP, BGP
2 Data link, 1 PhysicalLinkEthernet, Wi-Fi

The mapping is approximate. TLS, for example, is usually placed at the presentation layer in OSI teaching, but it sits inside TCP/IP's application layer in practice. That looseness is normal: OSI is a way to organize thinking, and Cloudflare puts it well — interpreting the model in the real world is sometimes a subjective exercise.

For exams and interviews, the key distinction is purpose: OSI is the model you use to describe and troubleshoot networks, while TCP/IP is the model that describes what the internet actually does. Knowing both, and where they diverge, is what interviewers are really testing.

Why does the OSI model still matter for security?

The OSI model still matters because attacks and defenses both live at specific layers, and naming the layer tells you which tool to reach for. A DDoS attack that floods layer 7 is a different problem from one that floods layers 3 and 4, and the fixes are different too.

  • Layer 1: cable taps, rogue access points and physical theft of devices.
  • Layer 2: MAC spoofing, ARP poisoning and rogue switches on the local network.
  • Layer 3: IP spoofing, route hijacking and ICMP floods.
  • Layer 4: TCP SYN floods and port scanning.
  • Layer 7: phishing pages, SQL injection, credential stuffing and malicious downloads.

Defenses map the same way: a VPN encrypts traffic at the network or transport layer, TLS protects the presentation layer, and email authentication such as DMARC works at the application layer. When an incident lands, working down the layers — is the cable up, is the link up, can we route, can we connect — isolates the fault faster than guessing. You can check the encryption layer of any site yourself with our free SSL checker.

Attacks and defenses, layer by layerCommon attacksL1 — cable taps, device theftL2 — ARP poisoning, MAC spoofingL3 — IP spoofing, route hijacksL4 — SYN floods, port scansL7 — phishing, injection, stuffingMatching defensesL1 — locked rooms, port securityL2 — DHCP snooping, 802.1XL3 — VPNs, firewall rulesL4 — rate limiting, SYN cookiesL7 — TLS, WAF, DMARC, MFAName the layer, and you know which control to reach for.
Where attacks and defenses sit on the OSI stack. Illustration by Cysoro.

What are the most common mistakes when learning the OSI model?

The most common mistake is treating the model as a literal description of the internet. It is not: the internet runs on TCP/IP, and several OSI layers — especially session and presentation — have no direct protocol of their own in everyday use. Treat OSI as a map, not a wiring diagram.

Another mistake is memorizing the layers without the data units. Knowing that layer 4 handles segments, layer 3 packets and layer 2 frames is what turns the list into a working tool for reading packet captures and firewall logs. A third mistake is confusing the application layer with the application itself: your browser is not layer 7, but the HTTP protocol it speaks is.

Finally, people often assume layers are sealed boxes. In practice, protocols cross boundaries: a VPN can encrypt at layer 3 or layer 4, and modern firewalls inspect traffic at several layers at once. The layers are a way to organize the work, not walls between the teams that do it.

The bottom line

The OSI model's purpose has not changed since 1984: it is the common language that lets different vendors' systems interoperate and lets engineers find faults by layer instead of by guesswork. Learn the seven layers, the data unit at each one and the protocols that live there, and most network problems — and most network exam questions — become straightforward.

Put it to work on your own network: check that your home router is using modern encryption with our guide to how to secure your Wi-Fi.

If you are curious about any address on your network, look it up with our free DNS lookup.

Frequently asked questions

What is the purpose of the OSI model in simple terms?

The OSI model exists so that computers, cables, routers and software from different makers can all work together. It does this by splitting network communication into seven layers, each with one clear job, so any vendor can build one layer without rebuilding the whole system.

What are the 7 layers of the OSI model?

From bottom to top they are the physical, data link, network, transport, session, presentation and application layers. A common mnemonic is Please Do Not Throw Sausage Pizza Away, with each first letter standing for one layer.

Is the OSI model still used today?

Yes, as a teaching and troubleshooting tool, even though the modern internet runs on the TCP/IP protocol suite rather than the OSI protocols themselves. Network engineers still describe problems, attacks and devices by OSI layer.

What is the difference between the OSI model and the TCP/IP model?

The OSI model has seven layers and is a reference framework, while the TCP/IP model has four layers and describes the protocols the internet actually uses. OSI splits TCP/IP's application layer into application, presentation and session, and its link layer into physical and data link.

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 at layer 2, the data link layer, and a firewall can operate at layers 3, 4 or 7 depending on what it inspects.

What does each OSI layer do with data?

Each layer takes the data from the layer above, adds its own header with the information its peer needs, and passes it down. On the receiving device the process reverses, with each layer stripping its header and handing the rest up.

Sources

  1. ISO — ISO/IEC 7498-1:1994, Open Systems Interconnection: Basic Reference Model
  2. Cloudflare — What Is the OSI Model?
  3. Akamai — An Introduction to the OSI Networking Model
Written & fact-checked byCysoro Security Team

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.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against ISO/IEC 7498-1, the OSI reference model standard, and Cloudflare's OSI learning guide.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free