# OSI Model

## Importance of OSI Model as a Developer

As a developer, it is good to learn how things work under the hood. OSI model provides a way to think about the various components and protocols that make up the internet.

## What is OSI Model

Open Systems Interconnection (OSI) model is a framework for understanding how communication occurs across networks.

![OSI Model](https://cdn.hashnode.com/res/hashnode/image/upload/v1673969733750/a7f8704f-fcc1-4313-830a-5304bda58938.png align="center")

## OSI Model

![OSI model](https://cdn.hashnode.com/res/hashnode/image/upload/v1673970717287/2a663da5-e977-4bbb-ba15-97975be52bfe.png align="center")

OSI model is divided into seven layers. Every layer has a specific function.

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

### Physical Layer

Physical layer deal with the physical connections of the devices. Voltage level and bits (0 and 1) are transferred here.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673971988440/3f549929-e369-494c-a11e-66e901de8706.png align="center")

### Data Link Layer

Bits came from the physical layer organized into the frames. Headers (containing MAC address) are added in this layer. The Data Link Layer has two sub-layers.

1. MAC (Media Access Control) Layer
    
    It controls how to get access and permission to the data and transform data. It carries the physical address of each device in the header.
    
2. LLC (Logical Link Control) Layer
    
    LLC is responsible for error-checking and flow control mechanisms.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673974976086/58e13296-dbe2-4077-841f-79275174d547.png align="center")

### Network Layer

Routing data frames across different networks is the responsibility of the network layer. The most important protocol in the network layer is IP. Send the packets from network to network in this layer. Data in this layer is known as packets.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673975429165/c56e072e-6c53-470a-868a-8ff98d687bb6.png align="center")

### Transport Layer

The transport layer handles end-to-end communication between two nodes. In this layer, data are known as segments. TCP and UDP are the two common transport layer protocols.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673977016593/55162548-8268-4d8d-84f7-06adfd84e39b.jpeg align="center")

**TCP -** Transmission Control Protocol

TCP is reliable but it is slow. All the packets are error-free, with no loss in sequence and secure delivery.

UDP - User Datagram Protocol

UDP is unreliable but it is fast. It is not a secure, fast and connectionless protocol.

[![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673978702958/d2e8c85d-5b3e-490a-b53a-f3aadd875412.png align="center")](https://www.wowza.com/blog/udp-vs-tcp)

### Session Layer

Deals with establishing, maintaining, and terminating connections between applications.

### Presentation Layer

Deals with the format and meaning of the data being exchanged. The Presentation Layer converts these different data formats (images, video, etc.) into a readable format.

### Application Layer

Deals with the interface between the application and the network. Some of the **protocols** used in the Application Layer are **Telnet, FTP, SMTP, HTTP** etc.

## **Thanks for reading!**
