# Networking Concepts: Subnetting a Class-B IP Address

by | Nov 6, 2015 | CCNA | 8 comments

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.

• No of Subnets
• No of hosts per subnet
• Range
• 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:

For second range:

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

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. 