Skip to content
GATEiit

GATE CSE 2024 Session 1 Q58: Packets sent to R2 by longest-prefix match

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.

PrefixNext hop router
10.1.1.0/24R1
10.1.1.128/25R2
10.1.1.64/26R3
10.1.1.192/26R4

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

Numerical answer. No negative marking.
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

WhatsAppDownload image

Source: official GATE 2024 Session 1 CS question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key