Why your data is not secure in public WIFI?-The OSI Model
Tags: backendessentials, webdev, networking, osi
Published: 2021-05-21 07:08:57

# Backend Essentials-1 [The OSI Model]
***
### 1. Overview

> This article gives basic information of the OSI(Open Systems Interconnection) Model. OSI model is conceptual framework used to describe the functions of a networking system, it consists of 7 layers. It was published in 1984 and is still used today as a means to describe Network Architecture.


### 2. The 7 Layers of OSI Model

> To understand the layers of OSI model lets take an example of sending a simple get request to the server.
> #### Layer-7 Application:

> <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkbuukm73jc56rhelbhf.png" width="50"/>

> This layer contains bunch of strings like header, cookies..., prepared by the network application. It also receives stuff for application to process and display.

> #### Layer-6 Presentation 

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ldoq6o7r6b4u1sgt9jpq.png)

> If using HTTPS, this layer encrypts/decrypts the above data.

> #### Layer-5 Session

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojvtr8lqm2tggxu6aqil.png)

> Controls connection between different computers. Like for HTTP we require a TCP connection. Assigns a tag which is send with the data.

> #### Layer-4 Transport

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y9vhi5g5la7rgcx0a5bg.png)

> On receiving the data from above layers, this layer performs segmentation, i.e. breaks the data into smaller units attaches the target and source port(mostly auto generated by application). It also implements error control.

> #### Layer-3 Network

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5fiisso8psfpju48rbs.png)

> This layer handles the transmission of data. It doesnot checks for any error, its job is to just send the data to destination IP address.

> #### Layer-2 Data Link

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dk6eac8zbqcpvouplrmg.png)

> This layers performs node-to-node transmission. It devides data into frames and attaches the MAC address to the frames. It also performs error correction.

> #### Layer-1 Physical

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/746e9qfvp5cpdv1wh1us.png)

> This layer contains information in the form of "bits" and transmits individual bits from one node to another in from of electrical/light/wifi... signals.

> Now at receivers end data is processed from Layer-1 to Layer-7.

### 3. Why Public WIFI is Unsafe?

> ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/956qo2t5zhd14hl0itr7.png)

> Frames sent by the client connected to WIFI network goes to every user connected to that network, network card rejects the frames which are not meant to be received by it, but a hacker can design an application to receive all the frames which are coming and if the data is not encrypted(site is not having HTTPS connection for example) the hacker can read all the data. This method is known as "network sniffing".

### 4. Conclusion

> This was an overview of The OSI model in software engineering perspective.

***

<p> [1]: <a href="https://youtu.be/7IS7gigunyI">The OSI Model-Explained by Example[Hussein Nasser]</a></p>
<p> [2]: <a href="https://www.geeksforgeeks.org/layers-of-osi-model/">Layers of OSI Model</a></p>
<p> [3]: <a href="https://www.forcepoint.com/cyber-edu/osi-model">What is the OSI Model?</a></p>

***