Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests - Download the BYJU'S Exam Prep App for free GATE/ESE preparation videos & tests -

Stop and Wait Protocol

Stop-and-wait ARQ, commonly known as the alternating bit protocol, refers to a communication technique used to transmit data between two linked devices. It makes sure that packets are received in the right order, and that data is not lost as a result of dropped packets.

In this article, we will look more into the Stop and Wait Protocol according to the GATE Syllabus for (Computer Science Engineering) CSE. We will read ahead to find out more about it.

Table of Contents

What is the Stop and Wait Protocol?

We must first grasp the error control mechanism in order to comprehend the stop and wait protocol. The error control technique is used to ensure that the received data is identical to that sent by the sender. The two types of error control mechanisms are Sliding Window and Stop and Wait ARQ. The sliding window is further separated into the Go Back N and Selective Repeat categories. People choose the error control method, stop and wait or sliding window, based on the usage.

Stop and Wait Protocol

In this case, stop and wait means that the sender provides the recipient’s desired data. The sender pauses after transferring the data and waits for the receiver to acknowledge his transmission. The stop and wait protocol, which is a flow control protocol, uses the data link layer’s flow control functionality.

It is a DDL (data-link layer) protocol that is used to send data through channels with no background noise. It offers unidirectional data transfer, which means that only one of the two operations, data sending or receiving, can occur concurrently. Although it offers a flow-control system, there is no error control mechanism.

The concept behind using this frame is that after sending one frame, the sender will wait for an acknowledgement before sending another one.

Primitives of Stop and Wait Protocol

Sender’s Side

Rule 1: The sender sends one data packet at a time.

Rule 2: The sender only sends the subsequent packet after getting the preceding packet’s acknowledgement.

Therefore, the concept behind the stop and wait protocol on the sender’s end is relatively straightforward: Send one packet at a time and refrain from sending any additional packets until you have received an acknowledgement.

Receiver’s Side

Rule 1: Receive the data packet, then consume it.

Rule 2: The receiver provides the sender with an acknowledgement after consuming the data packet.

As a result, the stop and wait protocol’s basic tenet on the receiver’s end is similarly extremely straightforward: Ingest the packet, and after it has been consumed, send the acknowledgement. This is a mechanism for flow control.

Working of Stop and Wait Protocol

diagram 1

The stop and wait protocol’s operation is depicted in the above figure. The sender sends the packet, referred to as a data packet if there is a sender and a receiver. After receiving a data packet, the receiver sends an acknowledgement. Without receiving acknowledgement for the first packet, the sender won’t send the second packet. The sender sends the subsequent packet after receiving the acknowledgement.

This procedure keeps going until all of the packets have been sent. The stop and wait protocol’s main benefit is simplicity, but there are some drawbacks as well. For instance, if 1000 data packets need to be delivered, they cannot all be sent at once since this protocol only sends one packet at a time.

Disadvantages of Stop and Wait Protocol

1. Problems arise because of lost data

diagram 2

Let’s say the sender sends the data, but it gets lost in transit. The receiver is patiently awaiting the data packet. The receiver does not send an acknowledgement because it does not receive the data. The sender won’t send the subsequent packet because it has not received any acknowledgement. The lost data is the root cause of this issue.

In this instance, there are two problems:

  • The sender waits an endless length of time for a response.
  • The receiver waits indefinitely for data.

2. Problems arise as a result of the lost acknowledgement

diagram 3

Let’s say the data was sent by the sender and was also received by the recipient. The receiver transmits the acknowledgement after receiving the packet. In this instance, there is no chance for the sender to get the acknowledgement because the acknowledgement is lost in a network. Additionally, there is no chance for a sender to send the subsequent packet because, according to the stop and wait protocol, this cannot happen until the previous packet’s acknowledgement has been received.

One issue arises in this situation:

  • The sender waits an endless time for an acknowledgement.

3. Problem resulting from delayed data or acknowledgement

diagram 4

Let’s say the data was sent by the sender and was also received by the recipient. The acknowledgement is then sent by the recipient, but it is not received until the timeout period has passed on the sender’s end. Due to the acknowledgement being received after this, it can be mistaken for acknowledging the receipt of another data packet.

Keep learning and stay tuned to get the latest updates on the GATE Exam, GATE 2023 along with GATE Eligibility Criteria, GATE Syllabus for CSE (Computer Science Engineering), GATE CSE Notes, GATE CSE Question Paper, and more.