The stop-and-wait protocol is ineffective because the sender can only send one packet at a time and will have to wait until the previous frame is acknowledged before transmitting the subsequent frame. This led to the introduction of the Go-Back-N protocol.
The Go-Back-N protocol is a data link layer and transport layer protocol that employs the sliding window approach to send data frames reliably and sequentially. We'll first look at the sliding window protocol and then review the Go-Back-N functions. The sliding window protocol enables sending numerous frames at once.
Note: For the data link layer, Go-Back-N is used for
communication, and transport layer protocol is used for end-to-end communication. hop-to-hop It means the transmission of packets from the network interface card (NIC) of the host to the interface of the router.
The 'N' in Go-Back-N specifies the size of the sender window. The number of frames transmitted while the sender waits for an acknowledgment is also determined by the value of N. The sender sends frames in sequential order. The receiver can only buffer one frame at a time since the size of the receiver window is equal to 1, but the sender can buffer N frames.
The Go-Back-N sender uses a retransmission timer to detect the lost segments. The Go-Back-N receiver uses both independent acknowledgment and cumulative acknowledgment.
Note: The size of the sender's window is calculated as
, where is the number of bits required to represent the sequence number.
The Go-Back-N protocol entails the following rules:
Only frames that arrive in order are accepted.
Any out-of-order frames are discarded.
It always sends back an acknowledgment after receiving a DataFrame that includes the sequence number of the most recent frame it has received.
The following illustration assists in grasping the concept of the Go-Back-N protocol:
Now, with the aid of an illustration, we'll understand how Go-Back-N operates.
The sender's window has a size of 3 or Go-Back-3.
The sender has sent out packets 0, 1, and 2.
The receiver is now anticipating packet 1 after acknowledging packet 0.
Packet 1 is lost somewhere in the network.
Since it's waiting for the packet with sequence number 1, the receiver will ignore every packet the sender delivered after packet one.
On the sender's side, a retransmission timer is set to expire.
The sender will re-transmit all packets from one up to N, which is 3.
The key benefit of the Go-Back-N is that it is easy to implement and performs well when only a small number of segments are lost. However, the performance rapidly falls when there is numerous packet loss.