Skip to content
GATEiit

GATE CSE 2023 Q65: Longest prefix match for 200.150.68.118

Question

The forwarding table of a router is shown below.

Subnet NumberSubnet MaskInterface ID
200.150.0.0255.255.0.01
200.150.64.0255.255.224.02
200.150.68.0255.255.255.03
200.150.68.64255.255.255.2244
Default0

A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID _______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 3 (official GATE 2023 final answer key)

Concept used: Routers forward on the longest matching prefix.

First step: AND the address with each mask, starting from the longest (/27), and compare with the subnet number.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2023 CS question paper and final answer key, organised by IIT Kanpur. Question paper · Answer key