Sitemap
codeburst

Bursts of code to power through your day. Web Development articles, tutorials, and news.

Learning the OSI Model

10 min readMar 18, 2018

--

Introduction

This is the continuation of the previous article in which we discussed the TCP/IP protocol suite. If you haven’t gone through my previous article, I would recommend you to have a look at it as I have already explained some basic terminologies in it that we will be discussing here again. Although, the whole post is a little long but I request you to read till the last. I can guarantee you will get to know so many in depth details just by reading this article. :)

In this article, we will try to get answers to the following questions:

  • What actually the OSI Model is ?
  • What is the need of OSI model ?
  • What constitutes OSI model? ( Hint: Some bunch of layers similar to that in TCP/IP)
  • Where we can see the practical implementation of this model ?

Let’s get started!

History

In the early days, when the network communication systems were in nascent stages, the architecture designers and engineers faced the frequently occurring issue of debugging where in the whole system, some error occurred. Further, it was a need to bring all the manufacturers of various hardware equipments to follow some references and benchmarks for manufacturing so as to standardize everything under the hood.

The OSI Model

The Open System Interconnection (OSI) is a reference model for how various applications communicate over any network.

Reference Model : A reference model is a conceptual model for understanding basic relationships between various basic elements.( Computer systems in terms of networking).

Need for this model

As already discussed in the introduction, the purpose behind this model was to provide developers, programmers, engineers, vendors and all the associated people a standard that can serve as a guide for them using which they would be able to create communication equipments and softwares inter operable.

Constituents of the OSI Model

The concept of the OSI model is pretty easy to understand. The process of communication between any two systems will involve flow of data between them. Both the systems must have some programs which can enable them to send and receive data properly.

To solve specific type of problems, the committee grouped similar type of problems together and divided the architecture of the model in layers which was minimized to seven layers. Different problems are solved by numerous protocols that have evolved with time. Let’s discuss all the seven layers one by one in the next section.

Layers of OSI Model

Seven Layers of the OSI Model

1. Application Layer

In simple words, this is the layer which enables the user to access the Internet. This user might be a human and might not be!
Guess what, it could be a bot, script or any other software.

The function of this layer is to provide:

  • User interfaces (UI)
  • Compatible support for various services such as Electronic mail, remote file transfer and access, shared database or any other type of distribution services.

2. Presentation Layer

This layer is concerned with the semantics and syntax of the information exchanged between the systems.

Some of the specific responsibilities of this layer are:

  • Encryption/Decryption of data: In simple words, encryption is the method of transforming the original message and sending it so as to ensure the privacy of data being transmitted. The decryption reverses the original process to transform the message back to its original form.
  • Compression: It is the reducing the number of bits contained in the information to be sent. This plays vital role in the transmission of information in form of audio, video, images, etc.
  • Translation: The information exchanged between two systems happens in form of bit streams (many bits at once), but since different computers use different encoding systems( ASCII, Unicode or may be some other), it is the responsibility of this layer to ensure interoperability between these different encoding methods.

3. Session Layer

As per Forouzan, the session layer is the network dialog controller, i.e. It establishes, maintains and synchronizes the interaction between communicating systems.

The responsibilities of this layer will make us understand about it’s existence.

  • Dialog Control: This layer allows two communicating systems to enter into a dialog. It allows the communication between two processes to take place in half duplex (one way at a time) or in full duplex mode ( both ways at a time).
Transmission Modes
  • Synchronization: This layer allows a process to add some checkpoints into a stream of data. Why so?

Consider a system sending a file of 100 pages with a checkpoint of say 10 pages. Thus after 10 pages being sent, the process will verify whether those 10 pages have been sent and received correctly or not.

If we wouldn’t have used checkpoint mechanism and some error would have arrived either while receiving or during transmission, it would be very hard to troubleshoot where the error occurred and the process would have to send all the 100 pages again. So, is the utility of using the checkpoints that if some error occurs during the transmission, the sender doesn’t have to send unnecessary frames again.

4. Transport Layer

The basic function of this layer is to accept data from session layer, split up in smaller chunks(referred to as segments), pass these segments to network layer while ensuring that all the pieces arrive correctly at the other end.

Get Vikas Yadav’s stories in your inbox

Join Medium for free to get updates from this writer.

Very Important Point: The transport layer is responsible for the process to process delivery of the entire message.

A process is an application program running on a system.

The transport layer ensures that the whole message arrives at the receiver intact and in order. This is not done by the network layer(discussed below) as it only oversees the source to destination delivery and the network layer doesn’t identify any relationship between the packets of same message.

Some other responsibilities of the transport layer are:

  • Service Point Addressing: There are two users (A and B) on different systems in a network running same program say Skype. Let us assume they are already added as contacts to each other. Now user A sends a message to user B. So, the task of transmitting the message from User A and delivering it to user B will involve all the layers in the protocol suite, but ensuring that the message from User A’s Skype comes on User B’s skype is ensured by the Transport Layer at both sides. Think of the consequences in terms of Security if Skype’s message appears on some other random process!
  • Flow Control: Both Transport layer and Data Link Layer (DLL) implements flow control mechanism. We will discuss this in detail in DLL. The only thing worth noting here is that flow control at this layer is performed end to end rather than across a single link.
  • Error Control: Again, both transport layer and DLL have error control mechanism. However, at this layer error control is performed end to end rather than across a single link.
    The transport layer on sender side ensures that the message arrives correctly on the transport layer on the other side.

What will happen if some error occurred in this process?
The answer is Retransmission. The error correction is usually done by this.

5. Network Layer

This layer is responsible for ensuring the source to destination delivery of a packet.

Is network layer needed always?
The answer is No.
If two systems are connected to the same link, there is usually no need for network layer. But, if two systems are attached to different networks with connecting devices between the networks, there is often a need for the network layer to accomplish packet delivery from the source to the destination.

Some of the responsibilities of the network layer are:

  • Logical Addressing: The logical addressing of nodes in the network is required to clearly identify among source, intermediate and destination nodes. This layer add in its headers, the logical addresses of the sender and the receiver before passing down to DLL.
  • Routing: It is the mechanism of identifying suitable routes for sending data packets in the fastest possible and efficient way. In a large network, the connecting devices route the packets to their final destination starting from the source destination following particular route.

6. Data Link Layer (DLL)

Data link is the means of connecting one location to another for the purpose of transmitting and receiving digital information. It can also refer to a set of electronics assemblies consisting of transmitter and receiver.

This layer makes the physical layer(discussed below) appear error-free to the upper layer. It provides end-to-end validity of the data being transmitted. It forms data frames from the packets of data received by the network layer and performs some operations and send those frames to the physical layer.
The other responsibilities of DLL are :

  • Flow Control: The DLL imposes a flow control mechanism, this is done so as to avoid the condition of receiver overwhelming at the receiver’s side. We can consider this in analogy of a traffic jam at receiver side.
    i.e. when the speed with which sender is transmitting the data is much higher than the speed with which the receiver is receiving the data.
  • Error control: The DLL provides mechanism to detect and retransmit damaged or lost frames. This is done by adding a trailer at the end of the frame.
  • Access Control: When two or more devices are connected to the same link, the DLL determines which device will have control over the link at any given time. This mechanism of providing control to some device is called as access control mechanism.

Extra Point: The DLL is further divided into two sub-layers:

  • Media Access Control (MAC) : This sublayer determines the physical addressing of the host systems.
    Have you ever heard of the word MAC address/ Physical Address/ Hardware address?
    Let me tell you that the Physical/Hardware address of your computer system is technically known as MAC address. This is the address which gives unique identity to your computer system. This address is nothing but a 48 bit number given to Network Interface Card(NIC) of your system.
  • Logical Link Control (LLC): This sublayer is responsible for frame synchronization, flow control and error checking mechanisms.

7. Physical Layer

We already discussed that the data flows in the network in form of bit stream. It is the responsibility of the physical layer to:

  • coordinate between all the functions required to carry a bit stream over a physical medium.
  • deal with the mechanical and electrical specifications of the interfaces and transmission media (cables, air, etc.)
  • define the functions and procedures that physical devices and interfaces have to perform for transmission to occur.

The physical layer is also concerned with :

  • Representations of bits : You might be wondering how bits ( 0 and 1) are actually sent from one place to another. Isn’t it?
    To transmit the data over some transmission medium, the data in the form of bits must be transformed into some other form.

Could you guess what it could be?
The answer is signals. These signals could be electrical or optical. Thus, this layer transforms bits into signals which in practicality travel over the transmission medium.

  • Physical Topology: It defines how devices are connected with each other to form a network. Have a look at some of the topologies in the following illustration. Every purple circle is a node(system) in the network.

    Note:
    In Ring topology, nodes are connected in the form of a ring. In Star, each node is connected via a central node. In Fully Connected, every node is connected to each other node, while line and bus have end points. If at any point in the system, the connection breaks, the Line and bus will stop working.
    Think what will happen when the central node in the Star topology stops working?
    Obviously, all the nodes won’t be able to communicate if the central node stops working. Thus, every topology has its own pros and cons.
Press enter or click to view image in full size
Various Networking Topologies
  • Synchronization of bits: The speed with which sender is sending the bits might not be the same as the speed with which receiver is receiving. Thus, they both need to be synchronized which is taken care by physical layer.
  • Transmission Mode: In simple words, the physical layer also defines the direction of transmission between two devices: simplex, half-duplex and full-duplex. The only thing to note is that in simplex mode, only one side could be the sender unlike the other two modes.

In this article, we discussed in detail about the OSI Model. Why it was created. What constitutes this model and what are the different layers and their functionalities.

To Sum Up: The OSI Model is said to be prescriptive model as opposite to the descriptive TCP/IP model. It was a reference model but heavily bloated and referred to as everything to everybody model. Being heavily complex, it was very difficult to implement its specifications completely and hence TCP/IP was brought in which was effective in practicality and the cost involved in designing TCP/IP protocol suite(which was inspired from OSI Model and incorporated many features and designs in it) was very less as compared to implementing the unrealistic OSI Model.
Thus, even today while using the TCP/IP suite, most of the implementation is somewhat similar to what we have discussed and surely gives us in depth details of basics of computer networking.

If you liked this article, please show your support by clapping and sharing it among other people.
If you would like to support my writing. You can help me out
here. It will keep me motivated to share more knowledge with people. :)
For any queries, reach out to me
@donvikas

✉️ Subscribe to CodeBurst’s once-weekly Email Blast, 🐦 Follow CodeBurst on Twitter, view 🗺️ The 2018 Web Developer Roadmap, and 🕸️ Learn Full Stack Web Development.

--

--