CS FundamentalsVery hardProduct company interview · GATE level
A router uses longest-prefix matching with these entries: 10.4.0.0/14 -> interface A, 10.6.0.0/15 -> interface B, 10.6.128.0/17 -> interface C, 10.7.64.0/18 -> interface D. How many distinct destination IPv4 addresses are forwarded out of interface B?
- A. 114688
- B. 131072
- C. 98304
- D. 81920
Correct answer: D. 81920
10.6.0.0/15 covers 10.6.0.0-10.7.255.255, which is 2^17 = 131072 addresses. Two more specific entries lie inside it: 10.6.128.0/17 (2^15 = 32768 addresses) and 10.7.64.0/18 (2^14 = 16384 addresses), and a longer prefix always wins. So B gets 131072 - 32768 - 16384 = 81920. 131072 ignores both more-specific routes, and 98304 or 114688 subtract only one of them.
More Computer Networks questions
- A site owns 172.18.72.0/22, 172.18.76.0/23 and 172.18.80.0/22 and wants to advertise them with one prefix. What is the smallest single…
- From the block 192.168.0.0/22, three subnets have already been assigned: 192.168.1.64/26, 192.168.2.0/25 and 192.168.3.240/28. How many…
- Host X sends 10 packets of 1000 bytes each to host Y through two store-and-forward routers. The three links on the path have rates 2 Mbps…
- A 4800-byte message is sent over a path of 4 store-and-forward links of equal rate (3 routers), with negligible propagation delay. The…
- A host is shaped by a token bucket of capacity 6 Mb that fills at 4 Mbps; the bucket is full at t = 0. The output link can carry at most…
- Stations sharing a 56 kbps pure ALOHA channel send 1000-bit frames. Together (new frames plus retransmissions) they attempt 28 frames per…