Sliding Window protocols Summary With Questions (original) (raw)

Last Updated : 26 May, 2025

Sliding Window Protocol is a flow control mechanism used in data link and transport layers to manage the reliable and efficient transmission of frames or packets between sender and receiver. Key Concepts in Sliding Window Protocol :

Tt(data) :Transmission delay for Data packet
Tp : Propagation delay for Data packet
Tq: Queuing delay
Tpro: Processing delay
Tt(ack): Transmission delay for acknowledgment

Stop And Wait

Stop and Wait ARQ is a Sliding Window Protocol method used for the reliable delivery of data frames. The stop-and-wait ARQ is used for noisy channels or links to handle flow and error control between sender and receiver. The Stop and Wait ARQ protocol sends a data frame and then waits for an acknowledgment (ACK) from the receiver.

Stop-and-Wait-ARQ

STOP AND WAIT WORKING

**Go Back N

In Go-Back-N, the sender can send multiple data packets without waiting for an acknowledgement for each one. However, it can only send a certain number of packets (this is called the window size). If one packet is lost or not acknowledged, the sender must go back and resend that packet and all the packets that followed it, even if they were received correctly.

Sliding_SET_2-1

GB-N WORKING DIAGRAM

**Selective Repeat

**Selective Repeat protocol (SRP) is mostly identical to GBN protocol, except that buffers are used and the receiver, and the sender, each maintains a window of size. SRP works better when the link is very unreliable. Because in this case, retransmission tends to happen more frequently, selectively retransmitting frames is more efficient than retransmitting all of them. SRP also requires full-duplex link.

Sliding-Window-Protocol

SELECTIVE REPEAT WORKING

Practice Questions

**Example-1. In Stop and wait protocol every 4th packet is lost and we need to send total 10 packets so how many transmission it took to send all the packets?

**Explanation

1 2 3 4 5 6 7 8 9 10 (Initially)
^
1 2 3 4 4 5 6 7 8 9 10 (Packet no. 4 retransmitted)
^
1 2 3 4 4 5 6 7 7 8 9 10 (Packet no. 10 retransmitted)
^
1 2 3 4 4 5 6 7 7 8 9 10 10 (Result)

So, we retransmitted packet number 4, 7, 10 Total count = 13

**Example-2. In S&W protocol if Error probability is p and no. of packets to send is 'n'. How many packets we have to send ?

**Explanation

Total retransmissions = n*p0+ n*p1+ n*p2 + n*p3 + n*p4 + ... = n(1 + p + p2 + p3 + p4 + ...) = n*(1 / (1-p)) using infinite GP sum formula

**Example-3. In GBN sender Window size = 10 and Tp = 49.5ms & Tt = 1ms. What is the Efficiency of the protocol and Throughput given Bandwidth = 1000 bps?

**Explanation

Efficiency = N/(1+2a) as there is only transmission delay and propagation delay , N = 10 (given), a = Tp/Tt = 49.5

Efficiency = 10/(1 + 2 * 49.5)

= 10/100

= 0.1 or 10%

Throughput = Efficiency * Bandwidth = 0.1 * 1000 = 100

**Example-4. In GB3 if every 5th packet is lost & we need to send 10 packets so how many retransmissions are required ?

**Explanation

1 2 3 4 5 6 7 | 8 9 10
^ $ (packet no. 5 lost)
1 2 3 4 5 6 7 5 6 7 8 9 | 10
* ^ $
1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 10
* ^ $
1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 10 9 10 (count starts from * till ^)
(from ^ to $ retransmission is done)
**Note - From the Last packet is window size to lost pocket we resend the entire window. Total no. of transmissions = 18

**Example-5. In SR Ws = 5 and we are sending 10 packets where every 5th packet is lost find number of retransmissions?

**Explanation

1 2 3 4 5 6 7 8 9 10
^
1 2 3 4 5 5 6 7 8 9 10
^
1 2 3 4 5 5 6 7 8 9 9 10

We see here there is no role of Window size in SR only the lost packet is resent. Total transmissions = 12

**Example-6. If there is K bits sequence no. define require sender window size and receiver window size for S&W, GBN & SR?

**Explanation

Given, K bits,

For S&W Ws = 1 and Wr = 1

For GBN, Ws = 2K-1 and Wr = 1

For SR, Ws = 2K-1 and Wr = 2(K-1)