If you are from an IT background it is obvious that you might have heard about the OSI model and its layers. The Open Systems Interconnection model or OSI model has been developed by International Organization for Standardization (ISO) in the year 1984. This is a reference model that describes the 7 layers that a computer uses to communicate with other devices over a network. Each of these layers has its own unique functions and they help us send our data from one system to another.
There are seven layers in the OSI model. Its details and functionalities are listed below.
Image https://osi-model.com
The physical layer is the lowest layer of the OSI model, and this is the layer that is responsible for the actual physical connection between devices. The data here is in the form of Bits. This layer transfers individual bits from one node to another.
Functions
Bit synchronization: It synchronizes the bits with the help of a clock
Bit rate control: Determine the transmission rate, ie, the number of bits sent per second
Physical topology: Determines the way in which devices are connected to form a network
Transmission mode: Determine the way in which data flows between two connected devices.
e.g. half-duplex, full-duplex
Devices that use Physical layer: Hub, Repeater, Modem, Ethernet cables, Bluetooth physical devices, etc.
This layer is responsible for the node-to-node delivery of messages. It makes sure that the data sent from one node to another is error-free. It also adds the MAC address to the data header.
Functions
1. Logical Link Control: Data is divided into logical groups called frames
2. Physical Addressing: It adds the MAC address to the header of each frame.
3. Error control: Controls errors during transmission.
4. Access control: Determine which device has control over the channel at a given time.
Devices that run on Data link layer: Switch, Bridge
Protocols of DLL: ARP, MPLS
It works for the transmission of data from one host to another located on another network. It also takes care of routing the packets from source to destination. The sender's and receiver's IP addresses are added to the header by the network layer. Data in this layer is called a packet.
Functions
Routing: Determines the suitable route from source to destination. It uses a routing table for this purpose. Packets will have source and destination IP addresses, this helps to route the traffic to the correct location.
Logical Addressing: Add the sender's and receiver's IP address to the header data to distinguish each device uniquely and universally.
Devices that run on Network layer: Router
Protocol of Network layer: ICMP, IPsec
Data in this layer is referred to as segments. It takes care of the end-to-end delivery of messages. It provides an acknowledgment capability for sent traffic so that messages can be retransmitted in case of failure.
Functions
Segmentation and Reassembly: Data is divided into segments. Each segment has a number and details of the source and destination port numbers.
Flow control: Control the amount of data transferred between devices so that no overflow of data happens.
Error control: A check sum is added to each segment to find the error. Checksums help to find and correct errors.
Service port Addressing: This adds a port address to each segment.
Protocols such as TCP and UDP work in this layer
Difference between TCP and UDP
Transmission Control Protocol (TCP) is a transport layer protocol. This protocol is connection-oriented and uses a 3-way handshake for communication.
Connection-oriented means that to transmit data, first a logical connection is made between the sender and receiver. Once the connection is established, data is transmitted. After data transmission is completed, the connection is closed.
3-Way handshake is the process TCP uses to establish the connection.
Setp1: client sent an SYN (synchronize sequence number) which tells the server that the client is likely to start communication.
Step 2: The server responds to the client with an SYN-ACK signal which is an acknowledgment bit.
Step 3: once the client receives the SYN-ACK, it then sent an ACK signal and they both establish a reliable connection and start sending the data.
User Datagram Protocol (UDP) is a connectionless protocol. Here a connection is not established in the beginning. Data is directly sent and received by the receiver. There is no guarantee that the data will reach the destination. This protocol does not care about the error happening during the data transfer. As it is connectionless, it is much faster than TCP.
Protocols of transport layer: TCP, UDP
This layer is responsible for establishing, maintaining, and terminating sessions.
Functions
Synchronization: It adds a synchronization point to data so that data can be resynchronized in case of an error.
Session establishment, maintenance, and termination: It allows 2 processes to establish, communicate, and terminate sessions.
Dialogue Controller: It allows the system to communicate either in half-duplex or full-duplex mode.
Authentication and Authorization: Help to authenticate and authorize.
Protocols of Sessions layer: ZIP, NetBIOS, RCP
This layer takes care of converting data from one form to another.
Functions
Translation: Translate data from one form to another. eg: ASCII to EBCDIC
Data Compression: It helps to Compress data.
Encryption and Decryption: Data encryption and decryption are done at this layer.
A protocol like SSL uses this layer for encryption.
Protocols of Presentation layer: RDA, VT, FTAM
This layer is used by applications like browsers, mail clients, etc.
Functions
Virtual terminals work in this layer
File transfer access and management, Mail services, and Directory services work in the application layer of the OSI model.
Protocol that works in the Application layer: HTTP, LDAP, NFS, SMB, etc
In the early stages of the internet, many hardware vendors used their standards for data communication and hardware making. This causes compatibility issues between different devices. So a standard model for communication across a network was required, and this paved the way for the OSI model. OSI model is not a physical model but it is a logical model which defines standards and functionalities divided into 7 layers. There are other models available like TCP/IP model but the OSI model is the most popular and widely refereed one.