Question:

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?

Show Hint

For a {/30} subnet, IP addresses are grouped in blocks of 4. If two IPs differ by less than 4 in the last octet and fall in the same block, they belong to the same subnet.
Updated On: Feb 16, 2026
  • M, N, and P all belong to the same subnet
  • Only M and N belong to the same subnet
  • Only N and P belong to the same subnet
  • M, N, and P belong to three different subnets
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Approach Solution - 1

To determine which machines belong to the same subnet, we must examine the IP addresses and the subnet mask.

The given IP addresses are:

  • M: 100.10.5.2
  • N: 100.10.5.5
  • P: 100.10.5.6

The subnet mask is 255.255.255.252. In binary, this is:

  • 11111111.11111111.11111111.11111100

This subnet mask indicates that the first 30 bits of the IP address are the network part, and the remaining 2 bits are used for host addresses.

Now, let's calculate the network address for each IP:

  • Convert each IP to binary and perform a bitwise AND with the subnet mask.

IP Address for M: 100.10.5.2

  • Binary: 01100100.00001010.00000101.00000010
  • Network (AND with subnet mask): 01100100.00001010.00000101.00000000 → 100.10.5.0

IP Address for N: 100.10.5.5

  • Binary: 01100100.00001010.00000101.00000101
  • Network (AND with subnet mask): 01100100.00001010.00000101.00000100 → 100.10.5.4

IP Address for P: 100.10.5.6

  • Binary: 01100100.00001010.00000101.00000110
  • Network (AND with subnet mask): 01100100.00001010.00000101.00000100 → 100.10.5.4

We can see that:

  • M belongs to the subnet 100.10.5.0
  • N and P belong to the subnet 100.10.5.4

Thus, the correct answer is that only N and P belong to the same subnet.

Was this answer helpful?
0
0
Hide Solution
collegedunia
Verified By Collegedunia

Approach Solution -2

Step 1: Understand the subnet mask.
The given subnet mask is $255.255.255.252$, which corresponds to a /30 network.
For a /30 subnet:
Block size $= 256 - 252 = 4$
Total IP addresses per subnet $= 4$
Usable host addresses per subnet $= 2$
Step 2: Determine the subnet ranges.
With a block size of 4, the subnet ranges in the last octet are:
$0\!-\!3,\; 4\!-\!7,\; 8\!-\!11,\; \dots$
Step 3: Find the subnet of each machine.
Machine M:
IP address = 100.10.5.2
This lies in the range $0\!-\!3$.
Subnet = 100.10.5.0/30
Machine N:
IP address = 100.10.5.5
This lies in the range $4\!-\!7$.
Subnet = 100.10.5.4/30
Machine P:
IP address = 100.10.5.6
This lies in the range $4\!-\!7$.
Subnet = 100.10.5.4/30
Step 4: Compare the subnets.
Machines N and P belong to the same subnet, while machine M belongs to a different subnet.
Step 5: Conclusion.
Only machines N and P belong to the same subnet.
Was this answer helpful?
0
0

Top Questions on Computer Networks

View More Questions