OSI layer
We all study about OSI layer, its 7 layers and the protocols used in each layer, but I personally believe the theory of OSI layer does not give a real picture how exactly it work so my this blog will try to give you a picture of how OSI layer work.
As we know that OSI model work on the principal of encapsulation, it means when data is formatted processed and changed in one layer, other layer does not have matter of it.
For Ex. If data change at layer 3 layer 4 do not have to do anything.
When data transfer from one layer to other it adds its header similarly when data is received by receiver at each layer header get removed. we can understand this with below example. In the below table, we have given an example how header is getting removed at each layer at receiver side.
|
|
|
|
|
|
|
Data |
|
|
|
|
|
|
|
Layer 7 Header |
Data |
7 |
|
|
|
|
|
Layer 6 Header |
Layer 7 Header |
Data |
6 |
|
|
|
|
Layer 5 Header |
Layer 6 Header |
Layer 7 Header |
Data |
5 |
|
|
|
Layer 4 Header |
Layer 5 Header |
Layer 6 Header |
Layer 7 Header |
Data |
4 |
|
|
Layer 3 Header |
Layer 4 Header |
Layer 5 Header |
Layer 6 Header |
Layer 7 Header |
Data |
3 |
|
Layer 2 Header |
Layer 3 Header |
Layer 4 Header |
Layer 5 Header |
Layer 6 Header |
Layer 7 Header |
Data |
2 |
Layer 1 Header |
Layer 2 Header |
Layer 3 Header |
Layer 4 Header |
Layer 5 Header |
Layer 6 Header |
Layer 7 Header |
Data |
1 |
At Receiver side (Decapsulation)
Now we will see how data transfer work in OSI model with below example.
Step 1: At Sender side Encapsulation happened and we get
data with header 2, so we have data with Layer 2 Header.
Step 2: data reach at switch 1 it check layer 2 header,
now S1 find that data is looking for R Router so it send to Router R,
Here Switch (S1) check that data is looking for Router (R)
only so it remove header 2 (data link header) from the data so here de-encapsulation
happens.
Step 3: Now Switch (S1) has removed layer 2 header and
Router (R) checks for layer 3 header (Network layer). Layer 3 device has
information of receiver, so here Router again add”data link layer header” so
that it can be send it to network cable (Note: here encapsulation also happened
here so in the process of data transfer encapsulation and de-capsulation takes
place at many place).
Step 4: Now switch 2 (S2) get data it check layer 2 header
and find that data want to reach at
receiver.
Step 6: Now data reach at receiver and receiver check L2
header and after that all layer data removed one by one.
So data move across a network and each device looks at
specific header information to determine if the data belongs to itself or if it
should forward the data on to another device