One conversation, seven perspectives
The OSI model is a reference for reasoning about communication. Real protocols do not always fit neatly into one layer. The TCP/IP model groups the same work into application, transport, internet and link layers.
- 7 · Application — HTTP, DNS and other application protocols define messages.
- 6 · Presentation — data representation and encoding; TLS is often discussed here.
- 5 · Session — coordination of a conversation; applications often implement it themselves.
- 4 · Transport — TCP streams or UDP datagrams connect application endpoints.
- 3 · Network — IP addresses and routing carry packets between networks.
- 2 · Data link — Ethernet or Wi-Fi frames deliver data over a local link.
- 1 · Physical — electrical, optical or radio signals carry bits.
Encapsulation, without the mystery
Each layer wraps data from the layer above. On receipt, the destination removes those wrappers in reverse order.
- An HTTP request becomes bytes in a TCP stream.
- TCP segments carry sequence numbers and port numbers.
- An IP packet carries a segment plus source and destination IP addresses.
- An Ethernet frame carries the packet plus link-layer addresses and a frame check sequence.
Use layers to narrow the fault
Begin with the symptom, then test the dependency beneath it. A working link light does not prove that DNS works; a working DNS answer does not prove that HTTPS works.
- Link down? Check power, cable and interface state.
- IP unreachable? Check address, prefix, gateway and routes.
- Host reachable but service fails? Check listening ports, firewalls, TLS and application logs.
PAUSE / CHECK YOUR UNDERSTANDING
Can you place the layer?
Four questions to connect the model to what it does. Check your answers, then read the explanation.