AlgoViz

How the OSI and TCP/IP models work

medium 40 min

A 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 hearSayBecause
"The site is down for some users"Which layer fails for them, and what is different about themDNS, routes and MTU differ by network
"Ping works but"ICMP proves L3 only, test TCP and DNSFirewalls treat protocols differently
"Connection refused"RST: host up, no listenerRefused 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 ICMPSmall packets fit, big ones vanish
"Type a URL and press Enter"Layer by layer with round tripsIt tests the whole stack in one question

Word for word

  1. Interviewer

    A user says the site does not load, but they can ping it. Where do you start?

  2. 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.

  3. Interviewer

    dig works and the TCP connect hangs.

  4. 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.