GateAI
IPv4, CIDR and NAT

GATE CSE 2014 Set 3 · Q26

NAT2 marksMedium

Time

An IP router implementing Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries: Refer to the table below. The identifier of the output interface on which this packet will be forwarded is _____.

GATE CSE 2014 Set 3 Q26 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 1

IPv4, CIDR and NAT

To determine the forwarding interface, we convert the destination address into binary and apply the Longest Prefix Match rule.

Destination IP: 131.23.151.76131.23.151.76

  • First octet: 131=100000112131 = 10000011_2

  • Second octet: 23=00010111223 = 00010111_2

Now, check each routing table prefix:

  1. 131.16.0.0/12131.16.0.0/12:

    • Requires matching the first 12 bits.

    • 16=00010000216 = 00010000_2, so the first 4 bits of the second octet are 000120001_2.

    • The first 4 bits of 2323 are also 000120001_2.

    • Matches (length = 12).

  2. 131.28.0.0/14131.28.0.0/14:

    • Requires matching the first 14 bits.

    • 28=00011100228 = 00011100_2, so the first 6 bits of the second octet are 0001112000111_2.

    • The first 6 bits of 2323 are 0001012000101_2.

    • No match (0001112≠0001012000111_2 \neq 000101_2).

  3. 131.19.0.0/16131.19.0.0/16:

    • Requires matching the first 16 bits.

    • Second octet is 19=00010011219 = 00010011_2, which does not match 2323.

    • No match.

  4. 131.22.0.0/15131.22.0.0/15:

    • Requires matching the first 15 bits.

    • 22=00010110222 = 00010110_2, so the first 7 bits of the second octet are 000101120001011_2.

    • The first 7 bits of 2323 are 000101120001011_2.

    • Matches (length = 15).

Among all matching entries (/12/12 and /15/15), the longest prefix is /15/15, which corresponds to output interface identifier 1.

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 IPv4, CIDR and NAT previous year question is Q26 of the GATE CSE 2014 Set 3 paper. Find more GATE CSE PYQs on IPv4, CIDR and NAT 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 IPv4, CIDR and NAT 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.

IPv4, CIDR and NAT in GATE CSE

IPv4, CIDR and NAT has 14 GATE CSE PYQs across 10 papers from 2012 to 2025. 3 of them are 2-mark NAT questions like this one, and GATE CSE 2014 Set 3 has 4.

How GATE tests IPv4, CIDR and NAT

More from GATE CSE 2014 Set 3

Share this solution

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

GateAI solution cardGATE CSE 2014 Set 3 · Q26 · NAT

An IP router implementing Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries: Refer to the table below. The identifier of the output interface on which this packet will be forwarded 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.