Sliding Window Protocol: Stop-and-Wait ARQ, Go-Back-N & Selective Repeat

Computer Networks • Chapter 18
Sliding Window Protocol: Stop-and-Wait ARQ, Go-Back-N & Selective Repeat
Sending one frame and waiting for every ACK is simple, but it wastes a fast communication link.

Sliding Window Protocol solves this problem by allowing several frames to remain in transit before acknowledgements return.

From this basic idea we get three extremely important ARQ mechanisms: Stop-and-Wait ARQ, Go-Back-N ARQ and Selective Repeat ARQ.
Direct Answer

Sliding Window Protocol is a Data Link Layer flow-control and error-control technique in which the sender can transmit multiple frames before waiting for acknowledgements, depending on the sender window size.

It uses sequence numbers, acknowledgements and sender/receiver windows to control which frames may be sent, accepted and retransmitted.

The major ARQ protocols are: Stop-and-Wait ARQ, Go-Back-N ARQ and Selective Repeat ARQ.

What Is Sliding Window Protocol?

Sliding Window Protocol: Stop-and-Wait ARQ, Go-Back-N & Selective Repeat

Sliding Window Protocol is a technique used to control the transmission of frames between a sender and receiver.

Instead of forcing the sender to wait after every single frame, the protocol gives the sender a range of sequence numbers called the sending window.

Frames whose sequence numbers fall inside this window may be transmitted.

As acknowledgements arrive, the window moves or slides forward.

Simple Definition: Sliding Window Protocol allows multiple frames to be transmitted before all previous frames have been acknowledged, while sequence numbers and acknowledgements maintain flow and reliability.

Why Do We Need Sliding Window Protocol?

Stop-and-Wait is easy to understand, but it wastes time.

Suppose a frame takes only 1 ms to transmit but the acknowledgement takes a long time to return.

The sender may remain idle for most of the communication cycle.

Sliding Window solves this by keeping the link busy.

1

Stop-and-Wait

Send one frame and wait for ACK.

2

Sliding Window

Allow several outstanding frames.

3

Go-Back-N

Multiple frames may be sent, but one loss can force retransmission of several outstanding frames.

4

Selective Repeat

Retransmit only the missing or damaged frames.

Basic Idea of Sliding Window

Suppose frame sequence numbers are:

0, 1, 2, 3, 4, 5, 6, 7

Assume sender window size is 4.

Initially, the sender may transmit:

0, 1, 2 and 3

Frames 4, 5, 6 and 7 must wait.

SENDER WINDOW WINDOW SIZE = 4
0 Allowed
1 Allowed
2 Allowed
3 Allowed
4 Wait
5 Wait
6 Wait
7 Wait
0 Next Cycle
1 Next Cycle
Window
Window
Window
Window
Future
Future
Future
Future
Future
Future

What Is a Window?

A window is the range of sequence numbers that a sender or receiver is currently allowed to use.

There are two important windows:

  • Sender Window
  • Receiver Window

Sender Window

The sender window contains the sequence numbers of frames that may currently be transmitted.

It may contain:

  • Already transmitted but not yet acknowledged frames
  • Frames that are allowed to be transmitted immediately

The sender cannot normally transmit a new frame whose sequence number lies outside the current window.

Receiver Window

The receiver window defines which sequence numbers the receiver is willing to accept.

Its behaviour depends on the ARQ protocol.

Protocol Receiver Window Behaviour
Stop-and-Wait ARQ Expects only one specific sequence number.
Go-Back-N Receiver window is normally 1.
Selective Repeat Receiver window can contain multiple sequence numbers and buffer out-of-order frames.

Sequence Numbers in Sliding Window Protocol

Every data frame is assigned a sequence number.

Sequence numbers help the protocol:

  • Identify individual frames
  • Detect duplicates
  • Track acknowledgements
  • Recognize missing frames
  • Maintain correct delivery order

Modulo Sequence Numbering

Sequence numbers are not infinitely large.

If m bits are used for a sequence number, the total number of possible sequence numbers is:

Sequence Number Space
Sequence Space = 2m
Sequence Numbers = 0 to 2m - 1

Example

If m = 3:

23 = 8
Sequence Numbers = 0, 1, 2, 3, 4, 5, 6, 7

After sequence number 7, numbering returns to 0.

3-bit
Sequence
Space
0
1
2
3
4
5
6
7

How Does the Window Slide?

Suppose sender window contains:

0, 1, 2, 3

Frame 0 is successfully acknowledged.

The window can now move forward:

1, 2, 3, 4

Frame 4 becomes eligible for transmission.

This movement is called sliding the window.

Acknowledgement and Negative Acknowledgement

ACK

ACK means Acknowledgement.

It tells the sender that a frame or group of frames has been successfully received.

NAK

NAK means Negative Acknowledgement.

It may be used to request retransmission of missing or damaged data.

An explicit NAK is not compulsory in every ARQ implementation. A protocol can also detect a missing frame through timeout, duplicate ACK information or other protocol rules.

What Is Piggybacking?

In bidirectional communication, both devices may be sending data to each other.

Instead of sending a separate ACK frame immediately, a device can sometimes attach the acknowledgement information to its outgoing data frame.

This technique is called piggybacking.

Normal:
Data →
← ACK

Piggybacking:
Data + ACK information inside reverse-direction data frame

Advantage

Reduces separate acknowledgement overhead.

Limitation

The protocol cannot delay an ACK indefinitely while waiting for reverse-direction data, so a timer or maximum ACK delay is usually required.

Role of Timers

A sender needs to know when an expected acknowledgement has taken too long.

A timer is therefore associated with outstanding data.

When the timer expires:

Timeout → Retransmission Decision

The exact retransmission behaviour depends on the ARQ protocol.

  • Stop-and-Wait → retransmit one frame.
  • Go-Back-N → may retransmit the oldest missing frame and subsequent unacknowledged frames.
  • Selective Repeat → retransmit only the required frame.

Stop-and-Wait ARQ

Stop-and-Wait ARQ is the simplest reliable ARQ protocol.

Its sender window size is:

Sender Window = 1
Receiver Window = 1

Only one data frame can remain unacknowledged at any moment.

Working of Stop-and-Wait ARQ

SENDER
RECEIVER
Frame 0
ACK
Frame 1
  1. Sender creates Frame 0.
  2. Frame 0 is transmitted.
  3. Sender starts a timer.
  4. Receiver receives Frame 0 correctly.
  5. Receiver delivers its packet upward.
  6. Receiver sends ACK.
  7. Sender receives ACK and stops timer.
  8. Sender changes sequence number from 0 to 1.
  9. Frame 1 is transmitted.

Lost Frame and Lost ACK in Stop-and-Wait ARQ

Case 1 – Data Frame Is Lost

1
Sender transmits Frame 0 and starts timer.
2
Frame 0 is lost before reaching receiver.
3
No acknowledgement arrives.
4
Sender timer expires.
5
Sender retransmits Frame 0.

Case 2 – ACK Is Lost

Receiver may successfully receive Frame 0 but its ACK may disappear.

The sender eventually retransmits Frame 0.

Receiver uses the sequence number to identify it as a duplicate.

Exam Point: Stop-and-Wait ARQ needs sequence numbers even though only one frame is outstanding because a lost ACK can create duplicate retransmissions.

Alternating Bit Protocol

Stop-and-Wait ARQ commonly uses one sequence-number bit:

0 → 1 → 0 → 1 → 0 → 1 ...

This is known as the Alternating Bit Protocol.

Stop-and-Wait ARQ Efficiency

Let:

  • Tt = frame transmission time
  • Tp = one-way propagation delay
  • a = Tp / Tt

If ACK transmission time and processing delay are negligible:

a = Tp / Tt
Utilization U = 1 / (1 + 2a)

Stop-and-Wait performs poorly when propagation delay is much larger than transmission time.

Go-Back-N ARQ

Go-Back-N improves Stop-and-Wait by allowing multiple frames to be sent before waiting for individual acknowledgements.

The sender keeps several unacknowledged frames in its window.

However, the receiver normally accepts only the next expected frame.

Core Idea of Go-Back-N

If Frame k is lost or damaged, the receiver rejects later out-of-order frames, and the sender eventually retransmits Frame k and the following outstanding frames.

How Go-Back-N ARQ Works

Suppose sender window size is 4.

The sender transmits:

Frame 0, Frame 1, Frame 2, Frame 3

without waiting after each individual frame.

If all arrive correctly, acknowledgements allow the sender window to move forward.

Go-Back-N Window Size

If the sequence number field has m bits:

Sequence Number Space = 2m
Maximum GBN Sender Window = 2m - 1
GBN Receiver Window = 1

Example

For a 3-bit sequence number:

23 = 8 sequence numbers
Maximum GBN Sender Window = 8 - 1 = 7
Important: For Go-Back-N with m-bit sequence numbers: Ws ≤ 2m - 1

Cumulative Acknowledgement in Go-Back-N

Go-Back-N commonly uses cumulative acknowledgements.

A cumulative ACK confirms multiple consecutive frames at once.

If the receiver has correctly received Frames 0, 1, 2 and 3 in order, one cumulative acknowledgement can indicate that all frames up to that point have been successfully received.

The exact ACK numbering convention depends on the protocol description.

Some textbooks describe ACK n as:

  • “All frames up to n were received.”

Others describe it as:

  • “The next frame expected is n.”
Always follow the ACK-number convention used in your university question or textbook. The underlying concept is cumulative acknowledgement, but notation can differ.

What Happens When a Frame Is Lost in Go-Back-N?

Suppose the sender sends:

0, 1, 2, 3, 4

but Frame 2 is lost.

GO-BACK-N RECOVERY
Frame 0 Accepted
Frame 1 Accepted
Frame 2 LOST
Frame 3 Discarded
Frame 4 Discarded
Frame 2 Resend
Frame 3 Resend
Frame 4 Resend
Error at Frame 2 → Go Back to 2 → Retransmit 2, 3 and 4

Step-by-Step

  1. Frames 0 and 1 arrive correctly.
  2. Frame 2 is lost.
  3. Frame 3 arrives while receiver is expecting Frame 2.
  4. Frame 3 is normally discarded.
  5. Frame 4 is also discarded.
  6. Sender eventually detects the missing progress through timeout or acknowledgement behaviour.
  7. Sender retransmits Frame 2 and later outstanding frames.

Timer Management in Go-Back-N

A common Go-Back-N implementation maintains a timer for the oldest unacknowledged frame.

When that timer expires, the sender retransmits the oldest outstanding frame and later outstanding frames in the window.

Exam Point: GBN does not normally require a separate timer for every outstanding frame. A timer for the oldest unacknowledged frame is sufficient for the classical design.

Advantages of Go-Back-N

  • Better utilization than Stop-and-Wait.
  • Multiple frames can be in transit.
  • Receiver logic is simple.
  • Receiver does not need to buffer many out-of-order frames.
  • Cumulative ACK reduces acknowledgement overhead.

Limitations of Go-Back-N

  • One lost frame can cause retransmission of many correct frames.
  • Wastes bandwidth when error rate is high.
  • Receiver discards correctly received out-of-order frames.

Selective Repeat ARQ

Selective Repeat is a more efficient ARQ protocol for noisy links.

Unlike Go-Back-N, the receiver can accept and buffer correctly received frames even if an earlier frame is missing.

Only the missing or damaged frame needs retransmission.

Go-Back-N: One error → retransmit several frames.

Selective Repeat: One error → retransmit only the required frame.

How Selective Repeat ARQ Works

Suppose the sender transmits:

0, 1, 2, 3, 4

Frame 2 is lost.

Frames 3 and 4 still reach the receiver.

Instead of discarding them, Selective Repeat stores them in a receiver buffer.

SELECTIVE REPEAT RECEIVER BUFFER
Frame 0 Delivered
Frame 1 Delivered
Frame 2 Missing
Frame 3 Buffered
Frame 4 Buffered
Frame 5 Future
Frame 6 Future
Frame 7 Future

When retransmitted Frame 2 arrives:

  • Frame 2 is placed in order.
  • Buffered Frames 3 and 4 now become part of a complete consecutive sequence.
  • Frames can be delivered upward in correct order.

Selective Repeat Window Size

Selective Repeat has a stricter window-size condition because old and new sequence numbers must never become ambiguous.

If m bits are used:

Sequence Space = 2m
Maximum SR Window = 2m-1

Example

If m = 3:

Sequence Space = 8
Maximum SR Window = 22 = 4
For Selective Repeat, both sender and receiver windows must generally be no larger than half of the sequence-number space. Otherwise a delayed old frame could be mistaken for a new frame after sequence numbers wrap around.

Why Does Selective Repeat Need More Buffer?

Go-Back-N discards out-of-order frames.

Selective Repeat keeps them.

Therefore the receiver must maintain memory for:

  • Frames received correctly but out of order
  • Sequence-number status
  • Individual acknowledgement information
Exam Line: Selective Repeat improves bandwidth efficiency at the cost of greater receiver-buffer and protocol complexity.

Lost Frame in Selective Repeat

Suppose:

Frame 2 is lost but Frames 3 and 4 arrive correctly.

The receiver:

  1. Recognizes Frame 2 is missing.
  2. Buffers Frames 3 and 4.
  3. Acknowledges correctly received frames according to protocol rules.
  4. Waits for Frame 2.

The sender retransmits only Frame 2 after the required retransmission condition occurs.

Timers in Selective Repeat

Selective Repeat commonly needs independent tracking of outstanding frames.

Conceptually, each unacknowledged frame may require its own timer or equivalent per-frame retransmission timing information.

GBN → usually oldest outstanding frame timer
SR → individual outstanding frame timing

Important Window Size Rules

Protocol Sender Window Receiver Window m-Bit Rule
Stop-and-Wait ARQ 1 1 1-bit numbering 0 and 1 is sufficient
Go-Back-N ARQ Up to 2m − 1 1 Ws ≤ 2m − 1
Selective Repeat ARQ Up to half sequence space Usually same supported range Ws, Wr ≤ 2m−1

Why Is Go-Back-N Window at Most 2m − 1?

If the sender used the entire sequence number space, a new frame after wraparound could become ambiguous with an old unacknowledged frame.

Leaving at least one sequence number outside the sender window prevents this ambiguity.

Why Is Selective Repeat Limited to Half the Sequence Space?

Selective Repeat accepts out-of-order frames and stores them.

After sequence numbers wrap around, the receiver must distinguish:

  • Old delayed frames
  • New frames using the same sequence number

Keeping each active window no larger than half the sequence space prevents the old and new windows from overlapping ambiguously.

Sliding Window Efficiency

For an ideal no-error sliding-window link, let:

  • W = sender window size
  • Tp = propagation delay
  • Tt = frame transmission time
  • a = Tp / Tt
a = Tp / Tt
U ≈ W / (1 + 2a)
U cannot exceed 1
Therefore: U = min[1, W / (1 + 2a)]
This ideal formula assumes negligible ACK transmission time, negligible processing time and no transmission errors. Errors reduce real throughput, especially in Go-Back-N when multiple frames must be retransmitted.

Condition for Full Link Utilization

To keep the sender continuously busy in the ideal case:

W ≥ 1 + 2a

The window must be large enough to fill the communication path while earlier acknowledgements are still returning.

Bandwidth-Delay Product

Bandwidth-delay product tells us how much data can be “in flight” on a link.

Bandwidth-Delay Product = Bandwidth × Propagation Delay

For bidirectional acknowledgement timing, sliding-window sizing is closely related to the round-trip delay and the amount of unacknowledged data needed to keep the link busy.

Exam Understanding: A high-bandwidth, long-delay link needs a larger sending window than a low-delay link if we want high utilization.

Solved Numericals on Sliding Window Protocol

Numerical 1: Maximum Go-Back-N Window

A protocol uses 4-bit sequence numbers. Find the maximum sender window size for Go-Back-N.

m = 4
Sequence Space = 24 = 16
Maximum GBN Window = 16 - 1
Answer = 15 Frames

Numerical 2: Maximum Selective Repeat Window

A protocol uses 4-bit sequence numbers. Find the maximum Selective Repeat window.

Maximum SR Window = 2m-1
= 23
Answer = 8 Frames

Numerical 3: Stop-and-Wait Efficiency

Frame transmission time = 10 ms.

Propagation delay = 20 ms.

a = 20 / 10 = 2
U = 1 / (1 + 2a)
= 1 / 5
Answer = 20%

Numerical 4: Sliding Window Utilization

Suppose:

  • Window size W = 5
  • Propagation delay = 20 ms
  • Transmission time = 10 ms
a = 20 / 10 = 2
1 + 2a = 5
U = W / (1 + 2a)
U = 5 / 5 = 1
Answer = 100% ideal utilization

Numerical 5: Required Window for Full Utilization

Propagation delay = 40 ms.

Frame transmission time = 10 ms.

a = 40 / 10 = 4
W ≥ 1 + 2a
W ≥ 1 + 8
Answer: W ≥ 9

Numerical 6: Required Sequence Bits for GBN

A Go-Back-N protocol requires a sender window of 31 frames.

Find the minimum sequence-number bits.

2m - 1 ≥ 31
2m ≥ 32
m ≥ 5
Answer = 5 bits

Numerical 7: Required Sequence Bits for Selective Repeat

Selective Repeat requires a window size of 16.

2m-1 ≥ 16
m - 1 ≥ 4
m ≥ 5
Answer = 5 bits

Stop-and-Wait ARQ vs Go-Back-N vs Selective Repeat

Feature Stop-and-Wait ARQ Go-Back-N ARQ Selective Repeat ARQ
Sender Window 1 Multiple frames Multiple frames
Receiver Window 1 1 Multiple frames
Outstanding Frames One Several Several
Sequence Number Need 1 bit sufficient m-bit modulo numbering m-bit modulo numbering
Sender Window Rule 1 ≤ 2m − 1 ≤ 2m−1
Receiver Window Rule 1 1 ≤ 2m−1
Out-of-Order Frames Not relevant beyond duplicate handling Discarded Buffered
ACK Type Per-frame Usually cumulative Selective / individual style
Frame Loss Retransmit one frame Retransmit missing frame and following outstanding frames Retransmit only required frame
Receiver Buffer Small Small Larger
Timer Complexity Simple Usually oldest outstanding frame Per-frame tracking more complex
Efficiency Lowest on long-delay links Good when errors are rare Best when errors are significant
Protocol Complexity Lowest Moderate Highest

Advantages and Limitations of Sliding Window Protocols

Advantages

  • Better link utilization than basic Stop-and-Wait.
  • Several frames can be in transit simultaneously.
  • Supports efficient flow control.
  • Supports reliable error recovery through ARQ.
  • Sequence numbers prevent duplicate delivery.
  • Window size can be chosen according to link characteristics.
  • Go-Back-N uses simple receiver logic.
  • Selective Repeat reduces unnecessary retransmission.
  • Useful on high bandwidth-delay links.

Limitations

  • More complex than Stop-and-Wait.
  • Requires sequence-number management.
  • Requires sender buffers.
  • Selective Repeat requires substantial receiver buffering.
  • Timers add implementation complexity.
  • Incorrect window size can create sequence ambiguity.
  • GBN can waste bandwidth after one error.
  • SR requires more complex ACK and reordering logic.

Common Exam Mistakes

Mistake 1: Sliding Window means every protocol has the same window size.

No. Stop-and-Wait, GBN and SR use different window rules.
Mistake 2: Go-Back-N receiver accepts out-of-order frames.

Classical GBN receiver window is 1, so out-of-order frames are normally discarded.
Mistake 3: Selective Repeat retransmits every frame after one error.

No. SR retransmits only the required lost or damaged frame.
Mistake 4: GBN sender window can equal 2m.

No. Maximum classical GBN sender window is 2m − 1.
Mistake 5: SR window can be 2m − 1.

No. Classical SR window must generally be no larger than half the sequence space.
Mistake 6: Stop-and-Wait needs a large sender window.

Its sender window size is exactly 1.
Mistake 7: Sequence numbers are only for ordering.

They also prevent duplicate delivery and help associate ACKs with frames.
Mistake 8: ACK is always a separate frame.

In bidirectional traffic, ACK information may be piggybacked.
Mistake 9: GBN and SR use identical retransmission strategies.

GBN retransmits a sequence of outstanding frames; SR retransmits selectively.
Mistake 10: Larger window always means unlimited improvement.

Utilization cannot exceed 100%, and protocol sequence-space limits still apply.
Mistake 11: Propagation delay and transmission time are identical.

They represent different physical effects.
Mistake 12: GBN always retransmits immediately when one frame disappears.

Recovery depends on ACK/NAK and timer behaviour. In the classical timeout case, the sender retransmits from the oldest missing unacknowledged frame.

Sliding Window Protocol Quick Revision

EXAM MEMORY BOARD
Sliding Window = Multiple Outstanding Frames
Sequence Space = 2m
Stop-and-Wait Window = 1
Stop-and-Wait Sequence = 0, 1, 0, 1...
GBN Sender Window ≤ 2m - 1
GBN Receiver Window = 1
GBN = Cumulative ACK
GBN Error → Go Back and Resend
SR Window ≤ 2m-1
SR = Buffer Out-of-Order Frames
SR Error → Retransmit Only Missing Frame
a = Tp / Tt
Stop-and-Wait U = 1 / (1 + 2a)
Sliding Window U = min[1, W / (1 + 2a)]
Full Utilization When W ≥ 1 + 2a

Important Exam Questions With Answers

1. What is Sliding Window Protocol?
Sliding Window Protocol is a flow-control and error-control technique in which the sender can transmit several frames before receiving acknowledgements for all previously transmitted frames. Sender and receiver maintain windows containing valid sequence numbers, and these windows move forward as frames are acknowledged.
2. Why is Sliding Window better than Stop-and-Wait?
Stop-and-Wait permits only one outstanding frame, causing the sender to remain idle while waiting for ACK. Sliding Window allows multiple outstanding frames and therefore keeps the communication link busy for a larger fraction of time.
3. What is a sender window?
The sender window is the range of sequence numbers that the sender is currently allowed to transmit. It includes frames already sent but not acknowledged and frames that may still be transmitted before the window becomes full.
4. What is a receiver window?
The receiver window is the range of sequence numbers the receiver is currently willing to accept. In GBN its size is normally one, while in Selective Repeat multiple sequence numbers may be accepted.
5. What is meant by sliding the window?
When acknowledgements confirm successful frame reception, the lower edge of the active window moves forward, making new sequence numbers eligible for transmission or reception. This movement is called sliding the window.
6. What is sequence-number space?
If m bits are used for sequence numbers, there are 2^m different sequence values ranging from 0 to 2^m − 1. After the last value, numbering wraps around to zero.
7. What is Stop-and-Wait ARQ?
Stop-and-Wait ARQ is a reliable protocol in which the sender transmits one frame, starts a timer and waits for its acknowledgement. If the ACK does not arrive before timeout, the same frame is retransmitted.
8. Why are sequence numbers 0 and 1 enough in Stop-and-Wait ARQ?
Only one frame can remain unacknowledged at a time. The receiver only needs to distinguish the current new frame from a retransmission of the previous frame, so one sequence-number bit is sufficient.
9. What is the Alternating Bit Protocol?
It is a Stop-and-Wait ARQ protocol in which the sequence number alternates between 0 and 1 for successive frames.
10. What happens when a data frame is lost in Stop-and-Wait ARQ?
The receiver sends no valid acknowledgement because it never receives the frame. The sender's timer expires and the sender retransmits the same frame.
11. What happens when an ACK is lost?
The sender does not know that the original frame was successfully received. After timeout it retransmits the frame. The receiver identifies the repeated sequence number as a duplicate and avoids delivering the same packet twice.
12. What is Go-Back-N ARQ?
Go-Back-N is a sliding-window ARQ protocol that allows multiple frames to be outstanding. If one frame is missing or damaged, the receiver normally discards later out-of-order frames and the sender retransmits from the missing frame onward.
13. What is the maximum sender window of Go-Back-N?
For an m-bit sequence number field, the maximum classical Go-Back-N sender window is 2^m − 1 frames.
14. What is the receiver window size in Go-Back-N?
The classical Go-Back-N receiver window size is one because the receiver only accepts the next expected frame and normally discards later out-of-order frames.
15. What is cumulative acknowledgement?
A cumulative ACK confirms successful reception of a continuous sequence of frames rather than acknowledging every frame independently. For example, an ACK may indicate that all frames up to a certain sequence number have arrived correctly.
16. Why is Go-Back-N called Go-Back-N?
When a frame is lost, the sender goes back to that missing frame and retransmits it together with the subsequent outstanding frames. Therefore several frames may be resent after a single error.
17. What is Selective Repeat ARQ?
Selective Repeat is a sliding-window ARQ protocol in which the receiver can accept and buffer correct out-of-order frames and the sender retransmits only the specific frames that are lost or damaged.
18. What is the maximum window size in Selective Repeat?
For m-bit sequence numbers, each Selective Repeat window must generally be no larger than 2^(m−1), which is half of the total sequence-number space.
19. Why must the Selective Repeat window be at most half the sequence space?
Because sequence numbers are reused after wraparound. If the window were larger than half the sequence space, a delayed old frame could fall inside the new receiver window and be mistaken for a new frame.
20. How does Selective Repeat handle out-of-order frames?
The receiver stores correctly received out-of-order frames in a buffer. When the missing earlier frame arrives, the receiver can assemble the complete ordered sequence and deliver it upward.
21. Why does Selective Repeat require more memory?
It must store multiple out-of-order frames until the missing frames arrive. Therefore receiver buffering and per-frame state management are greater than in Go-Back-N.
22. What is piggybacking?
Piggybacking is the process of attaching acknowledgement information to a data frame travelling in the reverse direction instead of sending a separate ACK frame.
23. What is the advantage of piggybacking?
It reduces the number of separate control frames and therefore lowers acknowledgement overhead.
24. What is the role of a timer in ARQ?
A timer allows the sender to detect that the expected acknowledgement has not arrived within a reasonable period. Timeout then causes the appropriate retransmission action.
25. Differentiate between Go-Back-N and Selective Repeat.
GBN discards out-of-order frames and retransmits the missing frame plus following outstanding frames. Selective Repeat buffers out-of-order frames and retransmits only the missing or damaged frames. GBN is simpler, while SR is more bandwidth-efficient on error-prone links.
26. What is the Stop-and-Wait utilization formula?
Ignoring ACK transmission and processing time, U = 1/(1+2a), where a = propagation delay divided by frame transmission time.
27. What is the ideal sliding-window utilization formula?
Ignoring errors, ACK transmission time and processing delays, U = min[1, W/(1+2a)], where W is sender window size and a = Tp/Tt.
28. When can a sliding-window protocol achieve 100% ideal utilization?
When the sender window is large enough to cover the complete round-trip waiting period. Under the simplified model, full utilization is possible when W ≥ 1 + 2a.
29. What is bandwidth-delay product?
Bandwidth-delay product is the amount of data that can occupy a communication path while signals propagate across it. It is calculated as bandwidth multiplied by propagation delay.
30. Why are Sliding Window protocols important?
They improve link utilization, provide flow control, support reliable retransmission and make high-speed communication more efficient than sending one frame and waiting after every transmission.
31. A GBN protocol uses 3-bit sequence numbers. What is the maximum sender window?
2^3 = 8 sequence numbers. Maximum GBN sender window = 8 − 1 = 7 frames.
32. A Selective Repeat protocol uses 3-bit sequence numbers. Find maximum window size.
Maximum SR window = 2^(3−1) = 2^2 = 4 frames.
33. GBN needs a window of 15 frames. What is the minimum number of sequence bits?
We need 2^m − 1 ≥ 15. Therefore 2^m ≥ 16, so m = 4 bits.
34. Selective Repeat needs a window of 8 frames. Minimum sequence bits?
We need 2^(m−1) ≥ 8. Therefore m−1 ≥ 3 and m = 4 bits.
35. Tp = 30 ms and Tt = 10 ms. Find Stop-and-Wait utilization.
a = 30/10 = 3. U = 1/(1+2×3) = 1/7 ≈ 14.29%.
36. Tp = 20 ms, Tt = 5 ms and W = 9. Find ideal sliding-window utilization.
a = 20/5 = 4. Therefore 1+2a = 9. U = min[1, 9/9] = 1 or 100%.
37. Tp = 20 ms and Tt = 5 ms. What minimum window gives full utilization?
a = 20/5 = 4. Full utilization requires W ≥ 1+2a = 1+8 = 9 frames.
38. A 5-bit sequence field is used. Find sequence space, maximum GBN window and maximum SR window.
Sequence space = 2^5 = 32. Maximum GBN window = 31. Maximum SR window = 2^4 = 16.
39. Why does GBN perform poorly when error rate is high?
Because one lost frame can cause several correctly transmitted later frames to be discarded and retransmitted. The amount of wasted bandwidth therefore increases when errors occur frequently.
40. Which protocol is more efficient on an error-prone long-delay link: GBN or SR? Why?
Selective Repeat generally uses bandwidth more efficiently because it retransmits only missing or damaged frames and buffers correct out-of-order frames. However, it requires more memory and more complex protocol logic.

Sliding Window Protocol MCQs With Answers

1. Sliding Window Protocol mainly improves:

A. Link utilization
B. DNS resolution
C. IP addressing
D. Encryption

Answer: A — Link utilization
2. Stop-and-Wait sender window size is:

A. 1
B. 2
C. 7
D. Unlimited

Answer: A — 1
3. Stop-and-Wait ARQ commonly uses sequence numbers:

A. 0 and 1
B. 0 to 255 only
C. 1 to 100
D. No sequence numbers

Answer: A — 0 and 1
4. Go-Back-N receiver window is normally:

A. 1
B. N
C. 2N
D. Unlimited

Answer: A — 1
5. For m-bit sequence numbers, maximum GBN sender window is:

A. 2^m − 1
B. 2^m
C. 2^(m−1)
D. m

Answer: A — 2^m − 1
6. Selective Repeat window is limited to:

A. Half the sequence space
B. Entire sequence space
C. One frame only
D. Zero frames

Answer: A — Half the sequence space
7. Selective Repeat receiver:

A. Buffers valid out-of-order frames
B. Always discards every out-of-order frame
C. Has no sequence numbers
D. Cannot acknowledge frames

Answer: A — Buffers valid out-of-order frames
8. Go-Back-N commonly uses:

A. Cumulative ACK
B. No ACK
C. DNS ACK
D. Routing ACK

Answer: A — Cumulative ACK
9. If Frame 3 is lost in classical GBN, the sender may retransmit:

A. Frame 3 and following outstanding frames
B. Only Frame 0
C. No frames
D. Only the final frame

Answer: A
10. If one frame is lost in Selective Repeat:

A. Only the required frame is retransmitted
B. Entire network is restarted
C. Every frame from zero is retransmitted
D. No recovery is possible

Answer: A
11. Piggybacking means:

A. Adding ACK information to reverse-direction data
B. Adding a router
C. Duplicating every frame
D. Removing sequence numbers

Answer: A
12. Timeout is mainly used to detect:

A. Missing expected acknowledgement
B. MAC address length
C. IP route cost
D. DNS response type

Answer: A
13. Sequence numbers help prevent:

A. Duplicate delivery
B. Cable attenuation
C. Router congestion only
D. Encryption errors

Answer: A
14. Which protocol has the simplest receiver?

A. Go-Back-N
B. Selective Repeat
C. Both are identical
D. Neither

Answer: A — Go-Back-N
15. Which generally requires more receiver buffering?

A. Selective Repeat
B. Go-Back-N
C. Stop-and-Wait
D. Pure ALOHA

Answer: A — Selective Repeat
16. If m = 4, maximum GBN window is:

A. 15
B. 16
C. 8
D. 4

Answer: A — 15
17. If m = 4, maximum SR window is:

A. 8
B. 15
C. 16
D. 4

Answer: A — 8
18. In the formula a = Tp/Tt, Tp means:

A. Propagation delay
B. Packet size
C. Processing rate
D. Protocol number

Answer: A — Propagation delay
19. Full ideal sliding-window utilization is possible when:

A. W ≥ 1 + 2a
B. W = 0
C. W < 1 always
D. ACK is disabled

Answer: A
20. Which is most bandwidth-efficient on a high-error link?

A. Selective Repeat
B. Go-Back-N
C. Stop-and-Wait always
D. Unrestricted Simplex

Answer: A — Selective Repeat

Frequently Asked Questions About Sliding Window Protocol

What is Sliding Window Protocol in simple words?

It is a method that allows a sender to send several frames before waiting for all acknowledgements, improving link utilization compared with basic Stop-and-Wait.

What are the main Sliding Window ARQ protocols?

The main protocols are Stop-and-Wait ARQ, Go-Back-N ARQ and Selective Repeat ARQ.

What is the sender window?

The sender window contains the sequence numbers of frames that the sender is currently allowed to transmit.

What is the receiver window?

The receiver window contains the sequence numbers the receiver is currently prepared to accept.

What is the maximum Go-Back-N window for m bits?

The maximum classical Go-Back-N sender window is 2^m − 1.

What is the maximum Selective Repeat window for m bits?

The maximum classical Selective Repeat window is 2^(m−1), or half of the sequence-number space.

Why does Go-Back-N discard out-of-order frames?

Its receiver window is normally one, so the receiver only accepts the exact next expected sequence number.

Why is Selective Repeat more complex?

It accepts out-of-order frames, buffers them, tracks individual acknowledgements and performs selective retransmission.

What is cumulative ACK?

A cumulative acknowledgement confirms that a consecutive range of frames has been successfully received.

What is piggybacking?

Piggybacking attaches acknowledgement information to reverse-direction data instead of sending a separate ACK frame.

What is the Stop-and-Wait efficiency formula?

Ignoring ACK transmission time and processing delay, U = 1/(1+2a), where a = Tp/Tt.

When can Sliding Window achieve full utilization?

Under the simplified no-error model, full utilization is possible when the sender window satisfies W ≥ 1+2a.

Final Chapter Summary

Sliding Window Protocol improves communication efficiency by allowing several frames to remain unacknowledged at the same time.

The protocol revolves around four ideas:

Sequence Number + Sender Window + Receiver Window + Acknowledgement

Stop-and-Wait ARQ keeps only one frame outstanding.

Window = 1
Sequence = 0,1
Error → Timeout → Retransmit One Frame

Go-Back-N allows multiple outstanding frames but keeps a receiver window of one.

GBN Sender Window ≤ 2^m - 1
Receiver Window = 1
Cumulative ACK
Error → Retransmit Missing + Later Outstanding Frames

Selective Repeat accepts and buffers out-of-order frames.

SR Window ≤ 2^(m-1)
Out-of-Order Frames Buffered
Selective ACK
Error → Retransmit Only Required Frame

For numericals:

a = Tp / Tt

Stop-and-Wait: U = 1 / (1 + 2a)

Sliding Window: U = min[1, W / (1 + 2a)]

Full Utilization: W ≥ 1 + 2a

The easiest final memory line is:

Stop-and-Wait = One and Wait
Go-Back-N = Error Means Go Back
Selective Repeat = Repeat Only the Error

Next Chapter: HDLC in Computer Networks: Stations, Configurations, Frames, Modes & Working

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Join Telegram Exam updates and free resources