GATE 2015 CS (CS2) – Question 36
An IP router has these routes:
| Network | Mask | Next hop |
|---|---|---|
| 128.96.170.0 | 255.255.254.0 | Interface 0 |
| 128.96.168.0 | 255.255.254.0 | Interface 1 |
| 128.96.166.0 | 255.255.254.0 | R2 |
| 128.96.164.0 | 255.255.252.0 | R3 |
| Default | — | R4 |
For i:128.96.171.92, ii:128.96.167.151, iii:128.96.163.151, iv:128.96.165.121, choose their next hops. Let a=Interface 0,b=Interface 1,c=R2,d=R3,e=R4.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) i–a,ii–c,iii–e,iv–d
Explanation
Apply longest-prefix matching. The /23 route at 170 covers 170–171, so i→a. The /23 at 166 covers 166–167 and overrides the broader /22 at 164, so ii→c. No listed prefix covers 163, hence iii→e. Address 165 lies in the 164–167 /22 but outside 166/23, hence iv→d. Thus A.
More IPv4: Addressing, CIDR, Fragmentation and NAT questions
- GATE 2015 CS (CS2) Q37
- GATE 2015 CS (CS3) Q46
- GATE 2026 CS (CS1) Q56
- GATE 2026 CS (CS2) Q33
- GATE 2025 CS (CS1) Q57
- GATE 2025 CS (CS2) Q18
All IPv4: Addressing, CIDR, Fragmentation and NAT questions →