Window size in Go-Back-N — Aptitude Question
Window size in Go-Back-N: A Go-Back-N protocol numbers its frames with a 4-bit sequence number. Answer and worked solution on CodeKairo.
- Topic: OS, DBMS & Networks
- Section: Programming MCQs
- Difficulty: Hard
- Time target: 120 seconds
Question
A Go-Back-N protocol numbers its frames with a 4-bit sequence number. What is the largest sender window it may use?
Options
- 4
- 8
- 15
- 16
Show the answer and the worked solution
Correct answer: C. 15
Worked solution
- Four bits give 2^4 = 16 distinct sequence numbers, 0 through 15.
- If the window used all 16, a receiver that lost every acknowledgement could not tell a retransmitted frame from a fresh one carrying the same number.
- Leaving one number unused removes the ambiguity, so the largest safe window is 16 − 1 = 15 frames. Selective repeat is stricter still and allows only half the space, 8.
Answer: 15.
The idea
Go-Back-N allows 2^n − 1 and selective repeat 2^(n−1), because selective repeat buffers out-of-order frames and so needs the old and new windows never to overlap.
Shortcut. A memory hook: the largest Go-Back-N window equals the largest sequence number, 2⁴ − 1 = 15.
Common trap. 16 uses all 2⁴ sequence numbers, which lets a fully retransmitted window be mistaken for a fresh one.