CS FundamentalsVery hardProduct company interview · GATE level
An HDLC-style link uses the flag 01111110 and bit stuffing: the sender inserts a 0 after every run of five consecutive 1s in the data. The 27-bit data field 011111011111101111110011111 is to be sent. How many bits are transmitted between the opening and closing flags?
- A. 29 bits
- B. 30 bits
- C. 31 bits
- D. 28 bits
Correct answer: C. 31 bits
A 0 is stuffed after every five consecutive 1s, whatever the next data bit is. The data has runs of 5, 6, 6 and 5 ones. Each run gets exactly one stuffed 0 (in a run of six, the count restarts after the stuffed 0, and the single remaining 1 does not reach five). That is 4 stuffed bits: 0111110011111010111110100111110, so 27 + 4 = 31 bits. Stuffing only where a sixth 1 actually follows gives 29; skipping the run at the very end gives 30 - but without that last 0, the data's final 11111 followed by the flag's leading 0 would be safe only by luck, and the rule is applied mechanically.
More Computer Networks questions
- Hosts A, B, C, D and E are each attached to their own port of one Ethernet switch whose MAC table is empty. These frames are then sent in…
- A leaky bucket holds at most 5 packets. In each clock tick, newly arrived packets are first placed in the bucket (those that do not fit…
- A browser with nothing cached fetches a page made of a base HTML file and 9 small images, all on one server. Resolving the server's name…
- For the host 172.29.115.201/21, what is the directed broadcast address of its subnet and how many usable host addresses does the subnet…
- The block 10.0.0.0/8 is cut into /19 subnets numbered 0, 1, 2, … in address order (subnet 0 is 10.0.0.0/19). What is the network address…
- A router's forwarding table holds 131.16.0.0/12 → R1, 131.28.0.0/14 → R2, 131.30.0.0/15 → R3, 131.30.128.0/17 → R4 and a default route →…