Skip to content
Official PYQ · 2003

GATE CS 2003 Q82 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI

The subnet mask for a particular network is 255.255.31.0.255.255.31.0. Which of the following pairs of IP\text{IP} addresses could belong to this network?

Choose one option
View worked solution

Answer: D

For two IP addresses to belong to the same network, their network addresses (obtained by performing a bitwise AND operation between the IP address and the subnet mask) must be identical.

The given subnet mask is 255.255.31.0255.255.31.0. Let us analyze the options:

  • Option A: The second octets are 5757 and 5656. Since the mask for the second octet is 255255, the resulting network prefixes will differ (57≠5657 \neq 56).
  • Option B: The third octets are 2828 and 2929. Bitwise AND with 3131 (00011111200011111_2):
    ∙  28 AND 31=28\bullet\; 28 \text{ AND } 31 = 28
    ∙  29 AND 31=29\bullet\; 29 \text{ AND } 31 = 29
    Since 28≠2928 \neq 29, they belong to different networks.
  • Option C: The second octets are 203203 and 234234. Since the mask is 255255, the network prefixes will differ.
  • Option D: The third octets are 129129 and 161161. Let's perform the bitwise AND with 3131 (00011111200011111_2):
    ∙  129 AND 31=100000012 AND 000111112=000000012=1\bullet\; 129 \text{ AND } 31 = 10000001_2 \text{ AND } 00011111_2 = 00000001_2 = 1
    ∙  161 AND 31=101000012 AND 000111112=000000012=1\bullet\; 161 \text{ AND } 31 = 10100001_2 \text{ AND } 00011111_2 = 00000001_2 = 1
    Since the first two octets (128.8128.8) are identical and the fourth octet is masked to 00, both IP addresses yield the same network address: 128.8.1.0128.8.1.0.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Fragmentation and IP Addressing, IPv4, CIDR questions