...

View Full Version : IP blocks



JudgementDay
02-14-2012, 01:39 PM
One of the most stupidest thing I have ever seen in computers is IP blocks.

I was wondering if anyone knows how I can convert them without making my mind explode?

I.E, how would I convert this?
186.120.128/17

oracleguy
02-14-2012, 10:18 PM
That typically isn't how you would write that, it would be written as 186.120.128.0/17. Nevertheless if you are asking about the /17 part that is representing the net mask and it means the upper 17 of the 32 bits are set.

So if you turn that into a hex number you get FFFF8000 and then break that into 4 bytes you get: FF FF 80 00 and then convert to decimal: 255 255 128 0. Then format it like a netmask: 255.255.128.0. Done.

So a network subnet with that netmask would have an IP range of
186.120.128.0 to 186.120.255.255. To determine this you bitwise AND the IP address with the netmask.

It isn't stupid it just uses bitwise math operations.

JudgementDay
02-15-2012, 01:12 AM
Cool. I didn't understand that.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum