Solved

Mnemonic to find how many Hosts in a Subnet

Posted on 2014-02-08
11
464 Views
Last Modified: 2014-02-16
Hi

I’m teaching our trainees how to find how many Hosts in a Subnet by mental arithmetic as they need it for School.

This is the way I learned how to.

Example Question:
If I need 50 Hosts in the 192.168.1.0 Range.

1. Step: 50 + 1 = 51
2. Step: 2 Power of 6 will fit = 64
(64 - 2 = 62 Hosts can be used)

Now if I need to find how many Subnets:
3. Step: 8 (total) - 6 (2 power of 6) = 4 Subnets

Is this the easiest way? Alternatively, do you have any other better mnemonic’s?

Many thanks in advance
0
Comment
Question by:hopeleonie
  • 6
  • 4
11 Comments
 
LVL 25

Assisted Solution

by:Fred Marshall
Fred Marshall earned 400 total points
ID: 39844506
I would say:
If I need 50 Hosts in the 192.168.1.0 Range.

1. Step: 50 + 2 = 52 (2 because 1 for network address and 1 for broadcast address)
2. Step: 2 Power of 6 will fit = 64
(64 - 2 = 62 Hosts can be used)    Yes, there's the "2"....

Now if I need to find how many Subnets:
3. Step: 8 (total) - 6 (2 power of 6) = 4 Subnets

Well this last part must be assuming a bunch of things:
1) the address range that's available overall has 256 addresses and not some other number.  Why?  OK, /24 is common but it's not absolute.
2) the assumption is that all the other subnets within will be the same size as the first one.  Why?  There can be all kinds of subnets of various sizes within /24.
0
 
LVL 18

Author Comment

by:hopeleonie
ID: 39844552
Hi fmarshall

Thanks for the correction "2". :-)

The second way I found to calculate Subnets are:
256 - 252 = 4 Subnets

But how do I know that it is 252???

Many thanks
0
 
LVL 25

Assisted Solution

by:Fred Marshall
Fred Marshall earned 400 total points
ID: 39844661
256 is supposed to represent what?  An octet of 11111111?
252 is supposed to represent what?  An octet of 11111100?

The difference is 4 > 00 to 11 i.e.  4 values.

But these would be addresses and not subnets.
So, I'm a bit confused.
0
 
LVL 18

Author Comment

by:hopeleonie
ID: 39845931
256 is supposed to represent what?  An octet of 11111111?
252 is supposed to represent what?  An octet of 11111100?

The difference is 4 > 00 to 11 i.e.  4 values.

But these would be addresses and not subnets.
So, I'm a bit confused.

That is also my problem. I'm also confused... Can anybody explain this?
0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 100 total points
ID: 39846167
256 is the number of possible addresses (not necessarily valid addresses, mind you) with 8-bits.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 25

Accepted Solution

by:
Fred Marshall earned 400 total points
ID: 39848939
I'm sorry I wasn't clearer.  OK, thank you.

So you have:

256 addresses - 252 addresses = 4 addresses (and not subnets).

So, since the original statement was in error, I'm left not understanding what to evaluate or comment on.  

You ask us to explain so I'll try in hope that something will stick to the wall here: :-)

A subnet mask of:
11111111  11111111  11111111  111111111  is 255.255.255.255
subtract 3 to get:
11111111  11111111  11111111  111111100  is 255.255.255.252
Now subtract the next 2 least significant "1" bits (which is 12)
11111111  11111111  11111111  111110000  is 255.255.255.240

The locations where the subnet mask is "1" represent the network address.
The locations were the subnet mask is "0" represent the host addresses plus network address value of "0" plus the broadcast address of all "1"s.

Examples:

192.168.0.0 / 255.255.255.252 is:
11000000 10101000 00000000 00000000
11111111 11111111 11111111 11111100
So, with the subnet mask, the host address is 00 - the network address

192.168.0.1 / 255.255.255.252 is:
11000000 10101000 00000000 00000001
11111111 11111111 11111111 11111100
So, with the subnet mask, the host address is 01

192.168.0.2 / 255.255.255.252 is:
11000000 10101000 00000000 00000010
11111111 11111111 11111111 11111100
So, with the subnet mask, the host address is 10 or 2 decimal

192.168.0.3 / 255.255.255.252 is:
11000000 10101000 00000000 00000011
11111111 11111111 11111111 11111100
So, with the subnet mask, the host address is 11 or 3 decimal .. the broadcast address.

Above, I picked a subnet with 4 addresses, 4-2= 2 usable.

Now, increase the subnet mask by two more zeros:

192.168.0.0 / 255.255.255.252 is:
11000000 10101000 00000000 00000000
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 00 - the network address

192.168.0.1 / 255.255.255.240 is:
11000000 10101000 00000000 00000001
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 01 binary or decimal.

192.168.0.2 / 255.255.255.252 is:
11000000 10101000 00000000 00000010
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 10 or 2 decimal

192.168.0.3 / 255.255.255.252 is:
11000000 10101000 00000000 00000011
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 11 or 3 decimal
...........
192.168.0.4 / 255.255.255.252 is:
11000000 10101000 00000000 00000100
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 100 or 4 decimal
..........
192.168.0.8 / 255.255.255.252 is:
11000000 10101000 00000000 00001000
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 1000 or 8 decimal

..........
192.168.0.8 / 255.255.255.252 is:
11000000 10101000 00000000 00001111
11111111 11111111 11111111 11110000
So, with the subnet mask, the host address is 1111 or 815 decimal - the broadcast address.

So, the number of zeros on the right end of the subnet mask tells you how many bits can represent addresses.
AND, if you take a particular pattern like the above AND call that a subnet then there is one (1) subnet.
BUT, if you start with a pattern like the above AND break it into smaller subnets then there are a variety of combinations to choose from.  
Further, if you set some ground rules, then you might use that context to talk about subnets.

Here is an example:
Above we have an address space of 4 bits.  
We know that 2 bits is the smallest meaningful subnet size yielding 4 addresses and 2 usable addresses.
Since we have 4 bits in the subnet mask, we can split that up into the smallest possible subnets of:
192.168.1.0 / 255.255.255.252
and
192.168.1.4 / 255.255.255.252
and
192.168.1.8 / 255.255.255.252
and
192.168.1.12 / 255.255.255.252

So, in this case, 4 bits yields 4 (of the smallest useful) subnets.
If there are 5 bits then there will be 32 addresses and 32/4=8 (of the smallest useful) subnets.
and so forth....

But I'm not sure that figuring out how many of the smallest possible subnets is very useful.

You can always say this:
2^N (where N is the number of zero bits in the subnet mask) is the total number of addresses available in that subnet.
2^(N-1) is the number of addresses in the 2 largest possible subnets within,
2^(N-2) is the number of of addresses in the 4 largest possible subnets within.
2^(N-n) (where N-2=n is the number of addresses in the smallest possible subnets within.

So, with all that, are we getting closer to what you're looking for?
0
 
LVL 18

Author Comment

by:hopeleonie
ID: 39849429
@All

Thanks Friends waiting now for more Mnemonic's
0
 
LVL 25

Assisted Solution

by:Fred Marshall
Fred Marshall earned 400 total points
ID: 39852004
There could be more if we understood what you're trying to accomplish in specific.
I've not seen what appears to be a complete, example question.

For example:
Q:
If I need 50 Hosts with a network address of 192.168.1.0, what subnet mask should I use for the smallest possible subnet?
[That's really the complete question isn't it?]
A:
50+2=52.
52 is between 32 and 64; the nearest powers of 2. I.e 2^5 and 2^6.
So, 64 is the smallest subnet size.
Now we know it's 2^6 we also know there will be 6 zeros in the subnet mask:
11000000 = 192  so
The subnet mask for that size subnet is  255.255.255.192
Or, if you like: 255.255.255.[256-64]

So, there are a couple of mnemonics there.
0
 
LVL 18

Author Comment

by:hopeleonie
ID: 39863934
I've requested that this question be closed as follows:

Accepted answer: 100 points for fmarshall's comment #a39848939
Assisted answer: 100 points for fmarshall's comment #a39844506
Assisted answer: 100 points for fmarshall's comment #a39844661
Assisted answer: 100 points for donjohnston's comment #a39846167
Assisted answer: 0 points for hopeleonie's comment #a39849429
Assisted answer: 100 points for fmarshall's comment #a39852004

for the following reason:

Thanks to you both again!
0
 
LVL 18

Author Comment

by:hopeleonie
ID: 39863935
Thanks to all again!
0
 
LVL 18

Author Closing Comment

by:hopeleonie
ID: 39863936
Have a nice day!
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Article by: Nicole
This is a research brief on the potential colonization of humans on Mars.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now