How to perform network sub-netting?

Introductory terms and concepts

• For Class C network, we can check if two IP addresses are in the same network by checking the leftmost 24 bits eg. 192.168.23.2 , 192.168.23.4 are in same network. similarly, 192.168.43.5 and 192.168.43.5 are in the same network. For Class A, we check the leftmost 8 bits and for Class B, we check the leftmost 16 bits.
• CIDR value: a CIDR network address looks like 192.168.20.6/24, where /24 notation, sometimes known as a subnet mask , represent that the leftmost 24 bits define the subnet network. It means that first 24 bits are the network part of the address and the remaining 32-24= 8 are the the host part of the address

Learn about IPv4, IP addresses, network classes, subnet, CIDR and other basic terms from here(link to Wikipedia), here(link to webopedia). Here is also a link to online subnet calculator.

The CIDR table: reference – http://cisco-kid.co.uk/wp/wp-content/uploads/2011/01/cidr_values.png CIDR table Example: Performing sub netting in Class C

Suppose we were to perform sub netting on 192.168.10.0/27 .

Here, no. of ON bits x = 27 – 24 = 3 bits

How many subnets?

No. of subnets = 2^x = 2 ^ 3 = 8 subnets

No. of hosts?

y = 8 – 3 = 5

Total hosts = 2 ^ y = 2 ^ 5 = 32 hosts

No. of valid hosts = Total hosts – 2  = 32 – 2 = 30 valid hosts ( Note: we subtract 2 because, one host ID is for gateway ID and 1 host ID is for broadcast ID, which is not counted)

Range of each valid Subnets = 256 – 224 = 32

So, gateway ID for each of the 8 subnet will start from 0,32,64,96,128,160,192,224

Hence the detailed range of every subnet of the network 192.168.10.0/27 will be as follows
Subnet 1: 192.168.0.0 – 192.168.0.31

Subnet 2: 192.168.0.32 – 192.168.0.63

Subnet 3: 192.168.0.64 – 192.168.0.95

Subnet 4: 192.168.0.96 – 192.168.0.127

Subnet 5: 192.168.0.128 – 192.168.0.159

Subnet 6: 192.168.0.160 – 192.168.0.191

Subnet 7: 192.168.0.192 – 192.168.0.223

Subnet 8: 192.168.0.224 – 192.168.0.255