It is 3 AM and a client’s banking application is crawling, or completely unreachable. One engineer is checking firewall rules. Another is restarting the web server. A third is reading application logs. Everyone is guessing, and nobody can say where the problem actually is.
The OSI model fixes that. It splits network communication into seven layers, so instead of guessing you can test one layer at a time and prove where the failure starts. In five years of working with Zscaler and enterprise firewalls, the layered approach is the single habit that has saved me the most troubleshooting time.
This guide explains each of the seven layers in plain language, shows how they map to the TCP/IP model, and then turns the model into a practical tool: a command for testing every layer, four real-style troubleshooting cases, and the attacks and defences that belong to each layer.
Key takeaways
- The OSI model is a reference model, not a protocol. Real networks run TCP/IP, but engineers still describe problems in OSI terms (“it is a Layer 2 issue”).
- Troubleshoot bottom-up: link, then local network, then IP, then ports, then the application. Most “application” outages turn out to be lower-layer problems.
- Each layer has its own failure symptoms, test commands and attacks. The cheat sheet below puts them on one page.
What is the OSI model?
The OSI (Open Systems Interconnection) model is a conceptual framework published by the International Organization for Standardization (ISO) as ISO/IEC 7498-1, and by the ITU as Recommendation X.200. It describes network communication as seven layers, where each layer provides a service to the layer above it and relies on the layer below.
Because each layer has a defined job, vendors can build products that interoperate, and engineers share a common language. When someone says “this is a Layer 3 problem”, everyone knows to look at IP addressing and routing, not at cables or application code.
A simple way to remember the order from Layer 7 down to Layer 1 is: All People Seem To Need Data Processing (Application, Presentation, Session, Transport, Network, Data Link, Physical).
The 7 layers at a glance
This table is the part of the article most worth bookmarking. It links each layer to what it does, what can go wrong, and how to test it.
| Layer | Job | Data unit | Examples | Typical failure | Quick test |
|---|---|---|---|---|---|
| 7 Application | Network services for apps | Data | HTTP, DNS, SMTP, SSH | HTTP 500, DNS SERVFAIL | curl -v, nslookup |
| 6 Presentation | Format, encoding, encryption | Data | TLS, UTF-8, JPEG | TLS version or cipher mismatch | openssl s_client |
| 5 Session | Open, keep and close sessions | Data | RPC, NetBIOS, SMB sessions | Session timeouts, frequent re-auth | App and auth logs |
| 4 Transport | End-to-end delivery, ports | Segment / datagram | TCP, UDP | Port blocked, resets, MSS issues | Test-NetConnection -Port |
| 3 Network | Addressing and routing | Packet | IPv4, IPv6, ICMP | Wrong gateway, missing route | ping, tracert |
| 2 Data Link | Delivery on the local segment | Frame | Ethernet, Wi-Fi, ARP, VLANs | Wrong VLAN, duplicate IP, loop | arp -a, switch logs |
| 1 Physical | Bits on the medium | Bits | Cables, fibre, radio, NICs | Link down, CRC errors | Link LEDs, interface counters |
The layer assignments for TLS and ARP are approximations. TLS is often placed at Layer 6, but in practice it sits between the transport and application layers. ARP links Layer 3 addresses to Layer 2 addresses and is sometimes described as “Layer 2.5”. The model is a guide, not a strict rulebook.
Each layer explained

Layer 7: Application
The layer closest to the user. It provides network services to applications through protocols such as HTTP/HTTPS, DNS, SMTP, FTP and SSH. Your browser is not Layer 7. The HTTP protocol it speaks is. Web application firewalls, secure web gateways and proxies inspect traffic at this layer.
Layer 6: Presentation
Makes sure data arrives in a format the receiving application can use. That covers character encoding (such as UTF-8), compression and, in the classic teaching model, encryption and decryption with TLS. If a client only supports TLS 1.0 and the server requires TLS 1.2 or later, the connection fails here.
Layer 5: Session
Establishes, maintains and ends sessions between two systems, including checkpoints and recovery for long exchanges. In TCP/IP networks, session functions are usually handled by the application itself, which is why Layer 5 problems often show up as login loops or sessions that drop after a fixed time.
Layer 4: Transport
Provides end-to-end delivery between processes, identified by port numbers. TCP is connection-oriented and reliable (the three-way handshake, acknowledgements, retransmission). UDP is connectionless and faster, used for DNS queries, VoIP and streaming. Stateful firewalls make most of their decisions at this layer.
Layer 3: Network
Handles logical addressing and routing between networks using IP addresses. Routers and Layer 3 switches operate here. A wrong default gateway, a missing route or an overlapping subnet are classic Layer 3 faults.
Layer 2: Data Link
Moves frames between devices on the same local network using MAC addresses. Ethernet, Wi-Fi (802.11), VLAN tagging (802.1Q) and switching all live here. ARP resolves an IP address to a MAC address so a frame can be delivered locally.
Layer 1: Physical
The actual medium: copper cables, fibre, radio signals, connectors and network interface cards. Layer 1 problems include damaged cables, dirty fibre connectors, duplex mismatches and Wi-Fi interference. They are easy to check and often skipped. See the network devices guide for which hardware works at which layer.
How data moves through the layers: encapsulation
When you open https://technaga.com, your request travels down the layers on your device. Each layer wraps the data from the layer above with its own header, a process called encapsulation:
- Layers 7 to 5: the browser builds an HTTP request, and TLS encrypts it.
- Layer 4: TCP adds source and destination ports (for example, a random high port to 443) and becomes a segment.
- Layer 3: IP adds source and destination IP addresses and becomes a packet.
- Layer 2: Ethernet or Wi-Fi adds source and destination MAC addresses (your device and your gateway) plus an error-check trailer and becomes a frame.
- Layer 1: the NIC sends the frame as electrical signals, light or radio waves.
At the server, the process runs in reverse (decapsulation). Each layer checks and removes its own header before passing the data up. Notice that MAC addresses change at every router hop, while the IP addresses stay the same end to end (unless NAT rewrites them).

OSI model vs TCP/IP model
The Internet runs on the TCP/IP model, described in RFC 1122. It has four layers instead of seven, but the two map onto each other cleanly:
| OSI layer | TCP/IP layer | Examples |
|---|---|---|
| 7 Application, 6 Presentation, 5 Session | Application | HTTP, DNS, TLS, SSH |
| 4 Transport | Transport | TCP, UDP |
| 3 Network | Internet | IP, ICMP |
| 2 Data Link, 1 Physical | Link (network access) | Ethernet, Wi-Fi, ARP |
Use TCP/IP to understand how protocols are actually built. Use OSI to troubleshoot and communicate, because its finer split (especially at the bottom) helps you isolate faults. The TCP/IP model guide covers the four-layer model in more depth.
How to troubleshoot with the OSI model, layer by layer
Work from the bottom up. Each step only makes sense once the layer below it passes. The commands below are for Windows, with Linux equivalents in the comments.

# Layer 1 - is the link up?
Get-NetAdapter # Linux: ip link show
# Look for Status = Up and the expected link speed
# Layer 2 - can I reach my local gateway's MAC address?
arp -a # Linux: ip neigh
# The default gateway should appear with a valid MAC (not 'incomplete')
# Layer 3 - is my IP configuration right, and can I route?
ipconfig /all # Linux: ip addr; ip route
ping 10.10.10.1 # default gateway
tracert 8.8.8.8 # Linux: traceroute 8.8.8.8
# Layer 4 - is the service port reachable?
Test-NetConnection technaga.com -Port 443 # Linux: nc -vz technaga.com 443
# Layers 5-6 - does the TLS handshake succeed?
openssl s_client -connect technaga.com:443 -servername technaga.com
# Layer 7 - does the application answer correctly?
nslookup technaga.com
curl -v https://technaga.com/Two rules make this faster:
- Stop at the first failure. If
pingto the gateway fails, there is no point reading application logs yet. - A pass at one layer proves the layers below it. If
Test-NetConnectionto port 443 succeeds, Layers 1 to 4 are working, so you can move straight to TLS and the application.
Microsoft documents every option of Test-NetConnection, including -TraceRoute and -InformationLevel Detailed.
Four troubleshooting cases, mapped to layers
Case 1 (Layer 3/4/7): DNS queries get no reply
A user cannot open any website by name. A packet capture on the client shows the query leaving but no answer coming back:
09:12:44.218321 IP 10.10.20.5.54322 > 8.8.8.8.53: 5234+ A? technaga.com. (32)Reading it by layer: the source is 10.10.20.5 and the destination 8.8.8.8 (Layer 3), from port 54322 to UDP 53 (Layer 4), asking for the A record of technaga.com (Layer 7). Because the request leaves but nothing returns, test each layer in turn: can the client ping its gateway and route to 8.8.8.8? Is UDP 53 to that resolver blocked by a firewall? In many enterprises, clients are only allowed to use internal resolvers, so the fix is the client’s DNS setting, not a new firewall rule. A healthy exchange looks like this:
09:12:44.218321 IP 10.10.20.5.54322 > 8.8.8.8.53: 5234+ A? technaga.com. (32)
09:12:44.250412 IP 8.8.8.8.53 > 10.10.20.5.54322: 5234 1/0/0 A 104.18.2.161 (48)Case 2 (Layer 2): The whole network slows to a crawl
During one banking deployment, a technician connected both ends of a patch cable to the same core switch. That created a Layer 2 switching loop, and the resulting broadcast storm took down most of the network. The team first investigated firewall policies and routing, but the evidence was in the switch logs: MAC address flapping between ports and interface utilisation near 100%. Spanning Tree Protocol (STP) with BPDU Guard on access ports is the standard protection against this.
Case 3 (Layer 3/4): A VPN or Zero Trust tunnel connects, then drops
Users report that the Zscaler Client Connector tunnel connects successfully but drops after a few seconds. Authentication logs look clean, so the instinct is to blame identity settings. The real cause is lower down: after tunnel encapsulation adds its own headers, full-size packets exceed the path MTU somewhere in the ISP network and are fragmented or silently dropped.
You can confirm a path MTU problem with a ping that forbids fragmentation, reducing the size until it succeeds:
ping -f -l 1472 8.8.8.8 # Windows: 1472 bytes payload + 28 bytes headers = 1500
ping -M do -s 1472 8.8.8.8 # Linux equivalentIf 1472 fails but a smaller size works, the path MTU is below 1500. Lowering the TCP MSS (a Layer 4 setting) or the tunnel MTU so packets fit the path keeps the session stable. The symptom looked like an application problem. The cause was at Layers 3 and 4.
Case 4 (Layer 6): HTTPS fails for one old client only
A legacy scanner can no longer upload to an internal web server after a security hardening change. Running openssl s_client with an old protocol version reproduces the failure:
openssl s_client -connect app.corp.example:443 -tls1
# handshake failure: server no longer accepts TLS 1.0The server is behaving correctly: TLS 1.0 and 1.1 were formally deprecated by the IETF in RFC 8996. The right fix is a firmware update for the scanner, not re-enabling old protocols on the server.
OSI layers, attacks and defences
Thinking in layers also helps you build defence in depth: a control at one layer covers gaps in another.

| Layer | Example attacks | Example defences |
|---|---|---|
| 7 Application | SQL injection, DNS tunneling, phishing sites | WAF, secure web gateway, input validation, DNS security |
| 6 Presentation | TLS downgrade, weak ciphers | TLS 1.2+ only, strong cipher suites, certificate validation |
| 5 Session | Session hijacking, token theft | Short session lifetimes, secure cookies, MFA |
| 4 Transport | SYN flood, port scanning | Stateful firewall, SYN cookies, rate limiting |
| 3 Network | IP spoofing, BGP hijacking, amplification DDoS | ACLs, anti-spoofing filters, RPKI, DDoS protection |
| 2 Data Link | ARP spoofing, MAC flooding, VLAN hopping | Dynamic ARP Inspection, DHCP snooping, port security, 802.1X |
| 1 Physical | Cable tapping, rogue devices, jamming | Locked racks, disabled unused ports, physical access control |
Notice how many controls sit at Layers 2 to 4. That is why network segmentation and properly configured firewalls remain core defences, even as more inspection moves to Layer 7.

Common mistakes when using the OSI model
- Starting at Layer 7. I have seen engineers spend hours reviewing Zscaler Client Connector policies and firewall rules, only to find the user’s Wi-Fi adapter was disabled.
- Blaming routing for Layer 2 faults. “Cannot reach the server” is often a wrong VLAN on the access port, a duplicate IP address or a stale ARP entry.
- Treating the model as exact. TLS, ARP, MPLS and tunnels do not fit neatly into one layer. Use the model to organise your thinking, not to win arguments about where a protocol “really” belongs.
- Testing with ping only. ICMP can be blocked while TCP 443 works, and vice versa. Test the actual port the application uses.
Frequently asked questions
Why learn the OSI model if networks use TCP/IP?
Because it is the shared vocabulary for troubleshooting, vendor documentation and interviews. Its seven-layer split, especially separating Layer 1 from Layer 2, makes it easier to isolate faults than the four-layer TCP/IP model.
At which layer does a firewall work?
Traditional packet-filtering and stateful firewalls work at Layers 3 and 4 (IP addresses, protocols, ports). Next-generation firewalls also inspect Layer 7 to identify applications, users and threats.
At which layer do switches and routers work?
A traditional switch forwards frames by MAC address at Layer 2. A router forwards packets by IP address at Layer 3. A Layer 3 switch does both.
At which layer does DNS work?
DNS is an application-layer (Layer 7) protocol. It normally uses UDP port 53 at Layer 4, and TCP port 53 for large responses and zone transfers.
What is a “Layer 8” problem?
An informal joke for human error: a mistyped configuration, a user clicking a phishing link or an undocumented change. It is not part of the official model, but it causes a lot of real outages.
Conclusion
The OSI model earns its place not as theory but as a checklist. Learn what each layer does, keep the cheat sheet handy, and troubleshoot from the bottom up with one test per layer. You will find faults faster, explain them more clearly to your team, and see where each security control in your network actually fits.
Related TechNaga guides
- TCP/IP Model for Security Analysts
- 3-Way Handshake Troubleshooting for Security Analysts
- Network Devices: Complete Beginner’s Guide
- Network Protocols and Ports
- IP Address Explained
- Network Segmentation Explained with Real-World Example
- Zero Trust Security in 2026









6 thoughts on “OSI Model Explained: The 7 Layers and How to Troubleshoot Each One”