GateAI
CIDR Notation

GATE CSE 2024 Set 1 · Q58

NAT2 marksMedium

Time

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. 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 ________

GATE CSE 2024 Set 1 Q58 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 40

CIDR Notation

To determine the next hop for each host IP address, we use the Longest Prefix Match (LPM) rule among the routing table entries:

  • Prefix 10.1.1.0/2410.1.1.0/24: covers addresses 10.1.1.010.1.1.0 to 10.1.1.25510.1.1.255 →\rightarrow Next hop: R1

  • Prefix 10.1.1.128/2510.1.1.128/25: covers addresses 10.1.1.12810.1.1.128 to 10.1.1.25510.1.1.255 →\rightarrow Next hop: R2

  • Prefix 10.1.1.64/2610.1.1.64/26: covers addresses 10.1.1.6410.1.1.64 to 10.1.1.12710.1.1.127 →\rightarrow Next hop: R3

  • Prefix 10.1.1.192/2610.1.1.192/26: covers addresses 10.1.1.19210.1.1.192 to 10.1.1.25510.1.1.255 →\rightarrow Next hop: R4

Now, evaluate each destination host IP:

  1. 10.1.1.1610.1.1.16:

    • Matches: /24/24

    • Longest match: /24→/24 \rightarrow R1

  2. 10.1.1.7210.1.1.72:

    • Matches: /24/24, /26/26 (10.1.1.64/2610.1.1.64/26)

    • Longest match: /26→/26 \rightarrow R3

  3. 10.1.1.13210.1.1.132:

    • Matches: /24/24, /25/25 (10.1.1.128/2510.1.1.128/25)

    • Does not match 10.1.1.192/2610.1.1.192/26

    • Longest match: /25→/25 \rightarrow R2

  4. 10.1.1.19110.1.1.191:

    • Matches: /24/24, /25/25 (10.1.1.128/2510.1.1.128/25)

    • Does not match 10.1.1.192/2610.1.1.192/26

    • Longest match: /25→/25 \rightarrow R2

  5. 10.1.1.20510.1.1.205:

    • Matches: /24/24, /25/25, /26/26 (10.1.1.192/2610.1.1.192/26)

    • Longest match: /26→/26 \rightarrow R4

Hosts forwarded via R2 are 10.1.1.13210.1.1.132 and 10.1.1.19110.1.1.191 (a total of 22 hosts).

Since 2020 packets are sent to each host:

Total packets via R2=2×20=40\text{Total packets via R2} = 2 \times 20 = 40

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This CIDR Notation previous year question is Q58 of the GATE CSE 2024 Set 1 paper. Find more GATE CSE PYQs on CIDR Notation in Computer Networks, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

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.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

CIDR Notation in GATE CSE

CIDR Notation has 7 GATE CSE PYQs across 7 papers from 2022 to 2026. 2 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2024 Set 1.

How GATE tests CIDR Notation

More from GATE CSE 2024 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2024 Set 1 · Q58 · NAT

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. 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 …

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.