why is it that the all subnet masks only use the following nos.: 0, 128, 192, 224, 240, 248, 252, 254, 255?...e.g. 255.255.128.0
any help would be appreciated!
Printable View
why is it that the all subnet masks only use the following nos.: 0, 128, 192, 224, 240, 248, 252, 254, 255?...e.g. 255.255.128.0
any help would be appreciated!
And this has what to do with C programming in the context you've provided? Oh that's right, nothing.Quote:
Originally posted by lonelyp
why is it that the all subnet masks only use the following nos.: 0, 128, 192, 224, 240, 248, 252, 254, 255?...e.g. 255.255.128.0
any help would be appreciated!
Quzah.
i believe, from what i m learning nowadays, that masking operations are programmed...since i am only familiar with C, thought this would b a good place to start in addition to my searches on google...
so far i have received great responses from users here and was hoping on getting some much needed advise~thats all~
so any1 got any knowledge, please share.
I may just be unclear on what you are saying here, so bear with me. Bitmasks would be something like MessageBox(0, "hello", "world", MB_ICONQUESTION | MB_YESNO). The fourth parameter would be the mask. Since I do not know that those numbers are even bitmasks (they very well could be) I cannot really tell you what the bit values are. I do believe those are just default values.
Quote:
why is it that the all subnet masks only use the following nos
255 is the highest number you can store in an unsigned char. So basically, it's an easy way to store an address in 4 bytes.
The answer of your question will not be a single line. I guess following links will give you a clear picture, of course you should have general knowledge on TCP/IP.
IP Tutorial
IP Subnet Calculations
ohh.. you know this is not the right place to ask question about Network. At least you could post in GD.
There are 8 bits in a byte, so you have 0 to 255. Then they chopped the 256 in half, then quarters etc. for various size users, and that is why you get 128, 192, etc. If you have a 0 in the first bit, your range is 0 to 127. If you have a 1 in the first bit, and a 0 in the 2nd bit, your range is 128 to 191.
1's in bit position: value:
_______________ ________
1 128+
1,2 192+
1,2,3 224+
1,2,3,4 240+
1,2,3,4,5 248+
1,2,3,4,5,6 252+
1,2,3,4,5,6,7 254+
1,2,3,4,5,6,7,8 256