Open In App

Sliding Window protocols Summary With Questions

Last Updated : 03 May, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Prerequisites – Stop & Wait, Go Back N, Selective Repeat

Summary of all the protocols –

Before starting with the questions a quick recap for all the protocols. Stop and wait –

  1. Sender window size (Ws) = 1
  2. Receiver window size (Wr) = 1
  3. Sequence Number ≥ 1 + 1
  4. Uses independent acknowledgement
  5. Discards out of order packets
  6. Packet Loss ? Retransmit packet after time out
  7. Acknowledgement loss ? Resends packet after time out
  8. Efficiency = 1/(1+2a) where a = Tp / Tt

Go Back N –

  1. Sender window size Ws = N
  2. Receiver window size Wr = 1
  3. Sequence number ≥ N + 1
  4. Can use both cumulative or independent acknowledgement depends on acknowledge timer
  5. Discards out of order packets
  6. Packet Loss ? Track back N size from the last packet within the window limit to the lost packet and retransmit them
  7. Acknowledgement loss ? If not received before timeout the entire window N size is resend
  8. Efficiency = N/(1+2a) where a = Tp / Tt

Selective Repeat –

  1. Sender window size Ws = N
  2. Receiver window size Wr = N
  3. Sequence Number ≥ N + N
  4. Uses only independent acknowledgement
  5. Can Accept out of order packets
  6. Packet Loss ? Resend only the lost packet after timeout
  7. Acknowledgement loss ? Resend if not receive before timeout
  8. Efficiency = N/(1+2a) where a = Tp / Tt

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), 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)

Similar Reads

Difference Between Network Layer Protocols and Application Layer Protocols
Prerequisite: Basics of Computer Network In the world of computer networking, protocols are the set of rules that govern communication between devices. These rules dictate how devices should send and receive data over a network. Protocols are typically organized into layers, with each layer serving a specific purpose and working in conjunction with
6 min read
Difference between Stop and Wait protocol and Sliding Window protocol
Introduction: Both Stop and Wait protocol and Sliding Window protocol are the techniques to the solution of flow control handling. The main difference between Stop-and-wait protocol and Sliding window protocol is that in Stop-and-Wait Protocol, the sender sends one frame and wait for acknowledgement from the receiver whereas in sliding window proto
4 min read
Sliding Window Protocol | Set 3 (Selective Repeat)
Prerequisite : Sliding Window Protocol - Set 1 (Sender Side), Set 2 (Receiver Side) Why Selective Repeat Protocol? The go-back-n protocol works well if errors are less, but if the line is poor it wastes a lot of bandwidth on retransmitted frames. An alternative strategy, the selective repeat protocol, is to allow the receiver to accept and buffer t
3 min read
Sliding Window Protocol | Set 1 (Sender Side)
The Stop and Wait ARQ offers error and flow control but may cause big performance issues as the sender always waits for acknowledgment even if it has the next packet ready to send. Consider a situation where you have a high bandwidth connection and propagation delay is also high (you are connected to some server in some other country through a high
7 min read
Controlled Access Protocols in Computer Network
In controlled access, the stations seek information from one another to find which station has the right to send. It allows only one node to send at a time, to avoid the collision of messages on a shared medium. The three controlled-access methods are: ReservationPollingToken PassingReservationIn the reservation method, a station needs to make a re
6 min read
Multiple Access Protocols in Computer Network
The Data Link Layer is responsible for transmission of data between two nodes. Its main functions are- Data Link ControlMultiple Access Control Data Link control - The data link control is responsible for reliable transmission of message over transmission channel by using techniques like framing, error control and flow control. For Data link contro
9 min read
Securing Routing Protocols
Prerequisite - Routing Information Protocol (RIP), EIGRP fundamentals, OSPF protocol fundamentals Routing is a process in which a layer 3 device (either router or layer 3 switch) finds the best path between the source and destination network. Dynamic routing protocols are used to decrease administrator overhead, i.e., administrator have to configur
5 min read
Collision-Free Protocols in Computer Network
Almost all collisions can be avoided in CSMA/CD but they can still occur during the contention period. The collision during the contention period adversely affects the system performance, this happens when the cable is long and length of packet are short. This problem becomes serious as fiber optics network came into use. Here we shall discuss some
5 min read
Types of Virtual Private Network (VPN) and its Protocols
VPN stands for Virtual Private Network (VPN), that allows a user to connect to a private network over the Internet securely and privately. VPN creates an encrypted connection that is called VPN tunnel, and all Internet traffic and communication is passed through this secure tunnel. Virtual Private Network (VPN) is basically of 2 types: 1. Remote Ac
7 min read
MANET Routing Protocols
In Mobile Ad hoc Network (MANET), nodes do not know the topology of their network, instead they have to discover it by their own as the topology in the ad-hoc network is dynamic topology. The basic rules is that a new node whenever enters into an ad-hoc network, must announce its arrival and presence and should also listen to similar announcement b
5 min read
Article Tags :