GateAI
CIDR Notation

GATE CSE 2023 · Q65

NAT2 marksMedium

Time

The forwarding table of a router is shown below. A packet addressed to a destination address 200.150.68.118200.150.68.118 arrives at the router. It will be forwarded to the interface with ID _________.

GATE CSE 2023 Q65 diagram

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 3

CIDR Notation

To determine the forwarding interface, we apply the Longest Prefix Match rule by performing a bitwise AND between the destination IP address 200.150.68.118 and each subnet mask in the routing table:

  1. Interface 1:

    • Subnet Mask: 255.255.0.0255.255.0.0 (/16)

    • Bitwise AND: 200.150.68.118AND\text{AND}255.255.0.0 = 200.150.0.0

    • Matches the Subnet Number 200.150.0.0 (Prefix length: 1616).

  2. Interface 2:

    • Subnet Mask: 255.255.224.0255.255.224.0 (/19)

    • 3rd octet: 68=01000100268 = 01000100_2, 224=111000002224 = 11100000_2

    • 68 AND 224=010000002=6468 \text{ AND } 224 = 01000000_2 = 64

    • Bitwise AND: 200.150.68.118AND\text{AND}255.255.224.0 = 200.150.64.0

    • Matches the Subnet Number 200.150.64.0 (Prefix length: 1919).

  3. Interface 3:

    • Subnet Mask: 255.255.255.0255.255.255.0 (/24)

    • Bitwise AND: 200.150.68.118AND\text{AND}255.255.255.0 = 200.150.68.0

    • Matches the Subnet Number 200.150.68.0 (Prefix length: 2424).

  4. Interface 4:

    • Subnet Mask: 255.255.255.224255.255.255.224 (/27)

    • 4th octet: 118=011101102118 = 01110110_2, 224=111000002224 = 11100000_2

    • 118 AND 224=011000002=96≠64118 \text{ AND } 224 = 01100000_2 = 96 \neq 64

    • Bitwise AND: 200.150.68.96≠\neq200.150.68.64 (Does not match).

Among the matching interfaces (1, 2, and 3), Interface 3 has the longest prefix match (/24).

Therefore, the packet is forwarded to interface ID 3.

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 Q65 of the GATE CSE 2023 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 2023.

How GATE tests CIDR Notation

More from GATE CSE 2023

Share this solution

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

GateAI solution cardGATE CSE 2023 · Q65 · NAT

The forwarding table of a router is shown below. A packet addressed to a destination address 200.150.68.118 arrives at the router. It will be forwarded to the interface with ID …

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.