We use subnet mask of a network to create subnets. Subnet mask is used to separate Network and Host portion of an IP address. In subnet mask all 1s are Network Bits and all 0s are Host bits. In subnetting we convert host bits into network bits. Or you can say convert 0s into 1s.
There are 3 classes that we can use while assigning IP Address: Class A, Class B and Class C. We can do subnetting for all those classes. So, let’s do it.
Subnetting Class A addresses
Let’s take a class A IP address first- 10.0.0.0/8. We have 32-8=24 bits in which we can do subnetting.
There are 4 main things to consider in subnetting.
- CIDR Value/ Subnet Mask,
- No of Subnets
- No of hosts per subnet
- Network Address and Broadcast address
- Valid Range
Let’s take an example of 10.10.0.0/10. First, check what will be network address of this IP Address. That will be 10.0.0.0 (because in class-A one octet is reserved for networks and three for hosts.)
- CIDR = 10 that means subnet Mask = 255.192.0.0. How?
Write /10 in bits form,
Now convert it into binary. That will be equal to 255.192.0.0. Got it?
Use the same formulas that we applied in previous class.
- For Number of subnets,
Number of subnets = 2^no of subnetted bits
In our case no of subnetted bits are 2. Why?
Because IP address that we are using here belongs to Class A and default CIDR Value of Class A is 8. We are using /10 here. That means No of subnetted bits = 10-8=2.
That means if we use /10 subnet mask (255.192.0.0), it will create 2^2=4 sub-networks.
So, we will get 4 subnets from /10 but what about hosts?
Number of Hosts per Subnets = 2^No of non-subnetted bits (No of Zeros)
In our case, it is 2^6 x 2^8 x 2^8 = 2^22
Here, 6 bits are available for subnetting in 2nd octet; 8 bits are available in 3rd octet and 8 bits are available in 4th octet. So, total 22 bits are available for subnetting.
Means there will be 2^22 hosts in a subnet and there will be two subnets. That is lot of hosts.
- Each subnet will start with an IP address and end at some IP address. After that, new subnet will start. IP addresses in a particular subnet will be its range.
We have two subnets, so first subnet will start from 184.108.40.206 and will end at 220.127.116.11 because there could be only 2^15 hosts (IP Addresses) in a subnet (2^7 from 3rd octet and 2^8 from 4th octet.)
So first range will be,
10.0.0.0 – 10.63.255.255
Second range will be,
10.64.0.0 – 10.127.255.255
Third range will be,
10.128.0.0 – 10.191.255.255
And finally fourth range will be,
10.192.0.0 – 10.255.255.255
I think you all know why we have taken 10.63.255.255? It’s because fourth octet will be filled first then third and then second.
- In each Range there will be a network address that will represent complete network for that subnet and there will be some broadcast address. Those addresses will always be first and last IP address of the range.
For first range:
Network Address: 10.0.0.0
Broadcast Address: 10.63.255.255
For second range:
Network Address: 10.64.0.0
Broadcast Address: 10.127.255.255
Same will be for the rest of the ranges. All the address in between the ranges can be used in our network, including addresses like 10.63.0.0. It doesn’t matter if there is a zero in the end. Note that it is not network address of the range so we can use it in our network and communication will be successful.
- Note that we cannot assign Network address and Broadcast address in our network. So valid range will be different from normal range. Valid range consists of IP addresses that we can assign in our network. So valid IP ranges will be,
10.0.0.1 – 10.63.255.254
10.64.1.1 – 10.127.255.254
10.128.0.1 – 10.191.255.254
10.192.0.1 – 10.255.255.254
We can assign IP Addresses from that range.
Valid Range will be No of hosts per network – 2. These are also called Valid Hosts.
That is how you can create sub-networks from a single network.
DO IT YOURSELF:
You can do this subnetting up to /30 in this class too; mean 10.0.0.0 /30. Process is same. Only number of networks will be increased and no of hosts will be decreased.
Quick cheat applies for this class as it was in class A. Take a look,
10.0.0.0 / 20
/20 mean 255.255.240.0. In which octet subnet mask is being changed? 3rd octet, right? Now take only that octet. /20 mean in 3rd octet there are 4 subnetted bits and 4 bits are remained for hosts (for that octet only). Now do the subnetting. Only when writing the range, change the 4th octet to 0 and 255.
10.0.0.0 – 10.0.15.255
10.0.16.0 – 10.0.31.255
10.0.32.0 – 10.0.47.255 and so far. As you can see changes are being made in 3rd octet only. 4th octet is changing to 0 and 255 only.
Try one for 18.104.22.168 / 22.
That was all you needed to know about Class-A Subnetting. If you want to practice your subnetting skills, visit here.