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?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2019 answer key

Solution

Calculate the subnet boundaries for the /30 mask (255.255.255.252) and match each host IP.

The given subnet mask is 255.255.255.252 (or /30 prefix length).
In binary, the last octet of the mask is 252=111111002252 = 11111100_2, which leaves 22 bits for the host ID.

The block size (subnet increment) is 256−252=4256 - 252 = 4.
Let us determine the subnet boundaries in the fourth octet:

  • Subnet 0: 100.10.5.0 to 100.10.5.3 (Usable hosts: .1 and .2)
  • Subnet 1: 100.10.5.4 to 100.10.5.7 (Usable hosts: .5 and .6)
  • Subnet 2: 100.10.5.8 to 100.10.5.11 (Usable hosts: .9 and .10)

Now examine the three given IP addresses:

  • M=100.10.5.2M = 100.10.5.2: belongs to Subnet 0 (100.10.5.0/30).
  • N=100.10.5.5N = 100.10.5.5: belongs to Subnet 1 (100.10.5.4/30).
  • P=100.10.5.6P = 100.10.5.6: belongs to Subnet 1 (100.10.5.4/30).

Thus, NN and PP belong to the same subnet (100.10.5.4/30), while MM belongs to a different subnet. Therefore, "Only N and P belong to the same subnet" is true.

Final answer

C

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2019 Computer Science and Information Technology (CS)
Question
38 of 65, printed as CS Q.28
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.