Let's just look back at the STOP & WAIT, STOP & WAIT ARQ protocols both of which had some drawbacks and then the Go-Back-N ARQ protocol which too had some limitations, as we studied that it requires more bandwidth while retransmitting the data packets, so now, to overcome this problem we came to an alternative technique, which is known as Selective Repeat Protocol.
So, what selective repeat protocol does is that it allows the receiver to accept & buffer the data packets following a damaged or lost one and then retransmits only those data packets which were lost or damaged in the network channel during transmission.
Let's take an example, consider you are sending data packets indexing from packet p1 to p5, now p1 & p2 are received successfully but packet p3 got lost or damaged in the network channel, now unlike Go-Back-N ARQ, as per the selective repeat protocol, the sender will send the packet p4 & p5, which the receiver will receive and after that, the selective repeat protocol will retransmit packet p3.
Either one or both approaches are used in practice.
This protocol is almost like the Go-Back-N ARQ protocol, or we can say that it is a modified form of GBN ARQ, the part where it differs is that here buffers are used and both receiver & sender maintain a window of size. This selective repeat works better at times when the network link is mostly unreliable. Because here, in this case, retransmission tends to happen more frequently, the selective retransmission of frames is much more efficient than retransmitting all the frames, selective repeat also requires a full-duplex communication channel for consistently transferring the data packet & the feedback/acknowledgment.
Note: The sender's window must be equal to the receiver's window and the window size should be less than or equal to half of the sequence number in the selective repeat protocol. This is to avoid the data packets being recognized incorrectly.
If the window size is greater than the sequence number space and then if a feedback/acknowledgment is lost, then the sender may send new data packets that the receiver believes are retransmissions.
The receiver then stores the correct packets until they can be delivered in the order, to the higher layers.
Now, in the above diagram, the sender first sends frame1(i.e. 0) and immediately the receiver acknowledges the frame and then, the frame2 is transmitted which too got acknowledged. Now, as we can see frame3 is lost during the transmission & was unable to reach the receiver, but the next frame, which is frame4 is transmitted and also accepted by the receiver, who then sends a negative acknowledgment due to which the sender only transmits frame3 again instead of retransmitting all the frames starting from frame3(which happens in Go-Back-N ARQ).
The efficiency of the selective repeat protocol is the same as that of the Go-Back-N ARQ protocol's efficiency.
Efficiency = N/(1+2a)
Where, a = propagation delay/transmission delay
Buffers = N+N
Sequence number = N(sender's side)+N(receiver's side)
Efficient flow control is the backbone of reliable data transmission, and the Selective Repeat Protocol stands as a testament to the advancements made in this domain. By allowing for the selective retransmission of lost or corrupted packets, it minimizes network congestion and optimizes the utilization of network resources.
With this, we have covered the three flow control protocols of computer networks, namely, STOP & WAIT, STOP & WAIT for ARQ, Go-Back-N ARQ protocol, and the Selective Repeat Protocol. You can learn more about Computer Networks from our Computer Network tutorial.
Flow control refers to the mechanisms and techniques used to manage the flow of data between a sender and receiver to ensure smooth and reliable transmission. It prevents overwhelming the receiver or causing congestion in the network.
The Selective Repeat Protocol is a flow control mechanism used in data communication. It allows for the retransmission of specific lost or corrupted packets, rather than requiring the retransmission of the entire data stream.
By selectively retransmitting only the lost or corrupted packets, the Selective Repeat Protocol reduces the overhead and congestion associated with retransmitting all packets. It ensures efficient data delivery and enhances reliability.
The Selective Repeat Protocol offers several advantages, such as increased network efficiency, reduced bandwidth consumption, and improved response time. It minimizes retransmissions and optimizes the utilization of network resources.
Yes, one of the strengths of the Selective Repeat Protocol is its ability to handle out-of-order packets. It can reorder received packets correctly at the receiver's end, ensuring the integrity of the data stream.