Skip to content
Official PYQ · 2010

GATE CS 2010 Q47 — Fragmentation and IP Addressing, IPv4, CIDR

Explain with AI

Suppose computers AA and BB have IPIP addresses 10.105.1.11310.105.1.113 and 10.105.1.9110.105.1.91 respectively and they both use same netmask NN. Which of the values of NN given below should not be used if AA and BB should belong to the same network?

Choose one option
View worked solution

Answer: D

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

The first three octets of both IP addresses (10.105.1.11310.105.1.113 and 10.105.1.9110.105.1.91) are identical (10.105.110.105.1). Thus, we only need to compare the fourth octet of the IP addresses with the fourth octet of the netmask (N4N_4).

Convert the fourth octets of the IP addresses to binary:

  • 113=011100012113 = 01110001_2
  • 91=01011011291 = 01011011_2

Now, let's test the given netmask options for the fourth octet (N4N_4):

  • Option A (N4=0N_4 = 0):
    113 AND 0=0113 \text{ AND } 0 = 0
    91 AND 0=091 \text{ AND } 0 = 0 (Equal, same network)
  • Option B (N4=128=100000002N_4 = 128 = 10000000_2):
    113 AND 128=0113 \text{ AND } 128 = 0
    91 AND 128=091 \text{ AND } 128 = 0 (Equal, same network)
  • Option C (N4=192=110000002N_4 = 192 = 11000000_2):
    113 AND 192=64113 \text{ AND } 192 = 64
    91 AND 192=6491 \text{ AND } 192 = 64 (Equal, same network)
  • Option D (N4=224=111000002N_4 = 224 = 11100000_2):
    113 AND 224=011000002=96113 \text{ AND } 224 = 01100000_2 = 96
    91 AND 224=010000002=6491 \text{ AND } 224 = 01000000_2 = 64 (Not equal, different networks)

Therefore, the netmask 255.255.255.224255.255.255.224 should not be used.

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

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