Subnetting Tutorial – Subnetting Made Easy
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″.
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.
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 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
Very Good Job!
Bravo!!!!!!!!!!!!
This is very helpful for a beginner like me.. :)
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,
hello guys.. Iiam preparing for my ccna exam can you plz help me send me latest dumps emailme at vithuvan@gmail.com.
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
thank u :) thanks a lot :)
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!
In reality, why a class A address always comes with /24, or more than 24 ’1′s?
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?
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
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
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!!!!!
what is this…we want to pay to read in this website anymore… ohh i betrayed u :)
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
@Ganesh: We are very sad but that is the only way 9tut and other sites can survive and develop.
Good Tutorial for subnet.
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
@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.
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…
@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.
how to find the network address in a easy way?
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?
@alex: The broadcast address can be found by subtracting the network address of the next subnet to 1.
“/28″ is equivalent to “255.255.240.0″ i thought this was 255.255.255.240
@henk: Oh, it’s a typo. Thanks for your detection. I updated it!
Very Good
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.
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.
Can someone send me the latest dumps for this exam, I am testing at the end of October.
Thanks, Tina
jrkays@gmail.com
Can someone send me the latest dumps for this exam, I am testing at the end of October
Thanks,Daniel
danielpendarvis@gmail.com
Nicely explained..!
The stuff is well treated.Thank God!
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
Amazingly good job! Thank you!!!
Beauiful work
Thank you dude.
will be doing my CCNA EXAMS this month please send me latest dumps kenmurimi485@gmail.com
Can someone send me the latest dumps for this exam, I am testing at the end of November
Thanks,Yacoub
yacoub9308@gmail.com
can somebody send me the latest dumps for the exam please.
thanx tshons@gmx.com
can somebody send me the latest dumps for the exam please. syedasifrizwi@live.com
good job :)
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.
Darn, I thought I had all my table info lined up right but oh well.
@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”.
Thank a lot for this tutorial.
Thank a lot for this tutorial.
very good and i like to ur page
Thanx a lot…
This Tutorial is indeed the best tutorial for subnetting in easy way…
Hi guys can someone send me the latest dumps for the exam.
Thanks
Sneh
aashug2002@yahoo.co.uk
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