Data Link Layer in OSI Model
The Data Link Layer is the 2nd layer from the bottom to the top of the OSI model. Its job is to provide node-to-node delivery of data. The primary role of the data link layer is to check whether the data transmitted from one point to another node point on the physical layer is error-free or not. If any error occurs during data transmission, the data link layer will discard that data and resend the data. This layer is responsible for reliable and efficient communication between devices.
The data packet travels from the network layer to the data link layer. These data packets are further divided into frames, and the frame size is chosen based on the NIC (Network Interface Card) used in the system.
This layer sets a logical layer between two points. It helps to manage the traffic control of frames on the network by stopping the transmitted signal when the frame buffer is full. For the transmission of information, the data link layer uses devices such as switches, bridges, etc.
The data link layer is classified into two sub-layers, which are given below:
- Logical Link Control (LLC) or Data Link Control (DLC) Sublayer: LLC or DLC is the topmost layer of the data link layer. It deals with the communication between the lower layers and upper layers. This sublayer runs above the data link layer and provides flow control and error information. It is responsible for assigning the frame sequence number. It specifies the mechanism that can be used to address stations on a transmission medium and to control the data exchanged between the sender and the receiver.
- Media Access Control (MAC) Sublayer: The bottom sublayer of the Data Link Layer is the Media Access Control. It is also known as Medium Access Control. It provides multiplexing and flow control for the transmission media. The main responsibility of this sublayer is to encapsulate the frame, check for transmission errors, and then allow the frame to be forwarded to the upper layer. It determines who is permitted to access the media at any given time.
Functions of Data link layer:
- Hop to Hop or Node to Node delivery of data: The responsibility of the Data Link Layer (DLL) is to provide hop-to-hop delivery of data. The data link layer determines the node to which the data should be sent first, then the following node the data should be sent to, and so on, till the information arrives at the destination system.
- Framing: It is a process of encapsulating data packets obtained from the network layer into frames for transmission. Each frame consists of a header, a payload field, and a trailer. The header contains the frame start bits, the address of both the source and destination, the type of data, and quality control bits. The payload field contains the data packet. The trailer contains error detection bits, error correction bits, and frame stop bits.
- Physical addressing: The Data Link Layer attaches the physical addresses of the receiver and sender to the header of each frame. To send information from source to destination, you must know what we are sending and where we are sending it.
- Error control: During transmission, the frame can get corrupted by any cause. The error can be controlled in the data link layer in three phases of error control as follows:
- Error detection: The error in the data frame is detected with the help of error detection bits present in the frame trailer.
- Acknowledgment: After receiving the data frame, the receiver responds to inform the sender about the successful delivery of the data frame. This acknowledgment can be positive or negative. If the data frame is received successfully, it sends positive feedback to the sender; otherwise, it sends negative feedback to the sender.
- Retransmission: If the receiver successfully receives the data frame, the sender sends the next set of data frames, but if the data frame does not reach the receiver successfully, the sender must resend the data frames.
- Flow Control: The receiver should be able to receive the data frame at the same speed at which the sender is sending the data frame, i.e., both the sender and the receiver should work at the same speed. If the sender sends frames with high speed and the receiver receives frames with low speed, the sender will be overloaded, resulting in loss of data.
Data loss can be handled with the help of two mechanisms:
- Stop and wait: The sender should wait until the acknowledgment is received from the receiver for frame-1. The sender will wait for the response of the receiver, and then it will send the next data frame.
- Sliding Window: Here, instead of sending acknowledgment after each frame, the sender sends acknowledgment after some set of frames.
Protocols of Data link layer:
- Synchronous Data Link Protocol (SDLC): It is the first bit-oriented protocol and is widely used. It is a subset of the High-Level Data Link Protocol. IBM developed this protocol in 1975. It manages synchronous serially transmitted bits over a data link layer.
- High-Level Data Link Protocol (HDLC): It is a bit-oriented protocol for conveying data on point-to-multipoint and point-to-point links. The International Organization for Standardization (ISO) developed this protocol in 1979. It is based on Synchronous Data Link Protocol. It provides connectionless and connection-oriented services. It provides two transmission modes: Asynchronous Balanced Mode (ABM) and Normal Feedback Mode (NRM).
- Serial Line Internet Protocol (SLIP): It is a simple internet protocol through which the user is allowed to access the internet with the help of a computer modem. Rick Adams developed this protocol in 1984. It works with TCP/IP for communication over the router and serial port.
- Point to Point Protocol (PPP): It is a character-oriented or byte-oriented protocol. PPP is a WAN protocol that runs over an Internet link. It is used in broadband communication. It is used to transmit multiprotocol data between point-to-point devices. It provides transmission encryption, loop connection authentication, and compression of data.
- Network Control Protocol (NCP): This layer was implemented by ARPANET. It allows transferring data between two devices. It is a part of the point-to-point protocol. This network layer will carry the data packets from the origin to the goal.
- Link Control Protocol (LCP): This layer is also a component of the point-to-point protocol. It is mainly used for establishing and maintaining the link before sending data.
- Link Access Procedure (LAP): It is derived from the high-level data link protocol. It is used for framing and data transmission over point-to-point links. It has several Link Access Protocols, such as Multilink Procedure (MLP), Link Access Procedure for Modems (LAPM), Link Access Procedure for Half-Duplex (LAPX), and Link Access Procedure for Frame Relay (LAPF).
- In this article, you have studied the data link layer in the OSI model, which is the 2nd layer of the Open Systems Interconnection model, and the job of this layer is to transfer error-free data from one computer to another.
- You have understood that the Data Link Layer in the OSI model has two sublayers, which are the Media Access Control (MAC) sublayer and the Data Link Control (DLC) sublayer or Logical Link Control (LLC) sublayer.
- You have studied several functions and responsibilities of the data link layer, such as framing, hop-to-hop data delivery, physical addressing, flow control, and error control.
- You have studied various protocols of data link layer such as Point to Point Protocol (PPP), High-Level Data Link Protocol (HDLC), Link Control Protocol (LCP), Synchronous Data Link Protocol (SDLC), Network Control Protocol (NCP), Serial Line Interface Protocol (SLIP), and Link Access Procedure (LAP).