Command Palette

Search for a command to run...

Hectal
PHASE 0Beginner ~8 min· topic 2 of 4

Topic 0.2

The OSI and TCP/IP Models

In one line

Networking is built in layers, each solving one problem and relying on the one below; the OSI model (7 layers) is the teaching vocabulary, the TCP/IP model (4 layers) is what the internet actually runs.

0/4 · 0%

Think of it like this

Sending a parcel internationally. You write a letter (application), put it in a labelled envelope (transport), the courier adds a shipping label with the destination city (network), and a truck carries it along a specific road (link). Each step only cares about its own job.

Key ideas

  1. 01

    OSI's seven layers: 7 APPLICATION (HTTP, DNS), 6 PRESENTATION (encoding, encryption), 5 SESSION (conversations), 4 TRANSPORT (TCP, UDP: ports, reliability), 3 NETWORK (IP: addresses, routing), 2 DATA LINK (Ethernet, MAC addresses, switches), 1 PHYSICAL (cables, radio, voltages).

  2. 02

    The TCP/IP model merges these into four: APPLICATION (OSI 5–7), TRANSPORT (4), INTERNET (3), and LINK (1–2). That's how real protocol stacks are built; OSI numbers are mainly vocabulary.

  3. 03

    Why DevOps engineers care: tools and problems are described by layer. An 'L4 load balancer' forwards TCP connections; an 'L7 load balancer' understands HTTP. A 'layer 3 problem' is routing or addressing; 'layer 7' is the application. Knowing the layer tells you which tool to reach for.

  4. 04

    Debugging bottom-up is a reliable habit: is the link up (L1/L2)? Do I have an IP and route (L3)? Can I open the port (L4)? Does the application answer correctly (L7)? Each check has a command, and you'll learn all of them in this course.

Code & diagrams

OsiVsTcpIpdiagram
Rendering diagram…
layer-by-layer-checks.shbash
ip link show eth0                 # L1/L2: is the interface UP?
ip addr show eth0                 # L3: do I have an IP address?
ip route                          # L3: do I have a route (default gateway)?
ping -c 3 8.8.8.8                 # L3: can packets reach the internet?
nc -vz example.com 443            # L4: can I open a TCP connection to port 443?
curl -sI https://example.com      # L7: does the application answer?

Explain it without notes

01

An 'L4 load balancer' and an 'L7 load balancer' both distribute traffic. What can the L7 one do that the L4 one can't?

02

Why is the OSI model still taught if the internet uses the TCP/IP model?

Practice

01

Classify each: an expired TLS certificate, a pulled network cable, a missing default route, a firewall blocking port 5432, a 500 error from the app.

Trade-offs

  • ↔

    Layering keeps each protocol simple and replaceable (HTTP doesn't care whether it runs over Wi-Fi or fibre), at the cost of overhead: every layer adds headers, and some optimisations need to cross layers (e.g. TLS 1.3 and QUIC merging transport and security handshakes).

Done when you can

  • I can name the 7 OSI layers and the 4 TCP/IP layers and map between them.

  • I know what L3, L4, and L7 mean in tool names.

  • I can debug connectivity bottom-up with one command per layer.