Understanding the 7 Layers of the OSI Model

NicolasBrondinBernard

Author
@NicolasBrondinBernard

A simple, clear, and illustrated explanation of networking basics!

Article published on 09/09/2024, last updated on 10/08/2026

In this article, we're going to explore the concept of the 7 layers of the OSI model, a key concept for understanding how communication networks work.

What is the OSI model?

The OSI model (for "Open Systems Interconnection") is a conceptual model divided into seven layers that helps standardize network communications.

Each of these layers has a specific role in preparing and transmitting data from one machine to another.

Here is a visual representation of this model:

Frame 99.png

To make this more accessible, we'll use simple analogies throughout this episode, imagining the delivery of a package:

The 7 layers of the model

1. Physical Layer

Let's start with the physical layer, the foundation of the OSI model. It's thanks to this physical layer that two machines are connected in a network.

Here, "physical" is meant in the "physics-chemistry" sense, so to speak.

For example, the physical connection can be an ethernet cable, but it can also work through waves, such as with wi-fi or 4G/5G.

In our package delivery analogy, imagine that the physical layer is like the roads and highways on which delivery trucks travel.

2. Data Link Layer

Now let's move on to the data link layer. This layer defines the format of data on the network, which we call "frames".

It's also this layer that "decides" when a device can send data in order to avoid collisions.

Here it represents our delivery truck, which must be a certain size to pass through highway tolls, only when the barrier is open.

3. Network Layer

The role of the network layer is to find the best path to route data to its destination.

By using IP addresses, it directs each data packet through different networks until it reaches its final destination.

This is the equivalent of our package, with the delivery slip that contains the sender's address, and above all the destination address.

4. Transport Layer

For the transport layer, this is what defines our data transmission protocol, the two main ones being TCP and UDP.

A dedicated article on TCP is available here: https://code-garage.fr/blog/tcp-ip-how-it-works/

The protocol defines how the transmission will take place, and what should be done in case of a problem.

In short, TCP is like a delivery with acknowledgment of receipt, all packets must arrive intact and in order. Whereas UDP is a faster delivery, but without any guarantee of receiving your package, or your data.

5. Session Layer

In the network, the session layer manages the opening and closing of connections and the various ports.

It plays the role of the intercom.

Because when your package arrives at the bottom of the building that's good, but if your neighbor across the hall receives it, that's useless. So you need to be able to talk to the delivery person, and open the door for them (making sure they close it behind them to avoid drafts)

6. Presentation Layer

The presentation layer is the translator of the OSI model. It's responsible for checking that the data is usable, and this is also where data encryption/decryption takes place.

In plain terms, this is your role when you receive the package, you must accept the package by checking that it isn't damaged, and possibly present your ID card to show that this package is indeed intended for you.

7. Application Layer

Finally, the application layer is the one you use directly.

It provides the protocols needed for applications such as SMTP for email, FTP for file transfer, and HTTP for web browsing, etc...

This is the moment when you take out the contents of the package and can start using it!


Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet