Logical division of IP addresses inside network is subnetting or we can say, The process of giving host bits to network is subnetting. We already know that only a limited number of ipv4 addresses are available. We need to use these ipv4 addresses wisely and there are three ways for it.

  1. Private IPs
  2. IPv6
  3. SubnettingSo now we are going to learn What happens if we don’t do subnetting using example.

Prerequisites for subnetting in networking

  1. What is IP Address
  2. Convert IP Address from Decimal to Binary
  3. The “What is Subnetting” Article of Your Dreams

In case you are interested in CIDR you can check here.

What happens if we don’t do subnetting

So now we are going to learn What happens if we don’t do subnetting using example.

how to do subnetting easy way

We want to assign two IPs and in two different sub-networks. We know that every interface of router must have a different network, which means every interface of router should have a different network ID. Now we can see in the above picture that we have given two different IPs to two different machines in two different networks. But there is a problem here. Both the IPs have same Network IDs.

Network IDs with IP Addresses for creating asubnets

It is not possible having the same network IDs in two different networks.

Why the same network IDs can not be used in a network.

If we use the same network IDs for different router interfaces, router would not know in which network the traffic has to be send.

We can think of Network ID as a pin code and router as post office. If two cities have the same pin code, Post office would not know for which city the letter is to be dispatched.

We can give anything apart from which can be like Here we can see that Network IDs and belongs to two different networks, as a result these can be used in a big network.

Moreover by now if you are thinking that while creating subnets we cannot use the network IDs of the same class, you are wrong. We can use the same class network IDs in creating subnets until unless the network IDs are different.

We can create subnets using networks and, which are Class C networks because both of these have different network IDs.

Subnet Mask

Before going further we need to understand what is Subnet Mask.

Network mask is a number which defines the range of IP Address which is being used in a network.

We call it a mask because it masks the network part of an IP Address and leaves the host part as it is.

IP Address ClassDefault Subnet Mask

If there is only default Subnet Mask is given in CIDR, then there is no subnetting done.

From the above table we can conclude that if Subnet Mask of any IP address of class A is 8, then no subnetting has been done.

So if our CIDR is then and there is no subnetting.

Subnetting of an IP Address using examples

Create subnet from CIDR based on below diagram.

how to do subnetting in networking

We can see that this is a class C IP address Subnet Mask is 24 which is default Subnet Mask for this class.

Get Network and Host parts

how to do subnetting for class C

Convert Host part to binary

  1. 10.10.00000000

Calculate How many IPs can be given to biggest subnet (which have 40 machines) using below formula

2n -2 >=40

26 -2 >=40

62-2 >=40


According to this formula we can give 62 IPs in this subnet, though it is up us how many we want to assign.


Divide bits into Network and Host

Reserve n (6) bits to host and give remaining bits to network (Remember the Subnet definition in the beginning of the article?) which is 2

Divide bits into network and host

We know that the Subnet mask given is 24 which represent network. Now we will give these two bits to network and we will get our first subnet which is

Important thing to remember here is we represent host bits by 0 and Network bits by 1.

Formula: Catch the running ones

Catch the running ones in CIDR: how to do subnetting in networking

Divide the subnets further

  • The second network would be
  • Now add 64 again to last octet and we get:
  • Fourth network would be: 197.10.10.(128+64)/26
    • 10.10.192/26
  • Next network would be which is wrong as max no. in an octet can be 255

So with this CIDR we can create only 4 subnets in this particular network.

To create 5 subnets you would need to go for Class B CIDR