L5. Compare go-back-N vs selective repeat mechanisms. Which one is used in TCP? Flashcards
What are GBN and SR?
Go-Back-N (GBN) and Selective Repeat (SR) are two common Automatic Repeat reQuest (ARQ) protocols used for reliable data transmission over networks.
How do GBN and SR differ?
They handle the retransmission of lost or corrupted packets differently.
What is ARQ?
Automatic Repeat reQuest (ARQ) is an error-control method for data transmission that uses acknowledgements (messages sent by the receiver indicating that it has correctly received a message) and timeouts (specified periods of time allowed to elapse before an acknowledgment is to be received) to achieve reliable data transmission over an unreliable communication channel.
How does GBN work?
GBN uses a sliding window protocol where the sender can send multiple frames before needing an acknowledgment for the first one, but the number of frames is limited by the window size.
The receiver sends a cumulative acknowledgment (ACK) for the last correctly received, in-order packet.
If a packet is lost or corrupted, the receiver discards all subsequent packets until the lost packet is retransmitted and correctly received. The sender must go back and retransmit the lost packet and all subsequent packets.
What are advantages and disadvantages of GBN?
Advantages: simplicity, memory use.
GBN is simple to implement because it requires little buffering at the receiver end. The receiver only needs to store one acknowledgment and can discard out-of-order packets.
Disadvantages: inefficiency in high error rates, throughput.
If a packet is lost or corrupted, all subsequent packets are retransmitted, leading to potentially significant redundant transmissions. Throughput can be significantly reduced in case of packet loss, especially with large windows.
How does SR work?
Similar to GBN, but both sender and receiver maintain a window of acceptable packets.
The receiver sends individual ACKs for each correctly received packet, even if they arrive out of order.
Only the lost or corrupted packets are retransmitted. The receiver stores out-of-order packets until the missing packet(s) are received, then reassembles the message in the correct order.
What are advantages and disadvantages of SR?
Advantages: efficiency, better throughput.
SR is more efficient than GBN because only the erroneous packets are retransmitted. This results in higher throughput in networks with higher error rates due to selective retransmissions.
Disadvantages: complexity, memory use.
SR is more complex to implement because it requires more storage at the receiver for out-of-order packets and additional logic to manage the buffer and windows.
How do ACKs work in GBN vs SR?
In GBN, the receiver sends a cumulative ACK for the last correctly received, in-order packet. In SR, an ACK is sent for each correctly received packet, even if it’s out of order.
How does retransmission work in GBN vs SR?
In GBN, if a packet is lost or corrupted, the receiver discards all subsequent packets until the lost packet is retransmitted and correctly received. The sender must go back and retransmit the lost packet and all subsequent packets.
In SR, only the lost or corrupted packets are retransmitted. The receiver stores out-of-order packets until the missing packet(s) are received, then reassembles the message in the correct order.
Does TCP use GBN or SR?
TCP uses a mechanism that is more similar to Selective Repeat, although it incorporates elements from both GBN and SR
How do ACKs work in TCP?
TCP traditionally uses cumulative acknowledgments like GBN. The acknowledgment number represents the next expected byte, which means all previous bytes have been received correctly.
TCP can also employ SACK, which allows the receiver to inform the sender about all segments that have been received successfully, thus enabling selective retransmission.
How does retransmission work in TCP?
If a packet is lost, TCP retransmits only that specific packet after a timeout, not the entire sequence, aligning more closely with the SR concept.