# Subnetting Doubt



## vishal16 (Jan 18, 2009)

I am pretty confident of how to do the subnetting of any paticular class but what i am doubtful about is the concept, when you chose certain number of bits from the host portion in order to be used as subnet bits. Do we use the formula 

*2 to the power of "n" - 2 * or do we use the formula *2 to the power of "n"* .

As i have read it in a number of places that when we put in the 'ip subnet-zero' command on the router we can use the second formula instead of having a minus 2 in our formula but Cisco itself in the CCENT/CCNA ICND1 book says that we use the first formula in order to calculate the number of subnets..

Now can anyone confirm it whether we use the first formula or do we use the second formula when studying for the CCNA examination. Also if you have any link of the CISCO website that says so, it would be great..


----------



## bilbus (Aug 29, 2006)

from a ccna question

By borrowing 5 bits from the last octet, you can. have 30 subnets. If you borrowed only 4 bits you could only have 14 subnets. The formula is (2 to the power of n)-2. By borrowing 4 bits, you have (2×2x2×2)-2=14. By borrowing 5 bits, you have (2×2x2×2x2)-2=30. To get 20 subnets, you would need to borrow 5 bits so the subnet mask would be 255.255.255.248. You are given the IP address of 172.16.2.160 with a subnet mask of 255.255.0.0. What is the network address in binary?
* 10101100 00010000
* 00000010 10100000
* 10101100 00000000
* 11100000 11110000
Correct answer: A


----------



## 13m4rc (Mar 3, 2009)

You should understand why you're subtracting 2:
1. XXX.YYY.ZZZ.0 <----this will indicate network ID
2. XXX.YYY.ZZZ.255 <----broadcast address, it's not necessary to end with 255


----------

