What is the OSI Model?
Computer networks is the one of the most crucial fields for us if we belongs to Software Development, Penetration Tester, network administrator, etc. This field deals with the interconnection of the computing devices (computers, printers, smart phones, etc.).
And in the computer networks one of the famous networking model is OSI model. OSI stands for the “Open System Interconnection” and this model was developed by International Standard Organization. So it is also known as ISO OSI model.
Now why is there need for such model? Let us take one example, suppose there are two CPU with two different brands. You purchase the CPU with the brand A which is providing its own list of protocols (Thinks it’s only the CPU in the world), and your friend purchase the CPU with the brand B which is providing us pretty different protocols.
Now suppose if you want to connect the two systems together how will you going to connect them. Well we can’t directly, the reason is both the brands are providing different protocols. You want to connect Ethernet cable to your friend’s computer and guess what, the computer is not accepting the Ethernet cable because the protocols are not same. Hence in order to prevent such a mess we need such standardize models.
There are seven principles in order to construct a model.
- The layer can be created only when there is need for different level of the abstraction.
- Each and every layer must provide the well-defined function.
- Every function in each layer must be internationally standardized protocol.
- The layers boundaries should be chosen to minimize the flow of information across the interfaces.
- Number of layers should be large enough so that the distinct function cannot be thrown together into the set of different functions.
Now let’s discuss about the OSI Model layer by layer.
There are total Seven Layers in the OSI Model, namely.
Layer 1 (Physical Layer):
This layer is responsible to transmit the raw bit into the communication channel. The raw bits are binary coded numbers which can be further sent via optical fibers or copper cables.
While sending the bits this layer make sure that bits are transferred into the correct order. As in the binary if the order of 1’s changed the value will be also changed and may further results in generating an error. If the medium is the optical fibers then 1 is implied if there is presence of the light, and 0 with absence of the light. While in the copper cables the 1 is denoted by high voltage and 0 with the low voltage.
Layer 2 (Data Link Layer):
The Data Link layer is more complex layer because it performs couple of functions. Data link layer will provide the abstraction for underlying hardware. It will receive the packets of data from the network layer and data link layer will convert those packets into the smaller sub packets known as “Frames”. This has to be done because we cannot send all the data continuously inside the transmission channel without making errors. The errors will be generated in both the ways but smaller the size of data easier to solve the errors. On the receiver’s end this frames are collected and assembles again. All the errors situated here are masked, so that transport layer. If the service is reliable then receiver will confirm the correct receipt of each frame by sending back the acknowledge frame.
Layer 3(Network Layer):
This layer is responsible for the packaging the data with correct sender and receiver IP address. Then this packets are passed into the Data Link Layer in the sender’s case. Protocols of this networks are also responsible to find the proper path to send the packet into the correct network. At this layers Internet Protocols (IP) are used. The layer is also capable for defining the subnet for the network.
Layer 4(Transport Layer):
The transport layer accept the data form the above layers and split into the smaller units. Afterward this data is passed into the Network layer to transmit it into the network and validate the response. This layer also determine what type of services to be presented to the session layers and ultimately to the users. Most commonly this layer provides the service error free pin to pin connection which will deliver the packets in the same order that was sent and received. There is another ways also to send the isolated messages in the unguaranteed way or broadcasting the message to the multiple spots.
Layer 5(Session Layer):
As the name suggest it provides the sessions for the users. The sessions can be for any function like “Token management” i.e. don’t allow two or more users to handle the same session at the same time, ”Cookies” i.e. store the user information in the specific way so that it can be monitories. And much more.
Layer 6(Presentation Layer):
This is the key layer for the developer as most of the abstraction takes place in this layer. This layer will check syntax and schematics of the data to be provided or transmitted. Some character encoding also takes places.
Layer 7(Application Layer)
Application Layer provides the varieties of the protocols so that user can interact with another computers may or may not be present on the same network. The most used protocols in this Layer is HTTP and HTTPS. These are used to send or request the data form the browser to the server.
Some tips to remember
Well now if you had read the full article, you gonna need some pills to digest such a heavy material. Well don’t worry I can provide some of the tips that you can follow to remember this model.
- It is harder to remember all the layers with their proper sequence, so phrasing the statement with the name of the layers will help you to remember it. Like 1. Please Do Not Throw Sausages and Pizza Away. (P -> D -> N-> T -> S -> P -> A). Or there is another one too if you want to remember in the reverse order. 2. All People Sleeping in The Networking Doesn’t Pass.
- The layers 1-4 all are used for the transferring data so here comes the subnets, IP address, TCP/UDP/SMTP, MAC address etc. And Layers 5,6,7 are fully focused on the application development including data structures, cryptography etc.
In the next blog or article I ll be covering each layers in depth so stay tuned !!.
Thanks for reading.