Field guide The OSI model

01 / Foundations

The OSI model

Follow a request through seven layers, from an application to the wire.

7 min read Practical fundamentals
01

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

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

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.

1 / 4Which OSI layer describes routing packets between networks?
2 / 4In the OSI reference model, which layer describes data representation and encoding?
3 / 4What is the main role of the physical layer?
4 / 4Which pair contains transport protocols?
UP NEXTProtocols & ports
Public sandbox · shared fictional data
Use test files only. Back to the room ↗