Sliding Window protocols Summary With Questions

03 May, 2022
Prerequisites – Stop & Wait, Go Back N, Selective Repeat
Before starting with the questions a quick recap for all the protocols. Stop and wait –
Sender window size (Ws) = 1Receiver window size (Wr) = 1Sequence Number ≥ 1 + 1Uses independent acknowledgementDiscards out of order packetsPacket Loss ? Retransmit packet after time outAcknowledgement loss ? Resends packet after time outEfficiency = 1/(1+2a) where a = Tp / Tt
Sender window size (Ws) = 1
Receiver window size (Wr) = 1
Sequence Number ≥ 1 + 1
Uses independent acknowledgement
Discards out of order packets
Packet Loss ? Retransmit packet after time out
Acknowledgement loss ? Resends packet after time out
Efficiency = 1/(1+2a) where a = Tp / Tt
Go Back N –
Sender window size Ws = NReceiver window size Wr = 1Sequence number ≥ N + 1Can use both cumulative or independent acknowledgement depends on acknowledge timerDiscards out of order packetsPacket Loss ? Track back N size from the last packet within the window limit to the lost packet and retransmit themAcknowledgement loss ? If not received before timeout the entire window N size is resendEfficiency = N/(1+2a) where a = Tp / Tt
Sender window size Ws = N
Receiver window size Wr = 1
Sequence number ≥ N + 1
Can use both cumulative or independent acknowledgement depends on acknowledge timer
Discards out of order packets
Packet Loss ? Track back N size from the last packet within the window limit to the lost packet and retransmit them
Acknowledgement loss ? If not received before timeout the entire window N size is resend
Efficiency = N/(1+2a) where a = Tp / Tt
Selective Repeat –
Sender window size Ws = NReceiver window size Wr = NSequence Number ≥ N + NUses only independent acknowledgementCan Accept out of order packetsPacket Loss ? Resend only the lost packet after timeoutAcknowledgement loss ? Resend if not receive before timeoutEfficiency = N/(1+2a) where a = Tp / Tt
Sender window size Ws = N
Receiver window size Wr = N
Sequence Number ≥ N + N
Uses only independent acknowledgement
Can Accept out of order packets
Packet Loss ? Resend only the lost packet after timeout
Acknowledgement loss ? Resend if not receive before timeout
Efficiency = N/(1+2a) where a = Tp / Tt
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), 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)
ayushgangwar
vaibhavsinghtanwar3
rkbhola5
divyanshkhetan
Computer Networks
GATE CS
Computer Networks
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
GSM in Wireless Communication
Socket Programming in Python
Differences between IPv4 and IPv6
Secure Socket Layer (SSL)
Wireless Application Protocol
ACID Properties in DBMS
Types of Operating Systems
Normal Forms in DBMS
Page Replacement Algorithms in Operating Systems
Introduction of Operating System - Set 1