GATE CS 2015 Set 2 — Question 36
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MCQ+2 / -0.67MediumLongest Prefix MatchNetwork Layer: RoutingComputer Networks
Computer Networks → Network Layer: Routing → Longest Prefix Match
Last updated
Question
Consider the following routing table at an IP router:
For each IP address in Group I identify the correct choice of the next hop from Group II using the entries from the routing table above.Group I
i) 128.96.171.92
ii) 128.96.167.151
iii) 128.96.163.151
iv) 128.96.165.121Group II
a) Interface 0
b) Interface 1
c) R2
d) R3
e) R4
| Network No. | Net 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 |
| 0.0.0.0 | Default | R4 |
i) 128.96.171.92
ii) 128.96.167.151
iii) 128.96.163.151
iv) 128.96.165.121Group II
a) Interface 0
b) Interface 1
c) R2
d) R3
e) R4
Correct answer
(A) i-a, ii-c, iii-e, iv-d
Solution
We perform Longest Prefix Match for each IP address.i) 128.96.171.92
- 128.96.170.0/23 (Mask 255.255.254.0): 171 in binary is 10101011. Mask 254 is 11111110. 171 & 254 = 170. Matches 128.96.170.0. Next Hop: Interface 0 (a).
- 128.96.170.0/23: 167 & 254 = 166 170. No match.
- 128.96.168.0/23: 167 & 254 = 166 168. No match.
- 128.96.166.0/23: 167 & 254 = 166. Matches 128.96.166.0. Next Hop: R2.
- 128.96.164.0/22 (Mask 255.255.252.0): 167 & 252 = 164. Matches 128.96.164.0. Next Hop: R3.
- Longest prefix is /23 (R2). Next Hop: R2 (c).
- 128.96.170.0/23: 163 & 254 = 162 170. No match.
- 128.96.168.0/23: 163 & 254 = 162 168. No match.
- 128.96.166.0/23: 163 & 254 = 162 166. No match.
- 128.96.164.0/22: 163 & 252 = 160 164. No match.
- Default route matches. Next Hop: R4 (e).
- 128.96.170.0/23: 165 & 254 = 164 170. No match.
- 128.96.168.0/23: 165 & 254 = 164 168. No match.
- 128.96.166.0/23: 165 & 254 = 164 166. No match.
- 128.96.164.0/22: 165 & 252 = 164. Matches 128.96.164.0. Next Hop: R3 (d).
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Network Layer: Routing
2026 Set 1 Q18With respect to a TCP connection between a client and a server, which one of the following…2026 Set 1 Q19Which of the following statements is/are true with respect to the interaction of a web browser with…2026 Set 2 Q21Consider a file of size 4 million bytes being transferred between two hosts connected via a path…2026 Set 2 Q22Which one of the following protocols may need to broadcast some of its messages?2026 Set 2 Q33If an IP network uses a subnet mask of 255.255.240.0, the maximum number of IP addresses that can…