The OSI Model Explained: What Really Happens When You Open a Website?
By Naveenkumar
Have you ever wondered what happens behind the scenes when you open Google, watch a YouTube video, or send a WhatsApp message?
You tap a button, wait a few seconds, and the information appears on your screen. It looks simple, right?
But there is a lot happening behind the scenes.
Your device needs to communicate with servers, send data across networks, identify destinations, and receive responses. Different networking technologies work together to make this communication possible.
This is where the OSI Model comes into the picture.
The OSI Model breaks network communication into seven layers. Instead of looking at networking as one complicated process, we can understand it step by step.
Let's explore these seven layers using simple explanations and real-world examples.
First, What Exactly Is the OSI Model?
OSI stands for Open Systems Interconnection. It is a conceptual reference model developed by the International Organization for Standardization (ISO) to help explain how devices communicate over a network.
Think of it like a delivery service. When you order something online, you place an order, the seller prepares the package, delivery services transport it, and finally you receive it.
Network communication also involves different stages, and each OSI layer represents a particular responsibility.
Here are the seven layers:
7. Application Layer – Layer 7
This is the layer closest to the user. It provides network-related services that application software can use, such as web access, email and file transfer.
What does it do?
- Provides network services to applications.
- Supports web browsing and email communication.
- Helps applications access network resources.
Examples / common technologies:
- HTTP – Used for web communication.
- HTTPS – Provides secure web communication using TLS.
- FTP – Used for file transfers.
- SMTP – Used for sending emails.
- DNS – Helps translate domain names into IP addresses.
Real-world example:
When you open YouTube, your browser uses application protocols to request pages and other resources from its servers.
6. Presentation Layer – Layer 6
This layer describes how data is represented so that the receiving system can interpret it. It is commonly associated with formatting, translation, compression and encryption.
What does it do?
- Data formatting and translation.
- Encryption and decryption in the OSI model.
- Compression and decompression.
Examples / common technologies:
- JPEG and PNG image formats.
- UTF-8 character encoding.
- Compression and encryption mechanisms.
Real-world example:
When you share an image, the receiving application needs to understand its format so it can display it correctly.
5. Session Layer – Layer 5
This layer describes the establishment, coordination, maintenance and termination of communication sessions between applications.
What does it do?
- Establishes and ends sessions.
- Helps manage ongoing communication.
- May provide synchronization or checkpoints.
Real-world example:
Think of an online meeting: participants need an ongoing communication session. The Session Layer is a conceptual way to discuss how such sessions are managed.
4. Transport Layer – Layer 4
This layer provides communication between applications running on different devices. It can split data into smaller units and use port numbers to deliver it to the correct application.
What does it do?
- Segments data for transport.
- Uses port numbers to identify applications.
- Can provide reliability, ordering, flow control and retransmission, depending on the protocol.
Examples / common technologies:
- TCP – Reliable, ordered byte-stream delivery.
- UDP – Connectionless datagram delivery without a guarantee of delivery or ordering.
Real-world example:
File downloads commonly use reliable transport. Real-time games or media applications may use UDP when low delay is important.
3. Network Layer – Layer 3
This layer handles logical addressing and forwarding between different networks. It helps packets travel from a source network toward a destination network.
What does it do?
- Uses logical addresses such as IP addresses.
- Routes and forwards packets between networks.
- Helps select paths toward destinations.
Examples / common technologies:
- IPv4 and IPv6.
- ICMP – Used for network control and diagnostic messages.
Real-world example:
When you send data to a server in another country, routers forward IP packets across interconnected networks toward the server's IP address.
2. Data Link Layer – Layer 2
This layer organizes data into frames and supports delivery across a single local network link.
What does it do?
- Creates and handles frames.
- Uses link-layer addresses, such as MAC addresses.
- Provides error detection and controls access to the medium, depending on the technology.
Examples / common technologies:
- Ethernet.
- Wi-Fi (IEEE 802.11).
- PPP.
Real-world example:
When your laptop sends traffic through a Wi-Fi router, the local wireless link carries frames between the laptop and the access point.
1. Physical Layer – Layer 1
This layer describes how raw bits (0s and 1s) are transmitted as signals over a medium.
What does it do?
- Transmits raw bits.
- Defines signal characteristics.
- Covers media, connectors and physical interfaces.
Examples / common technologies:
- Copper Ethernet cables.
- Fiber-optic cables.
- Radio signals used by wireless networks.
Real-world example:
When data travels over an Ethernet cable, electrical signaling carries the bits. Wi-Fi uses radio signals.
Quick Revision: Remember All Seven Layers
| Layer | Name | Main responsibility |
|---|---|---|
| 7 | Application | Network services for applications |
| 6 | Presentation | Data formatting and transformation |
| 5 | Session | Session management |
| 4 | Transport | End-to-end delivery |
| 3 | Network | IP addressing and routing |
| 2 | Data Link | Frames and MAC addressing |
| 1 | Physical | Transmission of bits |
A simple mnemonic:
All People Seem To Need Data Processing.
Now Comes the Interesting Part: How Do All Seven Layers Work Together?
Imagine opening your browser and entering https://www.google.com. You press Enter, and the homepage appears.
What happens between pressing Enter and seeing the page?
Step 1 – Application Layer
Your browser prepares an HTTP request to access the website. HTTPS protects this communication using TLS.
Step 2 – Presentation Layer
The OSI model describes data formatting and encryption at this layer. TLS provides encryption in modern HTTPS communication, although its real-world placement does not map exactly to the OSI Presentation Layer.
Step 3 – Session Layer
The OSI model uses this layer to describe how communication sessions are established and managed.
Step 4 – Transport Layer
HTTP/1.1 and HTTP/2 commonly use TCP. HTTPS over TCP commonly uses destination port 443. HTTP/3 is different: it uses QUIC over UDP.
Step 5 – Network Layer
IP addressing and routing help packets travel from your device toward the website's server.
Step 6 – Data Link Layer
Your device transfers frames across its local network link, such as the connection between your laptop and Wi-Fi router.
Step 7 – Physical Layer
Bits travel as signals through Wi-Fi radio waves, Ethernet cables or fiber-optic connections.
What happens next?
The server receives and processes the request, then sends a response back. Your browser receives the response and displays the website.
Key takeaway: Opening a website involves application communication, transport, IP routing, local-link delivery and physical signaling.
Why Should a Full Stack Developer Learn the OSI Model?
You might be wondering: "I'm learning MERN Stack. Why should I spend time understanding networking?"
As a developer, you will work with React applications communicating with backend APIs, Node.js and Express servers, HTTP requests and responses, HTTPS connections, IP addresses and ports.
Here is how networking knowledge helps:
- Application layer: Understand HTTP methods, status codes and API communication.
- Transport layer: Understand TCP versus UDP, ports and connection behaviour.
- Network layer: Understand IP addresses, routing and connectivity.
- Data Link and Physical layers: Understand local Wi-Fi, Ethernet and signal issues.
This foundation can help you understand how a browser communicates with a Node.js/Express API and where to begin investigating a connectivity problem.
Conclusion
At first, networking might look like a complicated process involving many devices, protocols and connections. But the OSI Model makes it easier to understand by dividing communication into seven layers.
Each layer has a specific responsibility, and together they help explain how data moves between devices. Although modern Internet protocols do not always map perfectly to the seven OSI layers, the model remains a useful learning and troubleshooting tool.
The next time you open a website, send a message or watch a video, remember that several networking processes are working behind the scenes.
Understanding these layers is one small step toward becoming a better software developer.
References and Further Reading
IBM – What Is the OSI Model?
https://www.ibm.com/think/topics/osi-modelCisco Press – Network Communication Models
https://www.ciscopress.com/articles/article.asp?p=3131360&seqNum=6Cloudflare – Network Layers
https://developers.cloudflare.com/fundamentals/reference/network-layers/Microsoft Learn – Windows Network Architecture and the OSI Model
https://learn.microsoft.com/en-us/windows-hardware/drivers/network/windows-network-architecture-and-the-osi-modelOracle – OSI Reference Model
https://docs.oracle.com/cd/E19120-01/open.solaris/819-3000/ipov-8/index.htmlIETF RFC 9114 – HTTP/3
https://www.rfc-editor.org/rfc/rfc9114IETF RFC 9000 – QUIC
https://www.rfc-editor.org/rfc/rfc9000
Thanks for reading! If this article helped you understand the OSI Model, share your thoughts or questions in the comments.

Top comments (0)