Elementary Data Link Protocols

In this tutorial, you will learn the basics of the Elementary Data Link Protocols. After reading this tutorial, you will understand the working, advantages, disadvantages, and flow and error control mechanism of Elementary data link protocols.

Contents:

  1. Why is Elementary Data Link Protocols needed?
  2. Elementary Data Link Protocols
  3. Utopian Simplex Protocol
  4. Working of Utopian Simplex Protocol
  5. Simplex Stop-and-Wait Protocol for a Noiseless Channel
  6. Working of Simplex Stop-and-Wait Protocol (Noiseless Channel)
  7. Simplex Stop-and-Wait Protocol for a Noisy Channel
  8. Working of Simplex Stop-and-Wait Protocol (Noisy Channel)

Why is Elementary Data Link Protocols needed?

Data Link Layer communicates with the network layer and physical layer. Generally, the data link layer receives packets and sends the data to the physical layer in form of frames. Elementary Data Link Protocols ensure reliability over a network during the transmission of frames. The Elementary data link protocols help the data link layer solve problems such as frame loss or damage and flow control.

  • The data link layer adds a header and trailer to the packet that makes up the frame. In the frame field, it contains an error detection method such as a checksum. Therefore, after adding the control information of the data link layer in the header and the checksum to the trailer, it is sent to the receiver.
  • When the receiver receives the frame, it calculates the checksum and compares it with the sender’s checksum.
  • If the checksum value matches, then the receiver’s data link layer will allow the frame to be sent to the network layer, otherwise, it sends acknowledgement to the sender that the frame has been damaged.
  • But when the process of sending a frame is taking place over a channel, a protocol is used, which defines the time limit for sending and receiving the frame.
  • As soon as the sender sends a frame, the timer will start, and it will wait for some time to receive an acknowledgment from the receiver that it has received the frame.
  • If the sender does not receive the acknowledgment within the given time, the sender will resend the frame to the receiver. This process is done by the Elementary data link protocols.

Elementary Data Link Protocols

When we study the various Elementary data link protocols, we will assume that there is an unreliable channel over which frame loss occurs during transmission. To recover frames lost during transmission, the sender starts the internal clock each time a frame is sent. The sender will wait for some time, and if no reply is received within the predetermined time, the clock times out, and the data link layer will receive an interrupt signal.

  • There are some methods or procedures executed by the protocol that turn the timer on and off, respectively. The clock is reset only after an interval is reached.
  • Since the Elementary data link protocol is used at the data link layer, the data link layer also controls access to the network layer. The data link layer decides when to enable the network layer to send packets to prevent it from swamping packets with them.

The below diagram shows that there are 3 types of Elementary Data Link Protocols.

advertisement
types of Elementary Data Link Protocols

The above diagram shows that a utopian simplex protocol, a simplex stop-and-wait protocol for a noiseless channel, and a simplex stop-and-wait protocol for a noisy channel are the Elementary data link protocols.

Utopian Simplex Protocol

An utopian simplex protocol is a simple protocol because it does not worry about whether something is going right or wrong on the channel.

  • In this protocol, data is transmitted in only one direction. Therefore it is unidirectional.
  • No matter what is happening in the network, the sender and receiver are always ready to communicate. So they also ignore the delay in processing.
  • This protocol is just a consideration so that there is infinite buffer space available on the sender and receiver.
  • It is an unrealistic protocol, or you can say it is an unrestricted protocol.
  • In this protocol, the channel used between layer-2 of the sender and receiver never discards or damages the frame during communication.

Working of Utopian Simplex Protocol

In protocol, two entities are sender and receiver, who communicate with each other over a channel. The sender process and receiver process are running at the data link layer of the sender’s machine and the receiver’s machine, respectively. Sequence number and acknowledgment number are not used. Only the undamaged frame arrival process is going on.

The diagram below explains the utopian simplex protocol.

utopian simplex protocol
  • As you can see in the diagram, the direction of communication is in only one direction. The sender is sending the data over the line as fast as possible. The sender’s machine fetches packets from the network layer, creates frames, and sends the frames over the line.
  • On the other hand, the receiver is waiting to receive the frame. The frame comes from the sender, so the receiver will take the frame that comes into the hardware buffer and send it to the network layer.
  • After the frame is sent to the network layer, the receiver’s data link layer will sit back to wait for the next frame.

Because this protocol is unrealistic and unrestricted, it has no flow control and error control restrictions. Here, no frame is lost during transmission, and hence no field of the frame is required to control the flow of data and detect the error.

Simplex Stop-and-Wait Protocol for Noiseless Channel

In a stop-and-wait protocol, the sender stops after sending a frame to the receiver and waits for an acknowledgment before sending another frame.

  • We here assume a noiseless channel that is error-free on which the frame is never damaged or corrupted. Here the channel is error-free but does not control the flow of data.
  • Using the simplex stop-and-wait protocol, we can prevent the sender from flooding the receiver with frames faster than the receiver can process them.
  • To prevent flooding on the receiver side, one solution is to enable the receiver to process frames back-to-back by adding a buffer of sufficient size. We can enhance the processing capabilities of the receiver so that it can quickly pass the received frame to the network layer. But it’s still not a general solution.
  • Common solutions for addressing flooding issues on the receiver side, providing feedback to the sender to reduce the flow rate at the receiver.
  • So that, in the simplex stop-and-wait protocol, the receiver sends a dummy frame back to the sender after the packet is sent over the network layer, asking the sender to send the next frame.
  • Frames can be transmitted to or received from the sender or receiver, so the simplex stop-and-wait protocol is bidirectional.

Working of Simplex Stop-and-Wait Protocol (Noiseless Channel)

As we got some basic idea about stop-and-wait protocol. Now, let’s see how the Simplex stop-and-wait protocol handles flow control over a noiseless channel.

The diagram below explains the working of the simplex stop-and-wait protocol.

working of the simplex stop-and-wait protocol
  • As you can see in the above diagram that the sender is sending the frame to the receiver. After sending the frame, the sender stops the transmission and waits for the acknowledgment from the receiver.
  • As soon as the receiver receives the frame, it opens it and sends it to the network layer for further processing. Now, the receiver will create an acknowledgment, which allows the sender to send the next frame.
  • You can see that the communication is bidirectional, but they are using half-duplex mode.

Simplex Stop-and-Wait Protocol for a Noisy Channel

Here, assume the general situation in which the sender and receiver on the communication channel make an error during transmission. Frames can either be damaged or lost completely during transmission.

advertisement
  • On a noisy channel, the receiver has only a limited buffer capacity and a limited processing speed, so the protocol prevents the sender from flooding the receiver with data too fast to handle it.
  • In rare cases, the frame sent by the sender may be damaged in such a way that the checksum is correct, causing this and all other protocols to fail. To avoid this situation, a timer is added.
  • Suppose, receiver’s acknowledgment is lost during transmission, the sender will wait for acknowledgment for some time, and after the timeout, the sender will send the frame again. This process is repeated until the frame arrives and the acknowledgment is received from the receiver.
  • The data link layer is responsible for flow and error control. Therefore, when the sender’s network layer transmits a series of packets to the data link layer, the data link layer transmits the packets through the receiver’s data link layer to the network layer.
  • Here, the network layer has no functionality to check whether there is an error in the packet, so the data link layer must guarantee to the network layer that no transmission error occurs in the packet. Although duplicate packets may arrive at the network layer, we can prevent this by using this protocol.

Working of Simplex Stop-and-Wait Protocol for a Noisy Channel

As we have seen in the above section that the network layer does not have the functionality to detect errors or duplication in the packet, so it is guaranteed by the data link layer that there are no errors in the packet. But duplicate packets can arrive at the network layer. So, let us understand this scenario with an example.

The diagram below explains the working of the simplex stop-and-wait protocol for a noisy channel.

working of the simplex stop-and-wait protocol for a noisy channel
  • As you can see in the above diagram, the sender sends the packet in the form of a frame to the receiver. When the receiver receives the frame, it sends the frame in a packet format to the network layer.
  • After frame-1 successfully reaches the receiver, the receiver will send an acknowledgment to the sender. The sender will send the frame-2 after receiving the acknowledgment from the receiver. But as shown in the figure, frame-2 is lost during transmission. Therefore, the sender will retransmit frame-2 after the timeout.
  • Further, the receiver is sending an acknowledgment to the sender after receiving frame-2. But the acknowledgment is completely lost during transmission.
  • The sender is waiting for the acknowledgment, but the timeout has elapsed, and the acknowledgment has not been received. So the sender will assume that the frame is lost or damaged, and it will send the same frame again to the receiver.
  • The receiver receives the same frame again. But how does the receiver recognize that the packet of the frame is a duplicate or the original? So, it will use the sequence number to identify whether the packet is duplicate or new.

In this protocol, the only ambiguity is one frame and its next frame. Suppose frame-n is lost or damaged, and the receiver didn’t receive the frame. Then, the receiver will not even send the acknowledgment to the sender. So the sender will keep sending frames again and again until the acknowledgment is received in a given amount of time.

Some possibilities exist on this protocol as follows:

  • If the packet is successfully received on the receiver side and the sender receives a valid acknowledgment, the sender fetches the next packet from the network layer and overwrites the previous packet in the buffer. Also, it increases the sequence number of the packet to prevent duplication of packets.
  • If a damaged frame occurs or the clock timer has expired, the packet’s buffer and sequence number will not change, and the sender will forward the same or the next packet to the receiver.
  • When the frame reaches the receiver successfully, the receiver will check the sequence number to see if it is a duplicate. If not, it is accepted and passed to the network layer, and an acknowledgment will be sent to the sender.

Key Points to Remember

Here is the list of key points we need to remember about “Elementary Data Link Protocols”.

  • The Elementary data link protocols help the data link layer solve problems such as frame loss or damage and flow control.
  • Since the Elementary data link protocol is used at the data link layer, the data link layer also controls access to the network layer. The data link layer decides when to enable the network layer to send packets to prevent it from swamping packets with them.
  • There are 3 Elementary data link protocols as follows.
    1. Utopian Simplex Protocol
    2. Simplex Stop-and-Wait Protocol for a Noiseless Channel
    3. Simplex Stop-and-Wait Protocol for a Noisy channel
  • In the utopian simplex protocol, data transmission is unidirectional and has no flow control and error control restrictions. Frames are not lost during transmission in the utopian simplex protocol.
  • In a stop-and-wait protocol, the sender stops after sending a frame to the receiver and waits for an acknowledgment before sending another frame. For a noiseless channel, the channel is error-free but does not control the flow of data.
  • Frames can be transmitted to or received from the sender or receiver, so the simplex stop-and-wait protocol is bidirectional.
  • On the noisy channel, the simplex stop-and-wait is in the general situation, in which flow control and error control mechanisms functioning.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.