Understanding the OSI Model Through One Network Request

작성자

카테고리:

← 피드로
DEV Community · Juma Evans · 2026-07-25 개발(SW)

The Hook

Every networking course begins with the same seven mysterious layers:

Physical
Data Link
Network
Transport
Session
Presentation
Application

Students memorize them.

Developers ignore them.

Network engineers live by them.

But here’s the problem:

Most people never learn why these layers exist.

In this article, we’ll follow a single message;”Hello, Server!” as it travels through every OSI layer, crosses routers and switches, reaches another computer, and climbs back up the stack.

By the end, you’ll understand not just the names of the layers, but why the Internet couldn’t exist without them.

The Story

Imagine you open your browser.

https://github.com

You press Enter.

Now follow that request.

Layer 7 : Application

This is where humans interact with software.

Examples:

Browser
WhatsApp
Discord
Gmail
Spotify

The browser creates:

GET / HTTP/1.1
Host: github.com

Notice:

No IP.

No MAC address.

No Ethernet.

Just application data.

Layer 6 : Presentation

This layer asks:

How should the data look?

Examples include:

Encryption (TLS/SSL)
Compression (gzip)
Character encoding (UTF-8)
Serialization (JSON, XML, Protocol Buffers)

Here your HTTP request is encrypted into ciphertext before leaving your machine.

Without this layer:

Everyone on the network could read your passwords.

Layer 5 : Session

This layer manages conversations.

Think of it as the meeting organizer.

Responsibilities include:

Opening communication
Keeping it alive
Reconnecting if interrupted
Closing the session cleanly

Modern TCP/IP doesn’t expose this as a separate layer, but the concept still exists in many protocols.

Layer 4 : Transport

Now things become interesting.

Imagine sending a 100 MB video.

Should it be one enormous packet?

No.

Transport breaks it into manageable pieces called segments.

It also adds:

Source port
Destination port
Sequence number
Acknowledgments
Error recovery

Protocols:

TCP
UDP

Analogy:

A courier numbers every box before shipping.

If Box #7 disappears…

Only Box #7 is resent.

Layer 3 : Network

Now we need directions.

The Network layer adds:

Source IP

Destination IP

Example:

192.168.1.10

140.82.121.3

Routers read this information.

Their only job is:

Which road gets this packet closer to its destination?

Think Google Maps.

Layer 2 : Data Link

Now the packet reaches your home Wi-Fi.

The router doesn’t care about IP first.

It wants:

MAC Address

Why?

Because devices communicate locally using hardware addresses.

The frame now contains:

Destination MAC

Source MAC

Payload

Switches live here.

They forward frames only to the correct device.

This is why switches are much smarter than hubs.

Layer 1 : Physical

Finally…

Everything becomes electricity.

Or light.

Or radio waves.

Bits become:

101001011010011001

Those bits travel through:

Copper cables
Fiber optics
Wi-Fi radio
Satellite signals

Layer 1 doesn’t know HTTP.

It doesn’t know IP.

It doesn’t even know bytes.

It only knows:

1
Encapsulation

Here’s the beautiful part.

Each layer wraps the previous layer with its own information.

Think of Russian nesting dolls.

Application Data

Segment

Packet

Frame

Bits

Or like mailing a package:

Letter

Envelope

Shipping Box

Truck

Road

Each layer adds just enough information for the next part of the journey.

At the Destination

The server receives:

Bits

Frame

Packet

Segment

Application Data

Each layer removes the information added by its counterpart on the sender’s side.

This process is called decapsulation.

Eventually GitHub receives:

GET /

and responds with HTML.

Which Devices Work at Each Layer?
Layer Device
7 Browser, Web Server
6 TLS, SSL
5 Session managers
4 TCP, UDP
3 Router
2 Switch
1 Cable, Fiber, Wi-Fi

This table alone helps readers connect abstract layers to real-world hardware and software.

Why Was the OSI Model Invented though?

Before the OSI model, networking vendors often built proprietary systems that worked only with their own hardware and software. There wasn’t a common language for how devices should communicate.

The OSI model introduced a layered architecture where each layer has a single responsibility and communicates only with the layers directly above and below it.

This separation provides several advantages:

Modularity: You can improve one layer without redesigning the entire stack.
Interoperability: Devices from different vendors can communicate because they follow the same layer responsibilities.
Troubleshooting: Network problems become easier to isolate. If you can’t even establish a physical connection, there’s no point debugging HTTP.
Scalability: New technologies can be introduced within a layer without affecting the rest of the system.

Although the Internet actually uses the simpler TCP/IP model, the OSI model remains one of the best conceptual tools for understanding how data moves across networks.

A Developer’s View of the OSI Model

When you’re writing backend services or APIs, you interact with multiple layers—even if you don’t think about them:

You build REST or GraphQL APIs at the Application layer.
HTTPS relies on Presentation layer concepts like encryption.
Socket connections and ports depend on the Transport layer.
IP addresses and routing involve the Network layer.
Switches, Ethernet, and Wi-Fi operate at the Data Link and Physical layers.

Understanding where a problem occurs makes debugging much faster.

Key Takeaways

The OSI model isn’t just a list to memorize for an exam—it’s a way of thinking about networking. Every request you send travels down the stack, where each layer adds the information needed for its specific job. It crosses the network as electrical signals, light, or radio waves, then climbs back up the layers on the receiving machine until the original application data is reconstructed.

Once you see networking as a journey through these seven layers rather than seven isolated definitions, concepts like routers, switches, TCP, IP, TLS, and HTTP start fitting together naturally.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다