Signup/Sign In
LAST UPDATED: JUNE 27, 2023

Flow Control - Selective Repeat Protocol

Technology #protocol

    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.

    Retransmission request:

    • Implicit Retransmission request: Here, it's the receiver's duty to acknowledge or give positive feedback on the received data packets and negative feedback for those which were lost or damaged during transmission, and that too before the expiry of the time-out timer.

    • Explicit Retransmission request: In explicit retransmission, the receiver can request the retransmission of just one packet.

    Either one or both approaches are used in practice.


    Selective Repeat Protocol

    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.

    Time for an Example!

    Selective Repeat Protocol example

    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)


    Conclusion

    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.

    Frequently Asked Questions(FAQs)

    1. What is flow control in data communication?

    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.

    2. What is the Selective Repeat Protocol?

    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.

    3. How does the Selective Repeat Protocol improve reliability?

    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.

    4. What are the advantages of the Selective Repeat Protocol over other flow control mechanisms?

    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.

    5. Can the Selective Repeat Protocol handle out-of-order packets?

    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.

    Shashwat Pandey is an accomplished technical author with a wealth of experience in writing about computer networks. His passion for the subject extends beyond his writing, and he enjoys exploring new networking technologies to stay on the trend.
    IF YOU LIKE IT, THEN SHARE IT
    Advertisement

    RELATED POSTS