The Data Link Layer provides Data Link Control as a service to ensure reliable data transport over the physical media. In half-duplex transmission mode, for example, one device can only transmit data at a time. If both devices at the end of the link transmit data at the same time, they will collide, resulting in information loss. The data link layer ensures that the devices work together to avoid collisions.
Data Link Control and Media Access Control are the two major roles of the Data Link Layer. The design and technique of communication between two neighboring nodes (node-to-node communication) is the focus of data link control.
Another important feature of the Data Link layer is media access control, which governs how the link is shared.
Let’s start with Data Link Control in this tutorial, and then move on to Media Access Control in the next.
Table of Contents
Data Link Control Functions
The following functions are included in data link control:
- Framing
- Controlling the Flow and Errors
- Protocols that are implemented in software (that provides smooth and reliable transmission of frames between nodes.)
Framing
Data transmission in the Physical layer refers to moving bits from the source to the destination in the form of a signal. Synchronization is also provided by the Physical layer, which ensures that the sender and receiver use identical bit durations and timings. The data link layer packs the bits into the frames so that each frame can be distinguished from the others.
Framing in the data link layer separates a message from one source to a destination or from other messages to other destinations by simply adding a sender address and destination address; the destination address specifies where the packet must go, and the sender address assists the recipient in acknowledging receipt.
Frames are available in two sizes: fixed and changeable. The data can be simply divided up into recoverable chunks using frames, and these chunks can be quickly verified for corruption during transmission.
Issues with Framing
The following are some of the issues that have arisen as a result of the framing:
- Detecting the frame’s beginning
Every station must be able to detect a frame whenever one is broadcast. Any Station can detect the frame by looking for the Starting Frame Delimiter, which is a particular sequence of bits designated at the start of the frame (SFD). - Any station’s method for detecting a frame
Through the sequential circuit, every station in the network listens to the connection for the SFD pattern. The sequential circuit warns the station if an SFD is detected. The Station then examines the destination address before accepting or rejecting the frame. - Detecting the frame’s conclusion
It’s the point at which you should stop reading the frame.
Flow and Error Control
The Data Link Layer’s key tasks are flow control and error control. Let’s look at what these two terms mean. Flow and error control is handled at the data connection layer for node-to-node data delivery.
One of the fundamental responsibilities of the data link layer is to coordinate the amount of data that can be transferred before getting an acknowledgment from the receiver.
Flow control is a collection of rules that instructs the sender how much data they can send before they have to wait for a response from the receiver in most protocols.
Because every receiving device has a very limited speed at which it can process incoming data and a limited quantity of capacity to retain the incoming data, the data flow must not overwhelm the receiver.
Because the processing rate is slower than the transmission rate, each receiving device contains a block of memory known as a buffer that is used to temporarily hold incoming data until it is processed. In the event that the buffer fills up, the receiver must be able to instruct the sender to pause transmission until the receiver is able to receive again.
As a result of the flow control, the sender must wait for the receiver’s acknowledgment before continuing to send more data to the receiver.
Stop-and-wait and sliding window approaches are two common flow control techniques.
Both error detection and correction are included in Error Control. It primarily lets the receiver notify the sender of any broken or lost frames during transmission and then coordinates the sender’s resend of those frames.
In the data link layer, the word “error control” refers to the methods of error detection and retransmission.
Error control is typically done in a straightforward manner, in which specified frames are retransmitted whenever an error is detected during the exchange, a procedure known as Automatic Repeat Request (ARQ).
Protocols
Protocols are mostly implemented in software utilizing one of the most widely used programming languages. The majority of the time, the protocols can be classified based on where they are employed.
Protocols can be used for both noiseless (i.e. error-free) and noisy (i.e. noisy) channels (that is error-creating). The protocols for noiseless channels are mostly useless in practice and are only used as a foundation for the protocols for noisy channels.
For flow and error control, special frames termed acknowledgment (ACK) and negative acknowledgment (NAK) can both flow in opposing directions, although data can only travel in one direction.
However, in a real-world network, the data connection layer protocols are implemented as bidirectional, implying that data flows in both ways. Flow control and error control information, such as ACKs and NAKs, are incorporated in the data frames of these protocols, a method known as piggybacking.
Furthermore, bidirectional protocols are more difficult to implement than unidirectional protocols.