GateAI
CIDR Notation

GATE CSE 2025 Set 1 · Q40

MCQ2 marksMedium

Time

A packet with the destination IP address 145.36.109.70145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?

GATE CSE 2025 Set 1 Q40 diagram

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) E3

CIDR Notation

To determine the forwarding interface, we apply the Longest Prefix Match (LPM) algorithm for the destination IP address 145.36.109.70145.36.109.70.

First, convert the 3rd octet (109109) to binary:

10910=011011012109_{10} = 01101101_2

Now, test each entry in the routing table:

  1. 145.36.0.0/16145.36.0.0/16 (Interface E1):

    • Requires matching the first 1616 bits (145.36145.36).

    • The destination address has 145.36145.36, so it matches (prefix length = 1616).

  2. 145.36.128.0/17145.36.128.0/17 (Interface E2):

    • Requires the first 1717 bits to match.

    • The 17th bit (most significant bit of the 3rd octet) must be 11 (12810=100000002128_{10} = 10000000_2).

    • The destination's 17th bit is 00. Hence, it does not match.

  3. 145.36.64.0/18145.36.64.0/18 (Interface E3):

    • Requires the first 1818 bits to match.

    • The first two bits of the 3rd octet must be 01 (6410=01000000264_{10} = 01000000_2).

    • The destination's first two bits of the 3rd octet are 01. Hence, it matches (prefix length = 1818).

  4. 145.36.255.0/24145.36.255.0/24 (Interface E4):

    • Requires the 3rd octet to be 255255 (11111111211111111_2).

    • The destination's 3rd octet is 109109, so it does not match.

Comparing all matching entries, 145.36.64.0/18145.36.64.0/18 has the longest prefix length (18>1618 > 16). Therefore, the router forwards the packet to interface E3 (Option A).

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 Q40 of the GATE CSE 2025 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 MCQs like this one, and it is the only one in GATE CSE 2025 Set 1.

How GATE tests CIDR Notation

More from GATE CSE 2025 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2025 Set 1 · Q40 · MCQ

A packet with the destination IP address 145.36.109.70 arrives at a router whose routing table is shown. Which interface will the packet be forwarded to?

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.