The subnet mask for a particular network is 255.255.31.0. Which of the following pairs of IP addresses could belong to this network?
(A) 126.96.36.199 and 188.8.131.52
(B) 10.35.28.2 and 10.35.29.4
(C) 184.108.40.206 and 220.127.116.11
(D) 18.104.22.168 and 22.214.171.124
Background required – Subnetting and SubNet Mask
Answer – D
Explanation – Suppose we have a host A with IP Address IPA and Subnet mask of the subnet of which A is a part is Ms. Now when A wants to send packet to a host B with an IP address say IPB, then A will first AND the subnet-Mask Ms with IPA to find out the subnet-id IDN of the subnet in order to identify whether IPB belongs to the same network. Now if B also belongs to the same network, then IPB BITWISE-AND Ms must be equal to IDN which A has calculated.
If IPA and IPB belongs to same network, we must have
IPA BITWISE-AND Ms == IPBBITWISE-AND Ms
Out of the 4 options, only option D matches.
126.96.36.199 BITWISE-AND 255.255.31.0 = 188.8.131.52 184.108.40.206 BITWISE-AND 255.255.31.0 = 220.127.116.11
You can check rest of the options.
This explanation has been provided by Pranjul Ahuja.
Quiz of this Question
- GATE | GATE-CS-2006 | Question 45
- GATE | GATE-CS-2015 (Set 2) | Question 65
- GATE | GATE-CS-2007 | Question 85
- GATE | GATE CS 2008 | Question 85
- GATE | GATE-CS-2017 (Set 1) | Question 1
- GATE | GATE CS 2018 | Question 65
- GATE | GATE CS 2018 | Question 64
- GATE | GATE CS 2018 | Question 63
- GATE | GATE CS 2018 | Question 62
- GATE | GATE CS 2018 | Question 61