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 255.0.0.0 (/8) 1.0.0.0 – 126.255.255.255
Class B 255.255.0.0 (/16) 128.0.0.0 – 191.255.255.255
Class C 255.255.255.0 (/24) 192.0.0.0 – 223.255.255.255

Table 1 – Default subnet mask & range of each class

Class A addresses begin with a 0 bit. Therefore, all addresses from 1.0.0.0 to 126.255.255.255 belong to class A (1=0000 0001; 126 = 0111 1110).
The 0.0.0.0 address is reserved for default routing and the 127.0.0.0 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 128.0.0.0 to 191.255.255.255 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 192.0.0.0 to 223.255.255.255 (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 “255.0.0.0″; “/12″ is equivalent to “255.240.0.0″; “/28″ is equivalent to “255.255.255.240″; “/32″ is equivalent to “255.255.255.255″.

Class_A_B_C_network_host_portions.jpg

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 11.0.0.1 belongs to class A and has a default subnet mask of 255.0.0.0; 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, 12.0.0.1 is in a different network from 11.0.0.1. But if we change a number in the Host part, we are still in the same Network. For example, 11.1.0.1 is in the same network of 11.0.0.1.

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 11.1.0.1 belong to a different network from 11.0.0.1.

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 11.0.0.1, we will write all numbers in binary form to reveal what a computer really sees in an IP address.

Class_A_binary_form.jpg

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:

Class_A_subnet_binary_form.jpg

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 11.1.0.1 is in different network from IP 11.0.0.1 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 (198) Comments
Comment pages
  1. Kiko
    May 29th, 2012

    Very Good Job!

    Bravo!!!!!!!!!!!!

  2. Len
    June 8th, 2012

    This is very helpful for a beginner like me.. :)

  3. Kay
    June 21st, 2012

    Good job!
    But i still have a little bit issues here doing Subnetting on my own. Please, just break it down so i can understand it indepth.

    Regards,

  4. venkatesh
    June 26th, 2012

    hello guys.. Iiam preparing for my ccna exam can you plz help me send me latest dumps emailme at vithuvan@gmail.com.

  5. Krishna
    June 30th, 2012

    hi …..i am taking my cisco(CCNA) exam this month.. pls send me the subnetting questions or tell me where i get more and more subnetting questions…. also pls send me the latest CCNA dumps…. pls email me at ktpatil123@gmail.com

  6. Krishna
    July 1st, 2012

    thank u :) thanks a lot :)

  7. Rhonda
    July 7th, 2012

    Can anyone email me any current dumps or tell me where to find? I know most without but I would like to know what to expect. ciscotestingsoon@gmail.com

    Thanks for any help!

  8. Andrew
    July 7th, 2012

    In reality, why a class A address always comes with /24, or more than 24 ’1′s?

  9. Judy
    July 8th, 2012

    For Ex3, 2 layers of SM? I mean practical setting is one SM only. Although I understand the logic of Ex3, how can we relate it to daily network?

  10. eckstar
    July 30th, 2012

    Hi guys,

    Can someone sned me the latest dumps for the exam, i have exam in 3weeks and would like to know what to expect on the question much appreciated :)
    email is: gabrieltyson87@yahoo.co.uk

  11. Gitgit
    August 3rd, 2012

    Hi guys,
    Can someone sned me the latest dumps for the exam, i have exam in 4weeks and would like to know what to expect on the question much appreciated :)

    email is: mjquimpo@gmail.com

  12. Cheaters Never Prosper
    August 28th, 2012

    Seriously?!?!?!? You all want brain dumps???? STUDY like the rest of us and DO NOT CHEAT! You get on a real network (that is if you pass the interview process) and you will have NO CLUE what you are doing!

    If you want the new job, EARN IT! I would never let someone who braindumps near any of my active networks!!!!!

  13. Bro
    August 29th, 2012

    what is this…we want to pay to read in this website anymore… ohh i betrayed u :)

  14. Ganesh
    August 30th, 2012

    Iam big Fan of this website ..I really appreciate the work they do for the upcoming Network Engineers..It was totally free and has become paid now.They made it commercial
    Fell very very sad for this .
    It has got world wide readers please try not to make it commercial for atleast tutorials..
    Thanx alot

  15. 9tut
    August 30th, 2012

    @Ganesh: We are very sad but that is the only way 9tut and other sites can survive and develop.

  16. VIVEK
    September 1st, 2012

    Good Tutorial for subnet.

  17. Rehan
    September 3rd, 2012

    This is not good that you will charge your tutorial, Kindly don’t do that because of that most of the student has suffered. your tutorials help alot and easy to understand.

    Regards,
    Rehan Khan

  18. 9tut
    September 3rd, 2012

    @Rehan: This is not the thing we want. But we can’t, we only limit a few tutorials while others are free.

    Hope you understand our situation.

  19. ChuckB
    September 13th, 2012

    9tut,

    When I was still a student, I always visit your site to learn and review some concepts that I might have forgotten. And I would like to thank you for the knowledge…

    I understand that you need financial support, but paying for a subnetting tutorial article is not cool… seriously.

    It is better if you put the “PAYING” policy on the dumps (Exam questions + answer portion)… but not on the subnetting tutorial. (or any tutorials)

    Come on, Everyone deserves to learn subnetting…

  20. 9tut
    September 13th, 2012

    @all: We agree Subnetting skill is the key to pass CCNA exam so this Sunetting tutorial should be free for everyone and we did that. But without the fund, new tutorials cannot be written. That is why we cannot make the “CCNA Knowledge” section totally free. We really hope you understand this.

  21. alex
    September 14th, 2012

    how to find the network address in a easy way?

  22. alex
    September 14th, 2012

    im sorry, disregard the prev message, I meant broadcast address. Sorry. can anyone tell me how to get the broadcast id when you already have the network id?

  23. 9tut
    September 14th, 2012

    @alex: The broadcast address can be found by subtracting the network address of the next subnet to 1.

  24. henk
    September 17th, 2012

    “/28″ is equivalent to “255.255.240.0″ i thought this was 255.255.255.240

  25. 9tut
    September 17th, 2012

    @henk: Oh, it’s a typo. Thanks for your detection. I updated it!

  26. siva
    September 19th, 2012

    Very Good

  27. Jjais
    September 25th, 2012

    That is my experience as well. My guess is there may be dicefrenefs in some IOS versions. I see plenty of people claiming ip subnet-zero affects the all 1 s and all 0 s subnet. But I typically see it affecting the all 0 s subnet and that is what the name implies as well.

  28. Anonymous
    September 25th, 2012

    Can someone PLEASE send me the latest dump for ccna. I attended a college and was ripped off by thousands of dollars and still haven’t taken the exam due to poor teaching. I just found out about 9tut. i need some help to pass and i think this will do. My email is ———–> emailvmason@gmail.com. thx in advance.

  29. ICND1
    September 28th, 2012

    Can someone send me the latest dumps for this exam, I am testing at the end of October.

    Thanks, Tina
    jrkays@gmail.com

  30. Daniel
    October 2nd, 2012

    Can someone send me the latest dumps for this exam, I am testing at the end of October

    Thanks,Daniel
    danielpendarvis@gmail.com

  31. Shrirang
    October 16th, 2012

    Nicely explained..!

  32. raphael
    October 20th, 2012

    The stuff is well treated.Thank God!

  33. Arison
    October 24th, 2012

    The only thing holding me back from taking the CCNA is the subnetting. I wonder if the paid for tutorial has a subnetting cheat sheet I’ve seen before? If not does anyone have a cheat sheet for subnetting? Because when I read the posts on examcerts it seems that everyone is less concerned on this section………. please someone respond here or email me at iverson2k10@gmail.com thank you and goodluck to all

  34. Anonymous
    November 1st, 2012

    Amazingly good job! Thank you!!!

  35. Priya
    November 2nd, 2012

    Beauiful work

  36. Tux
    November 3rd, 2012

    Thank you dude.

  37. ken M
    November 4th, 2012

    will be doing my CCNA EXAMS this month please send me latest dumps kenmurimi485@gmail.com

  38. Yacoub
    November 10th, 2012

    Can someone send me the latest dumps for this exam, I am testing at the end of November
    Thanks,Yacoub
    yacoub9308@gmail.com

  39. tshons
    November 14th, 2012

    can somebody send me the latest dumps for the exam please.
    thanx tshons@gmx.com

  40. Asif
    November 25th, 2012

    can somebody send me the latest dumps for the exam please. syedasifrizwi@live.com

  41. Michael
    November 27th, 2012

    good job :)

  42. Kratos9797
    December 5th, 2012

    Thanks for the great info 9tut. I’m currently taking the Cisco Discovery courses and will be taking the ICND1 soon. If I’m fully understanding your examples then the I believe the following should formula be true:

    # of hosts = subnet increment bit decimal value – 2 (I made this simplified formula using the information from the charts and other info you have here) so H = I – 2 where I = the decimal value of the increment bit(or I = 2^x, but I think it looks much simpler this way plus using this formula and the chart you have here for the individual bit values you can simply check the chart compared to the current mask to get I instead of trying to memorize all the 2^x values). And one more little note about H = I – 2 is that it doesn’t work for masks of /31 or /32, but you really shouldn’t need formulas to figure those out anyway(especially since they are extremely rare cases).

    And using the formula, that you have here(# subnets = 2^x, where x = # of borrowed host-bits), to figure out the # of subnets, then I believe the following example should be correct(fyi, I made this example).

    You are given the network ip address 172.16.128.192 with a subnet mask of 255.255.255.224. Using this information figure out the number of available subnets and the number of usable hosts for each subnet.

    So first we convert the ip and mask to binary so that we can compare the ip and mask so that we may figure out how many subnet bits we need and such.

    Since we already know that 172.16.x.x is a class B ip we start with the default network bits and end up with the following table:

    172.16.128.192 | 1010 1100 . 0001 0000 . 1000 0000 . 1100 0000
    255.255.255.224 | 1111 1111 . 1111 1111 . 1111 1111 . 1110 0000

    After comparing the ip and mask in binary we get the next table:

    Default Network-bits Subnet-bits Host-bits
    1010 1100 . 0001 0000 .|. 1000 0000 . 110 | 0 0000
    1111 1111 . 1111 1111 .|. 1111 1111 . 111 | 0 0000

    From this table we see that the # of host-bits borrowed is 11 so:

    2^11=2048

    We have 2048 available subnets. Using the charts you provided we also see that the subnet increment bit value is 32 so:

    32-2=30

    So if we had been given the network ip of 172.16.128.192 with a mask of 255.255.255.224 then we would have 2048 available subnets with 30 usable hosts each.

    Even though I’ve been getting most of the subnetting stuff right it’s been taking me a while to figure out some of them so using the information you provided here this going to be going much quicker for me from now on, thanks. I really appreciate all the work you guys here at 9tut put into all of these examples.

  43. Kratos9797
    December 5th, 2012

    Darn, I thought I had all my table info lined up right but oh well.

  44. 9tut
    December 6th, 2012

    @Kratos9797: Please don’t depend on the charts here. They are not always with you so the best way is to learn them by heart. Besides you don’t need to remember all 2^x values. I only remember 2^5= 32 and 2^10=1024, from them I can easily deduce all other 2^x values, just double and double them.

    Moreover, converting from decimal to binary (like 172.16.128.192 in your example) is not recommended because it take much time, especially for unusual numbers (like 123.213.199.89).

    The key point of quick subnetting is we don’t have to convert from decimal to binary and vice versa. So we should remember them, it’s not hard.

    You can use any method you feel the best, but don’t depend on any charts and rough paper, “subnet in your head”.

  45. Anonymous
    December 18th, 2012

    Thank a lot for this tutorial.

  46. Kyaw Zin Aung in Myanmar
    December 18th, 2012

    Thank a lot for this tutorial.

  47. zeeshan
    December 23rd, 2012

    very good and i like to ur page

  48. RAJEEV
    December 23rd, 2012

    Thanx a lot…
    This Tutorial is indeed the best tutorial for subnetting in easy way…

  49. Sneh
    January 19th, 2013

    Hi guys can someone send me the latest dumps for the exam.
    Thanks
    Sneh
    aashug2002@yahoo.co.uk

  50. Anonymous
    January 22nd, 2013

    thanx for the tutorial.was just wondering,given the no of host to be supported,lets say 20 host.how do you subnet your network
    thanx in advance

Comment pages
Add a Comment