in Computer Networks
3,916 views
4 votes
4 votes

If block contains 32 IP address which of the following is first address of the block ?
(A) 10.0.0.5
(B) 10.0.0.16
(C) 10.0.0.32
(D) 10.0.0.160
(E) None of the above
 

in Computer Networks
3.9k views

1 Answer

1 vote
1 vote

The first Address in a Block should be exactly divisible by Number of Addresses in a Block

As here block contains 32 IP addresses means #of host bits=5 

Let the IP address X.Y.Z.W  as number of IP address is 32 so we only have to focus about W (last octet)

We have to guess about these 8 bits of W  _ _ _ _ _ _ _ _ . as the number of host bits =5 and we have to tell first address of the block and we know for first address all host would be =0 and now if any of remaining 3 bits is 1 it would then multiply the 25 by some 2a .so ultimately it would become 25+a so that would certainly be divisible by 32 (the number of IP addresses). out of those option 3 and 4 are divisible by 32.

so option C,D are correct one.

edited by

4 Comments

Can you please explain why option C can not be the first IP address of the block? When we are dividing a binary no with 2n then if the least significant n bits of that binary no is 0 then it is evenly divisible by 2n .

For 32 the binary representation would be 00100000. Least significant 5 bits are zeros. So it is divisible by 32.

Also, you are saying option C can not be possible as 'a' can not be 0. But in the IP address when we are trying to represent 32 we will need a=1 (total 6 bits) as by 5 bits we can only represent till 31. Then how 'a' is becoming 0 ?

1
1
Hello saikat.

Thanks for the attention. I'm sorry for that. I am surprise why did i reject C.

I have updated the answer.
2
2
In case of conflict, do we choose just like a router would have chosen using the "longest prefix method"?

Because the Correct answer given is (D), while both (C) & (D) satisfy the condition.
0
0

I think longest matching prefix must be chosen out of C,D so i guess ans is D.

0
0

Related questions