Networking Concepts: Subnetting a Class- A IP Address
Coming to last class of subnetting, let’s take a look at subnetting of class A IP address. 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, 11111111.11000000. 00000000.00000000 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 220.127.116.11 and will end at 18.104.22.168 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.