GATE CS 2014 Set 3 — Question 36
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+2 / -0MediumLongest Prefix MatchNetwork Layer: RoutingComputer Networks
Computer Networks → Network Layer: Routing → Longest Prefix Match
Last updated
Question
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:
The identifier of the output interface on which this packet will be forwarded is ______.
| 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 |
Correct answer
1 to 1
Solution
We need to find the Longest Prefix Match for the destination IP address .IP Address:
First octet matches all entries.
Second octet in binary: Let's check each entry:
Therefore, the packet is forwarded to interface 1.
First octet matches all entries.
Second octet in binary: Let's check each entry:
1.131.16.0.0/12: Mask length 12. First 8 bits match (131). Next 4 bits of 16 () are . Next 4 bits of 23 () are . Match.
2.131.28.0.0/14: Mask length 14. First 8 bits match. Next 6 bits of 28 () are . Next 6 bits of 23 () are . Mismatch.
3.131.19.0.0/16: Mask length 16. Second octet 19 (). Mismatch.
4.131.22.0.0/15: Mask length 15. First 8 bits match. Next 7 bits of 22 () are . Next 7 bits of 23 () are . Match.
Matches found:- Interface 3 (Length 12)
- Interface 1 (Length 15)
Therefore, the packet is forwarded to interface 1.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Network Layer: Routing
2026 Set 1 Q18With respect to a TCP connection between a client and a server, which one of the following…2026 Set 1 Q19Which of the following statements is/are true with respect to the interaction of a web browser with…2026 Set 2 Q21Consider a file of size 4 million bytes being transferred between two hosts connected via a path…2026 Set 2 Q22Which one of the following protocols may need to broadcast some of its messages?2026 Set 2 Q33If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can…