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?
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 , which leaves bits for the host ID.
The block size (subnet increment) is .
Let us determine the subnet boundaries in the fourth octet:
- Subnet 0:
100.10.5.0to100.10.5.3(Usable hosts:.1and.2) - Subnet 1:
100.10.5.4to100.10.5.7(Usable hosts:.5and.6) - Subnet 2:
100.10.5.8to100.10.5.11(Usable hosts:.9and.10)
Now examine the three given IP addresses:
- : belongs to Subnet 0 (
100.10.5.0/30). - : belongs to Subnet 1 (
100.10.5.4/30). - : belongs to Subnet 1 (
100.10.5.4/30).
Thus, and belong to the same subnet (100.10.5.4/30), while belongs to a different subnet. Therefore, "Only N and P belong to the same subnet" is true.
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.