GATE CSE 2024 Session 1 Q58: Packets sent to R2 by longest-prefix match
- Computer Networks
- 2 marks
- NAT
- No negative marking
Question
Consider the entries shown below in the forwarding table of an IP router. Each entry consists of an IP prefix and the corresponding next hop router for packets whose destination IP address matches the prefix. The notation "/N" in a prefix indicates a subnet mask with the most significant N bits set to 1.
| Prefix | Next hop router |
|---|---|
| 10.1.1.0/24 | R1 |
| 10.1.1.128/25 | R2 |
| 10.1.1.64/26 | R3 |
| 10.1.1.192/26 | R4 |
This router forwards 20 packets each to 5 hosts. The IP addresses of the hosts are 10.1.1.16, 10.1.1.72, 10.1.1.132, 10.1.1.191, and 10.1.1.205. The number of packets forwarded via the next hop router R2 is _______
Try it: numerical answer: type the value
Show answer and explanation
Answer: 40 (official GATE 2024 final answer key)
Concept used: Longest-prefix match: the most specific matching prefix wins.
First step: Write each prefix's last-octet range: /25 at .128 covers 128–255, /26 at .64 covers 64–127, /26 at .192 covers 192–255.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2024 Session 1 CS question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key
More Computer Networks PYQs
- 2026 Session 1 · Q18True statement about TCP connection setup and closing
- 2026 Session 1 · Q19HTTP 1.1 persistent connections and pipelining
- 2026 Session 1 · Q44When segment 2000 is sent under TCP slow start
- 2026 Session 1 · Q45Minimum sliding window size for full link utilisation
- 2026 Session 1 · Q56Valid CIDR blocks for 6000 addresses inside 202.16.0.0/15
- 2026 Session 2 · Q21File transfer time over three links of different bandwidth