How many bits for subnets?

Unanswered Question
Apr 25th, 2008

The book for ICND1 has a section where classful addressing is used such that in a class A with all of the 2nd and 3rd octet ones are available. Later the book uses the "magic" number on the non-255 octet only to get the subnet details. For this mask which is correct? Thankls!

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (5 ratings)

Hi There

When you have a Class A network with a /8 or mask, then the first 8 bits on the mask define the network portion of the address and the remaining 24 bits of the address can be used for hosts. This would yield 16,777,216 addresses of which 16,777,214 could be used for host addresses as you cannot use the first and last IP address, which are reserved for the network number and the broadcast address respectively.

So if you are going to subnet your Class A network, then you can use up to the first 30 bits to define subnets. Initially in your CCNA studies you are thought to subnet creating subnets of equal size. Then a little later you will learn to use Variable Length Subnet Masking (VLSM) while subnetting. This is what is predominantly used in the real world.

I am not familiar with the book you are using for your ICND studies or what is meant by the statement "Later the book uses the "magic" number on the non-255 octet only to get the subnet details". However when I was studying for my CCNA, the book which I found to explain subnetting best was the Sybex "CCNA Study Guide" by Todd Lammle.

In your question you mentioned a Class A with a mask.

As mentioned earlier, a Class A network by default uses 8 bits to define the network portion of the address. The default mask is

In your example you are using the first 18 bits to define the subnets. This means that you have "borrowed" a further 10 bits form the host bits to create subnets, so you have now subnetted your Class A network into 2^10 or 1024 subnets.

There are now 14 bits remaining for host addressing, so each of you 1024 subnets would have (2^14) - 2 or 16,382 usable IP addresses. Remember that the first and last IP address in each subnet must be reserved for the subnet number and the broadcast address.

When subnetting a Class A network you start of with an 8 bit mask and you can borrow any or all of the next 22 bits to create subnets. --> you have borrowed 1 bit --> you have borrowed 2 bits

... ... ... ... --> you have borrowed 8 bits

... ... ... ... --> you have borrowed 16 bits

... ... ... ... --> you have borrowed 22 bits.

This is a /30 subnet and is the smallest subnet possible, which comprises 4 IP addresses, only 2 of which can be used for host addresses. These are normally used on point to point WAN links.


Best Regards,


scottmac Sat, 04/26/2008 - 06:28

Great explanation Michael(+5).

I think the "magic number" mentioned is looking at the subnet/host boundary ... if it's on the "16" bit position, then the subnet numbers will increment by sixteen.

Good Luck


pancreatitis Sat, 04/26/2008 - 12:45


Thanks so much for the detailed reply. The book I am using is from CiscoPress and is the latest for the ICND1 training. I have found a number of errors in it so far mostly with editing and proofreading.

The "magic number" is a phenom peculiar to Cisco/Wendell Odom. It simply is the number obtained by subtracting the non-255 octet, termed "the interesting octet" from 256. Thus you get 64 from 256 - 192. Then the text says to take multiples of this magic number up to less than or equal to the value in the same octet in the IP address. The number that you get is supposed to be the subnet number. The problem with this method is when the IP address in the selected octet is smaller than the magic number. The rules then fall out and one is left scratching his/her head. All the masks and IPs were constructed to avoid this issue in the text which, to me, raises questions about its application and worthiness.

My question arises because as you said the Class A is 8 and everything else is up for grabs depending on the mask to use for subnets. However later on the text only uses the non-255 octet in a class A address with mask of and only references subnets in that 192 octet.

That is confusing to me. I agree that you have all the bits(1s) available after the first octet in class A but the book is confusing on this point. What about the second octet which is available? Does the 192 octet determine the address range (64) and is that the boundary for the 255 octet address ranges?

Thanks again.


Hi John

Wendell Odom is a well respected author of Cisco study material and I actually have and would recommend his CCIE Routing & Switching book, but I have to admit that the subnetting material from your book sounds a little confusing. Although maybe if I had the book an read it, it would make more sense.

I think that when Wendell has you subtract the value of the "interesting octet" from 256 to get the "magic number" this is what I know as the block size.

So say you take the Class A network and you apply the subnet mask To me this means a block size of 64 in the 3rd octet. So the subnets would be as follows, -->subnet number - --> usable host IP addresses --> Broadcast address --> subnet number - --> usable host IP addresses --> Broadcast address




Each subnet is 64 higher (in the 3rd octet) than the previous subnet.

I really would recommend reading the Sybex book by Todd Lammle. Even if you just rent it out from your local library. I really think it is the best explanation of subnetting that I have come across.


Best Regards,



This Discussion