Tuesday, January 21, 2014

Discontinuous subnet masks

The subnet mask for a particular network is 255.255.31.0. Which of the following pairs of IP addressed could belong to this network? (GATE 2003)

A: 172.57.88.62 & 172.56.87.233
B: 10.35.28.2 & 10.35.29.4
C: 191.203.31.87 & 192.234.31.88
D: 128.8.129.43 & 128.8.161.55

Now here a lot of people get suspicious about the validity of this given subnet mask (31 = 00011111 ).
As according to the definition of subnet mask (from many renowned books, personally read 3 of them), this is a 32-bit number(for ipv4) where all the bits of the network part are represented as “1”and all the bits of the host part are represented as “0”. That means all 0’s should be following 1’s in a subnet mask.

Then that means this given subnet mask is wrong?
The answer is No. This subnet mask is completely fine. This is an example of a discontinuous subnet mask, which is no longer supported on most routers. Discontinuous subnet masks are still supported on some network access control devices for features like ACLs. (Sometimes, notably on Cisco routers, the subnet masks are written inverted, in this case, so you'll see 0.0.0.255, for example, to mean a /24). But practically these are not being used a lot nowadays. So Many people are unaware of this.

Those authors are also not wrong in their definition of a subnet mask. They are only referring to the latest trend being followed in Networking.

Now back to the question. The principle is the same: convert the dotted-quad IP addresses and mask to 32-bit unsigned integers and AND each address with the mask. If the results are the same, they're in the same subnet. 

NM = 255.255.31.0
• Hence, first, two parts of the n/w have to be same. Last part(third & fourth) can be anything.  This removes the possibility for A and C options.
• Now for B, consider the third part:
28 = 0001 1100
31 = 0001 1111
----------------------------
        0001 1100
 
29 = 0001 1101
31 = 0001 1111
----------------------------
        0001 1101
Last 5 bits are different. So they are not on the same network. 


• Now for D, consider the third part:
129 = 1000 0001
31  =  0001 1111
---------------------------
          1000 0001 


161 = 1010 0001
31   = 0001 1111
--------------------------
          1000 0001
Last 5 bits(network part) are same. Hence, the correct answer is D.

Friday, January 3, 2014

One Sided Love Stories

Some love stories start when they meet each other...
But then most love stories stop the moment they get to know each other...

As time passes by it feels as though the best love stories with fondest memories,
will always be the ones which were one sided love stories....
No promises were made or broken nor were there any bad memories,
those will always be the days of the beautiful one sided love stories....

The mystery and aura surrounding the angel entices you,
but you still wonder if cupid actually managed to hit you...
Her ever changing facebook profile captivates you,
but you wont send her a request fearing "who are you"...

You feel happy and you blush when you look at her...
You slowly turn around not to attract attention, but manage to take a peak at her...
The way she brushes her hair aside becomes your most awaited moment while staring at her,
but the moment she passes in front of you, you act as if you never looked at her....

With no expressions and expectations comes no rejections or dejections or depressions...
She'll always be "the one" rather than ending up being just another one....

One of the most treasured love stories will always be the one sided love stories....

#a poetry in diary.
#courtesy: prsnnaik