Subnetting in Decimal (Fast Way)

hello rene. pls i would really appreciate if u can share more light on class B part because i remember u first break the block in 8 but u only did four and more so how did u arrive at 172.16.31.255.just to cut the long story short i’m confused with class B part but with class C i can solve anything with my eyes closed.

Hello Damola

When working with a class B network, it simply means that the same process is applied to the third octet rather than the fourth octet. The fourth octet remains fully part of the host address. In the example in the lesson, Rene begins with the 172.16.0.0 network with a subnet mask of 255.255.0.0. This can also be written like so: 172.16.0.0/16. That means that the first 16 bits are the network portion and the second 16 bits are the host portion.

Now Rene wants to separate this into 8 smaller subnets. To do this, we break the third octet into eight blocks of 32 numbers. To make this clearer, let’s convert the second two octets of our address into binary:

172.16.00000000.00000000

To break up that third octet into eight blocks of 32, we need to move the boundary between the host and network portions three spaces to the right. 2^3 = 8. So whatever is in bold below is the network portion of the address.

172.16.00000000.00000000

Now we must define the eight new subnets that fit into the original 172.16.0.0/16. These are:

172.16.00000000.00000000
172.16.00100000.00000000
172.16.01000000.00000000
172.16.01100000.00000000
172.16.10000000.00000000
172.16.10100000.00000000
172.16.11000000.00000000
172.16.11100000.00000000

Note that all of the above have 19 bits in the network portion. We moved 3 bits to the right, which means our /16 becomes /19. In decimal form, these are:

172.16.0.0/19
172.16.32.0/19
172.16.64.0/19
172.16.96.0/19
172.16.128.0/19
172.16.160.0/19
172.16.192.0/19
172.16.224.0/19

These are all the network addresses. The broadcast address is the last address in the range. For the first subnet of 172.16.0.0/19, the last address in the range in binary is:

172.16.00011111.11111111

Note that all of the host bits are set to 1, which is the definition of the broadcast address.

This address in decimal is 172.16.31.255. An easy way to remember how to do this is that the broadcast address of a subnet is the network address of the next subnet minus 1.

So the network address of the next subnet is 172.16.32.0/19. Subtract one from this, and you get 172.16.31.255.

I hope this has been helpful!

Laz

Hi, Rene,
I am new to networking. And you are really giving an wonderful explaination!
But I got a few questions by reading the whole article:

  1. what is the relationship between different subnets ?
  2. how do different subnets talk with each other ?
    Additionally, for the article “Subnet in binary”, based on my understanding, I can get a formula: the number of subnets multipled by the number of IP addresses per subnet are equal to the number of “2 power of host bits”, is it right ?
    Thank you very much for your reply!

Helloo Heping

Glad to hear that you are finding the content helpful so far!

Networks by design are segmented into smaller network segments. Each network segment (or broadcast domain) is assigned a single subnet. So as far as subnetting IP addresses goes, each segment or broadcast domain is assigned IP addresses within the same IP subnet. So there is a one to one correspondence between IP address subnets and network segments.

In order or hosts within different subnets to communicate, you must employ routing. Where communication between hosts in the same subnet takes place directly, communication between hosts in differet subnets takes place via a default gateway. In other words, routing is involved.

Well not quite. If you have subnets of different sizes, this formula wouldn’t work. Also, you have to take into account that every subnet also reserves two IP addresses for the network and broadcast addresses. These are the first and last addresses within a subnet. This is more fully explained in the Subnetting in Binary lesson.

I hope this has been helpful!

Laz