Home > Subnetting Tutorial – Subnetting Made Easy

Subnetting Tutorial – Subnetting Made Easy

September 28th, 2011 Go to comments

In this article, we will learn how to subnet and make subnetting an easy task.

The table below summarizes the possible network numbers, the total number of each type, and the number of hosts in each Class A, B, and C network.

  Default subnet mask Range
Class A (/8) –
Class B (/16) –
Class C (/24) –

Table 1 – Default subnet mask & range of each class

Class A addresses begin with a 0 bit. Therefore, all addresses from to belong to class A (1=0000 0001; 126 = 0111 1110).
The address is reserved for default routing and the address is reserved for loopback testing so they don’t belong to any class.
Class B addresses begin with a 1 bit and a 0 bit. Therefore, all addresses from to belong to class B (128=1000 0000; 191 = 1011 1111).
Class C addresses begin with two 1 bits and a 0 bit. Class C addresses range from to (192 = 1100 0000; 223 = 1101 1111).

Class D & E are used for Multicast and Research purposes and we are not allowed to subnet them so they are not mentioned here.

Note: The number behind the slash notation (/) specifies how many bits are turned on (bit 1). For example:

+ “/8” equals “1111 1111.0000 0000.0000 0000.0000 0000” -> 8 bits are turned on (bit 1)
+ “/12” equals “1111 1111.1111 0000.0000 0000.0000 0000” -> 12 bits are turned on (bit 1)
+ “/28” equals “1111 1111.1111 1111.1111 1111.1111 0000” -> 28 bits are turned on (bit 1)
+ “/32” equals “1111 1111.1111 1111.1111 1111.1111 1111” -> 32 bits are turned on (bit 1) and this is also the maximum value because all bits are turned on.

The slash notation (following with a number) is equivalent to a subnet mask. If you know the slash notation you can figure out the subnet mask and vice versa. For example, “/8” is equivalent to “”; “/12” is equivalent to “”; “/28” is equivalent to “”; “/32” is equivalent to “”.


The Network & Host parts of each class by default

From the “default subnet mask” shown above, we can identify the network and host part of each class. Notice that in the subnet mask, bit 1 represents for Network part while bit 0 presents for Host part (255 equals to 1111 1111 and 0 equals to 0000 0000 in binary form).

What is “subnetting”?

When changing a number in the Network part of an IP address we will be in a different network from the previous address. For example, the IP address belongs to class A and has a default subnet mask of; if we change the number in the first octet (a block of 8 bits, the first octet is the leftmost 8 bits) we will create a different network. For example, is in a different network from But if we change a number in the Host part, we are still in the same Network. For example, is in the same network of

The problem here is if we want to create 300 networks how can we do that? In the above example, we can only create different networks when changing the first octet so we can create a maximum of 255 networks because the first octet can only range from 1 to 255 (in fact it is much smaller because class A only range from 1 to 126). Now we have to use a technique called “subnetting” to achieve our purpose.

“Subnetting” means we borrow some bits from the Host part to add to the Network part. This allows us to have more networks than using the default subnet mask. For example, we can borrow some bits in the next octet to make the address belong to a different network from

How to subnet?

Do you remember that I said “in the subnet mask, bit 1 represents for Network part while bit 0 presents for Host part”? Well, this also means that we can specify how many bits we want to borrow by changing how many bit 0 to bit 1 in the subnet mask.

Let’s come back to our example with the IP, we will write all numbers in binary form to reveal what a computer really sees in an IP address.


Now you can clearly see that the subnet mask will decide which is the Network part, which is the Host part. By borrowing 8 bits, our subnet mask will be like this:


After changing the second octet of the subnet mask from all “0” to all “1”, the Network part is now extended. Now we can create new networks by changing number in the first or second octet. This greatly increases the number of networks we can create. With this new subnet mask, IP is in different network from IP because “1” in the second octet now belongs to the Network part.

So, in conclusion we “subnet” by borrowing bit “0” in the Host portion and converting them to bit “1”. The number of borrowed bits is depended on how many networks we need.

Note: A rule of borrowing bits is we can only borrow bit 0 from the left to the right without skipping any bit 0. For example, you can borrow like this: “1111 1111. 1100 0000.0000 0000.0000 0000” but not this: “1111 1111. 1010 0000.0000 0000.0000 0000”. In general, just make sure all your bit “1”s are successive on the left and all your bit “0”s are successive on the right.

In the next part we will learn how to calculate the number of sub-networks and hosts-per-subnet

Comments (50) Comments
Comment pages
    September 1st, 2014


  2. Anonymous
    September 5th, 2014

    It help me so much!! Thank you so MUCH!!

  3. Mohammad Mozamel
    October 8th, 2014

    Nice Presentation
    Subnetting is the Root of Networking if We Don’t Practice Subnetting Examples it will forgot Faster then other Protocols
    Try to Design Your Lab Simulations in VLSM forms otherwise You Will Forgot Sebnetting

  4. Anthony
    October 9th, 2014

    Thanks a lot for this tutorial. :)

  5. Mariyam
    November 4th, 2014

    Thank you so much for making these tutorials available to everyone !

    November 12th, 2014

    Excellent and Lucid way.Simple..

  7. Eugene
    November 15th, 2014

    Thanks I liked everything in your presentation,let GOD reaching BLESS you .

  8. geteneh
    December 9th, 2014


  9. mohammed mussa
    December 26th, 2014

    I would like to thank for submit mask presentation

  10. mohammed mussa
    December 26th, 2014

    I wiil amember of your programing design

  11. Mason
    February 21st, 2015

    Please help,

    Why 2001:0db8:0:130h::87c:140b is not a valid IPV6 address?

  12. Mason
    February 21st, 2015

    Please help,

    What does it means when a question said “All of the networks are configured with the ip subnet-zero command” ?

  13. loigie panganoron
    February 21st, 2015

    good job

  14. Tauseef Yaseen
    February 22nd, 2015

    Thaank u…it is very help for me.

  15. ameer kabir
    February 26th, 2015

    subnetting becomes very simple after I finished the article thanks a lot

  16. ameer kabir
    February 26th, 2015

    is there any article for CIDR or summarization

  17. Anonymous
    March 20th, 2015

    Good stuff. Thanks

  18. M Ali
    March 22nd, 2015

    Excellent Tutorial

  19. gary B.
    March 24th, 2015

    now i need “how to” crack a 11110000.11110000. 11110000.11110000/4 or another simple. issue. Thanks for your help!

  20. Rahul
    April 1st, 2015

    Really confusing

  21. ghoneim
    April 2nd, 2015


  22. Adebayo
    May 4th, 2015

    Thanks a lot still trying to capture it cos am not too conversant with it but now am getting it.

  23. shoogn
    May 11th, 2015

    The loopback is not

  24. karthick
    June 6th, 2015

    What is the public ip range.?

  25. pre
    June 13th, 2015

    Wht is “any address”?

  26. Raju Gupta
    June 30th, 2015

    i Really influnce by ur Teaching ..methodology..great work..

  27. ghafleks
    July 2nd, 2015

    well done, suppose this type of question came out in exam….with this type of example how do u expect me to convert 2^16 with no calculator?

  28. philip yakwa
    July 13th, 2015

    fantastic expresed

  29. Anonymous
    July 14th, 2015

    In Exercise 3 , no of host should be 2^4=16(here we borrow 4 bits) and no of host =2^16-2=65534.

    Please let me correct if im wrong.

  30. Anonymous
    July 14th, 2015

    Anonymous July 14th, 2015 In Exercise 3 , no of network should be 2^4=16(here we borrow 4 bits) and no of host =2^16-2=65534.

    Please let me correct if im wrong.

  31. Alexie Nepeh
    July 17th, 2015

    @ Anonymous No, you are wrong. The network address has been sub-netted already… this is a class c network and the subnet mask should be in decimal, 11111111.11111111.11111111.00000000 in binary and the actual address but instead the address given is, which means we have borrowed 4 bits already…. so in order to create subnets with the given mask(, we need just to borrow 2 bits. hope i’m clear

  32. premkuamr K
    July 21st, 2015

    Really great work bro

  33. ghfff
    July 26th, 2015


  34. ghghgfhgf
    July 26th, 2015


  35. clinton
    August 12th, 2015

    i need a help on these question (because of increased enrolment,Arcitic university is expanding its stundent computers services by additional six computers labs located on the main campus.Each lab will contain 100 new windows XP-base computers. To reduce the amount of network traffic and increase control ,you recommend that each new lab be configured as a separate subnet .The new computers labs caan use the network ID subnet masks will you use to subnet the labs? What range of IP

    Addresses can you assign to each lab? Use a table similar to the one show below to recor your answer

  36. pathu
    August 13th, 2015


  37. pathu
    August 13th, 2015

    nice teaching method, this is a very easy method to calculate subnetting.
    thank you very much

  38. ggsf
    August 18th, 2015


  39. yugantha
    September 1st, 2015

    you’ve done this in a very understanding way….thank you mate…!!!

  40. Anonymous
    September 5th, 2015

    what the max number of subnet can we get in class A and in Class B and C

  41. Huh
    September 18th, 2015

    I still don’t get it. you suck

  42. Huh
    September 18th, 2015

    There has to be an easier way to do this. you suck

  43. Anonymous
    September 24th, 2015

    can anyone provide me latest dumps on rahulpabale@yahoo.com

  44. Anonimo
    September 28th, 2015

    wow da PUTO ASCO

  45. Mcebo
    September 29th, 2015

    Can anyone provide me with the latest dumps pls at maphosamcebo@yahoo.com

  46. Omo
    September 30th, 2015

    Thanks, bro. It helps me much more :)

  47. Omo
    September 30th, 2015

    Thanks, bro. It helps me much more :)

  48. johnd
    October 2nd, 2015

    exercise 3, two subnet masks? how do you know which to use or how are both applied? I can’t follow the progression on this problem.

  49. johnd
    October 2nd, 2015

    and this is a great site. it’s helped me nail down some concepts i’ve been struggling with. that 3rd exercise though just isn’t sinking in

  50. Anonymous
    October 3rd, 2015

    First sentence after the first table: “Class A addresses begin with a 0 bit.”This is a poor explanation. is a class A. is a class A. I don’t understand your methodology.

Comment pages
Add a Comment