LevelUpWith

Explore / How Networks Work: From Cable to Cloud / Lesson 2

Lesson 2: The OSI and TCP/IP Models

Understand how the OSI and TCP/IP layer models break networking into separate jobs, and why engineers use them to talk about problems and fix them.

Free to read, no account needed. Part of How Networks Work: From Cable to Cloud.

By the end of this level you'll be able to

  • Name the TCP/IP layers, match each one to the OSI layers, and give one real protocol at each layer
  • Describe encapsulation: how each layer wraps the data from the layer above with its own header
  • Sort a list of symptoms (unplugged cable, wrong IP, name won't resolve) by the layer where the fault sits

Why bother with layers?

In Level 1 a network was a set of devices that share a medium and agree on rules for passing messages. Loading one web page uses a lot of those rules at once. Something turns bits into electrical or radio signals. Something gets a message to the right machine on the local network. Something routes it across the internet, makes sure nothing goes missing, and in the end something has to understand "GET /index.html".

To keep this manageable, engineers split the work into layers. Each layer does one job and only talks to the layer directly above or below it. Think of a parcel service. The person writing the letter doesn't care whether it travels by van or plane, and the van driver doesn't read the letter. Each person does their own part and passes the parcel on.

There are two models you will hear about, and you need both.

The two models side by side

The OSI model is a seven-layer reference model from ISO. It was first published in 1984, and the current edition is ISO/IEC 7498-1:1994. The TCP/IP model describes how the internet's protocols are actually built. RFC 1122 sets it out as four layers.

OSI (7 layers)          TCP/IP (4 layers)     Real protocol examples
--------------------    -----------------     ----------------------
7 Application   \
6 Presentation   >----  Application           HTTP, DNS, SSH, TLS*
5 Session       /
4 Transport     -----   Transport             TCP, UDP
3 Network       -----   Internet              IP (IPv4/IPv6), ICMP (ping)
2 Data Link     \
1 Physical       >----  Link                  Ethernet, Wi-Fi

*TLS doesn't fit neatly into either model. People argue about where it belongs, and that argument tells you something: the models are maps, and the terrain doesn't always match them.

What production work teaches you: engineers talk in OSI numbers and build with TCP/IP. When someone says "it's a Layer 7 load balancer" (it understands HTTP) or "that's a Layer 2 problem" (local link), they're using OSI numbering. You'll rarely hear anyone talk about layers 5 and 6 on their own.

Encapsulation: wrapping the parcel

When your browser sends a request, each layer on the way down wraps the data from the layer above with its own header, a small block of control information for that layer's job:

Application:   [ HTTP request: GET / ... ]                    -> "data"
Transport:     [TCP hdr][ HTTP request ]                      -> "segment"
Internet:      [IP hdr][TCP hdr][ HTTP request ]              -> "packet"
Link:          [Eth hdr][IP hdr][TCP hdr][ HTTP ][Eth trailer] -> "frame"
Physical:      0101100111010... as voltage, light or radio    -> "bits"
  • The TCP header holds things like port numbers, so the receiving machine knows which program the data is for. With no options it is 20 bytes.
  • The IP header holds the source and destination IP addresses. An IPv4 header is at least 20 bytes.
  • The link header holds the addresses for the next hop on the local network. Ethernet also adds a trailer used to check for errors.

The receiver does the reverse, which is called decapsulation. Each layer reads and removes its own header, then hands what's left up to the next layer. A router in the middle only unwraps as far as the IP header. It doesn't need to read your HTTP.

Gotcha: the names change by layer: segment (TCP), packet (IP), frame (link). Mixing them up in a ticket is harmless, but using the right word shows people you know which layer you're talking about.

Hands-on: test your own machine layer by layer

The real payoff is troubleshooting. Start at the bottom and work up. When one layer fails, the layers above it don't matter yet. Try these on your computer now.

Link layer: is the adapter connected at all?

# Windows (PowerShell): Status should say "Up"
Get-NetAdapter
# Name    InterfaceDescription        Status  LinkSpeed
# Wi-Fi   Intel(R) Wi-Fi 6 AX201      Up      866.7 Mbps
# Linux: look for "state UP"
ip link show
# macOS: en0 is usually Wi-Fi; look for "status: active"
ifconfig en0

Internet layer: do I have an IP address, and can I reach a remote IP?

ipconfig            # Windows: look for the IPv4 Address line
ip addr show        # Linux: look for an "inet" line
ipconfig getifaddr en0   # macOS: prints just the address

ping 8.8.8.8        # ICMP to a public IP, no names involved
# Reply from 8.8.8.8: bytes=32 time=14ms TTL=117

Application layer (DNS): can names be turned into addresses?

nslookup example.com
# Name:    example.com
# Address: <an IP address>

Application layer (HTTP): does the service answer?

curl -I https://example.com     # -I = fetch headers only
# HTTP/2 200

Windows gotcha: in Windows PowerShell 5.1, curl is an alias for Invoke-WebRequest, which takes different options. Type curl.exe to run the real curl that ships with Windows.

Sorting symptoms by layer

This is how you'll use the models every day:

Symptom Likely layer Why
Cable unplugged, adapter shows "Disconnected" Physical / Link (OSI 1–2) No signal, so nothing above it can work
Wrong IP address, or ping 8.8.8.8 fails while the link is up Network / Internet (OSI 3) Addressing or routing is broken
ping 8.8.8.8 works but nslookup example.com fails Application (DNS) Packets get through, but names can't be resolved
Site loads, but the web app returns an error page Application (HTTP) The network is fine; the problem is in the service

The classic check: if pinging an IP works but pinging a name fails, stop looking at cables and look at DNS. One test like that rules out a whole set of layers.

Trade-off: layers overlap in real life, and some faults show up at more than one layer. Use the model to decide what to test next, and don't expect every fault to sit in exactly one box.

Key takeaways

  • OSI has 7 layers (a reference model). TCP/IP has 4: Link, Internet, Transport, Application (how the internet is actually built).
  • Example protocols: Ethernet/Wi-Fi (link), IP/ICMP (internet), TCP/UDP (transport), HTTP/DNS (application).
  • Encapsulation: each layer adds its own header on the way down, and the receiver removes them on the way up.
  • The units are named frame (link), packet (IP) and segment (TCP).
  • Troubleshoot from the bottom up: link → IP → DNS → application.
  • If you can ping an IP but not a name, the problem is DNS, not the cable.

A 6-question knowledge check follows this lesson in the app, free and without an account.

Keep going: levels 3 and 4 are free

Create a free account to open the next two levels, save your progress and pick up where you left off. No card needed.

Next: Level 3, Ethernet, MAC Addresses and Switches.

Create a free account →See the whole course

More like this

  • Microsoft Cybersecurity Architect (SC-100) Exam Prep

    Prepare for Microsoft Exam SC-100 using architecture case studies that cover every bullet in the skills measured as of October 21, 2026, from ransomware resili…

    Exam prep · SC-100 · IT Support, Networking & Security · Expert · 48 levels · 4 free · Professionally curated by levelupwith.com

  • Spot the Fake: Beating AI Scams for You and Your Family

    Learn to spot AI-powered scams before they cost you. That covers phishing written by AI, cloned voices, deepfake investment adverts, romance cons, fake website…

    Course · IT & Security · IT Support, Networking & Security · Capable · 17 levels · 4 free · Professionally curated by levelupwith.com

  • Google Cloud Professional Cloud Security Engineer Exam Prep

    A course for the Google Cloud Professional Cloud Security Engineer exam that covers every item in Google's exam guide, weighted as the guide weights its five s…

    Exam prep · Google · IT Support, Networking & Security · Expert · 60 levels · 4 free · Professionally curated by levelupwith.com

  • AWS Certified Security - Specialty (SCS-C03) Exam Prep

    Prepare to pass AWS Certified Security - Specialty (SCS-C03) by working through every task statement in AWS's exam guide, with CLI commands, policy JSON and co…

    Exam prep · SCS-C03 · IT Support, Networking & Security · Expert · 52 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Security Operations Analyst (SC-200) Exam Prep

    Prepare for Microsoft SC-200 against the skills measured as of October 21, 2026. You will configure Defender XDR and Microsoft Sentinel automation, ingestion a…

    Exam prep · SC-200 · IT Support, Networking & Security · Expert · 49 levels · 4 free · Professionally curated by levelupwith.com

  • Microsoft Security, Compliance, and Identity Fundamentals (SC-900) Exam Prep

    Learn every skill listed in Microsoft's SC-900 study guide (skills measured as of October 21, 2026): security, compliance and identity concepts, Microsoft Entr…

    Exam prep · SC-900 · IT Support, Networking & Security · Capable · 18 levels · 4 free · Professionally curated by levelupwith.com