Network security

How Many Layers in the OSI Model? The 7 Layers Explained Simply

The OSI model has seven layers, from the physical cables at the bottom to the applications you use at the top. Here is what each one does and how to use the model to troubleshoot a network.

Cysoro Security TeamPublished · 10 min read
NETWORK SECURITY7 Layersof OSIFrom bits on a cable to the apps you use.7 Application6 Presentation5 Session4 Transport3 Network2 Data link1 Physical
Quick answer

The OSI model has seven layers: physical (1), data link (2), network (3), transport (4), session (5), presentation (6) and application (7). Each layer handles one job in network communication, passes data to the layer above or below it, and only talks directly to its neighbours, which makes it easier to design, describe and troubleshoot networks.

Key takeaways

  • The OSI model has seven layers, numbered 1 to 7 from physical to application.
  • Each layer adds its own information, such as an IP address or a port number, as data moves down the stack.
  • Use the layers to troubleshoot in order: check the cable and Wi-Fi first, then addressing, then the application.

Ask a network engineer how the internet works and you will probably hear about seven layers. The OSI model is the map they use: seven jobs, stacked in order, that turn a click in a browser into signals on a cable and back again.

How many layers are in the OSI model?

The OSI model has seven layers. Numbered from the bottom, they are Layer 1 physical, Layer 2 data link, Layer 3 network, Layer 4 transport, Layer 5 session, Layer 6 presentation and Layer 7 application.

OSI stands for Open Systems Interconnection. The model was developed by the International Organization for Standardization (ISO) in the late 1970s and 1980s, and ISO published it in 1984. Its goal was practical: if every vendor built networking the same way, in layers with defined jobs, equipment from different makers could work together.

The model is a reference, not a protocol you install. Real networks run TCP/IP, but engineers still describe problems in OSI terms, as BMC explains in its layer-by-layer guide, because the layers give everyone a shared vocabulary. When someone says "it is a Layer 3 problem", they mean routing or IP addressing, not the cable or the app.

The 7 OSI layers7 — Application6 — Presentation5 — Session4 — Transport3 — Network2 — Data link1 — PhysicalData travels down the stack to send, and up the stack to receive. Illustration by Cysoro.
The seven OSI layers, from the physical layer at the bottom to the application layer at the top. Illustration by Cysoro.

What is the OSI model?

The OSI model is a conceptual framework that divides network communication into seven layers, each with a defined job. Each layer provides a service to the layer above it and uses the service of the layer below it.

Think of sending a letter. You write the message, put it in an envelope, address it, hand it to the post office, and the post office moves it by truck or plane. Networking works the same way: the application creates data, each lower layer wraps it with the information it needs, and the physical layer moves it. At the other end, each layer unwraps its part.

This wrapping is called encapsulation. As data moves down the stack, each layer adds a header — and sometimes a trailer — with its own details. The transport layer adds port numbers, the network layer adds IP addresses, and the data link layer adds MAC addresses. The receiving device strips each header off in reverse order.

Layers are grouped in two halves. Layers 1 to 3 are the media layers: they move data across the network. Layers 5 to 7 are the host layers: they deal with the data itself and the applications using it. Layer 4, transport, bridges the two halves.

What is Layer 1, the physical layer?

Layer 1 moves raw bits — ones and zeros — over a physical medium such as a copper cable, fibre-optic cable or radio waves. It defines voltages, signal timing, connectors and cable types.

If a device cannot send or receive bits at all, the fault is at Layer 1. Common Layer 1 problems are an unplugged cable, a damaged fibre, a dead switch port, or a Wi-Fi signal too weak to use. No amount of software configuration fixes a broken cable.

Examples at this layer include Ethernet cables, fibre, Wi-Fi radio signals, hubs and repeaters. The unit of data here is the bit. For a closer look at the wireless side, see our guide to securing your Wi-Fi.

Layer 2 moves frames between two devices on the same local network, using MAC addresses to identify them. It packages bits from Layer 1 into frames and detects errors in those frames.

This layer has two parts: the Logical Link Control (LLC) sublayer, which talks to the network layer above, and the Media Access Control (MAC) sublayer, which decides when a device may send on the shared medium. Ethernet and Wi-Fi are the best-known Layer 2 technologies, and switches are Layer 2 devices.

Layer 2 also handles flow control on a link and, in the case of Wi-Fi, retransmitting frames damaged by interference. If two devices on the same Wi-Fi network cannot see each other, but both can reach the internet, the problem is often at Layer 2.

What is Layer 3, the network layer?

Layer 3 moves packets between different networks, using logical addresses — IP addresses — and routing. This is the layer that lets a packet travel from your home network across the internet to a server in another country.

Routers are Layer 3 devices. They read the destination IP address on each packet, consult a routing table, and forward the packet toward its destination, one hop at a time. Protocols at this layer include IPv4, IPv6, ICMP and the routing protocols OSPF and BGP.

The unit of data at Layer 3 is the packet. A packet that cannot be routed — for example, because of a wrong subnet mask or a missing default gateway — never leaves the local network. You can check the address your network gives you with our what is my IP tool.

What is Layer 4, the transport layer?

Layer 4 delivers data end to end between two devices, splitting it into segments and making sure it arrives completely and in order. Its two main protocols are TCP and UDP.

TCP is reliable: it numbers segments, acknowledges receipt, retransmits lost segments and reassembles them in order. That makes it right for web pages, email and file transfers, where a missing piece corrupts the result. UDP skips acknowledgements and retransmission, which makes it faster and right for live video, voice calls and DNS lookups, where a lost packet is better than a delayed one.

Layer 4 also uses port numbers to direct traffic to the right application on a device. Port 443 is HTTPS, port 80 is HTTP, and port 25 is SMTP. A firewall rule that blocks a port is a Layer 4 control.

What is Layer 5, the session layer?

Layer 5 sets up, manages and ends sessions — the ongoing conversations between two applications. It decides when a session starts, keeps it alive, and closes it cleanly when it is done.

A video call, a remote desktop session and a login to a server all depend on session management. Layer 5 also handles checkpoints, so a long transfer can resume from where it stopped instead of starting over after an interruption.

In modern TCP/IP networks, session work is usually done inside the application or by TLS rather than by a separate Layer 5 protocol, which is one reason the session layer can feel abstract. The classic examples are NetBIOS sessions and the session handling in remote procedure calls.

What is Layer 6, the presentation layer?

Layer 6 translates data between the format the application uses and the format the network uses. It handles character encoding, data compression and encryption.

When your browser receives a compressed web page and decompresses it, or when an image is encoded as JPEG and decoded for display, that is presentation-layer work. Encryption also belongs here in the model: TLS encrypts the data before it is handed down for transport, which is why HTTPS protects the contents of a web session.

Common formats at this layer include JPEG, GIF, ASCII and Unicode. If a file opens but shows garbled characters, the cause is often a presentation-layer mismatch, such as the wrong character encoding. Our SSL checker can confirm whether a site's TLS is set up correctly.

What is Layer 7, the application layer?

Layer 7 is the layer closest to the user. It provides network services directly to applications, such as web browsing, email, file transfer and DNS lookups.

Protocols at this layer include HTTP and HTTPS for the web, SMTP and IMAP for email, FTP for file transfer, and DNS for turning domain names into IP addresses. When you type a web address, DNS at Layer 7 resolves it, and HTTP at Layer 7 requests the page.

Note that Layer 7 is not the application itself — your browser is not Layer 7, but it uses Layer 7 protocols. Security controls at this layer include web application firewalls, email authentication and content filtering. For the email side, read what DMARC is.

LayerNameJobUnitExample protocols and devices
7ApplicationNetwork services for appsDataHTTP, HTTPS, SMTP, DNS
6PresentationTranslation, compression, encryptionDataTLS, JPEG, ASCII, Unicode
5SessionStart, manage and end sessionsDataNetBIOS, remote procedure calls
4TransportEnd-to-end delivery, portsSegmentTCP, UDP
3NetworkRouting between networksPacketIP, ICMP, OSPF, BGP, routers
2Data linkFrames on the local networkFrameEthernet, Wi-Fi, switches, MAC
1PhysicalBits over a mediumBitCables, fibre, radio, hubs

How does the OSI model compare to TCP/IP?

The TCP/IP model has four layers: link, internet, transport and application. It maps to OSI by combining the top three OSI layers into one application layer, and the bottom two into one link layer.

TCP/IP is the model the real internet runs on. It came from the ARPANET work of the 1970s and was standardised before the OSI model was finished. OSI, by contrast, was designed as a clean reference, and its original protocols never became dominant — only a few, such as X.400 and X.500, saw lasting use.

So why learn OSI at all? Because TCP/IP's four layers hide useful distinctions. Splitting the link layer into physical and data link, and the application layer into session, presentation and application, gives troubleshooters a finer map. Most certifications and job interviews still use OSI terms, and most network documentation does too.

A practical mapping: when a site will not load, check Layer 1 (is the cable or Wi-Fi connected?), Layer 2 (is the device on the local network?), Layer 3 (does it have an IP address and a gateway?), Layer 4 (is the port open?), and Layer 7 (is the application or DNS working?). That is the OSI model doing its job.

How an email crosses the OSI layersSender: 7 Application — email client writes it4 Transport — TCP splits it into segments3 Network — IP addresses and routes it1 Physical — bits travel as signalsReceiver: 7 Application — inbox shows it4 Transport — TCP reassembles segments3 Network — router delivers the packets1 Physical — signals become bits againEach layer adds a header on the way down and removes it on the way up. Illustration by Cysoro.
An email travels down all seven layers to send, and back up all seven to be read. Illustration by Cysoro.

How do you troubleshoot a network using the OSI model?

Troubleshoot from the bottom up: confirm Layer 1, then Layer 2, then Layer 3, and only then blame the application. That order stops you wasting an hour on software settings when a cable is unplugged.

Work through these checks in order:

  1. Layer 1: Is the cable plugged in? Is Wi-Fi on? Is the link light on? Try another cable or port.
  2. Layer 2: Is the device on the network? Can it see the switch or access point? Check the MAC address and the Wi-Fi association.
  3. Layer 3: Does it have an IP address, subnet mask and gateway? Try pinging the gateway, then pinging an outside address.
  4. Layer 4: Is the port open? A web server that answers ping but not port 443 has a transport or firewall problem, not a routing one.
  5. Layer 7: Does DNS resolve the name? Does the application itself work from another device? Check the service status and credentials.

Security teams use the same map. A firewall can filter at Layer 3 by IP address, at Layer 4 by port, or at Layer 7 by inspecting the application traffic. Knowing which layer a control sits on tells you what it can and cannot see — a Layer 4 firewall cannot tell a safe web request from a malicious one.

Common mistakes include jumping to Layer 7 first, confusing the Wi-Fi address (a MAC address, Layer 2) with the IP address (Layer 3), and assuming a "no internet" message means the router is broken when the fault is DNS. Our DNS lookup tool can show whether a domain resolves at all.

What mistakes do people make with the OSI model?

The most common mistake is treating the model as a description of how the internet is built, rather than a reference for describing it. Real traffic does not pass through seven separate programs; TCP/IP merges several layers, and TLS sits between layers.

Other frequent errors: saying a switch is a Layer 3 device (most are Layer 2, though managed switches can route), saying encryption is only Layer 6 (it also happens at Layer 2 with WPA3 and at Layer 3 with IPsec), and memorising the layers without learning which protocols live at each one. The protocols are what make the model useful in an interview or an incident.

Finally, do not confuse the OSI model with the OSI protocols. The model survived and is taught everywhere; the original OSI protocol suite mostly did not, and TCP/IP won. The seven-layer idea outlived the products built on it.

The bottom line

The OSI model has seven layers: physical, data link, network, transport, session, presentation and application. Learn the job of each layer, the protocols that live there, and the unit of data it handles, and you have a map for almost any networking question.

Next time a connection fails, work the layers from the bottom up instead of guessing. Check the cable, the local network, the IP address, the port and the application in that order — and use our free IP and DNS tools to confirm what the network is actually doing.

Frequently asked questions

How many layers are in the OSI model?

There are seven layers in the OSI model. From bottom to top they are the physical, data link, network, transport, session, presentation and application layers. The model was published by the International Organization for Standardization (ISO) in 1984.

What is the OSI model in simple terms?

The OSI model is a way of splitting network communication into seven jobs, one per layer. Each layer does one thing, such as moving bits over a cable or choosing a route, and hands the result to the next layer. It is a teaching and troubleshooting framework, not a product you install.

What is the easiest way to remember the 7 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, Please Do Not Throw Sausage Pizza Away gives the same layers in reverse.

Is the OSI model the same as TCP/IP?

No. The OSI model has seven layers and is mainly a reference model. The TCP/IP model used by the real internet has four layers: link, internet, transport and application. TCP/IP combines the OSI session, presentation and application layers into one application layer.

Which OSI layer is a router?

A router works mainly at Layer 3, the network layer, because it reads IP addresses and forwards packets between networks. A switch works mainly at Layer 2, the data link layer, using MAC addresses. A hub or cable is a Layer 1 device.

Which OSI layer is HTTP?

HTTP works at Layer 7, the application layer. It is the protocol your browser uses to request web pages. HTTPS is also Layer 7, with encryption handled by TLS, which sits between the application and transport layers in practice.

Which OSI layer is TCP?

TCP works at Layer 4, the transport layer. It breaks data into segments, numbers them, checks that they arrive in order and retransmits any that are lost. UDP also works at Layer 4 but skips most of that reliability work for speed.

Do I need to know the OSI model for a networking job?

Yes, in most cases. Network, helpdesk and security interviews and certifications regularly ask about the seven layers. More importantly, support teams use the layers every day to narrow down where a connection problem sits.

Sources

  1. Akamai — An Introduction to the OSI Networking Model
  2. BMC — What is the OSI Model? The 7 Layers Explained
  3. JumpCloud — What is the OSI Model?
  4. Wikipedia — OSI protocols
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 Akamai's OSI guide, BMC's layer-by-layer explanation and the OSI protocol reference.

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