GateAI
IPv4, CIDR and NAT

GATE CSE 2019 · Q28

MCQ2 marksEasy

Time

Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines. Which one of the following is true?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) Only N and P belong to the same subnet

IPv4, CIDR and NAT

To determine which machines belong to the same subnet, we perform a bitwise AND between each IP address and the subnet mask 255.255.255.252255.255.255.252 (a /30/30 mask with a block size of 256−252=4256 - 252 = 4 addresses per subnet).

Looking at the last octet:

  • For Machine M (100.10.5.2100.10.5.2):

    Subnet ID=2 AND 252=0  ⟹  100.10.5.0/30\text{Subnet ID} = 2 \text{ AND } 252 = 0 \implies 100.10.5.0/30

    Usable IP range: 100.10.5.1100.10.5.1 to 100.10.5.2100.10.5.2.

  • For Machine N (100.10.5.5100.10.5.5):

    Subnet ID=5 AND 252=4  ⟹  100.10.5.4/30\text{Subnet ID} = 5 \text{ AND } 252 = 4 \implies 100.10.5.4/30

    Usable IP range: 100.10.5.5100.10.5.5 to 100.10.5.6100.10.5.6.

  • For Machine P (100.10.5.6100.10.5.6):

    Subnet ID=6 AND 252=4  ⟹  100.10.5.4/30\text{Subnet ID} = 6 \text{ AND } 252 = 4 \implies 100.10.5.4/30

    Usable IP range: 100.10.5.5100.10.5.5 to 100.10.5.6100.10.5.6.

Thus, only N and P belong to the same subnet (100.10.5.4/30100.10.5.4/30), whereas M belongs to a different subnet (100.10.5.0/30100.10.5.0/30).

Therefore, option (C) is correct.

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 Q28 of the GATE CSE 2019 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. 4 of them are 2-mark MCQs like this one, and it is the only one in GATE CSE 2019.

How GATE tests IPv4, CIDR and NAT

More from GATE CSE 2019

Share this solution

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

GateAI solution cardGATE CSE 2019 · Q28 · MCQ

Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5, and 100.10.5.6 respectively. The subnet mask is set to 255.255.255.252 for all the three machines. Which one of the following is true?

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.