# Understanding Subnetting of a given IP address

CIDR notation is a format for IP address and a suffix is attached to indicate Network identifier bits. For example, consider an IP address, 10.0.0.0/16

For this IP, /16 represents the Network bits,

So the first two blocks reserved for network that means these two blocks won’t change at all.

The following IP will be start from, 10.0.0.0

The IP will be end at, 10.0.255.255

So how many IP can be create from 10.0.0.0 to 10.0.255.255? There is a formula, 2 ^ (total number of bits – total number of bits allocated for network)

With this formula, 2 ^ (32 -16) = 65536, so 65536 can be created with the range of 10.0.0.0-10.0.255.255

This is the overview for CIDR notation.

Now let’s move to subnetting. What is Subnetting?

For a given IP or CIDR notation we can get one or more IP addresses by splitting the CIDR notation (10.0.0.0/16), this process is called Subnetting. Our IP is 10.0.0.0/16,

Since the IP has 16 bits for dedicated network portion and 16 bits for host portion.

Let’s borrow 8 bits for the host portion,

New Subnet Mask will be, 255.255.255.0/24

So the two new subnets will be, 10.0.0.0/24 and 10.0.1.0/24

We split two subnets one is 10.0.0.0/24 and another one is 10.0.1.0/24 (these two subnets can’t be same). The network of 10.0.0.0/16 cannot be greater than its subnet’s network.

For subnet 1 the total number of ip will be, 2 ^ (32-24) = 256, so the range will be 10.0.0.1 – 10.0.0.254

For subnet 2 the total number of ip will be, 2 ^ (32-24) = 256, so the range will be 10.0.1.1 – 10.0.1.254