The OSI model is a teaching model: the internet itself runs on the four-layer TCP/IP stack, and protocols such as TLS and ARP sit awkwardly between OSI layers. It survives because it is the best map we have for one question: at which layer does this attack work, and therefore at which layer must the defence sit? A web application firewall cannot stop ARP poisoning, and port security cannot stop SQL injection. Defence in depth means having a control at every layer, because attackers will look for the one you skipped.
1 · Seven Layers, Attacked
Top to bottom, the way a request leaves a browser.
| Layer | Common attacks | Defences |
|---|---|---|
| 7 · Application | Phishing, malware delivery, SQL injection, cross-site scripting (XSS) | Web application firewall, input validation, MFA, secure coding to OWASP guidance |
| 6 · Presentation | SSL stripping, weak or downgraded encryption, man-in-the-middle where encryption is optional | TLS 1.2/1.3 only, strong cipher suites, HSTS, proper key and certificate management |
| 5 · Session | Session hijacking, session fixation, cookie theft, replay | Session timeouts, new session ID at login, cookies with Secure, HttpOnly and SameSite, signed short-lived tokens |
| 4 · Transport | SYN flood, port scanning, TCP reset injection, UDP amplification | Firewalls, IDS/IPS, SYN cookies, rate limiting, closing unused ports |
| 3 · Network | IP spoofing, volumetric DDoS, routing (BGP) hijacks, network-level man-in-the-middle | Network segmentation, ACLs, anti-spoofing filters, RPKI route validation, IPsec, zero-trust network policies |
| 2 · Data link | MAC spoofing, ARP poisoning, VLAN hopping, MAC (switch) flooding | Port security, dynamic ARP inspection, DHCP snooping, 802.1X port authentication, disabling auto-trunking |
| 1 · Physical | Wiretapping, hardware keyloggers, signal jamming, physical tampering | Locked server rooms, access control, CCTV, shielded or fibre cabling, tamper-evident seals |
▸ Two notes the usual charts get wrong. Certificate pinning is no longer recommended for websites (browsers dropped HPKP) — it survives mainly in mobile apps. And TLS 1.0 and 1.1 are formally deprecated (RFC 8996, 2021); anything still offering them fails a modern audit.
2 · Where Today’s Protocols Actually Sit
The protocols that keep the internet running, placed on the stack, with the one security fact worth knowing about each.
| Protocol | Layer | What it does | Security note |
|---|---|---|---|
| HTTP/3 | 7 | Web traffic over QUIC | Encryption is mandatory — there is no plaintext HTTP/3 |
| DNS / DoH | 7 | Names to addresses; DoH carries DNS inside HTTPS | Plain DNS is spoofable and visible; DoH hides lookups from attackers — and from your own monitoring |
| SMTP | 7 | Moves email between servers | Sender spoofing is stopped by SPF, DKIM and DMARC, not by SMTP itself |
| SSH | 7 | Secure remote access and tunnelling | Key-based login only; tunnels can bypass firewalls — see Authentication Protocols |
| gRPC / WebSocket / MQTT | 7 | Service calls, two-way app messaging, IoT publish/subscribe | Long-lived connections need authentication on connect and authorisation per message |
| DHCP | 7 | Hands out network configuration | A rogue DHCP server redirects traffic — DHCP snooping blocks it |
| TLS | 5–6 | Encrypts and authenticates a connection | Use 1.3 where possible; it removed the legacy ciphers attackers relied on |
| TCP / UDP | 4 | Reliable streams / fire-and-forget datagrams | TCP is SYN-floodable; UDP is spoofable and used for amplification |
| QUIC | 4 | Encrypted, multiplexed transport over UDP | TLS 1.3 is built in; older middleboxes cannot inspect it |
| IPv4 / IPv6, ICMP, NAT | 3 | Addressing, error reporting, address translation | IPv6 is often enabled but unmonitored — a blind spot |
| BGP / OSPF | 3 | Routing between and within networks | BGP trusts announcements by default; RPKI is the fix for hijacks |
| ARP | 2–3 | Maps IPv4 addresses to MAC addresses | No authentication at all — hence ARP poisoning |
| Ethernet, Wi-Fi, VLAN, PPP | 2 | Frames on wired, wireless and point-to-point links | Use WPA3 on Wi-Fi; VLANs separate traffic but are not a security boundary on their own |
3 · VPN Types: Which Still Deserve to Run
A VPN is a tunnel built at a particular layer. The layer decides what it protects, how it gets through firewalls, and how it fails.
| VPN | Layer | Typical use | Verdict |
|---|---|---|---|
| IPsec (IKEv2) | 3 | Site-to-site tunnels between firewalls; also remote access | Use. The standard for site-to-site; needs UDP 500/4500 open |
| SSL/TLS VPN | 4–7 | Remote-access clients and browser portals (e.g. OpenVPN and vendor clients) | Use, and patch fast. Runs over 443, so it passes most firewalls; internet-facing VPN appliances are a top target for exploits |
| WireGuard | 3 | Modern remote access and site links | Use. Small code base, modern fixed cryptography, fast |
| L2TP/IPsec | 2 over 3 | Legacy remote access | Phase out. L2TP adds no encryption itself; it relies on IPsec and adds overhead |
| PPTP | 2 | Very old Windows remote access | Retire. Its MS-CHAPv2 authentication is broken; treat a PPTP tunnel as unencrypted |
▸ A VPN puts a user on the network, which is exactly what zero trust tries to avoid. For remote access to applications, zero-trust network access (ZTNA) grants one app at a time, after checking identity and device. Keep VPNs for site-to-site links and the cases ZTNA cannot cover.
Bottom line
- Defend where the attack lives — a layer-7 control cannot stop a layer-2 attack, and vice versa.
- Layer 2 is the forgotten one — ARP has no authentication; turn on DAI, DHCP snooping and 802.1X.
- Encrypt by default — TLS 1.3, HSTS, no TLS 1.0/1.1; HTTP/3 and QUIC make it mandatory anyway.
- Encryption cuts both ways — DoH and QUIC also blind your own monitoring; plan visibility at the endpoint.
- Retire PPTP, patch SSL VPNs, prefer ZTNA for user access.
Sources & method. Layer definitions from ISO/IEC 7498-1 (the OSI reference model); protocol facts from the relevant IETF RFCs (QUIC RFC 9000, HTTP/3 RFC 9114, TLS 1.3 RFC 8446, deprecation of TLS 1.0/1.1 RFC 8996, DoH RFC 8484, WireGuard design paper). Placing a protocol on a single OSI layer is a simplification, and the layer column says so where it spans two. Original analysis; no third-party graphics or text reproduced.
← Back to Cyber security