How many subnets (and hosts per subnet) can you get from the network 10.0.0.0 255.255.240.0?

1

3

I saw this question on subnettingquestions.com and thought it would be easy!

How many subnets (and hosts per subnet) can you get from the network 10.0.0.0 255.255.240.0?

Unfortunately, the answer they gave is very different to what I got from my calculations.

If someone could answer this (and show their working) I would appreciate it.

Edit:

Some of the answers I'm seeing below aren't saying exactly what the site says (i.e. the official answer is "4096 subnets and 4094 hosts"). Could anyone elaborate a bit on exactly how you are supposed to reach those values?

For anyone interested in how I tried to calculate it, this is what I did:

255.255.240.0 is a /20 subnet mask, therefore there are 4 borrowed bits (from the 3rd octet).

Number of subnetworks = 2 to the power 4 (as network bits = 4), which gives 16

Number of hosts on each subnetwork = (2 to the power 4) - 2 (i.e. 4 bits in host portion of address), which gives 14.

So I got 16 subnetworks, and 14 hosts on each subnetwork. My answer is out by a factor of 256!

Can anyone see where I'm going wrong? I seem to get the Class C calculations right, but have problems with the others.

enter image description here

Austin ''Danger'' Powers

Posted 2014-02-09T23:09:54.123

Reputation: 5 992

1

I cheated and uses this http://jodies.de/ipcalc?host=10.0.0.0&mask1=20&mask2= (sorry I'm terrible calculating subnet but since someone else already made the tool for it... with some details if you follow the links - also sorry for link-only answer)

– Darius – 2014-02-09T23:13:34.917

Austin, can you really have 4096 subnets? Does a mask of 255.255.255.255 really work? I thought that you needed at least 3 addresses to make a subnet to include the network and broadcast addresses? – Julian Knight – 2014-02-10T08:39:52.390

Answers

4

With those settings, as @Darius points out, you get a 20bit mask and so:

Start Address: 10.0.0.1
End Address..: 10.0.15.254

The maximum number of available hosts is 4094. You cannot, of course, use the first or last IP in a subnet (e.g. 10.0.0.0 and 10.0.15.255) for hosts as these are required for other purposes. The first IP is used for the network address and the last as the broadcast address.

Using exactly your mask, you would strictly speaking only have 1 subnet. Using a mask of 255.255.255.0, you could have 16. You could, of course use other masks to get different numbers of subnets but this gets complex to calculate. This is because it is the mask that creates the subnets.

Julian Knight

Posted 2014-02-09T23:09:54.123

Reputation: 13 389

Now corrected.. – Julian Knight – 2015-12-20T17:02:02.427

1You cannot, of course, use .0 or .255 for hosts as these are required for other purposes such as broadcasts. - You can't just make this blanket statement. In this example 10.0.0.0 is the network address and 10.0.15.255 is the broadcast address. All other .0 or .255 addresses are perfectly valid host addresses. – joeqwerty – 2014-02-10T00:06:18.053

1That's true. An IP ending with ".0" or ".255" is not necessarily the network address or broadcast address. What is true is that the first IP in a subnet is reserved for the network address, and the last is the broadcast. Not the same thing! – Austin ''Danger'' Powers – 2014-02-10T00:26:57.950

1Fair comment, oversimplifying. – Julian Knight – 2014-02-10T08:35:42.153

3

For your specific question in regards to the 255.255.240.0 subnet mask on a class A 10.0.0.0 network, here's the 'work':

network ID: 10.0.0.0

subnet mask: 255.255.240.0

to bits: 1111 1111 . 1111 1111 . 1111 0000 . 0000 0000

Our last octet is all 0's (or 256 hosts) with the last 4 bits of the 3rd octet being 0's as well (16). To get the total number of hosts, we would multiply the 4th octet host count (256) by the remaining octet host count (16) and get 4096 (256*16) possible hosts (4094 usable address')

To get the number of subnets we do the same thing but with the 'network bits'; since we are on a class A network, we are concerned with the 2nd octet and the remainder of the 'network' bits in the 3rd octet, in this case it's 1111 1111 . 1111 ... (2nd octet and remainder of 3rd). Same math here, 2nd octet says all so this gives us (256) possible networks in the first octet multiplied by the remaining networks in the 3rd octet (16), thus giving us 4096 possible subnets.

The same math applies to the other network classes but will focus on different octets.

To go a little more into it:

To calculate subnet, you start with the host octet and 'count' up from there, so in our example, we will assume a subnet mask of all 255:

255.255.255.255 == 1111 1111 . 1111 1111 . 1111 1111 . 1111 1111

This gives us only 1 IP so lets start flipping bits to see where we go:

255.255.255.254 == 1111 1111 . 1111 1111 . 1111 1111 . 1111 1110

Remember: the bit flipped to 0 is the 'usable' IP's, so this would give us only 2 IP's (.0 and .1 to start our subnet range), both unusable as 1 is the host and the other broadcast...lets continue:

255.255.255.252 == 1111 1111 . 1111 1111 . 1111 1111 . 1111 1100

Ok, now we have 4 IP's but only 2 usable (.0 - .3, .0 is 'host' '.3' is broadcast)...let's continue:

255.255.255.248 == 1111 1111 . 1111 1111 . 1111 1111 . 1111 1000

now we have 8 total (6 usable) with this subnet mask .. one more..

255.255.255.240 == 1111 1111 . 1111 1111 . 1111 1111 . 1111 0000

Now we're at 16 total IP's with 14 usable.

This is for a class C based network an only concerns the last octet but the same pattern continues to apply (as stated above) in the other network classes too.

Subnet calculations are tedious (especially when you have to calculate each network by hand and you have hundreds of networks to calculate).

I hope that can help out.

txtechhelp

Posted 2014-02-09T23:09:54.123

Reputation: 3 317

2

Most probably this has been forgotten, but if txtechhelp's answer doesn't suffice, here's another way to explain this.

  1. The question is a "classful" subnetting question. This means that part of the information for solving the problem is included in the IP address.

  2. In this case, a 10.0.0.0 is a Class A network, or a /8 CIDR block. Therefore, this network consists of 8 bits with a mask of 255.0.0.0.

  3. Subnetting a network means borrowing bits, and the subnet mask (think of it as the extended mask) tells you how many bits have been borrowed.

  4. In this case, a 255.255.240.0 means the 255.240 is the "extended" part. The 255 consists of 8 bits and the 240, of 4 bits. This totals to 8+4=12 more bits.

  5. To find the number of subnets, just look at how many different ways the bits borrowed can be turned on or off. This means 2^n, so 2^12=4096.

  6. To find the number of hosts, look at how many different ways the remaining bits can be turned on or off. See that there are 32-(8+12)=12 bits remaining, so again this is 4096.

  7. Subtract 2 from the total hosts because a host cannot be assigned the first and last addresses (they are used to identify the subnet and broadcast).

That should be it.

Note: That last enumerated point should not be confused with a ".0" or ".255" network. The first and last addresses can be any number (for details, see [1]). Note that without these addresses you wouldn't be able to route packets to a subnetwork or allow a host to communicate with other hosts in the same subnetwork. Granted, this is IPv4-specific. IPv6 makes things more intuitive.

[1] https://serverfault.com/questions/10985/is-x-y-z-0-a-valid-ip-address

Ray

Posted 2014-02-09T23:09:54.123

Reputation: 21

No need to consider ancient IP classes. We replaced them long long (15-ish years?) ago with CIDR and the OP already was given a network mask. So he knows which part is the base network and which part (s)he gets to sub-divide. – Hennes – 2014-10-21T12:11:56.697