Computer Netwoking - OSI Model
Tags: devops, computerscience, codenewbie
Published: 2022-02-20 16:00:07

## **OSI - Open Systems Interconnection Model**

So, basically it tells us about how one computer communicate to another computer via Internet.
<a href= "https://youtu.be/vv4y_uOneC0"> Overview Of OSI Model </a>
<a href="https://youtu.be/IPvYjXCsTg8">For Deep dive into OSI Model</a>
**OSI Model contains 7 layers,**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3gdl89u59m147vj5d5v.jpg)
---

## 1. **Application Layer**

- Layer where user interact with it.

- Consist of application like Web  Browsers, Chat Applications,


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qarewggjwfq8ktse3j5q.png)

- A server is a computer or system that provides resources, data, services, or programs to other computers.

- so, the application has two sides: Client side & server side and they communicate through each other,

- Ping measures the round trip time for messages send from the originating host to destination computer & are echoed back,

```
ping google.com
```
Web protocols;
- TCP/IP:
  HTTP - Hyper text transfer protocol
  DHCP - Dynamic Host Control Protocol
  FTP - File transfer Protocol
  SMTP - Simple mail transfer Protocol
  POP3 & IMAC - used to receive Email
  SSH - Seceure Shell
  VNC - Virtual Networking Computing 

- Basically it provide services for network applications with help of protocols.

---

## 2. **Presentation Layer**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e2jgkw2swdkgg807kwry.png)

- Receive data from application layer,

-So, the data we receive is in either alphabet or digits,
first we convert that data into binary ,

- then presentation layer compress the data

-and then it encrypt that data by Secure Sockets Layer (SSL).

---


## 3. **Session Layer** 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8bjjw5shf0bs0pok08al.png)

- Helps is setting up & managing connection enabling sending & receiving data followed by sessions,

- Perform Authentication
- Perform Authorization
- Manage Sessions

---


## 4. **Transport Layer**

- Layer 4 is responsible for end-to-end communication between the two devices. 

_Consist of_ -
1.Segmentation 
2.Flow Control
3.Error Control

-__Segmentation__ this includes taking data from the session layer and breaking it up into chunks called segments before sending it to layer, 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/016qzsf1fyyz017auovc.jpg)

Sequence Number - Each block of data is identified with a sequence number. Helps to reassemble segments in correct order to make correct messages/ user input.

Port Number -A port is identified for each transport protocol and address combination by a 16-bit unsigned number, known as the port number.

-__Flow Control__ Control amount of Data being transmitted

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17l9vosjd7u73hydjo7m.jpg)

-__Error Control__  Error control is basically process in data link layer of detecting or identifying and re-transmitting data frames that might be lost or corrupted during transmission

-__Protocol of Transport Layer__   
01. UDP (User Datagram prortocol) - Data may or may not be delivered/ changed/ ordered,

02.TCP (Transmission Control Protocol)- 100% data transfer.

---


## 05. **Network Layer** 
- Work for transmission of data from one computer to another computer which is connected to another network.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ld2zuaaws3cw4lbw7129.jpg)
- 01. Logical Addressing - 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x208j8jhpsipsfd9nacl.jpg)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ufod2kx473051u4oi1ok.png)

---


## 06. **Data Link Layer** -

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rddrnibz3bgu8459ngrk.jpg)
- 01. Framing  a frame is a simple container for a single network packet

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mo4sxgnm5ty8r36re1gc.jpg)

02.Control how data is placed and received from media

---
## 07. **Physical Layer** 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lj80bdy3do6xb13dfoc5.png)
-Physical layer is the lowest layer of the OSI reference model. It is responsible for sending bits from one computer to another. This layer is not concerned with the meaning of the bits and deals with the setup of physical connection to the network and with transmission and reception of signals. 

---