CS FundamentalsHardGATE CS

An HDLC sender bit-stuffs the payload 0111111111111101111101111110 (a 0 after every five consecutive 1s, counting restarting after each stuffed 0). How many 0s does it insert?

  1. A. 4
  2. B. 3
  3. C. 5
  4. D. 2

Correct answer: A. 4

The run of 13 ones gets a 0 after the 5th and 10th ones; the next run of exactly 5 ones still gets a 0 even though a 0 follows; the run of 6 ones gets one. Total 4. Answering 3 assumes stuffing happens only when a sixth 1 would follow.

More Computer Networks questions

Exams that ask this topic