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- 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 First, check what will be network address of this IP Address. That will be (because in class B two octets are reserved for networks and two for hosts.)

  • CIDR = 17 that means subnet Mask = How?

Write /17 in bits form,

11111111.11111111. 10000000.00000000

Now convert it into binary. That will be equal to 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 (, 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 and will end at 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, –

And second range will be, –

Now why “”? 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:

Broadcast Address:

For second range:

Network Address:

Broadcast Address:

All the address in between the ranges can be used in our network, including addresses like 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, – –

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 =
  • 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, – – – –



. –

  • 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?

cisco ccna ebook


You can do this subnetting up to /30 means /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, / 20

/20 mean 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. – – – 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 / 27.

That was all you needed to know about Class-B Subnetting. If you want to practice your subnetting skills, is a great website to visit.


Register for Free Demo Session