Course map

Topic 023 / Core

OSI and TCP/IP models

Chapter 3.1 · Network Foundations

What and why

A network request involves many independent concerns — signaling bits on a wire, addressing a machine, delivering bytes reliably, giving them application meaning — that would be unmanageable as one tangled piece of logic. A layered model splits networking into independent layers, each depending only on the layer below it. OSI is the 7-layer reference model (physical, data link, network, transport, session, presentation, application) used as shared vocabulary; TCP/IP is the 4-layer model (link, internet, transport, application) that the internet actually runs on. Builds on: → 10 (client–server architecture — this topic explains how the request between client and server actually travels).

Diagram

TCP/IP layer Rough OSI equivalent Example concern
Application Application, presentation, session HTTP, DNS — meaning of the data
Transport Transport TCP/UDP — process-to-process delivery
Internet Network IP — addressing and routing between networks
Link Data link, physical Ethernet/Wi-Fi — getting bits onto one physical hop

How it works

  1. The sender's application layer hands data down; each layer below wraps it with its own header (encapsulation) — transport adds ports, internet adds IP addresses, link adds hardware addresses.
  2. The fully wrapped frame crosses the physical medium, hop by hop.
  3. Each router on the path reads only the internet-layer header to decide the next hop.
  4. At the receiver, each layer strips its own header and hands the rest up (decapsulation), until the application layer sees the original data.

Practical example

(illustrative). An HTTP GET leaves the browser as application data, gains a TCP header (source/destination port), then an IP header (source/destination address), then a link-layer header for the first hop — four nested wrappers around one request, each read and removed by exactly one layer.

When to use it

  • Use when: debugging — the model tells you which layer a symptom belongs to ("can I ping the host" is internet-layer; "the JSON is malformed" is application-layer).
  • Avoid when: treating OSI's 7 layers as literally implemented software — real stacks implement TCP/IP's 4; OSI stays useful only as a naming convention.
  • Failure scenarios: misdiagnosing a problem at the wrong layer — blaming "the network" for a bug that is actually in the application's own request handling, or vice versa.
  • Simpler alternative: for day-to-day engineering, the 4-layer TCP/IP model is enough; reach for OSI's extra vocabulary only when discussing a problem with others who use it.

Practice

(vocabulary kind — classification drill; 15 min, no lab services). Classify each of these by the layer it belongs to: a cable unplugged; a host with no route to a destination network; packet loss mid-stream on an otherwise-connected link; a server returning malformed JSON. Done when each is assigned to link, internet, transport, or application with a one-line reason.

Key takeaway

Layering lets each piece of the network stack change independently; use TCP/IP's 4 layers as your working model and OSI's 7 as shared vocabulary. Done when you can: place any networking symptom at the correct layer without hesitating. Used next in → 24 (addressing), → 25 (TCP and UDP), → 28 (HTTP).

References

None — this topic makes no external claims.

Source directory

Search the guide