Data Link Controls in Computer Network

We offer you a brighter future with FREE online courses - Start Now!!

The Data Link Layer provides Data Link Control to ensure reliable data flow across the physical media. In the half-duplex transmission mode, for example, only one device can communicate data at a time. If both devices at the ends of the connections broadcast data at the same time, they will collide, resulting in data loss. The data link layer coordinates the devices so that there are no collisions.

Functions of Data Link Layer (Controls):

1. Line Discipline:

Line Discipline is a Data Link Layer feature that enables coordination across link systems. It regulates which devices may transfer data and when they can do so.

There are two ways to achieve Line Discipline:

a. ENQ/ACK:

When there is no incorrect receiver accessible on the link and a dedicated path between the two devices, ENQ/ACK stands for Enquiry/Acknowledgement and is used to ensure that the device capable of receiving the communication is the intended one.

ENQ/ACK specifies which device will initiate and start the transmission and whether or not the recipient is ready to receive the data.

Working of ENQ/ACK:

The transmitter sends a frame known as an Enquiry (ENQ) to the receiver, inquiring whether or not the receiver is ready to receive the data.

The receiver responds either positively (ACK) or negatively (NACK), where positive acknowledgement indicates that the receiver is ready to receive the transmission and negative acknowledgement indicates that the receiver is unable to take the message.

Response of the Receiver:

If the ENQ answer is positive, the sender will transfer its data, and once all of its data has been delivered, the device will terminate its transmission with an EOT (END-of-Transmission) frame.

If the ENQ answer is negative, the sender disconnects and resumes the transmission at a later time.

If neither a negative nor a positive answer is received, the sender thinks that the ENQ frame was lost during transmission and makes three tries to establish a link before giving up.

response of the receiver

b. Poll/Select:

The Poll/Select technique of line discipline is applicable to topologies in which one device is designated as the primary station and the others as secondary stations.

Working of Poll/Select:

The major device and many secondary devices are connected by a single transmission line in this case, and all exchanges are conducted through the primary device even though the destination is a secondary device.

The primary device controls the communication link, while the secondary device obeys the first device’s commands.

The principal device controls which devices are permitted to utilise the communication channel. As a result, we may claim that it is the session’s initiator.

If the primary device wishes to receive data from the secondary device, it polls the secondary device to see if it has anything to send.

If the main device wishes to transmit data to the secondary device, it instructs the target secondary to prepare to accept the data; this is known as choosing.

Select:

When the primary device has anything to send, the choose mode is employed.

When the main device wishes to transfer data, it notifies the secondary device by delivering a Select (SEL) frame, one field of which contains the address of the targeted secondary device.

When the secondary device gets the SEL frame, it sends an acknowledgement indicating that the secondary is ready.

If the secondary device is ready to receive the data, the primary device sends two or more data frames to the specified secondary device. When the data is transferred, the secondary sends an acknowledgment indicating that it has been received.

working of select

Poll:

When the primary device wishes to receive data from the secondary device, it uses the Poll mode.

When a primary device wishes to receive data, it queries each device to see whether it has anything to send.

To begin, the primary requests (polls) the first secondary device; if it answers with NACK (Negative Acknowledgement), it implies it has nothing to communicate. It now approaches the second secondary device and answers with the ACK, indicating that it has data to deliver. Depending on the protocol, the secondary device can send many frames one after the other, or it may be needed to provide ACK before sending each one.

working of poll

2. Flow Control:

It is a collection of protocols that advises the sender how much data it can communicate before the recipient becomes overwhelmed.

The receiving device has limited processing power and memory to store the data. As a result, the receiving device must be able to notify the transmitting device to temporarily halt transmission before the restrictions are reached.

It necessitates the use of a buffer, which is a block of memory used to store data until it is processed.

Methods of Flow Control:

a. Stop-and-wait:

The Stop-and-wait technique requires the sender to wait for an acknowledgement after each frame is sent.

When an acknowledgement is received, just the next frame is sent. The process of transmitting and waiting for a frame alternates until the sender sends the EOT (End of transmission) frame.

b. Sliding Window:

The Sliding Window is a flow control mechanism in which a sender can send multiple frames before receiving an acknowledgement.

Multiple frames can be sent one after the other in Sliding Window Control, allowing the communication channel’s capacity to be used efficiently.

Multiple frames are acknowledged by a single ACK.

The term “Sliding Window” refers to imaginary boxes at both the sender and recipient ends.

The window can store frames at either end and sets the maximum number of frames that can be broadcast before the acknowledgement.

Even if the window is not entirely filled, frames may be acknowledged.

The window has a specified size and is numbered modulo-n, which means it is numbered from 0 to n-1. For example, if n = 6, the frames are numbered from 0,1,2,3,4,5,0,1,2,3,4,5…

The window’s size is denoted by the symbol n-1. As a result, a maximum of n-1 frames can be transmitted before acknowledgment.

When the receiver sends the ACK, it contains the frame number that it wishes to receive in the following frame. To acknowledge a series of frames that ends with frame number 4, for example, the receiver will send the ACK with the number 5. When the sender gets the ACK with the number 5, it knows that frames 0 through 4 were received.

3. Error Control:

Error Control is a mechanism for detecting and retransmitting errors.

Mechanisms for Error Control:

a. Stop-and-wait ARQ:

Stop-and-wait ARQ is a method for retransmitting data in the event of missing or damaged frames.

This method operates on the basis that the sender will not transmit the next frame until it gets acknowledgement of the previous frame.

Working of Stop-and-wait ARQ:

Until the acknowledgement is received, the transmitting device retains a duplicate of the previous sent frame. Keeping the copy enables the sender to retransmit the data if the frame is not successfully received.

Both the data frames and the ACK frames are numbered 0 and 1 alternatively to allow them to be recognised independently. If the data 1 frame acknowledges the data 0 frame, it implies and shows that the data 0 frame came successfully and that it expects to receive the data 1 frame next in line.

If there is a mistake in the final sent frame, the receiver transmits the NAK frame, which is unnumbered. When the sender receives the NAK frame, he retransmits the data.

It operates in conjunction with the timer. If the acknowledgement is not received within the time limit, the sender thinks that the frame was lost during transmission and will retransmit the frame.

Cases for retransmission of frames:

Lost Frame:

The timer on the sender begins when the frame is sent. Sometimes the frame does not reach at the receiving end and cannot be recognised favourably or negatively. The sender awaits acknowledgement until the timer expires. In case the timer expires, the last frame which was sent is retransmitted.

Damaged Frame:

When the receiver gets a damaged frame, that is, a frame with an error, it returns the NAK frame. For example, sending the data 0 frame and then receiving the ACK 1 frame shows that the data 0 frame arrived successfully and thus the data 1 frame is transmitted. The sender sends the following frame: data 1. It arrives unharmed, and the recipient responds with ACK 0. The sender sends the following frame: data 0. The fault is reported by the receiver, and the NAK frame is returned. The sender sends the data 0 frame again.

b. Sliding Window ARQ:

Sliding Window ARQ is a continuous transmission error control method.

Working of Sliding Window ARQ:

In this situation, the sender retains a copy of all sent frames until they are acknowledged. Let us suppose that frames 0 through 4 have been transmitted, and the last acknowledgement was for frame 2, the sender must retain copies of frames 3 and 4 until they are successfully received.

Depending on the circumstances, the receiver can transmit either NAK or ACK. The NAK frame informs the sender that the data received has been corrupted. Because the sliding window is a continuous communication system, both ACK and NAK must be numbered in order for a frame to be identified. The ACK frame contains a number that signifies the next frame that the recipient anticipates receiving.

The NAK frame is made up of a number that corresponds to the damaged frame.
The sliding window ARQ includes a timer to manage missing acknowledgements. Assume n-1 frames were transmitted before getting any acknowledgment. Because the sender is waiting for the acknowledgement, it begins the timer and waits before sending any more messages. If the timer expires, the sender retransmits one or all of the frames, depending on the protocol.

Different Protocols in Sliding Window ARQ:

i. Go-Back-n ARQ:

If a frame is lost or damaged in the Go-Back-N ARQ protocol, it retransmits all of the frames and does not get a valid ACK.

go back n arq

Cases when frames are retransmitted:

Lost Frame:

Data frames are transmitted consecutively in Sliding Window systems. If any of the frames is lost, the following frame received by the receiver is out of order. The receiver examines each frame’s sequence number, identifies the frame that was skipped, and returns the NAK for the missing frame. The frame indicated by NAK, as well as the frames transferred following the lost frame, are retransmitted by the transmitting device.

Lost Acknowledgment:

Before waiting for an acknowledgement, the sender can transmit as many frames as the windows allow. When the window’s limit is reached, the sender has no more frames to send and must wait for acknowledgement. If the acknowledgement is lost, the sender may be forced to wait indefinitely. To circumvent this, the transmitter is outfitted with a timer that begins counting when the window capacity is reached. If the acknowledgement is not received within the specified time period, the sender retransmits the frame since the last ACK.

ii. Selective-Reject ARQ:

selective reject arq

The Selective-Reject ARQ approach is more efficient than the Go-Back-n ARQ technique.

Only frames that have received negative acknowledgement (NAK) are retransmitted using this approach.

All damaged frames are held in the receiver storage buffer until the frame in mistake is successfully received.

The receiver must contain the necessary logic to reinsert the frames in the right order.

The sender must provide a searching mechanism that only retransmits the requested frame.

Your opinion matters
Please write your valuable feedback about DataFlair on Google

follow dataflair on YouTube

1 Response

  1. Md Golam Kabir says:

    Very nice presentation in plain text. waiting for the next session.

Leave a Reply

Your email address will not be published. Required fields are marked *