What is OSI Reference Model ? Explained

What is OSI Reference Model ? Explained

Open System Interconnection(OSI) is the abstract representation of how devices communicate with each other in the form of layers. OSI is not a protocol it's a model.

It was developed by The International Organisation for Standardization. The OSI reference has 7 layers. It tells how data Flow between the layers and reaches the end-user.

What is OSI Model?

In 1984 OSI model was approved as an international standard for communication which was developed by ISO. The word "open" means that any device on the internet can connect with each other if they follow the standards of the OSI model. Before OSI mode the well-known Reference Model was TCP/IP model which was developed by ARPANET. If you don't know the history of the Internet Check this Article History of Computer Networking.

Nowadays billions of devices have internet access and can communicate with each other. All the devices are of different brands different architecture, different processes, different specifications, yet they can communicate with each other using the OSI model. This is the use of this model it enables devices to communicate with each other without changing the internal hardware configurations. It tells that data flow over the network can be divided into 7 layers and each layer have their own protocols and rules which helps in data flow over the layers.

The 7 Layers of OSI Model

As we have talked there are seven layers in OSI lets see in detail about each layer starting with the Physical layer. In this article, we are taking the Bottom-up approach some may consider a top-down approach which is also valid but coming from the bottom makes life a lot easier. We shall see about the functionalities of each layer, the protocols which they use, and examples.

Physical Layer

This layer is all about actual data transmission in bits across the cables and fiber optics. It tells how bits are transferred over the wires and reach the other side, the physical topologies, line configurations, transmission mediums, etc. There are different types of topologies that we can use in a network they are Bus, Mesh, Star, Ring, etc. All have their own advantages and disadvantages. 

Here data can be transmitted in different forms Electrical signals, Lightwaves, etc. And also there are 2 different transmission mediums in the physical layer Guided and Unguided transmission medium. The transmission which has a dedicated medium is known as Guided transmission medium the popular examples of this are Fiber optics, Co-axial cables, Twisted copper pairs. The transmission which doesn't have a dedicated medium is unguided transmission the examples of this are Radio waves, Wireless Networks such as WiFi, and telephone communication.

Data Link Layer

This is one of the Important layers. The data link layer has multiple tasks to do. It also monitors the physical layer for reliable communication. The data unit in this layer is Frame. The main operations which are performed by the data link are Framing, Error Control, Flow control, Access Control. It provides point-to-point communication over the device. It can support Half or even Full duplex communication.

Framing is the process of dividing the data into parts which are known as frames when required because sometimes the intermediate nodes or transmission medium cant support large files so they need to be divided into smaller parts. Bit stuffing, Byte-stuffing, adding delimiters, are some ways framing is done In the data link layer. When the data is transmitted through the physical medium there might be noises and attenuations which can cause the data to be corrupted and causing errors in the data. So it's the responsibility of the data link layer to find these errors and detect them and correct them. Parity bits, Cyclic Redundancy Check, Checksum are some of the error detection algorithms and hamming code is used for both error detection and correction. Check out the codes on these algorithms here GuND0Wn151/Computer-Science.

Another main responsibility of the Data link layer is Medium access. In the data link layer devices are recognized based on MAC(Medium Access Control) address. When multiple devices are connected to the same shared network and if more than one device transmits data in the channel there might be a collision and the data may be corrupted. So this issue is also resolved by the data link layer. The strategies which this layer uses to avoid collisions are ALOHA, CSMA(Carrier Sense Multiple Acess ).CSMA is a popular strategy that is even used now in this device senses the channel whether there is some data being transmitted in it and then sends data. The sensing of data is only done near the device, not the entire Channel. A switch is an example of the network layer device

Network Layer

The Devices are identified based on the IP address. Every device which is connected to the internet has a different IP address. There are 2 representations of IP addresses IPv4 and IPv6. When the WWW and Internet were developed the number of devices connected to it are less so IPv4 was able to handle it But Now the numbers are increasing tremendously so we need to develop IPv6. IPv4 can handle up to 2^32 devices and IPv6 can handle 2^128 really a huge number.

The data unit of the Network layer is Packet. The data from the above layers are divided in the form of packets. and delivers to the end-host. There are 2 types of data transmission Circuit switching and Packet Switching. In-Circuit switching there is a predefined path set up between the devices and all data flow in that path hence there is reliability and less packet loss. In packet switching all the packets flow in different paths, there is a high chance of out-of-order packet delivery and packet loss. Packet switching is further divided into Datagram and Virtual Circuit. The Task of the Network layer is Proper Routing of the packets and Finding Optimal paths. A router is an example of a Network layer device.

Transport Layer

 This is the 4th layer in the model. It is known as the True End to End layer. Data come in the stream to transport layer, so it divides the data into fragments and sent fragments one by one. The transport layer is responsible for sending segments of data from 1 device to other devices. The transport layer decides which data is to be sent/open from which port. The services provided by the Transport layer are Addressing, Flow Control, Congestion Control, Multiplexing, Reliable delivery, and End to End Delivery. Flow control is the same as the data link layer it checks if the speed at which the sender sends data and the receiver receives data are both acceptable or else it takes necessary actions. It is known as End to End connection but it's the responsibility of the data link layer to make this connection. 

Congestion control is when many packets arrive at the router and the router cant manage the traffic in the same way as road traffic. The protocols in the transport layer are TCP(transmission control protocol) and UPD(User Datagram Protocol). TCP is connection-oriented(Connection is established before sending data) whereas UDP is a connection-less protocol(Sends data directly to other end and doesn't check if it is ready to receive or not). TCP is highly reliable but slow where UDP is not reliable and fast, TCP takes acknowledgment and retransmits data if needed but UDP neither takes acknowledgment nor retransmits data. UDP is used when data transfer is more important than reliable data transfer TCP is used for reliable and accurate data transfer.

Session Layer

The session layer handles and maintains the session between the two devices. Its the responsibility of this layer to establish manage and terminate the session. It can provide both full and half-duplex communication. In Full-duplex communication, both users can send data simultaneously but in half-duplex both users can send data but not at the same time. It also ensures the session is undisturbed and any interference in the session and restores it in the time of failures. The session layer is not present in the TCP/IP model the transport layer is responsible instead of this.

Presentation Layer

The Interaction which we do in the application needs to be converted in network format so it can be transmitted across the network. Its the responsibility of the presentation layer to convert data from the application layer and send it to the transport layer. We use different languages to write an application and from the transport layer, we get different types of data. this layer sends data from the transport layer to the required application. The data which it translates needs to be understandable by other layers. Another main responsibility of this layer is Data Encryption if needed. Some applications need to encrypt their data before sending it for secure transmission.

Application Layer

This is the layer in which the user interacts with all the applications and programs which we use comes under this layer. It's the interface between Network and User. The application layer takes information from the user interaction and sends it to the presentation for the next steps. Some of the important protocols at this layer are HTTP, SMTP, DNS, FTP, TELNET, etc.

HTTP(HyperText Transfer Protocol) is the most popular and most important protocol. It is the protocol which makes you read this article HTTP works in form of some calls which are GET POST DEL HEAD PUT etc. There will be an HTTP server that has the information and resources about the website when a client wants the information a GET request will be sent to the server and the required information will be sent to the client. In the same way, we can POST data also.
SMTP(Simple Mail Management Protocol) is used to send E-Mails. This was a very popular protocol in the olden days when E-mail was introduced. When a user wants to send data user agent takes the information and sends it to the mail transfer agent and the data will be sent across the internet to the other user's mail transfer agent then to the user agent and to use it finally.

DNS(Domain Name System) is the way a computer gets the IP address of the website by URL. We should know the IP address of the destination to send data but remembering the addresses of all the websites is a hard task. So whenever we type the name of one website the request is sent to DNS resolver and it uses UDP protocol. Then the server searches for the IP address of the website if the site is not present in the cache is sends requests to other zones this can be performed in two ways Recursive and Iterative way.
FTP(File Transfer Protocol) and TELNET(Terminal Over A Network) Are used to transfer files over the network TELNET is used for remote login onto a device

Popular Ports and Protocol :

  • HTTP: 80, TCP
  • FTP: 20 for connection and 21 for data transfer, TCP
  • SMTP: 25, TCP
  • TELNET: 23, TCP
  • SSH: 22, TCP
  • DNS: 53, UDP
  • SNMP: 161, UDP
Don't Forgot to comment about the article in the comment section

Post a Comment

Previous Post Next Post