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 …
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2023 · Q65
Time

Your answerNumerical answer
Solution
Official answer: 3
CIDR NotationTo determine the forwarding interface, we apply the Longest Prefix Match rule by performing a bitwise AND between the destination IP address 200.150.68.118 and each subnet mask in the routing table:
Interface 1:
Subnet Mask: (/16)
Bitwise AND: 200.150.68.118255.255.0.0 = 200.150.0.0
Matches the Subnet Number 200.150.0.0 (Prefix length: ).
Interface 2:
Subnet Mask: (/19)
3rd octet: ,
Bitwise AND: 200.150.68.118255.255.224.0 = 200.150.64.0
Matches the Subnet Number 200.150.64.0 (Prefix length: ).
Interface 3:
Subnet Mask: (/24)
Bitwise AND: 200.150.68.118255.255.255.0 = 200.150.68.0
Matches the Subnet Number 200.150.68.0 (Prefix length: ).
Interface 4:
Subnet Mask: (/27)
4th octet: ,
Bitwise AND: 200.150.68.96200.150.68.64 (Does not match).
Among the matching interfaces (1, 2, and 3), Interface 3 has the longest prefix match (/24).
Therefore, the packet is forwarded to interface ID 3.
Try the question first, then check your work.
Examiner trap
Apply the bitwise AND operation between the destination IP address and each subnet mask to find matching subnets, then choose the interface corresponding to the longest prefix mask.
This CIDR Notation previous year question is Q65 of the GATE CSE 2023 paper. Find more GATE CSE PYQs on CIDR Notation in Computer Networks, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related CIDR Notation PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
CIDR Notation has 7 GATE CSE PYQs across 7 papers from 2022 to 2026. 2 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2023.
How GATE tests CIDR NotationIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.