GATE 2025 CS (CS1) – Question 40
A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?
Subnet Address | Subnet Mask | Interface
145.36.0.0 | /16 | E1
145.36.128.0 | /17 | E2
145.36.64.0 | /18 | E3
145.36.255.0 | /24 | E4
Default | -- | E5
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) E3
Explanation
Destination: $145.36.109.70$. Compare the third octet $109=01101101_2$ with each entry.
| Entry | Prefix covers third octet | Match? |
|---|---|---|
| 145.36.0.0/16 | any | yes |
| 145.36.128.0/17 | 128–255 | no |
| 145.36.64.0/18 | 64–127 | yes (109 is in 64–127) |
| 145.36.255.0/24 | exactly 255 | no |
Two entries match: the /16 and the /18. Routers use **longest prefix match**, so the /18 entry wins: interface **E3**.
More Routing: Distance Vector and Link State Routing questions
- GATE 2025 CS (CS2) Q17
- GATE 2023 CS Q25
- GATE 2022 CS Q57
- GATE 2014 CS (CS1) Q33
- GATE 2014 CS (CS2) Q33
- GATE 2017 CS (CS2) Q19
All Routing: Distance Vector and Link State Routing questions →