Skip to content
Official PYQ · 2019

GATE CS 2019 Q28 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI

Consider three machines M, N, and P with IP addresses 100.10.5.2, 100.10.5.5100.10.5.2, \: 100.10.5.5, and 100.10.5.6100.10.5.6 respectively. The subnet mask is set to 255.255.255.252255.255.255.252 for all the three machines. Which one of the following is true?

Choose one option
View worked solution

Answer: C

To determine which machines belong to the same subnet, we perform a bitwise AND operation between each machine's IP address and the subnet mask, or simply analyze the block sizes determined by the mask.

1. Analyze the Subnet Mask

The subnet mask is given as 255.255.255.252.

  • The first three octets (255.255.255) are identical for all three machines, so we only need to examine the last octet.
  • The last octet of the mask is 252252, which in binary is 11111100211111100_2.
  • The number of host bits in the last octet is 8−6=28 - 6 = 2 bits.
  • This gives a block size (subnet size) of 22=42^2 = 4 IP addresses per subnet.

2. Determine the Subnet Ranges

Since the block size is 44, the subnets for the last octet start at multiples of 44:

  • Subnet 1: .0.0 to .3.3 (Network ID: 100.10.5.0, Broadcast: 100.10.5.3)
  • Subnet 2: .4.4 to .7.7 (Network ID: 100.10.5.4, Broadcast: 100.10.5.7)
  • Subnet 3: .8.8 to .11.11 (Network ID: 100.10.5.8, Broadcast: 100.10.5.11)

3. Map the Machines to Subnets

  • Machine M: IP 100.10.5.2 (Last octet is 22). It falls in the range [0,3][0, 3], so its subnet ID is 100.10.5.0.
  • Machine N: IP 100.10.5.5 (Last octet is 55). It falls in the range [4,7][4, 7], so its subnet ID is 100.10.5.4.
  • Machine P: IP 100.10.5.6 (Last octet is 66). It falls in the range [4,7][4, 7], so its subnet ID is 100.10.5.4.

Thus, only N and P belong to the same subnet (100.10.5.4/30).

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

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