Subnetting counting on fingers with 2’s the easy way.

 

How many bits in the mask 255.255.255.240?

 

Answer: How many full 8 bits in each octet? The first 3 octets are 255. That’s all 8 bits. 3 x 8 = 24 bits so far in the network mask. The last octet is not 8 bits. A 2 is a bit. How many bits or 2’s do we subtract to see how many bits left masking the network number revealing the host number? 256 is 2^8 power. 256 – 240 = 16. How many bits/2’s in 16? 2 x 2 = 4 x 2 = 8 x 2 = 16. That was 4 2’s or 4 bits. There is 8 possible bits in the octet minus 4 bits = 4 bits. So the 3 previous octets totaling 24 bits plus the bits in the last octet of 4 equal 28. 28 network bits in the mask 255.255.255.240.

 

How many bits in the mask 255.255.192.0?

 

Answer: How many full 8 bits in each octet? The first 2 octets are 255. That’s all 8 bits. 2 x 8 = 16 bits so far in the network mask. The next octet is not 8 bits. A 2 is a bit. How many bits or 2’s do we subtract to see how many bits left masking the network number? 256 is 2^8 power. 256 – 192 = 64. How many bits/2’s in 64? 2 x 2 = 4 x 2 = 8 x 2 = 16 x 2 = 32 x 2 = 64. That was 6 2’s or 6 bits. There is 8 possible bits in the octet minus 6 bits = 2 bits. So the 2 previous octets totaling 16 bits plus the bits in the 3rd octet of 2 equal 18. The last octet is 0 bits so, 18 plus 0 = 18. 18 network bits in the mask 255.255.255.192.

 

Let’s go the other way?

 

What is the network mask for a /21 bit subnet mask?

 

Answer: How many whole 8’s in 21? 8 + 8 = 24 + 8 = 24. Twenty-four takes you over 21. It is time to stop. There are 2 full 8 bit octets in the first part of the mask. You have 255.255 so far. Now to figure out the 3rd octet. How many bits left to go in the 3rd octet? The first 2 octets are 8 + 8 = 16 bits. 21 – 16 = 5 bits in the 3rd octet. What is the number 5 2’s squared out makes? 2 x 2 = 4 x 2 = 8 x 2 = 16 x 2 = 32. 32 bits subtracted from the decimal 256 (2^8 power) is 256 – 32 = 224. So now you have 255.255.224 so far. Since there are no more bits left, the last octet of course is 0. So the mask for a /21 bit network mask is 255.255.224.0.