1829902 Members
3787 Online
109993 Solutions
New Discussion

Re: subnet mask

 
SOLVED
Go to solution
Not applicable

subnet mask

For a given subnet mask, how may hosts can be incorporated in a
subnet.
2 REPLIES 2
Not applicable
Solution

Re: subnet mask

255.255.255.0 -> 254 hosts
255.255.0.0 -> 65534 hosts
255.0.0.0 -> 16777214 hosts
Jerome Henry
Honored Contributor

Re: subnet mask

To complete Lubomir tip, each octet (in a.b.c.d, each letter is an octet) is a list of 8 bits (00000000 to 11111111). When you set up a netmask, you define a part on 1, which is the network part, and a part on 0, wich is the hos parts.
Example :
255.255.255.0 is
11111111.11111111.11111111.00000000
So you see the network part and the host part.
Now how to calculate how many hosts you have ?
What you see here is the mask. Ok. from this mask, you take the host part, here the last 8 zeros.
This defines the machines in your subnetwork. Basically speacking, this last number will define your machine on the network. One machine will be identified as 00000001, another for example 000100010, and so on.
As it is a set of bit, only 0 and 1 values are authorized. So value can be from 00000000 to 11111111. How many machines does that make ? Calculate it by yourself :
If you would code in 1 digit instead of 8 , you would have 2 possibles solutions : 0 or 1. OK.
If you code on 2 digits, you can have 00,01,10 or 11. 4 solutions (oh, it's 2x2 !).
On 3 digits, 000,001,010,011,100,101,110 and 111, say 8 solutions (oh, 2x2x2 !).
You got the points :
on 8 digits, you get 2x2x2x2x2x2x2x2 solutions, so 256. Aha.
BUT : the very first number is forbidden, the 00000000, it' the network definition as you see it in the mask.
And the last number is forbidden too (the 11111111), by convention it is used to call all the machines on your network (it's called broadcast).

From this principle, you see that if your mask is 255.255.0.0, then your network part is 255.255 and your host part 0.0, so last 2 octects, meaning 00000000.00000000.
Number of machines are 2x2x2x...(16 times), less first and last number...
You can now do it by yourself.

Last tip : you are not compelled to use full octec mask, for example you'll find networks saying mask is 255.255.255.240. Translating to binary (use you windows calculator to convert !), it means 11111111.11111111.11111111.11110000.
Here the host part is last four digits, so you'll have 2x2x2x2 les first and last, so 14 different machines possibles... This is slightly harder, and used if you have a network on which you do not need or want to use 254 addresses, for example... but stick on the beginning if you fill more confortable.
hope this helps.
J
You can lean only on what resists you...