The selective repeat ARQ is one of the Sliding Window Protocol strategies that is used where reliable in-order delivery of the data packets is required. The selective repeat ARQ is used for noisy channels or links and it manages the flow and error control between the sender and the receiver. In the selective repeat ARQ, we only resend the data frames that are damaged or lost. If any frame is lost or damaged then the receiver sends a negative acknowledgment (NACK) to the sender and if the frame is correctly received, it sends back an acknowledgment (ACK). As we only resend the selected damaged frames so we name this technique the Selective Repeat ARQ technique. The ACK and the NACK have the sequence number of the frame that helps the sender to identify the lost frame.
The selective repeat ARQ is one of the Sliding Window Protocol strategies that is used where reliable in-order delivery of the data packets is required. The selective repeat ARQ is used for noisy channels or links and it manages the flow and error control between the sender and the receiver.
In the selective repeat ARQ, we only resend the data frames that are damaged or lost. On the other hand, the correct frames are received at the receiver's send and are buffered for future usage. As we only resend the selected damaged frames so we name this technique the Selective Repeat ARQ technique.
In selective repeat ARQ, the sender sets a timer for each frame so whenever the timer is over and the sender has not received any acknowledgment for the frame, then the sender knows that the particular frame is either lost or damaged. So, the sender sends back the lost or damaged frame once the timer is out.
Now, if any frame is lost or damaged then the receiver sends a NACK to the sender. When the sender gets NACK then it retransmits the lost frame only. The receiver does not discard all the subsequent frames following a lost frame, it just sends back A NACK and stores the rest of the frames in its memory buffer. In this way, the sender does not need to wait for the timer to expire. Hence, the performance of the selective repeat ARQ increases.
As the receiver may receive the frames in a different order, the receiver has the capability of sorting the frames present in the memory buffer using the sequence numbers. On the other hand, the sender must be capable enough to search for the lost frame for which the NACK has been received. So searching at the sender's end and sorting at the receiver's are two minor drawbacks of the selective repeat ARQ.
In the selective repeat ARQ, both the sender and the receiver have windows of the same size. The window on the sender's side covers the sequence of data packets that are sent (or to be sent). On the other hand, the window on the receiver's side covers the sequence of data packets that are received (or to be received).
The overall working of the selective repeat ARQ is simple. Initially, the sender sends several frames according to the window size. The receiver on the other end receives the frames and sends the ACK for correct frames and NACK for lost or damaged frames. The sender re-transmits the frames for which the NACK was sent by the receiver. After receiving all the frames, the receiver sorts the frame according to the sequence number for further usage.
Now, let us take an example to visualize the working of selective repeat ARQ or how the data packet is transmitted using the selective repeat ARQ protocol. The image below shows the transmission of frames. Let us suppose that the window size of the sender and the receiver is 2.
the sliding in selective repeat depends on the received ack's for the previous frame and it should be consecutive . b sends ack's for 0 1 3 then o and 1 are consecutive it will move the sliding window till it gets any unacknowledged frame . it will wait for the time out for this frame (2) and resend it after timeout. meanwhile as b sent ack for 3 also it will mark it as acknowledged but will not move.
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.
This protocol is almost like 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 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.
To implement and research on two generic forms of pipelined approaches in transport service, go-Back-N (GBN) and selective repeat (SR), through software [url removed, login to view] we may already know, these two approaches have their advantages and disadvantages. In nature, some upcoming packets may be lost or have to be re-sent due to premature timeout or delayed ACK. Since the behavior of data transfer is not fully predictable, it is hard to tell which approach is superior. Through this project, we need to investigate the performance difference from the simulated results between these two methods. 2b1af7f3a8