- 2073 Chaitra · 3 marks
Bit stuffing of a given string (1)
Short answer
In HDLC, a 0 is inserted after every five consecutive 1s. Applying to 01111011111011111110 yields the transmitted string 0111101111100111110110 (20 bits become 22).
Suppose a bit string, 01111011111011111110, needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing?
Rule: in bit stuffing (HDLC, flag = 01111110), the sender inserts a 0 after every five consecutive 1s in the data.
Given data (20 bits): 01111011111011111110
Step by step
| Position in data | Run of 1s | Action |
|---|---|---|
| 0 | none | send 0 |
| 1 to 4 | 1111 (four 1s) | no stuffing; next bit is 0 |
| 5 | 0 | send 0 |
| 6 to 10 | 11111 (five 1s) | insert 0 after the fifth 1 |
| 11 | 0 | send 0 |
| 12 to 18 | 1111111 (seven 1s) | insert 0 after the first five 1s; the remaining two 1s are followed by 0 |
| 19 | 0 | send 0 |
Grouped:
original : 0 1111 0 11111 0 1111111 0
stuffed : 0 1111 0 11111[0] 0 11111[0] 11 0
Stuffed data (22 bits): 0111101111100111110110
With flags added at both ends (01111110), the frame on the line is:
01111110 0111101111100111110110 01111110
Answer: 0111101111100111110110 (two extra 0s inserted, 20 bits become 22 bits).
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Error correction vs detection, bit stuffing · Computer Networks and Security, chapter 3
- Functions of data link layer · Computer Networks and Security, chapter 3 · asked 3×
- Data link layer framing · Computer Networks and Security, chapter 3 · asked 3×