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

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: Aug 26, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Forwarding principle.
Routers use longest prefix match. That is, among all subnet matches, the subnet with the most specific (longest) mask is chosen.
Step 2: Convert destination address.
Destination = $200.150.68.118$.
Step 3: Check against entries.
Entry 1: Subnet $200.150.0.0/16$ (mask 255.255.0.0). Matches since first 16 bits are 200.150. $\Rightarrow$ Match. Entry 2: Subnet $200.150.64.0/19$ (mask 255.255.224.0). Range: 200.150.64.0 – 200.150.95.255.
118 falls within. $\Rightarrow$ Match.
Entry 3: Subnet $200.150.68.0/24$ (mask 255.255.255.0).
Range: 200.150.68.0 – 200.150.68.255.
118 falls within. $\Rightarrow$ Match.
Entry 4: Subnet $200.150.68.64/27$ (mask 255.255.255.224).
Range: 200.150.68.64 – 200.150.68.95.
118 is outside (since 118>95). $\Rightarrow$ No match.
Step 4: Longest prefix match.
Matching subnets: /16, /19, /24.
Longest prefix is /24 (Entry 3).
\[ \boxed{\text{Interface ID = 3}} \]
Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions