Everything About the OSI Model
You open WhatsApp, type "Hey," and hit Send.
Your friend's phone buzzes 400 milliseconds later, possibly in a different country, on a completely different device connected to a completely different network.
That single message didn't just "fly through the internet." Between your tap and that buzz, it passed through seven distinct stages of transformation. Each stage solved one specific problem and then handed the result to the next stage.

This is the OSI Model.
Practically speaking, you already use it hundreds of times every day. This blog is designed to help you understand what happens behind the scenes and build a complete mental model so that future networking concepts can easily snap into place within this framework.
The OSI Model is a layered framework that divides network communication into 7 categories. Protocols like HTTP, TCP, IP, and Ethernet are the actual rules that operate inside those categories, doing the real work. The model organizes them; the protocols execute them.
Why the OSI Model Exists
Before learning the seven layers, understand why the OSI Model was created.
In the 1970s, different companies used their own networking systems, and most of them could not communicate with each other. Networking was built as one large, tightly connected system, so changing one part often affected everything else.
In 1984, ISO introduced the OSI Reference Model to solve this problem by dividing network communication into seven separate layers, where each layer is responsible for one specific task.

Each layer follows a simple contract:
- It receives input from the layer above (or below).
- It performs its specific job.
- It passes the result to the next layer.
- It does not need to know how the other layers work internally.
In Low-Level System Design, we follow the SOLID principles to build software. The “S” stands for the Single Responsibility Principle (SRP), which means a component should have one clear responsibility.
The OSI Model applies the same idea to networking: each layer has one specific job, exposes a well-defined interface, and remains decoupled from the internal implementation of the other layers.
Layer 1 : Application Layer
The problem it solves: How does software communicate over a network in a way that both sides understand?
This is the layer you interact with directly. When you type a URL in your browser, compose an email, or send a WhatsApp message, your application needs a protocol that defines the rules of that specific type of communication.
The Application Layer doesn't mean "the application itself." Your browser is not Layer 7. The protocol your browser uses to request a web page (HTTP) is Layer 7.
Key protocols:
- HTTP/HTTPS: How your browser sends a request to a server and receives the web page from the server in response.
- SMTP: How email is sent between servers.
- DNS: How human-readable domain names (google.com) get translated to IP addresses. Your browser can't send a request to "google.com." It needs an IP address. DNS resolves that.
- FTP: How files are transferred between machines.
Layer 2 : Presentation Layer
The problem it solves: Both sides are speaking the same protocol, but how do they agree on the format of the data they're exchanging?
Your WhatsApp message is a string of text. But under the hood, that text needs to be serialized into a specific binary format. Images need to be encoded as JPEG or PNG. If your message is encrypted, this is where encryption happens. If data needs compression before being sent, this is where that happens.
The Presentation Layer is responsible for translation, compression,and encryption, making sure the data is in a format the receiving application can actually read.
Key protocols:
- JPEG, PNG, GIF: Different ways computers store and transmit images.
- ASCII, UTF-8: Rules that define how text characters are converted into bytes so computers can store and exchange text correctly.
- TLS: Keeps data private while it travels across the internet by encrypting it. The padlock icon on our browser means the website has a trusted security certificate and the connection is encrypted.
Layer 3 : Session Layer
The problem it solves: How do two devices maintain an ongoing conversation rather than treating every exchange as a one-off?
When you open WhatsApp, your phone establishes a persistent connection to WhatsApp's server. You don't reconnect every time you send a new message. That ongoing connection is a session.
The Session Layer is responsible for establishing, maintaining, and terminating sessions between two communicating devices. It also handles re-synchronization, if a long data transfer gets interrupted, the session layer can resume from a checkpoint rather than restarting from scratch.
Layer 4 : Transport Layer
The problem it solves: How does data reach the correct application on another computer?
You can have many apps using the internet at the same time, such as WhatsApp, and Spotify. The Transport Layer makes sure the data is sent to the right app on the other machine.
It uses port numbers to identify applications. For example, a WhatsApp server may listen on port 443, while Spotify uses a different port. The Transport Layer adds the correct port number to each piece of data so the receiving computer knows which application should receive it.
It also decides the delivery strategy:
- UDP (User Datagram Protocol): Very fast. It just sends the data to the server and does not wait for an acknowledgement. Some packets may be lost or arrive in the wrong order. This is useful for live video calls or online games, where staying real-time is more important than receiving every single packet.
- TCP (Transmission Control Protocol): Reliable and ordered. After sending data, it waits for acknowledgement from the other side. If a packet is lost, it sends it again. This is useful for WhatsApp messages, emails, or file downloads, where losing data is not acceptable.

Layer 5 : Network Layer
The problem it solves : How does data travel from one device to another across the internet?
Your WhatsApp message usually does not go directly from your phone to your friend’s phone. It travels through many networks and devices on the internet before reaching your friend. At each step, a router decides where the message should go next so it can eventually reach the correct device.
The Network Layer is responsible for:
- Logical addressing using IP addresses.
- Routing, which means finding the best path from the source device to the destination device across different networks.
Every device connected to the internet has an IP address.
Key protocols:
- IP (Internet Protocol): Identifies the source and destination devices and helps move data across the internet.
- ICMP (Internet Control Message Protocol): Used for diagnostics, such as the ping command.
Layer 6 : Data Link Layer
The problem it solves : How does data move from one directly connected device to another?
For Example,
- Phone → Wi‑Fi
- Laptop → Wi‑Fi
- Computer → Another computer on the same network
The Data Link Layer handles this short-distance delivery (also known as hop-by-hop delivery) between devices that are connected to the same local network.
It uses MAC addresses, which are the physical addresses of network devices.
- MAC address: Used to identify a device on the same local network.
- Every network device (such as a phone, laptop, or Wi‑Fi adapter) has a unique MAC address, making it a unique physical identifier for that specific hardware.
Key protocols/standards: Ethernet Cable ; Wifi


