Exams › GATE › Technical
An IP router implementing Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries:
Prefix — Output Interface Identifier
131.16.0.0 /12 — 3
131.28.0.0 /14 — 5
131.19.0.0 /16 — 2
131.22.0.0 /15 — 1
The identifier of the output interface on which this packet will be forwarded is _____.
- 3
- 5
- 2
- 1
Correct answer: 1
Solution
131.23 in binary is 10000011.00010111. The /15 entry 131.22.0.0 masks to 10000011.0001011x, and 131.23 (...0001011 1) matches it, so it qualifies; the /12 entry also matches but /15 is longer. Among the four entries only /12 and /15 match, and longest-prefix routing chooses /15, giving output interface 1 (index 3).
Related GATE Technical questions
⚔️ Practice GATE Technical free + battle 1v1 →