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?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2025 Set 1 · Q40
Time

Select one answerSingle correct
Solution
Official answer: A) E3
CIDR NotationTo determine the forwarding interface, we apply the Longest Prefix Match (LPM) algorithm for the destination IP address .
First, convert the 3rd octet () to binary:
Now, test each entry in the routing table:
(Interface E1):
Requires matching the first bits ().
The destination address has , so it matches (prefix length = ).
(Interface E2):
Requires the first bits to match.
The 17th bit (most significant bit of the 3rd octet) must be ().
The destination's 17th bit is . Hence, it does not match.
(Interface E3):
Requires the first bits to match.
The first two bits of the 3rd octet must be 01 ().
The destination's first two bits of the 3rd octet are 01. Hence, it matches (prefix length = ).
(Interface E4):
Requires the 3rd octet to be ().
The destination's 3rd octet is , so it does not match.
Comparing all matching entries, has the longest prefix length (). Therefore, the router forwards the packet to interface E3 (Option A).
Try the question first, then check your work.
Examiner trap
Convert the third octet of the destination IP address to binary and compare it with the subnet prefixes to find the matching entry with the longest prefix length (Longest Prefix Match).
This CIDR Notation previous year question is Q40 of the GATE CSE 2025 Set 1 paper. Find more GATE CSE PYQs on CIDR Notation in Computer Networks, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related CIDR Notation PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
CIDR Notation has 7 GATE CSE PYQs across 7 papers from 2022 to 2026. 2 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2025 Set 1.
How GATE tests CIDR NotationIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.