Saturday, September 17, 2016

IPV4 Subnetting Tips


It always takes a bit to get your head around subnetting for the first time, and even more to answer the exam questions they give as they often are designed to trick you.

For random IPV4 subnetting questions to hone your skills, I suggest you bookmark:



Memorizing the tables help immensely,  although at first appearance they appear daunting.


/24 8 255.255.255.0 256 = 28 Large LAN
/25 7 255.255.255.128 128 = 27 Large LAN
/26 6 255.255.255.192 64 = 26 Small LAN
/27 5 255.255.255.224 32 = 25 Small LAN
/28 4 255.255.255.240 16 = 24 Small LAN
/29 3 255.255.255.248 8 = 23 Smallest multi-host network
/30 2 255.255.255.252 4 = 22 "Glue network" (point to point links)
/31 1 255.255.255.254 2 = 21 Point to point links (RFC 3021)
/32 0 255.255.255.255 1 = 20 Host route

TIPS:

Remember the binary number doubles for each bit.  2, 4, 8, 16, 32, 64, 128, 256 etc

Also remember 8, 16, 24, 32 for the 8 bit block sizes. 

To find the block size, find the first octet that is not 255, then subtract it from 256... eg subnet mask of 255.255.255.224 ...256 - 224 = block size of 32 

Subtract 2 from the block size to get the number of hosts eg 32 - 2 = 30 host IP.
(network and broadcast addresses cannot be used for user IP)

For the slash format, eg /27 subtract 27 from 32 to give a remainder of 5
Then if we count up 5 times doubling, 2, 4, 8, 16, 32 we get to the same block size of 32.

We also see that 224 is equal to 3 subnet bits taken from the octet ( 11100000) in a C class subnet, this will equal 8 subnets (allowing for subnet zero) 1, 2, 4 = 7+1 = 8 subnets.


Some providers have questions relating to old routing kit that did not allow the use of the all "1" subnet or all the "0" subnet (known as 'subnet zero').On all new Cisco routers, the number of subnets is calculated using the formula of 2^n by default. However, for legacy routers network engineers use 2^n - 2 to comply with the almost obsolete RFC 1878 standard. 

Some text books and courses that relate to old routing equipment also refer to the old formula as do some Microsoft Learning courses. If you're planning to take a non-Cisco exam that involves subnetting you should make sure you understand the 'subnet zero' concept' and check what is considered the default correct formula by your examining board

Once you get the patterns 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, etc and the masks 255, 254, 252, 248, 240, 224, 192, 128 burnt in it will become way easier :-)


No comments:

Post a Comment