OSI Model Attack Map: the 7 Layers and What Attacks Each One
The OSI model describes network communication as seven layers, from physical cables at layer 1 to applications at layer 7. For security work it is most useful as a map: every layer has its own protocols, its own typical attacks and its own controls. Click a layer below to see all three, then test yourself by placing real attacks on the right layer. Free to use, runs in your browser.
TL;DRThe short version
5 points
- The OSI model splits network communication into 7 layers: Physical, Data link, Network, Transport, Session, Presentation and Application. It was published as ISO/IEC 7498-1.
- Attacks are easiest to remember by layer: cable taps at 1, ARP spoofing at 2, IP spoofing and BGP hijacks at 3, SYN floods at 4, session hijacking at 5, SSL stripping at 6, SQL injection and XSS at 7.
- Each layer has its own controls. Dynamic ARP inspection helps at layer 2, ingress filtering at layer 3, SYN cookies at layer 4, a web application firewall and input validation at layer 7.
- The internet runs on the four-layer TCP/IP model (RFC 1122), not OSI. OSI is a teaching and troubleshooting reference, and the mapping between the two is approximate.
- This page runs in your browser. Nothing you click or answer is sent anywhere.
Use the up and down arrow keys to move between layers.
Layer 7: Application
The services programs use directly: web, mail, name lookups, file transfer.
Data unit: Data. TCP/IP layer: Application.
Protocols
HTTP, DNS, SMTP, FTP, SSH
Typical devices
Web application firewall, Proxy, Load balancer (L7)
Typical attacks
- SQL injection. Input is treated as part of a database query, so an attacker can read or change data.
- Cross-site scripting (XSS). A page echoes attacker-supplied script that then runs in other visitors’ browsers.
- DNS cache poisoning. A resolver is tricked into storing a false answer, sending users to the wrong address.
Controls that help
- Input validation and parameterised queries. Keeps data from being read as code.
- Web application firewall. Filters known attack patterns in HTTP traffic.
- DNSSEC and patched resolvers. Lets resolvers reject forged DNS answers.
The 7 layers at a glance
| Layer | Example protocols | Example attack |
|---|---|---|
| 7. Application | HTTP, DNS, SMTP | SQL injection |
| 6. Presentation | TLS, ASN.1, MIME | SSL stripping |
| 5. Session | RPC, NetBIOS, SOCKS | Session hijacking |
| 4. Transport | TCP, UDP, QUIC (runs over UDP) | SYN flood |
| 3. Network | IPv4, IPv6, ICMP | IP spoofing |
| 2. Data link | Ethernet, ARP, Wi-Fi (802.11) | ARP spoofing |
| 1. Physical | Ethernet cabling standards, Fibre, Wi-Fi radio | Cable tapping |
Using the model to defend
When something breaks, ask which layer it is at. A flood of half-open connections points to layer 4, so look at SYN cookies and connection limits on your firewall. Odd traffic on a local segment points to layer 2. To see which ports are risky to leave open, use the Port Risk Lookup.
Addressing questions sit at layer 3: the Subnet Calculator works out networks and host ranges, and the DNS Lookup shows what a resolver returns. For the encryption layer, the TLS Handshake Lab walks through where downgrade and man-in-the-middle attacks hit.
Layer definitions follow ISO/IEC 7498-1. The four-layer TCP/IP model is defined in IETF RFC 1122. The attack and control lists are illustrative examples, not complete catalogues.
Frequently asked questions
What are the 7 layers of the OSI model?
From top to bottom: 7 Application, 6 Presentation, 5 Session, 4 Transport, 3 Network, 2 Data link and 1 Physical. A common memory aid reading from the top is "All People Seem To Need Data Processing". Layer 1 moves raw bits, layer 2 moves frames between neighbouring devices, layer 3 routes packets between networks, layer 4 delivers data between programs by port, and layers 5 to 7 handle sessions, data formats and the services applications use.
What is the OSI model in cyber security?
In security it is a checklist for asking where an attack happens and which control belongs there. A flood of half-open connections is a layer 4 problem, so a web application firewall will not help; a forged ARP reply is a layer 2 problem, so a perimeter firewall will not see it. Mapping an incident to a layer narrows the investigation and the fix.
Which layer is most attacked?
There is no single answer, and this page does not claim one. Application-layer flaws such as injection and cross-site scripting are common, but denial of service, routing attacks and local network attacks each target lower layers. Defence in depth means having at least one control at every layer you operate.
What is the difference between the OSI model and the TCP/IP model?
OSI has seven layers and was designed as a reference model. TCP/IP has four (Application, Transport, Internet and Link in RFC 1122) and describes the protocols the internet actually uses. RFC 1122 describes the TCP/IP Application layer as combining the OSI Presentation and Application layers; in common teaching it is drawn as covering OSI layers 5 to 7. Transport matches layer 4, Internet matches layer 3, and Link covers layers 1 and 2. Some textbooks use a five-layer variant that splits Link in two.
Where does TLS fit in the OSI model?
The OSI standard (ISO/IEC 7498-1) predates TLS, so there is no official placement. Textbooks and courses differ: many put TLS at layer 6 (Presentation) because it handles encryption, others at layer 5 or between layers 4 and 7. The quiz on this page accepts the common teaching answer of layer 6.
Where do ARP and BGP fit?
ARP resolves an IP address to a MAC address on a local network. It is usually taught at layer 2, and RFC 1122 covers it in its Link Layer chapter, though it is used to support IP at layer 3. Placement varies between textbooks. BGP exchanges routing information between networks, so its effect is on layer 3 routing, although the protocol itself runs over TCP.
More security tools
The tools people use most on PlayCISO.
Catch injected instructions hiding in content your AI agent should only read.
Score your readiness against the first international standard for AI security threats.
Critical CVEs across 21 major vendors, month by month — and what the 2026 surge means.
Build an ordered ruleset, replay labelled packets and catch shadowed and any-to-any rules.
Self-assess all six Functions, from Govern to Recover, and see your weakest one.
Search 172 threat actors across Microsoft, CrowdStrike, Mandiant and community names.