GATE CS 2023 Set 1 — Question 65
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 NetworksSubnetting & CIDRNetwork Layer: Addressing
Computer Networks → Network Layer: Addressing → Longest Prefix Match
Last updated
Question
The forwarding table of a router is shown below.
A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID __________.
| Subnet Number | Subnet Mask | Interface ID |
|---|---|---|
| 200.150.0.0 | 255.255.0.0 | 1 |
| 200.150.64.0 | 255.255.224.0 | 2 |
| 200.150.68.0 | 255.255.255.0 | 3 |
| 200.150.68.64 | 255.255.255.224 | 4 |
| Default | 0 |
Correct answer
3 to 3
Solution
To determine the correct interface, we perform a bitwise AND operation between the destination IP address (200.150.68.118) and each subnet mask in the table. If the result matches the corresponding subnet number, it is a potential match. If multiple matches exist, the router selects the one with the longest prefix (most specific mask).
1.Interface 1: . Match. Prefix length is 16 bits.
2.Interface 2: . Match. Prefix length is 19 bits (, so ).
3.Interface 3: . Match. Prefix length is 24 bits.
4.Interface 4: . No match. ().
Comparing the matching prefixes (/16, /19, and /24), the longest prefix match is Interface 3 (/24).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: Addressing
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…