OSI stands for “open system interconnection”. This model is developed by ISO ( International organisation of standardization. OSI model basically divides the data communication in the form of seven layers. From sender to receiver every task is performed by these layers.
Let’s try to understand the concept of OSI model with one simple example. We perform many daily life tasks in the form of layers. For example easypaisa service is very common in Pakistan we send and receive money through this service. We perform this task in three layers. (See Fig-1)
Fig-1: Task in layer
This task is always performed in the same order. Similarly data communication between every type of computer network system is done in the form of layers. Each layer has its own jurisdiction to handle the data.
OSI Model Layers
The seven layers of OSI model are given below. They are separate but closely related to each other.(See fig-2)
Fig-2: OSI Model Layers
Are you thinking why i wrote in descending order? It doesn’t matter whether you put the physical layer at the top and application at the bottom but their numbers must be same as given in the above figure. Writing in descending order is easy to understand the overall concept of layers step by step. Because the data communication actually starts from the sender and receiver is the last terminal.
How to remember the sequence?
It’s necessary to remember the layers in sequence. If you break it you can’t understand the OSI model. Because each layer has its specific functionality and it must come before or after a particular layer.
Fig-2: Tip to remember OSI Model Layers in Sequence
Functions of OSI Model Layers
7. Application Layer
Application layer in OSI model provides an interface to human or software to access the network services. Such as email service, cloud data service, file transfer services and other types of distributed services
Basically the user becomes a virtual terminal of a network. The user can login to the host system and use its services. The host computer talk with the software installed in your device and considers it as one of its terminal. For example the application software of gmail in your mobile phone login to host server of Google to access your emails. The Google host take is as one of its end terminal.
Similarly you can access data and transfer data to you Google drive. The host computer allows you to control and manage data into your drive remotely.
Some Application Layer Protocols
6. Presentation Layer
Presentation layer in OSI model is mainly responsible for encryption, data compression and translation process.
Every data communication system must be secure otherwise people will reject it to use. Encryption techniques ensures the data security. It converts the data from one format to another before transmitting. On the other side receiver applies decryption to retrieve data.
In order to save channel capacity compression techniques must be applied before data is sent. Compression is particularly important if data is in the form of text, picture, audio or video.
Similarly there are many types of networking devices with different type of encoding techniques. This layer translates their encoded data into common format and then it is transmitted. Receiver again convert common format into receiver’s device dependent format.
For example your windows phones or laptops would have different encoding method. This data is converted into common format by presentation layer and then transmitted. The other device might be running Android OS or MAC OS, so the presentation layer at the receiver again converts the common format into receiver dependent format.
Some Presentation Layer Protocols
5. Session Layer
Session layer in OSI model is responsible for making, managing and terminating a data exchanged session between the two nodes.
For example you make a phone call to your friend then you exchange the data. When you are done. You finally terminate the call session.
This layer basically create a dialogue session between the two nodes. In this dialogue session these nodes can exchange data in either simplex, half duplex or full duplex mode.
In addition to this, this layer allows to add checkpoints during the exchange of data sessions. For example you want to send 100 packets, this layer will verify the successful delivery of packets after every 20 packets by getting an acknowledgement from the receiver. If there is some error in the packet number 45, then only packets from 41 to 45 are resent instead of sending all the packets before 41.
Some Session Layer Protocols
Apple talk, PAP, SMPP, RPC
Often the computers and other smart devices run several programs at the same time which is also known as multitasking. Each individual program is known as a process. Transport layer in OSI model is responsible for delivery of PDU (Protocol Data Unit) between the correct processes from one node to another node. It also makes sure that all the PDUs has been sent/received in the correct sequence.
PDU at transport layer is called segment. Each segment has a sequence number. This sequence number help transport layer to arrange the segments in the correct order even the segments are received without any order. Due to this sequence number it is always easy to identify the segments with errors. So you can replace faulty segments with correct ones.
At the transport layer there are two types of connections
- Connection-less: In this type of connection every segment is considered an individual and it is sent to correct destination.
- Connection-oriented: In connection oriented transmission the transport layer of the sender makes a connection with the transport layer of the receiver. After sending the data the connection is terminated.
Some Transport Layer Protocols
UDP, TCP, DCCP
3. Network Layer
Network layer in OSI model is responsible for the delivery of packets between the sender and receiver. PDU in network layer is known as packet. Packet can consist of several segments.
Usually network layer is present when you are communicating between the two networks. Within the same network this layer is often not used.
Fig-3: Network Layer Function
Fig-3 illustrates the working of network layer. PC1 wants to send information to PC2. PC2 is on another network. PC1 sends information to RouterA. RouterA uses its routing table to make a final decision. RouterA sends information packet to RouterB and finally network layer of RouterB forwards information packet to the network layer of PC2. Network layer adds header information containing the address of destination. This is basically a logical address of device in the network which is commonly known as IP address.
Some Network Layer Protocols
IPX, IPV4,IPV6, RIP
2. Data Link Layer
Data link layer in OSI model is responsible for the movement of packets received from network layer. PDU in the data link layer is called a frame. One frame can consists of many packets.
Some of the major functions of the data link layer are
- It optimises the flow of data. For example if receivers packet can receive 100 packets per second but the sender’s device can send 300 packets in one second. It automatically controls the flow of data so the receiver will not be overburdened.
- It also make a mechanism to point out damaged and lost frames
- It also specifies which device or devices has control over the link.
Some Data Link Layer Protocols
Frame relay, IEEE 802.11, FDDI
1. Physical Layer
Physical layer in OSI model is responsible for transmission of bits. It converts the bits in the form of signals.
Some of the responsibilities are given below
- It defines the characteristics and type of transmission medium
- It defines the type of encoding. In simple words which type must be used to convert the bits (0s and 1s) in electrical,radio or optical signals.
- It defines the network topology, physical connection configuration and transmission mode.
Some Physical Layer Protocols
DSL, USB, ISDN, Ethernet
Some Common Questions and Their Answers
Difference between OSI model and TCP/IP?
- OSI model has seven layers whereas TCP/IP has four layers
- TCP/IP is less complicated as compared to OSI model
- TCP model is the backbone of today’s internet whereas OSI is obsolete
- The session and presentation layers of OSI are merged in one layer of TCP/IP i.e application
- Some layers of OSI model are not fully defined whereas all layers of TCP/IP are fully defined
Where OSI model is used?
The main purpose of OSI is to provide a guideline to vendors and researchers in the filed of networking and communication. It basically divides the work in layers so each layer can be treated independently. In addition to this it provides a relationship between various tasks in a data communication system
How OSI model works in real world?
For example you want to call someone on Skype. Then OSI model will work as follows
- Application layer will provide a user interface (UI) to dial the skype ID/Number.
- The presentation layer will encrypt and compress your data.
- The session layer will be responsible to provide a session between you and receiver where you can transfer your data to each other.
- The transport layer will assign a port and control the data flow.
- The network layer will provide IP addresses of the source and destination to each segment. Now the segment has converted into a packet.
- In the data link layer packets are converted to frames and MAC address of each device is assigned
- The physical layer sends the data through physical medium
Why OSI model was developed?
The OSI model was developed to separate each and every task of data communication system. i.e from application to the medium. This idea was very helpful for research and especially for troubleshooting. Because it exactly tells you where (in what layer) the problem persists.