Home » Computer Network » Write a note on Stop and Wait protocol. Also state drawbacks of stop and wait protocol

Write a note on Stop and Wait protocol. Also state drawbacks of stop and wait protocol

Last updated:

Support this post with a reaction:

6,099 views

In computer networks, reliable data transmission is important for successful communication between two devices. When data is transferred from a sender to a receiver, frames may sometimes be lost, damaged, or received incorrectly due to network problems. To manage these situations and ensure proper communication, different data link layer protocols are used.

One of the simplest protocols used for controlling data transmission is the Stop and Wait Protocol. It is a flow control protocol that allows the sender to transmit only one frame at a time and wait for an acknowledgement from the receiver before sending the next frame.

The main purpose of the Stop and Wait Protocol is to prevent the sender from transmitting data faster than the receiver can process it. It also helps achieve reliable communication when combined with error-control mechanisms such as acknowledgements, timers, and retransmissions.

This protocol is easy to understand and implement. However, it can become inefficient when the sender and receiver are separated by a large distance or when network transmission delays are high.

Stop and Wait Protocol

The Stop and Wait Protocol is a flow control mechanism used in the Data Link Layer of the OSI model. It allows the sender to transmit one data frame at a time and then stop transmitting until it receives an acknowledgement (ACK) from the receiver.

After receiving the frame successfully, the receiver sends an acknowledgement to inform the sender that the frame has been received. Once the sender receives this acknowledgement, it can transmit the next frame.

If the acknowledgement is not received within a specified time, the sender may retransmit the frame when using the Stop-and-Wait ARQ error-control mechanism.

In simple words, Stop and Wait Protocol works on the principle of “Send one frame, wait for acknowledgement, and then send the next frame.”

Key Points of Stop and Wait Protocol

  • It is a flow control protocol used in computer networks.
  • It allows only one outstanding data frame at a time.
  • The sender waits for an acknowledgement before sending the next frame.
  • The receiver sends an ACK after successfully receiving a frame.
  • A timer can be used to detect lost frames or acknowledgements.
  • Sequence numbers help identify frames and prevent duplicate delivery.
  • It is simple to implement but may reduce network efficiency.

Need of Stop and Wait Protocol

During data transmission, the sender and receiver may operate at different speeds. For example, a sender may transmit data faster than the receiver can accept and process it.

If the sender continuously transmits frames without waiting, the receiver may become overloaded. Its buffer may become full, resulting in frame loss and communication problems.

The Stop and Wait Protocol solves this problem by controlling the speed of data transmission.

The following are the main reasons why this protocol is needed:

1. To Control Data Flow

The protocol ensures that the sender does not transmit multiple frames continuously. It allows the receiver to process one frame before another frame is transmitted.

2. To Prevent Receiver Overloading

The receiver gets sufficient time to process the incoming frame. This reduces the possibility of buffer overflow and frame loss.

3. To Confirm Successful Transmission

The receiver sends an acknowledgement to inform the sender that the transmitted frame has been received successfully.

4. To Support Reliable Communication

When used as Stop-and-Wait ARQ, the protocol uses timers and retransmissions to recover from lost frames or acknowledgements.

How Does Stop and Wait Protocol Work?

The Stop and Wait Protocol follows a simple communication process between a sender and a receiver. The sender transmits one frame and waits for an acknowledgement before sending another frame.

The working process can be explained through the following steps:

Step 1: Sender Transmits a Data Frame

The sender prepares the data and divides it into frames. It then transmits the first frame to the receiver through the communication channel.

Step 2: Sender Stops Transmission

After transmitting the frame, the sender stops sending additional frames. It waits until it receives an acknowledgement from the receiver.

Step 3: Receiver Receives the Frame

The receiver receives the transmitted frame and checks whether it has arrived correctly. If the frame is valid, the receiver accepts the data and processes it.

Step 4: Receiver Sends an Acknowledgement

After successfully receiving the frame, the receiver sends an acknowledgement (ACK) to the sender. This acknowledgement indicates that the frame has been received.

Step 5: Sender Receives the Acknowledgement

The sender receives the ACK and understands that the previous frame has been successfully delivered.

Step 6: Sender Transmits the Next Frame

After receiving the acknowledgement, the sender transmits the next data frame. The same process continues until all the data has been transmitted.

Therefore, the Stop and Wait Protocol ensures that the sender transmits frames one by one instead of sending multiple frames without confirmation.

Important Components of Stop and Wait Protocol

The Stop and Wait Protocol uses several important components to control data transmission and maintain reliable communication.

1. Sender

The sender is the device or system that transmits data frames to the receiver. It sends one frame at a time and waits for an acknowledgement before transmitting the next frame.

The sender is responsible for preparing frames, transmitting them, and checking whether an acknowledgement has been received. In Stop-and-Wait ARQ, it also manages retransmission when a frame or acknowledgement is lost.

2. Receiver

The receiver is the device or system that accepts data frames sent by the sender. It checks the received frame and processes the data if the frame is valid.

After receiving a frame successfully, the receiver sends an acknowledgement to the sender. This acknowledgement allows the sender to continue transmitting the next frame.

3. Data Frame

A data frame is a unit of information transmitted from the sender to the receiver.

The sender divides the data into frames and transmits them one at a time. Each frame may contain data, control information, and a sequence number.

4. Acknowledgement (ACK)

An acknowledgement is a control message sent by the receiver to inform the sender that a particular frame has been received successfully.

The sender waits for this acknowledgement before transmitting the next frame. If the acknowledgement is delayed or lost, the sender may retransmit the frame after a timeout when using Stop-and-Wait ARQ.

5. Timer

A timer is used to identify situations where an acknowledgement does not arrive within the expected time.

After transmitting a frame, the sender starts the timer. If the acknowledgement is received before the timer expires, the sender stops the timer and sends the next frame.

If the timer expires without receiving an acknowledgement, the sender retransmits the previous frame in the ARQ version of the protocol.

6. Sequence Number

A sequence number is a small numerical value assigned to each frame to identify its order during transmission.

Stop-and-Wait ARQ commonly uses one-bit sequence numbers, which are 0 and 1. These numbers alternate between consecutive frames.

Sequence numbers help the receiver identify duplicate frames. For example, if the sender retransmits a frame because its acknowledgement was lost, the receiver can recognize that the frame has already been received and avoid delivering the same data twice.

7. Retransmission Mechanism

Retransmission means sending a frame again when the original frame or its acknowledgement is lost or damaged.

In Stop-and-Wait ARQ, the sender retransmits the frame if it does not receive the expected acknowledgement before the timer expires.

This mechanism helps recover from transmission errors and improves the reliability of communication.

Example of Stop and Wait Protocol

Consider a situation where a computer sends five data frames to another computer.

The sender first transmits Frame 1 and waits for an acknowledgement. After receiving ACK 1, it sends Frame 2.

Similarly, after receiving ACK 2, it sends Frame 3. This process continues until all five frames are transmitted successfully.

For example:

TransmissionAction
Frame 1Sender transmits Frame 1
ACK 1Receiver acknowledges Frame 1
Frame 2Sender transmits Frame 2
ACK 2Receiver acknowledges Frame 2
Frame 3Sender transmits Frame 3
ACK 3Receiver acknowledges Frame 3
Frame 4Sender transmits Frame 4
ACK 4Receiver acknowledges Frame 4
Frame 5Sender transmits Frame 5
ACK 5Receiver acknowledges Frame 5

This example shows that the sender must receive an acknowledgement for each frame before sending the next one.

Advantages of Stop and Wait Protocol

The Stop and Wait Protocol provides several advantages in controlling data transmission.

1. Simple to Understand and Implement

The protocol follows a straightforward mechanism in which the sender transmits one frame and waits for an acknowledgement. Its simple working process makes it easy to understand, design, and implement.

2. Prevents Receiver Overloading

Since only one frame is transmitted at a time, the receiver gets enough time to process the received data. This reduces the chances of buffer overflow.

3. Controls Data Transmission

The protocol controls the flow of data between the sender and receiver. It prevents the sender from transmitting frames continuously without considering the receiver’s processing capacity.

4. Provides Acknowledgement-Based Communication

The receiver sends an acknowledgement after receiving a frame. This helps the sender understand whether the frame has reached the receiver successfully.

5. Supports Error Recovery

When implemented as Stop-and-Wait ARQ, the protocol uses timers and retransmissions to recover from lost frames and acknowledgements.

6. Requires Less Buffer Space

Since the sender transmits only one outstanding frame at a time, the receiver does not need to maintain a large buffer for multiple incoming frames.

7. Suitable for Simple Communication Systems

It is useful in communication environments where the data transmission rate is low and the communication process does not require high throughput.

Drawbacks of Stop and Wait Protocol

Although the Stop and Wait Protocol is simple and useful for controlling data transmission, it has several limitations that affect network performance and efficiency.

1. Low Transmission Efficiency

The major drawback of the Stop and Wait Protocol is its low transmission efficiency. The sender transmits only one frame and waits for an acknowledgement before sending the next frame.

During this waiting period, the communication channel remains idle. As a result, the available network bandwidth is not used efficiently.

2. Wastage of Bandwidth

After transmitting a frame, the sender remains idle until it receives an acknowledgement. If the acknowledgement takes a long time to reach the sender, a significant amount of transmission time is wasted.

This reduces the effective utilization of the communication channel.

3. Slow Data Transmission

The protocol sends frames one by one instead of transmitting multiple frames continuously. Therefore, the overall data transmission speed becomes slow, especially when large amounts of data need to be transferred.

4. Not Suitable for Long-Distance Communication

In long-distance communication, the propagation delay is usually high because the signal takes more time to travel between the sender and receiver.

Since the sender must wait for an acknowledgement after every frame, this delay increases the total transmission time and reduces performance.

5. Poor Performance in High-Speed Networks

In high-speed networks, a large amount of data can be transmitted in a short period. However, Stop and Wait allows only one frame to remain unacknowledged at a time.

As a result, the sender cannot take full advantage of the available network capacity.

6. Increased Waiting Time

The sender must wait for an acknowledgement after every frame. When the receiver is slow or the network experiences delays, the sender spends more time waiting than transmitting data.

This affects the overall communication speed.

7. Low Throughput

Throughput refers to the amount of data successfully transmitted over a network within a given period.

Because the sender can transmit only one frame before waiting for an acknowledgement, the amount of data delivered per unit of time is limited. Therefore, the protocol provides low throughput, particularly in networks with high propagation delays.

8. Performance Decreases When Errors Occur

In Stop-and-Wait ARQ, if a frame or acknowledgement is lost, the sender must wait for the timeout period before retransmitting the frame.

Repeated transmission errors and retransmissions increase communication delays and reduce overall performance.

Applications of Stop and Wait Protocol

The Stop and Wait Protocol is useful in communication environments where simplicity and controlled data transmission are more important than achieving high transmission speeds.

Some of its applications include:

1. Simple Data Communication Systems

It can be used in basic communication systems where devices exchange small amounts of data and do not require continuous high-speed transmission.

2. Embedded Systems

Some embedded devices have limited memory and processing capabilities. A simple flow control mechanism can help manage communication between such devices.

3. Low-Speed Communication Networks

The protocol is suitable for certain low-speed communication environments where the time required to transmit a frame and receive its acknowledgement is relatively small.

4. Error-Control Learning and Implementation

Stop and Wait is commonly used in computer networking education to explain flow control, acknowledgement mechanisms, timers, sequence numbers, and retransmission techniques.

5. Simple Point-to-Point Communication

It can be used in simple communication systems where two devices exchange data in a controlled manner.