The Gateway to Computer Science Excellence
+24 votes

Suppose computers $A$ and $B$ have $IP$ addresses $$ and $$ respectively and they both use same netmask $N$. Which of the values of $N$ given below should not be used if $A$ and $B$ should belong to the same network?

  1. $$
  2. $$
  3. $$
  4. $$
in Computer Networks by Veteran (105k points)
edited by | 3.5k views

3 Answers

+35 votes
Best answer

D is correct answer because:

When we perform $AND$ operation between $IP$ address $$ and $$ result is  $$

When we perform $AND$ operation between $IP$ address  $$ and $$ result is $$

$$ and $$ are different network so $D$ is correct answer.

by (341 points)
edited by
The question says which of the values of N given below should not be used if A and B should belong to the same network. According to option 4 A and B do not belong to same network hence the option should not be considered only. If i choose answer as A where least numbers of bits are used to represent subnet mask. While in option B and C more nos of bits are used in Subnet mask. Hence answer should be A why D is selected as an option?
+12 votes


128  64  32  16  8  4  2  1

  0     1   1    1   0  0  0  1  --- (113 last octet of first address)
  0     1    0   1   1  0   1  1  ----(91 last octet of second address)

Now, first MSB and second bit matching but 3rd bit is different.

so , we need 3  continos one's in mask, for different network.
So mask will be

@Arjun Sir please check , this method is also right or not?
by Active (4.1k points)
Good method
I apply the same...right method...
+6 votes

The last octets of IP addresses of A and B 

A:113 (01110001) and

B: 91 (01011011). 

The netmask in option (D) has first three bits are 111  in last octet. If netmask has first 3 bits set, then these bits must be same in A and B, but that is not the case. we can say option (D) is not a valid netmask because doing binary ‘&’ of it with addresses of A and B doesn’t give the same network address. It must be same address as A and B are on same network. 

by Active (1k points)
good explanation.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,370 answers
105,276 users