Networking Concepts: Subnetting a Class-B IP Address
Subnetting, as we have already discussed in our previous post, is one of the most important topic in CCNA. We have already discussed how to create a sub-network from a single network address? Now, let’s take a look at subnetting of class B IP address. So, let’s do it.
Subnetting a Class B IP address
Let’s take a class B IP address first- 184.108.40.206/16. We have 32-16=16 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 220.127.116.11/17. First, check what will be network address of this IP Address. That will be 18.104.22.168 (because in class B two octets are reserved for networks and two for hosts.)
- CIDR = 17 that means subnet Mask = 255.255.128.0. How?
Write /17 in bits form,
Now convert it into binary. That will be equal to 255.255.128.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 is 1. Why?
Because IP address that we are using here belongs to Class B and default CIDR Value of Class B is 16. We are using /17 here. That means No of subnetted bits = 17-16=1.
That means if we use /17 subnet mask (255.255.128.0), it will create 2^1=2 sub-networks. And we don’t even have to change the Network.
- So, we will get 2 subnets from /17 but what about hosts?
Number of Hosts per Subnets = 2^No of non-subnetted bits (No of Zeros)
In our case, it is 2^7 x 2^8 = 2^15
Here, 7 bits are available for subnetting in 3rd octet and 8 bits are available in 4th octet. So, total 15 bits are available for subnetting.
Means there will be 2^15 hosts in a subnet and there will be two subnets.
- 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 22.214.171.124 and will end at 126.96.36.199 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,
188.8.131.52 – 184.108.40.206
And second range will be,
220.127.116.11 – 18.104.22.168
Now why “22.214.171.124”? That’s because when we talk about hosts, we start from right to left. So, 4th octet will be filled first then 3rd one.
- 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: 126.96.36.199
Broadcast Address: 188.8.131.52
For second range:
Network Address: 184.108.40.206
Broadcast Address: 220.127.116.11
All the address in between the ranges can be used in our network, including addresses like 18.104.22.168. 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,
22.214.171.124 – 126.96.36.199
188.8.131.52 – 184.108.40.206
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.
Now let’s quickly do it for /19
- CIDR Value/ Subnet mask = 255.255.224.0
- No of subnets = 2^Subnetted bits = 2^3 = 8 (19-16=3, if you are wondering)
- No of Hosts per subnet = 2^no of non-subnetted bits = 2^5 x 2^8 = 2^13
- Range will be,
220.127.116.11 – 18.104.22.168
22.214.171.124 – 126.96.36.199
188.8.131.52 – 184.108.40.206
220.127.116.11 – 18.104.22.168
22.214.171.124 – 126.96.36.199
- Valid IP Addresses = 2^13-2 for each subnet
- Network Address: First IP address of each Subnet
- Broadcast Address: Last IP address of each Subnet
That was really TOUGH. Wasn’t it?
DO IT YOURSELF:
You can do this subnetting up to /30 means 188.8.131.52 /30. Process is same. Only number of networks will be increased and no of hosts will be decreased.
There is a quick cheat for class B and subnetting. Instead of checking the entire octet, check in which octet subnetting mask is being changed. Then do subnetting only for that particular octet. You will come up with the same result. Take a look,
184.108.40.206 / 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.
220.127.116.11 – 18.104.22.168
22.214.171.124 – 126.96.36.199
188.8.131.52 – 184.108.40.206 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 220.127.116.11 / 27.
That was all you needed to know about Class-B Subnetting. If you want to practice your subnetting skills,http://ip-subnetting.com/ is a great website to visit.