7 Explain the difference between the GobackN and Selective R
7. Explain the difference between the Go-back-N and Selective Repeat protocol. Explain the following:
a. Does this GBN protocol have a time for each unacknowledged packet? Explain
b. When a timer expires, what happens for the GBN?
c. Does the Selective Repeat protocol have a timer for each unacknowledged packet? Explain.
d. When an acknowledgement arrives for the oldest unacknowledged packet what happens with Selective Repeat?
Solution
Go-Back-N Protocol and Selective Repeat Protocol are sliding window protocols. The sliding window protocol is primarily an error control protocol. It is a method of error detection and error correction. The basic difference between go-back-n protocol and selective repeat protocol is that the go-back-n protocol retransmits all the frames that lie after the frame which is damaged or lost. But selective repeat protocol retransmits only that frame which is damaged or lost.
Comparison Chart
Concept
go-back-n protocol
selective repeat protocol
Basic
Retransmits all the frames that sent after the frame
Retransmits only those frames that are suspected to lost or damaged.
Complexity
Less complicated.
More complex as it requires applying extra logic and sorting and storage, at sender and receiver.
Bandwidth
If error rate is high, it wastes a lot of bandwidth.
Comparatively less bandwidth is wasted in retransmitting.
Window size
N-1
<= (N+1)/2
a)
In a GBN protocol, the sender is allowed to transmit multiple packets without waiting for an acknowledgment, but is constrained to have no more than some maximum allowable number, N, of unacknowledged packets in the pipeline. If we definebase to be the sequence number of the oldest unacknowledged packet and nextseqnum to be the smallest unused sequence number (i.e., the sequence number of the next packet to be sent), then four intervals in the range of sequence numbers can be identified. Sequence numbers in the interval [0,base-1] correspond to packets that have already been transmitted and acknowledged.
The interval [base,nextseqnum-1] corresponds to packets that have been sent but not yet acknowledged. Sequence numbers in the interval [nextseqnum,base+N-1] can be used for packets that can be sent immediately, should data arrive from the upper layer. Finally, sequence numbers greater than or equal to base+N can not be used until an unacknowledged packet currently in the pipeline has been acknowledged.
The range of permissible sequence numbers for transmitted but not-yet-acknowledged packets can be viewed as a ``window\'\' of size N over the range of sequence numbers. As the protocol operates, this window slides forward over the sequence number space. For this reason, N is often referred to as the window size and the GBN protocol itself as a sliding window protocol. You might be wondering why even limit the number of outstanding, unacknowledged packet to a value of N in the first place. Why not allow an unlimited number of such packets? That flow control is one reason to impose a limit on the sender.
B)
``Go-Back-N,\'\' is derived from the sender\'s behaviour in the presence of lost or overly delayed packets timer will again be used to recover from lost data or acknowledgement packets. If a timeout occurs, the sender resends all packets that have been previously sent but that have not yet been acknowledged. If a sender uses only a single timer, which can be thought of as a timer for the oldest transmitted-but-not-yet-acknowledged packet. If an ACK is received but there are still additional transmitted-but-yet-to-be-acknowledged packets, the timer is restarted. If there are no outstanding unacknowledged packets, the timer is stopped.
C)
Theoretically, SR uses one timer for each outstanding packet. When a timer expires only the corresponding packet is resent. But GBN treats outstanding packets as a group. SR treats them individually, how ever most transport layer protocols that implement SR use only one single timer.
D)
If an acknowledgement is received, the SR sender marks that packet as having been received, provided it is in the window. If the packet\'s sequence number is equal to sendbase then window base is moved forward to the unacknowledged packet with the smallest sequence number. If the window moves and there are un transmitted packets with sequence numbers that now fall within the window, these packets are transmitted.
| Concept | go-back-n protocol | selective repeat protocol |
| Basic | Retransmits all the frames that sent after the frame | Retransmits only those frames that are suspected to lost or damaged. |
| Complexity | Less complicated. | More complex as it requires applying extra logic and sorting and storage, at sender and receiver. |
| Bandwidth | If error rate is high, it wastes a lot of bandwidth. | Comparatively less bandwidth is wasted in retransmitting. |
| Window size | N-1 | <= (N+1)/2 |

