How the OSI and TCP/IP models work
medium 40 minA network request is a message wrapped in headers, one per layer, like dolls inside dolls.
When it comes up
The moments this idea belongs in a design interview, and the moments it does not.
Signals
When the layers come up
| You hear | Say | Because |
|---|---|---|
| "The site is down for some users" | Which layer fails for them, and what is different about them | DNS, routes and MTU differ by network |
| "Ping works but" | ICMP proves L3 only, test TCP and DNS | Firewalls treat protocols differently |
| "Connection refused" | RST: host up, no listener | Refused and timeout mean different layers |
| "L4 or L7 balancer?" | Does it need to read HTTP? | Only L7 can route by path or header |
| "Big uploads fail on VPN" | MTU and ICMP | Small packets fit, big ones vanish |
| "Type a URL and press Enter" | Layer by layer with round trips | It tests the whole stack in one question |
Word for word
Interviewer
A user says the site does not load, but they can ping it. Where do you start?
You
Ping proves the route works for ICMP. I would check DNS first with dig, because the browser uses the name. Then a TCP connect to port 443, then curl -v for TLS and HTTP.
Interviewer
dig works and the TCP connect hangs.
You
Then something drops the SYN: a firewall or security group that allows ICMP but not 443, or the return route is wrong. tcpdump on the client would show SYNs repeating with no answer. On the server I would check whether the SYNs arrive at all.
How do you explain where a failure is?
Breaks"The network is broken"
- How
- Restart things and hope.
- Limit
- Says nothing testable. Different failures get the same fix.
- Choose when
- Never.
WorksRecite the seven OSI layers
- How
- Name each layer and its protocols.
- Limit
- Correct vocabulary, but no evidence about this failure.
- Choose when
- As a first screen answer.
StrongOne check per layer, lowest failing layer
- How
- Link, neighbour, route, DNS, TCP, TLS, HTTP, each with a command and expected output; say what each result rules out.
- Limit
- Takes a minute longer to explain.
- Choose when
- Every troubleshooting round.