Subnetting in Decimal (Fast Way)

In the previous lesson I showed you a lot of binary numbers so let’s work some more with decimal numbers. We can do subnetting just by working with decimal numbers.

As you have seen in the binary examples, the rule of “powers of 2” is very useful. By taking an extra bit the decimal value doubles every time:

  • For every host bit you borrow the number of subnets you can create doubles.
  • Every host bit left doubles the size of the subnet.

Instead of thinking/working in binary, we’ll start thinking in “blocks”.

Take this 192.168.1.0 network with subnet mask 255.255.255.0 as an example:

We know because the subnet mask is 255.255.255.0 we have 8 bits left, and with 8 bits the highest “number” we can create is 256.

128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.

Don’t forget about the 0! The 0 is being used so the highest value you can create is 256.

Visualize this as a block:

256 bit block

We want to subnet our 192.168.1.0 network, so we’ll chop our “block” in two pieces.

When we chop this block in two pieces, this is what we get:

128 bit blocks chainsaw

So now we created 2 subnets out of our Class C network, the next questions are:

  • What are the network addresses?
  • What are the broadcast addresses?
  • What is the subnet mask?
  • What are the usable host IP addresses?

We can write down the network addresses, they are both blocks of “128”. We’ll start at 192.168.1.0 and the second subnet will be 192.168.1.128 (.0 – .127 = 128)

  • Subnet 1:
    • network address: 192.168.1.0
  • Subnet 2:
    • network address: 192.168.1.128

The second question is: what are the broadcast addresses? We know that the broadcast address is the last address within a subnet, so we can just write those down:

  • Subnet 1:
    • network address: 192.168.1.0
    • broadcast address: 192.168.1.127
  • Subnet 2:
    • network address: 192.168.1.128
    • broadcast address: 192.168.1.255

The third question: what is the subnet mask?To solve this question I’ll teach you a new trick:

256 – “block size” = subnet mask.

So in our example that will be:

256 – 128 = 128.

The subnet mask will be 255.255.255.128

One question left: what are the usable host IP addresses?

  • The first usable host IP address comes after the network address.
  • The last usable host IP address comes before the broadcast address.
  • Everything in between is a usable host IP address.

Let’s fill this in:

  • Subnet 1:
    • network address: 192.168.1.0
    • first host: 192.168.1.1
    • last host: 192.168.1.126
    • broadcast address: 192.168.1.127
  • Subnet 2:
    • network address: 192.168.1.128
    • first host: 192.168.1.129
    • last host: 192.168.1.254
    • broadcast address: 192.168.1.255

That was pretty fast right? We just subnetted this class C network, calculated the network address, broadcast address and the usable host IP addresses.

Let’s try one more!

We’ll take the 192.168.1.0 class C network but now we’ll chop it into four pieces so we get 4 “blocks”:

64 bit blocks

We have the same set of questions to answer:

  • What are the network addresses?
  • What are the broadcast addresses?
  • What is the subnet mask?
  • What are the usable host IP addresses?

Let’s write down the networks, all “blocks” of 64:

  • Subnet 1:
    • network address: 192.168.1.0
  • Subnet 2:
    • network address: 192.168.1.64
  • Subnet 3:
    • network address: 192.168.1.128
  • Subnet 4:
    • network address: 192.168.1.192

Now we know the networks we can write down the broadcast addresses:

  • Subnet 1:
    • network address: 192.168.1.0
    • broadcast address: 192.168.1.63
  • Subnet 2:
    • network address: 192.168.1.64
    • broadcast address: 192.168.1.127
  • Subnet 3:
    • network address: 192.168.1.128
    • broadcast address: 192.168.1.191
  • Subnet 4:
    • network address: 192.168.1.192
    • broadcast address: 192.168.1.255

What is the subnet mask?

256 – “block size” = subnet

In our example: 256 – 64 = 192

The subnet mask will be 255.255.255.192

One more step, we need to fill in the usable host IP addresses:

  • Subnet 1:
    • network address: 192.168.1.0
    • first host: 192.168.1.1
    • last host: 192.168.1.62
    • broadcast address: 192.168.1.63
  • Subnet 2:
    • network address: 192.168.1.64
    • first host: 192.168.1.65
    • last host: 192.168.1.126
    • broadcast address: 192.168.1.127
  • Subnet 3:
    • network address: 192.168.1.128
    • first host: 192.168.1.129
    • last host: 192.168.1.190
    • broadcast address: 192.168.1.191
  • Subnet 4:
    • network address: 192.168.1.192
    • first host: 192.168.1.193
    • last host: 192.168.1.254
    • broadcast address: 192.168.1.255

And that’s it. Once you understand the rules, calculating in decimal is a lot faster than doing it in binary.

Can we apply this same method for class B networks? Sure! The only difference with a class C network is we have more space because we are now playing with the third octet.

Let’s take the 172.16.0.0 network and create eight subnets.

We still have the same questions to answer:

  • What are the network addresses?
  • What are the broadcast addresses?
  • What is the subnet mask?
  • What are the usable host IP addresses?

We start with our block of “256” but now we are playing with the third octet:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You've Ever Spent on Your Cisco Career!
  • Full Access to our 655 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

535 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags:


Forum Replies

  1. great information, i have been in a class room setting for a bit and never had it explained this way

  2. Hi Rene
    When creating this blocks, do they have to be of equal size?

    For example, you have an address of 10.10.10.0/23, and I am working to create a network/mask for the below requirements

    I. 24 hosts
    II. 111 hosts
    III. 47 hosts
    IV. 200 hosts

    I came up with this , can you let me know if this is correct

    I. 10.10.10.0/27
    II. 10.10.10.128/25
    III. 10.10.10.64/26
    IV. 10.10.11.0/24

    If I did this way, is this correct?

    I. 10.10.10.192/27
    II. 10.10.11.64/25
    III. 10.10.11.0/26
    IV. 10.10.10.0/24

    Thanks
    Palani

  3. Palani,
    Short answer: Everything you have is correct. For any given subnet mask, the block size is always the same.

    People do subnetting many different ways. I haven’t heard of others doing it my way, but it works for me. I thought I might share with you how I can do subnetting very fast in my head–no calculators or even pencil and paper required.

    I use the formula 2^X >= Y, which reads as 2 to the Xth power is greater than or equal to Y. Y is the number of hosts (or subnets) you are trying to figure out, and X is the variable you are trying to solve for.

    ... Continue reading in our forum

  4. Guys, I need help. Every time I try getting into different topics, be it NAT, Routing Policy, etc - I always get back to Subnetting. I finally realized there’s no way to progress without mastering this subject. I google everywhere, but I need your help and hopefully I’ll finally figure this out. Please, show me how would you answer this question;

    Write a standard ACL that will cover the host range from 192.168.100.128 through 192.168.100.131.

    Let’s not worry about the ACL part, but how would you go about writing an IP address with a subnet (wildcard) mask tha

    ... Continue reading in our forum

  5. Hi Maros,

    Once you understand the fundamentals of subnetting, a quick way to solve a question like this is to visualize it and think in “blocks”:

    ... Continue reading in our forum

19 more replies! Ask a question or join the discussion by visiting our Community Forum