Solved

Total host by Subnets

Posted on 2014-09-17
18
586 Views
Last Modified: 2014-09-22
I am trying to understand how many hosts can exist in a certain subnet based on the subnet mask provided. however it is a bit confusing when the subnet mask does not match the subnet class.
I am checking the table in this link:
http://www.finseth.com/parts/address.php

I see:
 for class B network /25

  25 255.255.255.128 128 126 512 64512

Why total hosts is 64512 ?
I thought 126 is the correct number
 

Thanks
0
Comment
Question by:jskfan
  • 9
  • 4
  • 3
  • +2
18 Comments
 
LVL 24

Assisted Solution

by:Mohammed Khawaja
Mohammed Khawaja earned 63 total points
ID: 40327676
Class B subnet mask is 255.255.0.0 and further subnetting this will be 255.255.128.0 which will yield 32766 hosts.  You could have IP address that may be part of a B class network but you could further subnet it as C class to give you larger subnets with small hosts (i.e. /25 which is 255.255.255.128 for a total of 126 hosts).

/24 is the default C class network which can be subnetted further.  /16 is the default B class and /8 is the default A class.
0
 
LVL 14

Assisted Solution

by:Otto_N
Otto_N earned 125 total points
ID: 40327754
jskfan

You are correct, 126 is the total number of hosts available per subnet.  However, if you take a single Class B subnet and divide it into /25 subnets, you'll get 512  different /25 subnets, each capable of hosting 126 devices, giving you a total host capacity of 64512 for the entire Class B subnet.

In practice, you'll most often consider the per subnet-value - The total value will only be considered when planning for future expansion - reserving an entire Class B subnet to use as /25 subnets will provide you with a theoretical capacity of handling 64500 hosts, which could indicate if you're over or under provisioning for your expected demand.
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 63 total points
ID: 40327765
64512 is the total number of hosts in all (512) possible /25 networks of a class B address range.

A single /25 subnet can contain 126 hosts, as you correctly assumed.

64512 = 512 * 126
0
 

Author Comment

by:jskfan
ID: 40331834
Let's make it simple:

192.168.1.0 /24

this will give 24 to the power of 2 (24^2) Networks and (2^8)-2 =254 Hosts (192.16.1.1 to 192.168.1.254)

so the network 192.168.1.0/24 will give 254 hosts, and the only way to get more than 254 hosts is either to create another subnet, example :192.168.2.0 or subnetting the existing network and make it 192.168.1.0 /23

in this case ,what will be the first host and last host ?

  is the first will be192.168.1.1 and the last 192.168.126.254 ?

Thanks
0
 
LVL 45

Assisted Solution

by:Craig Beck
Craig Beck earned 249 total points
ID: 40331868
If you have a network of 192.168.1.0/23 you can use addresses 192.168.0.1 - 192.168.1.254 inclusive.  The network is actually 192.168.0.0/23.

Let's take your example:

192.168.1.0/24 gives 254 hosts.  256 (number of addresses in subnet) - 2 (broadcast and network addresses) = Total usable hosts.

Now, let's break that up.  If we subnet that down to two /25 networks we get 192.168.1.0/25 and 192.168.1.128/25.  That gives us:

192.168.1.1 - 192.168.1.126 and 192.168.1.129 - 192.168.1.254 as usable addresses.  Do the maths...
256/2 = 128.  Subtract the two addresses (broadcast and network - we do this for EVERY subnet), that leaves 126.  Now we do that for the second /25 subnet.  So, instead of losing 2 addresses (broadcast and network address) we lose 4 here (2 per subnet).

Make sense?

In a /16 network we can use 65534 host addresses.  In a /17 network we can use 32766 addresses, but we can use two /17 in the same /16 space, so we have to take 2x broadcast and network addresses from the 65536 inside the /16, so we end up with 65532 host addresses; 32766 per /17.
0
 

Author Comment

by:jskfan
ID: 40331914
<<Now we do that for the second /25 subnet.>>

DO you mean  for subnet 192.168.1.0 /25 we'll have usable addresses :
192.168.1.1 - 192.168.1.126 and 192.168.1.129 - 192.168.1.254


I do not understand when you said we ll do that for second subnet, which one ?
0
 
LVL 14

Assisted Solution

by:Otto_N
Otto_N earned 125 total points
ID: 40332170
What Craig explained, is actually the opposite what you asked - He took one subnet (192.168.1.0/24) and divided that into two: Subnet 1 - 192.168.1.0/25 (.1 - .126 usable) and Subnet 2 - 192.168.1.128/25 (.129 - .254 usable).

You can do the reverse, i.e. merge two subnets to get more hosts.  So, to create a /23 subnet, the network address will be 192.168.0.0/23, with usable addresses from 192.168.0.1 to 192.168.1.254.

To understand why 192.168.1.0/23 is not a network address, you'll have to look at the binary representation - "The TCP-IP Guide" have an extensive overview at http://www.tcpipguide.com/free/t_IPAddressing.htm
0
 
LVL 45

Assisted Solution

by:Craig Beck
Craig Beck earned 249 total points
ID: 40332223
DO you mean  for subnet 192.168.1.0 /25 we'll have usable addresses :
192.168.1.1 - 192.168.1.126 and 192.168.1.129 - 192.168.1.254


I do not understand when you said we ll do that for second subnet, which one ?
In my example I used a /24 network then split that into 2x /25 networks to explain how we end up with two less hosts per subnet.
0
 

Author Comment

by:jskfan
ID: 40334897
If I understand when you take a Network  address such as 192.168.1.0/24, you do not loose many hosts by breaking up that network into smaller subnets..
When you change the address mask, example 192.168.1.0/23  then you are borrowing one Bit from Network to Host..
192.168.1.0/23  the mask can be written as 255.255.254.255
 I do not think there will be any host that can be created on the third octet, since:
256-254=2
first subnet is 192.168.0.0, the second is 192.168.2.0, in this case 192.168.1.0 is the broadcast
192.168.4.0 will be the third subnet, etc..... the last will be 192.168.254.254
I don't see where the difference in hosts  between 192.168.1.0/23 and 192.168.1.0/24
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:jskfan
ID: 40334902
oops
192.168.1.0/23  the mask can be written as 255.255.254.0
0
 

Author Comment

by:jskfan
ID: 40334918
I Guess where I am still confused, is how many usable hosts per subnet...

I was watching this video: http://www.youtube.com/watch?v=GSX1GlaznKM
The instructor is saying  We ll have 62 hosts per subnet.

the address is 10.15.67.128
mask is 255.255.255.192

mmmmmmmmm....confusing,
 why it is 62 per subnet... I know the last octet will give us 62 hosts, but the first three octet should not change (10.15.67)...
0
 
LVL 45

Assisted Solution

by:Craig Beck
Craig Beck earned 249 total points
ID: 40335149
I don't see where the difference in hosts  between 192.168.1.0/23 and 192.168.1.0/24
The first issue here is that 192.168.1.0/23 is not a valid network.  You can't use 192.168.1.0 - 192.168.2.255.  It has to be 192.168.0.0 - 192.168.1.255, therefore the network is 192.168.0.0/23.

If you take 192.168.1.0/24 you have 254 hosts.  256 - 2 = 254.
If you take 192.168.0.0/23 you have 510 hosts.  512 - 2 = 510.

However, if you take a /24 (just as an example) and subnet that into smaller blocks it changes depending on how you use it.  This is the same whenever you subnet a block into smaller chunks.

With a /24 we already know we can use 254 hosts.  If we split that into /25 networks we get two subnets - 192.168.0.0/25 and 192.168.0.128/25.  Remember, for EVERY subnet we need to subtract 2 from the subnet size to get the usable hosts, so where we had 254 hosts able to use a /24 we now have 126 hosts which are able to use each /25 network.  126 * 2 = 252 hosts, so you can see we lose 4 host addresses by subnetting in this way instead of 2.

Let's now split the /24 into /26 networks.  We get 4 subnets from the /24 by subnetting down to /26 - 192.168.0.0/26, 192.168.0.64/26, 192.168.0.128/26 and 192.168.192.0/26.  For each subnet here we get 64 - 2 = 62 hosts, so 62 (number of hosts) * 4 (number of subnets) = 248 usable hosts.

The thing to remember is that every subnet loses 2 hosts, regardless of the mask.  When you split a subnet you lose 2 hosts per subnet so where a /24 could accommodate 254 hosts once it's split it's no longer that size, so as per the example, 4x /26 networks can only accommodate 248 hosts.
0
 

Author Comment

by:jskfan
ID: 40335214
192.168.0.0/25 =255.255.255.128
number of subnets = 2^25=33554432 subnets
number of hosts= (2^7)-2=126

To my understand the IP addresses we can assign are  :
192.168.0.1       to:  192.168.0.126
192.168.0.128   to: 192.168.0.254


does the  3rd octets change too ?
for instance. these IP addresses we 'll be assigned too:
192.168.1.1  to : 192.168.1.126
192.168.1.128 to :192.168.1.254
========
192.168.2.1 to 192.168.2.126
192.168.2.128 to 192.168.2.254
=======
etc...

Till you reach:
192.168.254.1 to 192.168.254.126
192.168.254.128 to 192.168.254.254

???
0
 

Author Comment

by:jskfan
ID: 40335217
192.168.0.0/23=255.255.254.0
number if subnets=(2^23)8388608
number if hosts= (2^9)-2=512-2=510

the IP addresses that will be assigned:
192.168.0.1 to 192.168.0.254 = 254 Ip addresses
192.168.254.1 to 192.168.254.254 = 255 Ip addresses

254+255 Ip addresses is 509 IP addresses still not 510
0
 
LVL 45

Accepted Solution

by:
Craig Beck earned 249 total points
ID: 40335225
In the /23 network above, 192.168.0.0 is the network address and 192.168.1.255 is the broadcast address.  Why would you think that a /23 would have two broadcast and two network addresses?

You're missing something quite fundamental here (apart from your incorrect sum above).  You don't actually 'split' the /23 into two /24 networks when working out how many hosts you would have in a /23.  There is no precedent which says everything revolves around a /24; it's just the most common subnet size when referring to Class C networks.

Firstly, 192.168.1.1 to 192.168.1.254 is 254 addresses, not 255.

Secondly, a /23 is not the same as a /24.  A /23 address range lets you use the .255 and .0 in the middle of the range - they are valid host IP addresses.  Therefore the range 192.168.0.0/23 spans across the following IP addresses:

192.168.0.1 - 192.168.1.254

This includes 192.168.0.255 and 192.168.1.0 as usable host addresses.
0
 

Author Comment

by:jskfan
ID: 40335770
I agree, I do not understand well Subnetting...
So when it comes to subnetting  or supernetting, does it apply to the following networks only :

10.0.0.0
172.16.0.0
192.168.0.0

for instance we cannot write 192.168.0.0 /9, because the .168 will ne gone away ?
 
Also in your statement above :
<<A /23 address range lets you use the .255 and .0 in the middle of the range - they are valid host IP addresses.>>

I have not seen a Host with IP address of :
 
192.168.0.255 OR 192.168.1.0
0
 

Author Closing Comment

by:jskfan
ID: 40335827
I will do more reading about subnetting and come back...

Thank you
0
 
LVL 14

Expert Comment

by:Otto_N
ID: 40336750
@jskfan

Thanks for the points and grades assigned, appreciated.

Just one last note - To understand IP addressing and the conventions, you have to look at the binary representation (or at least understand that the dotted-decimal notation we're used to is a representation of the binary address.)  Every explanation I've read that makes sense, and is universally applicable, starts from that foundation.  That's why I would strongly suggest the explanation provided by "The TCP/IP Guide", at http://www.tcpipguide.com/free/t_IPAddressing.htm - It moves a bit slow at first, but since it doesn't assume any prior knowledge of IP addressing, it is perfect to "fill in the gaps" other sources sometimes choose to ignore.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a guide to configure bridging on Cisco Routers.  This is something I never knew was possible until after making a few phone calls to Cisco.  Using bridging saved our company money by not requiring us to purchase a new switch.  Bridgi…
Getting hacked is no longer a matter or "if you get hacked" — the 2016 cyber threat landscape is now titled "when you get hacked." When it happens — will you be proactive, or reactive?
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…

758 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

21 Experts available now in Live!

Get 1:1 Help Now