Why the OSI model matters
The OSI model is a seven-layer reference framework used to describe how applications communicate over networks. Real protocols do not always fit perfectly into one layer, but the model gives engineers a shared troubleshooting language.
Best interview use: Do not only recite layer names. Explain what each layer contributes and how you would test it during an outage.
The seven layers
| Layer | Main responsibility | Examples / devices | PDU |
|---|---|---|---|
| 7 Application | Network services used by applications. | HTTP, DNS, SMTP, SSH | Data |
| 6 Presentation | Format, encoding, encryption and compression. | TLS concepts, JSON, character encoding | Data |
| 5 Session | Establishes, maintains and ends logical conversations. | Session checkpoints, RPC/session control | Data |
| 4 Transport | End-to-end delivery, reliability, segmentation and ports. | TCP, UDP, load balancers | Segment / datagram |
| 3 Network | Logical addressing and routing between networks. | IPv4/IPv6, ICMP, routers | Packet |
| 2 Data Link | Frames, MAC addressing and local-segment delivery. | Ethernet, 802.1Q, switches | Frame |
| 1 Physical | Signals, media, connectors and bit transmission. | Fibre, copper, radio, transceivers | Bits |
Encapsulation and de-encapsulation
Application data
TCP/UDP header
IP header
Ethernet header + trailer
The sender adds control information as data moves down the stack. The receiver removes and validates it as data moves upward. A packet capture lets you inspect several layers at once.
Layer-by-layer troubleshooting
| Symptom | Likely starting layer | Checks |
|---|---|---|
| Interface is down / no light | Layer 1 | Cable, transceiver, speed, duplex, signal, interface state. |
| Same VLAN hosts cannot communicate | Layer 2 | VLAN membership, MAC table, STP state, trunk allowance. |
| Remote subnet unreachable | Layer 3 | IP, mask, gateway, ARP/ND, route, ACL. |
| Ping works but application fails | Layer 4–7 | Port listening, firewall, TLS, DNS, application logs. |
| Name fails but IP works | Layer 7 | DNS resolver, record, cache and reachability to DNS service. |
Interview explanation example
Question: A user cannot open an HTTPS application. How do you troubleshoot?
- Check link/Wi-Fi and interface status.
- Verify VLAN, address, mask and default gateway.
- Test gateway and remote-IP reachability.
- Test DNS resolution.
- Test TCP/443 and inspect firewall/load-balancer path.
- Check TLS certificate, SNI and application response.
- Use packet captures and logs to identify the exact failure.
Quick self-check
1. Which layer handles logical IP addressing?
Answer: Layer 3, the Network layer.
2. Which layer uses ports?
Answer: Layer 4, the Transport layer.
3. At which layer does a switch primarily forward Ethernet frames?
Answer: Layer 2.
4. What is the PDU at Layer 2?
Answer: Frame.
5. Why is the OSI model useful even though the Internet uses TCP/IP?
Answer: It provides a structured vocabulary and troubleshooting method.
Frequently asked questions
1. Is the OSI model an actual protocol suite?
Answer: No. It is primarily a reference model. The TCP/IP suite is what the Internet uses operationally.
2. Where does TLS belong?
Answer: It is often associated with the presentation/session area, but real implementations cross model boundaries. Explain the function instead of forcing a perfect layer label.
3. Is a firewall Layer 3 or Layer 7?
Answer: It depends on its capabilities. Basic filtering uses network and transport information; next-generation firewalls can inspect application-layer traffic.
Standards and further reading
- ISO/IEC 7498-1 overview — OSI Basic Reference Model
- RFC 1122 — Requirements for Internet Hosts: Communication Layers
Editorial note: Vendor commands and best-path tie-breakers can differ by platform and software release. Always verify production configuration against the device vendor documentation.
