Question:medium

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

Show Hint

Always apply longest prefix match} in routing tables. Even if multiple entries match, the most specific subnet mask decides the outgoing interface.
Updated On: Feb 3, 2026
Show Solution

Solution and Explanation

Step 1: Express destination IP in binary

Destination IP:
200.150.68.118

Binary form:
200 = 11001000
150 = 10010110
68 = 01000100
118 = 01110110


Step 2: Apply subnet masks using bitwise AND

Entry 1: 200.150.0.0 /16
Mask: 255.255.0.0 → first 16 bits checked
After masking, network becomes 200.150.0.0 → Match

Entry 2: 200.150.64.0 /19
Mask: 255.255.224.0 → first 19 bits checked
Masked result = 200.150.64.0 → Match

Entry 3: 200.150.68.0 /24
Mask: 255.255.255.0 → first 24 bits checked
Masked result = 200.150.68.0 → Match

Entry 4: 200.150.68.64 /27
Mask: 255.255.255.224 → first 27 bits checked
Masked result = 200.150.68.96 ≠ 200.150.68.64 → No match


Step 3: Select the most specific match

Among all matching entries, the subnet with the highest number of fixed bits is chosen.
Matching prefixes: /16, /19, /24

The most specific prefix is /24, corresponding to Entry 3.


Final Answer:

Interface ID = 3

Was this answer helpful?
0


Questions Asked in GATE CS exam