cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5395
Views
10
Helpful
8
Replies

Learning: how do you find subnet, & host bits? As well as #of subn and hosts in a network

Heads up: I already have the answers I'm not trying to cheat on an assignment. It's about learning and comparing your answers to a sheet and not being marked. I'm showing I understand it in an exam. So I'm showing one example and what I have so far. Any help is a huge help as I'm trying to learn how do get these answers.

 

So the problem is: 

Ip: 10.66.5.99

Subnet mask: 255.255.254.0

I need to find:

Network bits: I determined 8 looking at class chart.

Subnet bits: the answer is 15 but I'm unsure how to get the answer

host bits: answer is 9 unsure how to get it

# of subnet in network: 32,768 (doesnt make sense I think its 512)

# of hosts per subnet: 510 not sure how that answer was gotten.

 

For this question I just need to see how you calculate this so I can understand it. My text book doesnt have it and my searching online has been difficult. 

 

I'm not used to seeing a subnet address with the # 254, and I would love to know a little more about it. 254 in an ip address I understand but not in a subnet. A huge thank you in advance to anyone willing to go through this with me

8 Replies 8

Richard Burts
Hall of Fame
Hall of Fame

To start let us review some of the concepts involved:

- an IP address has 32 bits. It is a series of binary 0 and binary 1 bits. The IP address is typically written in dotted decimal where there are 4 numbers separated by "dot". Each of the numbers if the decimal representation of 8 binary digits. 

- in the early stages of developing the IP protocol we considered that an IP address contained network bits and host bits. The network bits were the left side bits of the address and the host bits were the right side of the address. 

- we identified classes of networks. A class A network had 8 network bits and 24 host bits. A class B network had 16 network bits and 16 host bits. A class C network had 24 network bits and 8 host bits. 

- this was not very flexible, and so the concept of subnets evolved to make better use of the address space. In subnetting we "borrow" some bits from the host bits and use them to extend the network side of the address. So now we can consider an IP address to be made up of <network bits> <subnet bits> <host bits> which need to add up to 32. 

- the dividing point between the networking bits and the host bits is indicated by the network mask. The network mask is also usually written in dotted decimal notation. In the network mask a networking bit is a binary 1 and a host bit is a binary 0.

- and probably we need a bit of binary math. 

255 in binary is 11111111 (8 ones)

254 in binary is 11111110 (7 ones and 1 zero)

0 in binary is 00000000 (8 zeros)

 

So if we look at your example we find an IP address of 10.66.5.99 and a network mask of 255.255.254.0

The points you raise are:

* what are the network bits. The address falls into the class A range and there are 8 network bits in a class A network. 

* what are the subnet bits. If we look at the subnet mask of 255.255.254.0 we will find that there are 23 networking bits (8 plus 8 plus 7). If 8 of those bits are for the class A network then (23 minus says that there are 15 subnet bits.

* how many host bits. If we look at the subnet mask we will find that there are 9 zeros (one in third octet plus eight in last octet). So 9 host bits. We could also solve this a different way: if there are 32 bits, and if networking bits are 23, the the host bits are 32 - 23 = 9

* the number of subnets given a class A network and 255.255.254.0 mask. This is perhaps the most challenging part. To solve it we start with the fact that there are 15 subnetting bits. So how many different decimal numbers can we make with 15 binary bits? It turns out that 2 ** 15 does equal 32768. 

** number of hosts per subnet. To solve this we start with the fact that we have 9 host bits. So how many decimal numbers can we make with 9 binary bits? 2 ** 9 equal 512. So there are 512 addresses in the subnet. In a subnet the very first address is reserved (can not be assigned to a host) and is referred to as the network address (basically it is the address for the entire subnet). And the very las address is reserved and is referred to as the broadcast address. So 512 total addresses minus 2 reserved addresses gives 510 as the number of host addresses in each subnet. 

HTH

Rick

pmckenzie
Level 3
Level 3

As well as the great answer from Richard I found that practice practice and more practice helped me. Here is a link to a great resource that allows you to do just that.

For example

subnet.PNG

https://www.kirkwood.edu/pdf/uploaded/569/ip_addressing_and_subnetting_workbook-student-v2.0.pdf 

There are worlds out there where the sky is burning, where the sea's asleep and the rivers dream, people made of smoke and cities made of song. Somewhere there's danger, somewhere there's injustice and somewhere else the tea is getting cold" Dr Who

I agree with @pmckenzie that really learning subnetting takes lots and lots of practice. And there are many sites available on the Internet that can help with this. The 2 primary formulas that he offers (calculation of number of subnets, and calculation of number of hosts) are correct. I feel I need to comment on the second subnet formula that he offers for the calculation of number of subnets. It seems to relate to the formula for hosts where we subtract 2. That is absolutely correct for calculating hosts since in every subnet there are 2 reserved addresses (the very first address is the subnet address and the very last address is the broadcast address, and neither of these can be used as a host address). It seems to be a similar approach in the second subnet formula where it subtracts 2. But for subnets it has never been the case that the last subnet was reserved. In the early days of IP addressing the very first subnet was reserved (it was referred to as subnet zero) and there were reasons why it was better to not use that subnet. But that restriction has not been valid for quite a long time. So in current practice the only valid calculation of the number of subnets is 2 raised to the power of the number of subnet bits.

HTH

Rick

Hi @Richard Burts thanks for pointing this out.  I didn't do due diligence on the quote I pulled out.

There are worlds out there where the sky is burning, where the sea's asleep and the rivers dream, people made of smoke and cities made of song. Somewhere there's danger, somewhere there's injustice and somewhere else the tea is getting cold" Dr Who

I sympathesize @pmckenzie It is an easy thing to miss. I have seen that version of the formula quite a few times in various sources. Many people find it quite believable since it seems to parallel the subtract 2 in the formula for calculating the number of host addresses. But as you think about it you realize that it is not correct. There is not (and never has been) a restriction about using the very last subnet (there is not a "broadcast" subnet similar to the broadcast IP address in a subnet). And while there were suggestions in the early days of developing IP addressing to not use the very first subnet, it has been accepted practice for a long time that every subnet can be used.

HTH

Rick

Martin L
VIP
VIP

 

There are lots of videos on subnetting on youtube; I know not , it is not a standard source of IT training but you can find couple good videos with excellent explanations and methods. Find video with method that appeals to you, like Magic number method which is not binary one (good thing).

 

 

 

Thank you everyone for the help. I managed to work it out. But all your answers help solidify everything for me. Thanks richard too for all the insight stuff to help me understand!!

You are welcome. I am glad that our explanations have been helpful and that you have managed to work it out.

HTH

Rick