GATE / CS ARCHIVE

GATE CSE 2004 / QUESTION 55

Longest-prefix routing and host route

Computer Networks · Routing Algorithms · Full GATE CSE 2004 paper

GATE 2004, Q55 2 marks · MCQ
Report issue

Routing Algorithms

Question 55, GATE 2004: Router entries (destination,mask,interface) are (128.75.43.0,255.255.255.0,Eth0), (128.75.43.0,255.255.255.128,Eth1), (192.12.17.5,255.255.255.255,Eth3), and default→Eth2. Which interfaces forward destinations 128.75.43.16 and 192.12.17.10 respectively?
Options:
(A) Eth1,Eth2
(B) Eth0,Eth2
(C) Eth0,Eth3
(D) Eth1,Eth3
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step through it (4 steps)

Step 1: 128.75.43.16 matches both 128.75.43.0/24 and 128.75.43.0/25; the longer /25 prefix selects Eth1.192.12.17.10 does not equal the only 192.12.17.* explicit route, the /32 host route 192.12.17.5 via Eth3, so it uses default Eth2. Matching the first three octets does not make a /32 host route a subnet route.

Step 2: Teaching check: The /25 mask covers last-octet values 0–127, including 16, and outranks /24. The /32 entry matches exactly 192.12.17.5, not all addresses beginning 192.12.17. Any other unmatched destination, including .10, uses default.

Original paper, page 8