Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Mnemonic to find how many Hosts in a Subnet

Posted on 2014-02-08
Medium Priority
506 Views
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?

0
Question by:*** Hopeleonie ***
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 6
• 4

LVL 26

Assisted Solution

Fred Marshall earned 1600 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 19

Author Comment

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 26

Assisted Solution

Fred Marshall earned 1600 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 19

Author Comment

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

Don Johnston earned 400 total points
ID: 39846167
256 is the number of possible addresses (not necessarily valid addresses, mind you) with 8-bits.
0

LVL 26

Accepted Solution

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

So you have:

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: :-)

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.

Examples:

192.168.0.0 / 255.255.255.252 is:
11000000 10101000 00000000 00000000
11111111 11111111 11111111 11111100

192.168.0.1 / 255.255.255.252 is:
11000000 10101000 00000000 00000001
11111111 11111111 11111111 11111100

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

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

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, 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 19

Author Comment

ID: 39849429
@All

Thanks Friends waiting now for more Mnemonic's
0

LVL 26

Assisted Solution

Fred Marshall earned 1600 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 19

Author Comment

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 19

Author Comment

ID: 39863935
Thanks to all again!
0

LVL 19

Author Closing Comment

ID: 39863936
Have a nice day!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We are taking giant steps in technological advances in the field of wireless telephony. At just 10 years since the advent of smartphones, it is crucial to examine the benefits and disadvantages that have been report to us.
An article on effective troubleshooting
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…
###### Suggested Courses
Course of the Month5 days, 18 hours left to enroll