# Simple ways of subnetting class B IP addresses

In my previous post, I shared how we can subnet a class C address with an example. In this post, I will share how to subnet a class B address with two examples. Since class B uses two octets for the host bit, I will show two examples one from each octets. Let’s get going.

Range of class B address: first of all, be reminded that any IP whose values in the first octet fall between 128 and 191, is a class B address.

Example 1: Given 172.16.12.0/19, determine the following:

(i) The number of subnets that the given address and subnetmak will produce.

(ii) The number of hosts per each of the subnets generated in (i) above

(iii) Using a table, list all subnets, first and last valid IPs, and broadcast address

First thing to do is write the subnetmask from the given slash notation: /19 will be 255.255.224.0 (8 bits on is 255 and 3 bits on is 224, remember?)

(i) To determine the number of subnets, use 2^X, where X is equal to the number of bits borrowed. This will give 2^3=8 (the default subnetmask for B is 16 but in this example, we are given /19, meaning that we borrowed 3.) So our number of subnets will be 8. Question one answered.

You may also like: Subnetting class A address, on my next post

(ii) To determine the number of host per subnet, use 2^Y-2, where Y equals the number of bits off. This will give 32-19=13 (IPv4 is a 32-bit address format and in this example, 19 bits are turned on) Now, that will have 13 off, we will substitute that into the equation, giving us 2^13-2=8,190. We will have 8,190 hosts per subnets (the -2 is for the network and broadcast addresses that we can’t assign to hosts on the networks).

(iii) To list out the subnets, we will need a block size. Block size=256-224, which gives us 32. (to get your block size, simply substitute the value of the subnet bits from 256. 256 is a constant value). Now, that we have a block size of 32, we can list our subnets in block size of 32, starting from subnet zero (back in the days, IP subnet zero was not used except you turn it on yourself on the router. Now, IP subnet zero is turned by default and so, you can use the zero subnet)

 Subnet 0 32 64 96 128 160 192 224 First IP 0.1 32.1 64.1 96.1 128.1 160.1 192.1 224.1 Last IP 31.254 63.254 95.254 127.254 159.254 191.254 223.254 255.254 Broadcast 31.255 63.255 95.255 127.255 159.255 191.255 223.255 255.255

Example 2. Given 172.16.0.0/26, determine the following:

(i) Number of unique subnets that the given address and subnetmask will produce

(ii) Number of hosts per subnet

I chose /26 because with it, the subnet bit falls into the fourth octet, which will be different from the first example where it fell into the third octet.

First, the subnetmask will be 255.255.255.192

(i) Number of subnet will be 2^X where X equals the number of borrowed bits. This will give us 2^10=1024 (again, the default for class B is 16 but in this example, we have /29. So when you substitute 16 from 29, you have 10). Answer to question (i) is 1024 subnets.

(ii) How many hosts per subnet? To get this, we use the formula 2^Y-2 where Y equals the number of off bits. This gives us 2^6-2=62 (again, IPV4 is a 32-bit address and we are given /29. That leaves us with 6 bits off).

(iii) Block size will be 256-192 which will give us 62. With that, we list our subnets in blocks of 62.

First eight subnets

 Subnet 0 0.64 0.128 0.192 1 1.64 1.128 1.192 First IP 0.1 0.65 0.129 0.193 1.1 1.65 1.129 1.193 Last IP 0.62 0.126 0.19 0.254 1.62 1.126 1.19 1.254 Broadcast 0.63 0.127 0.191 0.255 1.63 1.127 1.191 1.255

Last eight subnets
 Subnet 254 254.64 254.128 254.192 255 255.64 255.128 255.192 First IP 254.1 254.65 254.129 254.193 255.1 255.65 255.129 255.193 Last IP 254.62 254.126 254.19 254.254 255.62 255.126 255.19 255.254 Broadcast 254.63 254.127 254.191 254.255 255.63 255.127 255.191 255.255

### One thought on “Simple ways of subnetting class B IP addresses”

• December 27, 2017 at 9:34 am