How OSI layer Works




OSI Layer:- Easy to remember.....

Please          Physical Layer
Do               Data Link Layer
Not              Network Layer
Take            Transport Layer
Sales            Session Layer
Person         Presentation Layer
Advice         Application Layer

Let us compare the OSI layer with an example, suppose a Manager of an office, wants to invite his friend to a dinner, who is working in a different office sharing the same Rank:

User
Boss
Decides to send a parcel to his friend
Application
Application used
He posts a letter, and informs his PA about it.
Presentation
Personal assistant (PA)
PA says, “Ok Sir! I will forward this parcelif needed I will do the job of translation and encryption and passes the message to Legal Adviser!"
Session
Legal Advisor
On getting the parcel, he checks it, and decides whether it is wise to send it and checks if their office is in good terms with the different office; and then he passes the message Mail Manager
Transport
Mail Manager
He gets the parcel, and then he thinks that “Oh My God! Such a big parcel, let me break the parcel and make segments(chunks) of it ”, he further numbers the chunks so that it can be combined to make the parcel by the receiving party. Next he contacts the Mail manager of the receiving office, and says, “hey I will be sending  your office some segments, please let me know when you receive the segments” and then passes the segments to Mail Room.
Network
Mail Room
When the Mail Room receives the segments, people working there, adds From and To address to each segments, and now the segments are known as packets. And now these packets are handed to Mail Service Department.(Mail Room is more concerned about the location address of the receiving party, but not the exact address, which is the house number)
Data Link
Mail Service
When the Mail Service Department, receives the packets it adds the physical address of the office, which is the house number, and then makes a check of the packets for any mismatch or loss by the above layers. Then places the result on the packets, and now what we have is a Frame. Again the Frame has to have some kind of medium so that it can reach the receiving party. It decides the medium and then hands over to the decided medium.
Physical
Medium
The Frames are converted to BITS, before it was handed to the medium. Now medium, which can be a Van, Train, Cargo, Airplane, etc..takes it, and starts for the receiving party.

Application Layer (Layer 7)


Now, there must be a Driver driving the medium, let’s say a cargo van, the medium doesn’t know without the driver where to go. Here Driver acts as a Router, and he makes decision based to network layer address (Layer 3), and drives to the exact location (Routes to the correct network).

But again the driver doesn’t care about the exact house number, he delivers it to door of the location (network) and his job is done. Now they are picked up by the guard, and takes it to the Data Link (Mail service Department), what he receives is a Frame, they verifies and replies  “Oh yes! These are for us! Thank you!” They then removes the physical address header from the packets and passes it to the Mail Room, they verifies and replies “Ohh! Yes, these packets are meant for us. Thank You”, they removes the Logical Address (To and From Address) and now we have segments, which are handed to Mail Manager, he combines the segments based on the numbering and labeling done by the sending Mail Manager, and Acknowledges the Sending Mail Manager “Hey, I just received all the segments. Thank You!” now after combining the segments what we have is the parcel and it is handed to Legal Advisor (Session Layer), he checks and decides “Umm!! So it seems this parcel is for our boss, well I will process the parcel as we are in a good relation with the sender, it will not contain any harmful materials”, he then hands it to the Personal Assistant, and says “This message is for our Boss, please see that before you transfer you do your job of Translation or Decryption is Required”, PA then checks if there is anything to Translate or Decrypt and then hands it to Application Layer, now the Application layer reads the letter for the Boss..

”Hi Mr. Vishal,
It has been a long time that we have met each other, let us meet for a dinner party..Blah blah blah!!”

So wasn’t that easy?? Huh!! That really was..Believe me it will really help you to correlate when I actually describe the functions in terms of Data Transfer in a network following the OSI Layer.

When a Data is transferred by a User from one host to a different host, the first layer who provides the service is the Application layer.

Application Layer provides the application service to the user to communicate. These services may be like a web browser application, or an email application, or a messenger application, etc. So, the applications which are meant for communication and data transfer purpose, provides service here.

 This layer will actually work and provide service if you have a valid internet connection. Now what does that mean, right?? Well, application such as a Web browser can be used to open up any HTML that is saved on a host computer, but can you communicate with any other host, if you don’t have an internet connection or if you are not in any kind of network?? No. So, in order to communicate one has to be in a network, so that the application layer can provide the service.

So to keep it simple, Application Layer provides service to a User to communicate, with application software like Email Client, Web Browser, FTP, etc.

When a User inputs some kind of data in the Application layer, it will pass the data streams to the next layer which is the Presentation Layer.


For example:

A User on Host A is sending an Email to a different host.

So, the User will open up any application software through which he can send email, here let us suppose Microsoft Office Outlook.

Where he types in his email and provides the destination host email address, and clicks on send.
This layer will check if there is any valid internet connection, if yes, it will start sending the mail, so its job of providing the interface to the User for typing in the mail and checking for a valid connection is done. Now it will pass the Data (Mail) to the next layer which is the Presentation Layer.

User

Application Layer
Web Browser, Email Clients

Presentation Layer (Layer 6)


In a Data Transfer process, after the Application Layer has done its done job of providing the application service, the data is then handed to the next layer which is known as the Presentation Layer.


What does it do?? Well, as the name suggests “Presentation”, it has something to do with the presentation of the data that came from the upper layer “Application Layer”.


Presentation Layer helps in presenting the data in correct format, it provides service of encryption, decryption, compression, decompression, capsulation, etc.


From the sending host side:

When a data is received by the presentation layer, it formats the data in correct format, so that it helps the layers below to help in the data transfer process. It also compress the data, to make the data size smaller so that the data is transferred easily (no one would like to carry a big packet with him for delivery), and provides encryption so that when a data is transferred, the layers below should not be able to see what the actual content is.


From the receiving host side:

When a data is received by the presentation layer, it just does the opposite of whatever services was provided by the presentation layer by the sending host to unpack the content for the application layer.
If compression was done, here it will be decompression.
If encryption was done, here it will be decryption, and so on..

From the sender side, after Presentation Layer has done its job, it will then hand the formatted data to the next layer which is the Session Layer.


User
Service
Application Layer
Web Browser, Email Clients
Presentation Layer
Formats data, compression, encryption, etc
Special thnxs to Sky.





Share your views...

0 Respones to "How OSI layer Works"

Post a Comment

 

WhoIsAmoungUS

Trace

Copy Restrict

About Me

Scroll Button

Popular Posts

Counter

© 2014 Hacking-The Art of Exploitation All Rights Reserved Vishal S Sangwa A Ethical Hacker White Hat Hacker