a bundle of optical fibers
Fri Nov 04

The OSI Model Layers Explained

Understanding OSI model layers will be helpful if you want to learn about networking. The purpose of networking is simple, establishing connections between two or many hosts so they can communicate with each other.

Just like we use English to communicate, we have to follow a set of rules like grammar , pronunciation and so on. This is quite similar in networking where the hosts need some set of rules to communicate known as protocols. In fact, there are so many protocols with their own specific function. OSI Model Layers is then introduced trying to explain how these protocols interact with each other on 7 different abstraction layers.

What is OSI Model Layers?

OSI (Open Systems Interconnection) Model Layer is an abstract protocol, explaining how the data in a network flows. OSI model consists of 7 layers including (sorted from layer 1 to 7)

  1. Physical
  2. Data Link
  3. Network
  4. Transport
  5. Session
  6. Presentation
  7. Application

To make things easier, you can use simple mnemonic. For me, I prefer this one.

From Layer 1 to Layer 7

“Please Do Not Throw Sausage Pizza Away”

From Layer 7 to Layer 1

“All People Should Try New Dr. Pepper”

OSI Model Data Flows

You can see how the data flows.

Client SideFormServer Side
Application⇓Data

Application⇑
Presentation⇓| Presentation⇑
Session⇓| Session⇑
Transport⇓| TCP Segment / UDP Datagaram| TCP/UDP Header| Data
---|---
Transport⇑
Network⇓| IP Datagram| IP Header| TCP / UDP Header| Data
---|---|---
Network⇑
Data Link⇓| Frame| Frame Header| IP Header| TCP / UDP Header| Data| FCS
---|---|---|---|---
Data Link⇑
Physical⇓| Bits| 1| 0| 0| 1| 0| 0| 1| 1
---|---|---|---|---|---|---|---
Physical⇑
⇒| Signal⇒ ⇒ ⇒ ⇒ ⇒ ⇒ | ⇒

7 Layers of OSI Model

Layer 7 - Application

By accessing this website, you basically ask my web server to serve you with the page you have requested. How do you do it? You can simply type on your web browser or by using a search engine like Google . But how does my web server know that you are asking for it? In fact, both client and server use a particular protocol called HTTP. By using HTTP, you send a GET object message to the server, so the server knows what to respond to.

As you can see now, the application layer provides you with a user-interface (web browser) where the user to machine interaction occurs. You might already know that within the application layers, there are also some other protocols like POP3, SMTP, FTP with its own various purposes. This is where the actual data is generated.

Layer 6 - Presentation

On this layer, the data generated from layer 7 is translated into a readable and understandable manner that the lower layer could comprehend. Data conversion, encryption, and compression all took place here. You’ve probably heard of TLS (Transport Layer Security), which is a cryptographic protocol used to encrypt data transmission over a higher layer protocol like HTTP. The TLS is one of the protocol example

Layer 5 - Session

Session is when the connection is established, managing it until it is terminated between the sender and recipient. Think of it like doing a video call where both parties need to be in the same session to be able to communicate. Session is responsible for keeping the communication open.

One of the protocols within this layer is L2TP. Despite its name, L2TP (Layer 2 Tunnel Protocol) is on layer 5 on the OSI model. The entire packet of L2TP is sent using UDP (User Datagram Protocol) datagram. You can learn more about it here.

Layer 4 - Transport

On this layer, the data will be disassembled into smaller chunks. The data is then attached with a header consisting of some additional information like source port, destination port, checksum, and sequence number. This packet is what will be sent over TCP or UDP. On the receiver side, the packet is reassembled to obtain the actual transferred data using the sequence number. If the transport data used is TCP, the packet is then called TCP segment. If the transport data used is UDP, the packet is then called UDP datagram.

Layer 3 - Network

At this point, IP protocol is the main protocol.The TCP/UDP packet is attached to address information including sender IP address and receiver IP address. Just like sending a packet to your home address, the sender needs to know your home address as well. The unit of communication on this layer is called IP datagram.

More header is added on this layer such as source and destination MAC address (frame header) and FCS (trailer). Why does it need a MAC address? Think of it like a serial number for your mobile phone. Each device has its own unique serial number, right? The MAC address is also a unique identifier embedded directly to your Network Interface Card (NIC). Because of this, the MAC address is referred to as a physical address, as opposed to an IP address, which is referred to as a logical address. The whole packet on this layer is called an ethernet frame. The NIC is responsible for creating the frame on the sender side as well as breaking it down on the receiver side.

Layer 1- Physical

The frames from the data link are generated and encoded into a series of signals (bits) on the physical layer. These signals are transmitted using any medium, such as electricity (copper cable), light waves (fiber optics), or radio waves.

Conclusion

Networking is the process of establishing connections between computers or devices so they can communicate with each other. To facilitate this communication, we need protocols that define the rules and formats of data exchange. In this article, we have learned about the OSI model, a conceptual framework that describes how different protocols interact with each other on seven layers: physical, data link, network, transport, session, presentation, and application. Each layer has a specific function and responsibility in the data flow, from encoding and transmitting signals to providing user interfaces and services. By understanding the OSI model, we can gain a better insight into the complex and dynamic nature of networking.