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- 172.35.10.0/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
- Range
- Network Address and Broadcast address
- Valid Range
Let’s take an example of 172.35.10.0/17. First, check what will be network address of this IP Address. That will be 172.35.0.0 (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,
11111111.11111111. 10000000.00000000
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 172.35.0.0 and will end at 172.35.127.255 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,
172.35.0.0 – 172.35.127.255
And second range will be,
172.35.128.0 – 172.35.255.255
Now why “172.35.127.255”? 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: 172.35.0.0
Broadcast Address: 172.35.127.255
For second range:
Network Address: 172.35.128.0
Broadcast Address: 172.35.255.255
All the address in between the ranges can be used in our network, including addresses like 172.35.1.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,
172.35.0.1 – 172.35.127.254
172.35.128.1 – 172.35.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.
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,
172.35.0.0 – 172.35.31.255
172.35.32.0 – 172.35.63.255
172.35.64.0 – 172.35.95.255
172.35.96.0 – 172.35.127.255
.
.
.
172.35.224.0 – 172.35.255.255
- 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 172.35.0.0 /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,
172.35.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.
172.35.0.0 – 172.35.15.255
172.35.16.0 – 172.35.31.255
172.35.32.0 – 172.35.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 181.181.181.181 / 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.
This is seriously epic. You have explained the concepts of subnetting so easily that I could understand it in 30minutes with this article.
I am sure that now I will never forget how to find subnetting and how to use the concepts in my practicals.
Thank you so much.
Can you please share articles on BGP?
Thank you for appreciation. We are working on BGP Article. It will be posted very soon.
Sir,
There is any placement guarantee in networking course. I want to do it but need assurance of my job. I have completed my B.tech in 2015. Suggest me.
your article helps me a lot to understand about subnetting. I need to know about proper training of CCNA or Cisco networking. Please share the contact details for career guidance.
Hi Nitin,
Thanks a lot for your appreciation. you can call/ whatsapp/ sms on the below numbers:
8800833865 / 8750004411 or mail us at [email protected]
We will be happy to help/ guide you.
Thanks
I love your explanation of explaining how to subnet the B Class. You made it seen so easy and the way you showed examples as you were explaining it. I appreciate your time and knowledge
if i have been given a question of subnetting 192.186.31.4/26
how would i identify whether it is a class B or call C subnetwork?
Hi Bhavin Soni,
Here is the answer:
We can easily look up at the first octet of the given IP. It is starting from 192 and recalls from your study that if an IP starts from any number coming in the range 192 to 223, it belongs to CLASS C. So, it’s safe to say that this is a Class C subnet.