A Simplex Stop-and-Wait Protocol for an Error-Free Channel

Stop-and-Wait protocol is a data link layer protocol for transmission of frames over noiseless channels. It provides unidirectional data transmission with flow control facilities but without error control facilities.

This protocol takes into account the fact that the receiver has a finite processing speed. If data frames arrive at the receiver's end at a rate greater than its processing rate, frames will be dropped. To avoid this, the receiver sends an acknowledgement for each frame upon arrival. The sender transmits the next frame only after receiving a positive acknowledgement confirming the receiver is ready for further data processing.

How It Works

  • Sender Site − The data link layer waits for the network layer to provide a data packet. It checks whether it can send the frame, and if the physical layer gives positive notification, it creates frames from the data and sends them. It then waits for acknowledgement before sending the next frame.

  • Receiver Site − The data link layer waits for a frame to arrive. When it arrives, the receiver processes it, delivers it to the network layer, and sends an acknowledgement back to the sender.

Stop-and-Wait Protocol Flow Sender (Data Link Layer) Receiver (Data Link Layer) Frame 1 ACK 1 Frame 2 ACK 2 t1 t2 t3 t4 Sender waits for ACK before sending next frame

Sender Site Algorithm

begin
   canSend = True;           //Allow the first frame to be sent
   while (true)              //check repeatedly
   do
      Wait_For_Event();      //wait for availability of packet
      if ( Event(Request_For_Transfer) AND canSend) then
         Get_Data_From_Network_Layer();
         Make_Frame();
         Send_Frame_To_Physical_Layer();
         canSend = False;
      else if ( Event(Acknowledgement_Arrival)) then
         Receive_ACK();
         canSend = True;
      end if
   end while
end

Receiver Site Algorithm

begin
   while (true)              //check repeatedly
   do
      Wait_For_Event();      //wait for arrival of frame
      if ( Event(Frame_Arrival)) then
         Receive_Frame_From_Physical_Layer();
         Extract_Data();
         Deliver_Data_To_Network_Layer();
         Send_ACK();
      end if
   end while
end

Advantages and Disadvantages

Advantages Disadvantages
Simple implementation and flow control Low bandwidth utilization due to waiting
Prevents receiver buffer overflow No error detection or correction
Reliable for error-free channels Inefficient for high-speed networks

Conclusion

The Simplex Stop-and-Wait protocol provides basic flow control for error-free channels by ensuring the sender waits for acknowledgement before transmitting the next frame. While simple and reliable, it suffers from low bandwidth utilization due to the mandatory wait time between transmissions.

Updated on: 2026-03-16T23:36:12+05:30

15K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements