Search This Blog

Thursday, April 29, 2010

How to subnet from learning-networking.com

http://learn-networking.com/network-design/how-to-subnet-a-network
Learn-Networking.comWhere 127.0.0.1 is Home.
Today is Thursday, April 29th, 2010
HomeAboutNewsletterRSS.Definitions
Design
Exam Preps
Featured
Hardware
Offers
Packet Tracer Tutorials
Router Configuration
Security
TCP/IP
..How to Subnet a Network
January 27th, 2008 • Related • Filed Under
Filed Under: Design • Featured Tags: classes • how to subnet • IP • subnet • subnet mask
A properly designed subnet can do wonders for the security and performance of a network. The main idea in subnetting is to divide a network into smaller pieces, which we call subnets. Actually implementing a subnet is typically more difficult than simply using the default subnet mask of 255.255.255.0. This usually means that temporary or smaller networks do not need to be subnetted.

Security sees benefit since the IP addresses of the host computers on each subnet are masked by the network address- which means they are invisible to the outside world. We call this network address translation, or NAT. This same technique helps conserve IP addresses, since all hosts on the subnet essentially just use the network IP address during communication.

A Basic Review on Subnetting
If you’re a little rusty on the basics of subnetting, don’t worry. We’ll cover everything you need to know from beginning to end. First thing first: we need to learn about the IP basics.

The current version of internet protocol, or IP, is IP version 4. This IP version allows four octets of data to represent an IP address. Each octet is considered to be a byte, so there are 8 bits in every octet. Note that in binary form you can see that there are 8 numbers, each one consisting of a bit. Finally, each octet is separated by a period, as shown below.



Each IP address is usually represented in decimal form, as seen above as “192.168.2.1”. However, each IP address is actually used by computers in binary form. You may have noticed a huge flaw in IP version 4: the amount of unique IP addresses is limited! To be exact, only 4,294,967,296 unique IP addresses can be created. This may seem like a large number but keep in mind every single device in the world needs a unique IP address to communicate with one another while online.

The IP version 6 protocol was created for when the transition is needed. Most computers don’t use IPv6 just yet, but in the future it will inevitably be used. (In case you were wondering, IPv6 will support 2^128 unique IP addresses… egad!)

Classes
There are three main types of classifications of IP addresses in IPv4: class A, class B, and class C. There are class D and class E types, but those are for multicasting and private uses, respectively. Each class differs by the number of network and host octets it has. Each network octet is for classifying which network a host is on. More network octets will mean more networks! Likewise, each host octet specifies a host that can be assigned to the network. More host octets means more computers per network.

Each class has a certain range that the first octet can be assigned to. This lets us know to what network class any IP belongs to with ease. Review the diagram below to see a visual diagram.



Now the bad news: you must memorize each range for each class if you hope to pass most network exams. Don’t worry! It’s actually easy- just memorize how we get the numbers, not the numbers themselves! All you have to do is remember n^8 (read as “n” to the eighth power), and how many network portions each class has. Review the diagram below.



One final note before we move on. Notice how we didn’t use the IP address 127 for the class A network- that’s because this is loopback address. We use this for testing configurations on the IP network. Also take note that there are reserved IP addresses, such as those for private networks. These IP addresses will not connect to the internet, which is handy if you just want computers to be connected with each other- and not the whole world.

Subnet Masks
A subnet mask is what we use to assign different amounts of networks and hosts to an IP network. It essentially divides the IP address into two parts: the network and host. This is a trading game- the more hosts you have, the fewer networks you will have. And yet the more networks you have, the fewer hosts you will have. Review the class A default subnet masks as shown below.



The class B network will need to recognize two network portions, and two host portions. This can be seen in the below diagram.



Lastly, we have the class C subnet. It is the most commonly used subnet, so pay special attention to it in the upcoming lecture. You can see a diagram of the default subnet below.



We’ve laid Down the Foundation, Let’s Build the House!
We just reviewed the basics of IP addresses and subnet masks. The bad news is, we usually don’t use the default subnet mask at all when we subnet a network! The good news is, learning how to subnet isn’t too hard. It will, however, take some practice.

An Example of Subnetting a Class C Network
Subnetting varies in difficulty, depending on which class you are subnetting. More often than not, you will need to create a subnet for a class C network. A class C network allows for many networks to be created, but not as many hosts. In fact, you can create a hefty 2,097,152 networks- but only 254 hosts per network are allowed.

Let’s say we are subnetting a school’s network. We need 5 separate networks that have 30 computers on each subnet.

First we calculate how many usable subnets we need. Next we will need to determine how many hosts are required. Both of these values can be calculated with the following equations:

Two Important Equations to Remember:


--------------------------------------------------------------------------------

1. Usable Subnets = (2^n) – 2 , where N = power of bits assigned
2. Usable Hosts = (2^n) – 2 , where N = power of bits remaining

Let’s start with usable subnets. Review the diagram below for a visual example.



If you are wondering what the “-2” part of the equation is for, this is how we account for the two addresses in each subnet we can’t use. We will review what these addresses are for more specifically later on. For now, let’s find out what our usable hosts are!



Alright Already! What’s My Subnet Mask?!
Getting your subnet mask at this point is incredibly easy. Simply take all of your network bits, and add them up. Look at the diagram below for a visual guide.



That’s it! You’re done. You have successfully created a subnet mask that can be used on the school’s network. Keep in mind that every computer must have the subnet mask set in order for them to be on the same network. Also note that since we are using a class C network, the first three octets will always be 255. When subnetting other classes, be sure to keep the network portions in mind.

Closing Comments
Subnetting may not be fun, but it is required for students to know on networking exams. That means you should stay away from subnet calculators until you have grasped the full concept of how to do it yourself. These calculators should only be used as a time saving tool, not a learning tool or way to cheat on homework.

With enough practice, subnetting will become much easier. Class A and Class B networks are a bit trickier, but follow the same example as shown above and it should be quite easy to accomplish.


--------------------------------------------------------------------------------



There Are 58 Responses So Far. »
Pingback by Kopi-Oh Times » Blog Archive » How-to: Subnet a network on 9 March 2008:

[...] NAT and so on. Check this web site out for a very visual way of illustrating what subnet is about: http://learn-networking.com/network-design/how-to-subnet-a-network Share and Enjoy: These icons link to social bookmarking sites where readers can share and [...]


Comment by william on 11 March 2008:

i think this article was a great. easy to follow


Comment by guillermo galdames on 21 March 2008:

I have to say….thanks….this article is much more clear and efficient…now I have learn how to make a subnet…!!!yeap!


Comment by GEORGE on 25 May 2008:

I have searched the net and I should say I have not come across an article like this which is so easy to understand and learn the concepts.
cheers


Comment by Hussam on 5 June 2008:

thanks for the lovely article and I want to add that
the amount of IPv6 is 34,028,236,692,093,846,346,337,460,743,177 Unique Ip Address


Comment by padma on 13 June 2008:

This is a very well written article.Easy to follow.I am happy that I came across this.Thank you.


Comment by Yousaf on 14 June 2008:

Now this is a true, efficient, user-friendly, easy and simple way to teach subnetting. I search the whole internet almost but this tutorial is awsome. I appreciate you of publishing these tutorials here. Thanks a ton !!


Comment by eddy on 10 July 2008:

HI,
very nice work,
u really have a smooth way to deliver information, thanks for the clear efforts ur making.
allow me to mention a small note here regarding the use of (N) and (n) , i think replacing N with 2 in the tables would be less confusing while using (N and M) or N and (32-N) in the equation will make it more rational..
all my respect.
and thanks again.


Comment by Dana on 28 August 2008:

This tutorial should be put in a place of honor. The best!!!


Comment by Chris on 3 September 2008:

Thank you, I now have a better understanding of subnet masks.

Chris.


Comment by sophie on 5 September 2008:

Thanx very much!

For sure its a long time since i was looking for this but today you change ma brain.

I really like the way you deliver information/skills, it seems to me very tough to study it in my class n get the concept of subnetting. But today am sure i may even taught someone n get the real meaning of subnetting.

If u don mind can u please give us some more example by using other classes A & B? Am sure you can

Once again thank you very much!! God bless you


Comment by Devendra on 20 September 2008:

The artical gives good information in systematic manner.It will be bit easier to understand with digramatic representation


Comment by Tasnim hafiz on 28 September 2008:

I am totally confused with my first networking course. Unfortunately my exams tomoro, n I foudn this website today…:p if I pass the exam..I will join this community for future:D


Comment by Satheeshiyer on 28 September 2008:

Hey.. Thank you for sharing this superb article.. I have come across many sites.. but couldn’t get the idea of subnetting..

But finally when I came across this, my cheek started to smile a bit.. from nervousness..

Superb Article ………….
Smiling ever!!


Comment by stanlywit on 30 September 2008:

its interesting to see this article ……….how it produces better knowledge who are all in doubt regarding the concept subnetting


Comment by Jelkyes on 4 October 2008:

I can’t believe that people can actually sit to make things easier for their fellow humans like this free. The material is the best I have ever seen on subnet. Continue with the good work.


Comment by nasir sohail on 20 October 2008:

i am cheerful to find this information because it greatly hepled me to understand the lecture i took from my ccna class yesterday , i am really thankful for this infromation


Comment by MCQ on 22 October 2008:

This is really hard worked, labored, very useful article.

Thanks a lot to the administrator. I liked the article and included the link of this article on my site http://www.psexam.com/websites/others/2.html


Comment by Tom on 22 October 2008:

IPv6 blows my mind… Here’s some back-of-the-envelope calculations I’ve made about it:

-If every person had a trillion devices, each with their own unique IP address, and there were a trillion people on the planet, and there were a trillion such worlds, we would still be using only a fraction of the possible IP addresses.

-There are enough IP address to assign every single atom in over 6 trillion kilograms of carbon a unique address.

-Hussam’s number isn’t right. The actual number of unique IP addresses is (taking the 2^128 number to be correct):
340,282,366,920,938,463,463,374,607,431,768,211,456

Note that MS Calculator can’t display the number of digits necessary for this, and Hussam wrote what it showed.


Comment by Gary on 4 November 2008:

Well organized and useful! I wish to point out a pair of unnecessary ambiguities that could be removed to make the presentation even clearer:

“Powers of N” are really powers of 2. Perhaps N is used here for historical reasons? If not, I would replace it with 2.

If keeping “Powers of N” please do not re-use N as a generic variable, such as in the formula 2^n – 2. Any other letter (e.g. x) would work here.

Thanks


Comment by Baron Von Cisco on 7 November 2008:

Thoroughly good article, clean cut and precise. However, comments like “Subnetting may not be fun, but it is required for students to know on networking exams. That means you should stay away from subnet calculators until you have grasped the full concept of how to do it yourself.”
Although I completely understand the need for students to understand how to subnet, it is fickle to say the above. What benefit is it to not use a calculator. If your stuck in the situation where you need to create subnets then the quickest and easiest solution is to use the calculator. Its good to know manually how to do it but when was the last time you sat a maths exam without a calculator ?


Comment by PaRaNa on 24 November 2008:

Great article ,Thanks for this. But you have shown class C IP blog only on the your examples. Anyway, all of them easy already.


Comment by chris on 4 December 2008:

im pretty sure that you can contary to as you mention use all ones or zeros for the subnet portion in a network so there is no need to subtract two when calculating. you can’t use all ones in the host portion though. cant tell you the rfc. well written. great way of plotting it out.


Comment by shadab on 3 February 2009:

Explanation is too good… easy to understand. Thanks keep up the good work.


Comment by Roxane on 6 March 2009:

You know, I am speechless. I searched allll over the web for the right explaination. Man you did a great job. It went straight to the point. Now I can do this with confidence. Thank you very much.


Comment by saul on 9 March 2009:

i totally found this enlightening. thanx. God bless


Comment by melvit on 12 March 2009:

hi i liked the contents of this article.they are very satisfactory.!!!!!!!!!!


Comment by Rudy on 30 April 2009:

Love it
This subnetting explanation was package in the most simple way yet so easy to understand. I wish I could get more info like this..

Thanks for the good work.


Comment by zild on 8 May 2009:

Hi, Thanks for the tutorial


Comment by Safinatu on 11 May 2009:

Hi, thanks for the tutorial, it really helped me.


Comment by 1di0T on 15 May 2009:

Sorry for being a dumb…
I am confuse on the example problem:

Number of Subnets Needed: 5
What power of 2 allows five networks?

——————————————-
Power of N: N7 N6 N5 N4 N3 N2 N1 N0
——————————————-
>>>>Equals: 128 64 32 16 8 4 2 1
——————————————-

Since 1 + 2 + 4 = 7, we can use N3 (This is where I got confused)???
You said we can use N3 but the one you’ve encircled is N2 = 4
and 1 + 2 + 4 is on N2 N1 and N0 and not N3.

Usable Subnets = 2^3 – 2 (On this part it appears you’ve used N3)
Usable Subnets = 8-2 = 6

I know that 8 > 5, the reason why you used 1+2+4
What power of 2 allows five networks? -> In between 8 – 4

Crap I’ve answered my question…

I think this is still worth posting for future confused like me to be enlightened.. Lol


Comment by Karl on 18 May 2009:

Very good!!! This is the best tutorial I have read on the internet.

Subnetting… DONE!!!


Comment by jm on 22 May 2009:

I have the same problem!


Comment by janak on 29 May 2009:

i am also little confused,

Since usable Subnets = 2^3 – 2, what if i want 7 subnets?

thank you


Comment by Brian on 4 June 2009:

Are IP adresses different from subnet masks? So would a device have an IP address ‘192…’ and ALSO a subnet ‘255…’?


Comment by Gary Z. on 13 July 2009:

so you have 5 groups of 30 , how do you specify which of the 5 groups that a computer/host is in?? Is it via the mask? can you
have a mask that is like this in the last octet? 11001111 ?


Comment by wilfred.kennick on 14 July 2009:

i need that you may send me more information on subneting since i realise the impacts and knowledge that move to the sucess in my assignment best regard kennick


Comment by sachinsonker on 20 July 2009:

thanks for describing subnet in detail


Comment by Sohail Pasha on 28 July 2009:

Its a good article. It should be further extended to Subnet address and Broad cast address. That also involves a simple technique, which I am sure, author of this article is already expert.
God bless you.


Comment by James W on 28 July 2009:

You explanation is the most helpful I have found, thank you very much for explaining so clearly.


Comment by Aslyn on 19 August 2009:

Good!


Comment by Xcuru on 14 September 2009:

nice explanation but u need more example!pls add more


Comment by sachin on 25 September 2009:

Very nicely you have explained basics about subnet masking and IP addressing. However it would be nice if you include examples for each class of networks.


Comment by suresh on 6 October 2009:

simply superb…..!


Comment by TEHSEEN on 9 October 2009:

Very nice explanation,please add some more Examples about prefix, sub netting and subnet mask

thanks


Comment by Naren on 11 October 2009:

hey thanks, but can you please explain some more in the class b, i would really appreciate if you could update on class b with examples too, thanks a lot.


Comment by gaurav on 10 November 2009:

can you please put some light on the reasons of reducing two from 2^n while calculating usable subnets and hosts.

Thank you


Comment by DAMBIO ISAAC CLIVE on 24 November 2009:

Ive been a memeber of cisco systems for a good period of time and i feel delighted to see the above information still being provided to us world wide.


Comment by DAMBIO ISAAC CLIVE on 24 November 2009:

Yeh ithink i can give a clear reason please just give me a sec


Comment by Richard on 24 November 2009:

there seems something obviously wrong here, or am I missing the blindingly obvious…the requirement is for 5 separate networks. The calculation is given as “Usable Subnets = (2^n) – 2 , where N = power of bits assigned”. The need to minus 2 is understandable when it comes to the usable hosts calculation (“Usable Hosts = (2^n) – 2 , where N = power of bits remaining”) because each host needs its own subnet address and broadcast address. But this doesn’t apply when it comes to usable hosts. 2^3 means 8 usable hosts and that’s what you get in this. The range of the final octet for each of the 8 usable hosts, including subnet address and broadcast address, is 0-31, 32-63, 64-95, 96-127, 128-159, 160-191, 192-223, 224-255. So if the school only implements 5 subnets, they have 3 in hand for future needs, not one.


Comment by Richard on 25 November 2009:

IP Subnet-Zero
It’s this option, enabled by default on Cisco see http://www.itdojo.com/blog/2009/02/let-me-take-a-stab-at-this-ip-subnet-zero-thing/) that means that the formula specified in the article, “Usable Subnets = (2^n) – 2″, should actually read “Usable Subnets = 2^n”.
Typos in my previous comment by the way: I said ‘this doesn’t apply when it comes to usable hosts’, meant to refer to usable subnets. Same goes for the following 2 references to hosts, sorry for confusion.


Comment by Richard on 25 November 2009:

It’s indeed the most clearly laid out guide to subnetting..but would second Eddy and Gary’s points that talking about N to the power of is unnecessarily confusing, because we are only ever raising the digit * 2 * to power of this or that. If you could update this to take into account IP Subnet Zero, change N to 2 and include some class A & B examples – would be perfect.


Comment by Felix on 18 December 2009:

The explanation on this subject is very good,but need to elaborate on the power of “N” just a bit morer.Thanks


Comment by Blackslaine on 31 December 2009:

Brilliant, just brilliant, it is so simple when you know how. Thanks a million and best of luck to you…


Comment by Moulay on 4 March 2010:

hello all
i’m new at this, i just have one question, the company i work for run out of ip addresses! the current addresses 192.168.107.XXX
they were talking about getting more ips ? so my question is can you buy more ip addresses? and if you change to another Ip class, do you have buy anything as far as ip addresses or just bigger router or switches?


Comment by Sydney Thomas on 18 March 2010:

Hello there,I am so interested to much better about subnetting,could you please provide me with the easy method to do subnetting,esp.Class A subnetting,eg that of IP address 10.2.3.0,Subnet mask 255.255.254.128.


Comment by monger on 9 April 2010:

Nothing more than introduction, does not tell you the nuts and bolts of how to apply the theory to a practical problem.


Comment by yeds on 21 April 2010:

I like it too, but I agree with monger, could there be an example in applying this to a real problem? that would be a great help. thanks for this. more power!
.Comment on This Article
Name (required)

Mail (will not be published) (required)

Website



PopularMost CommentsSearchTagsArchivesPopular
Most Comments
Search
Tags Site Tags 568A 568B api application layer arp arpanet backdoors bandwidth binary cable testing CCNA CCNA 1 ccna exams cisco cisco poster cisco router emulator classes client/server computer networking crossover cable crosstalk CSMA/CD datagram ddos decimal demodulation DHCP dos download packet tracer download packet tracer 5 encapsulation ethernet exam preps fast ethernet fiber optic free cisco poster ftp gigabit ethernet hex hexadecimal history hostname how to subnet hub internet layer IP kerberos LAN legacy ethernet modem modulation netbus netstat network access layer network interface card network math network media network topology NIC osi model packet tracer packet tracer 5 packet tracer example packet tracer network topology packet tracer tutorial peer to peer ping ping flood ping of death pneumonics poster rollover cable router Router Configuration router security SAN Security Security segment signal attenuation smurf socket spanning tree protocol STP straight-through cable sub7 subnet subnet mask switch tcp tcp/ip tear drop tftp throughput tracert transport layer trojans UDP UTP WAN whois wireless
Archives Monthly Archives March 2010 January 2010 December 2009 May 2008 February 2008 January 2008
•Recent Comments
arbind kr on How the Transport Layer Works
godwin williams on A Guide to Network Topology
me on Configure A Router With Packet Tracer
good on Configure A Router With Packet Tracer
gerry on CCNA 1 Module 6/7 Solutions
•Subscribe

•Recent Articles
Free Cisco Poster Offer
Configure A Router With Packet Tracer
Download Packet Tracer 5 For Free
Enable Passwords On Cisco Routers Via Enable Password And Enable Secret
How a Broadcast Address Works
•Forums

•Our Readers
Recent Readers
You!

Join Our Community
babyina
Try to learn more
Damita
popeto
View Reader Community
Join this Community
(provided by MyBlogLog)

•Tags
arpanet bandwidth binary CCNA 1 ccna exams cisco classes client/server datagram decimal encapsulation ethernet exam preps fiber optic hex hexadecimal history how to subnet hub internet layer IP LAN network access layer network math network media network topology osi model packet tracer peer to peer pneumonics Router Configuration router security SAN Security STP subnet subnet mask switch tcp tcp/ip throughput UDP UTP WAN wireless.© Copyright Learn-Networking.com 2007. All rights reserved. Powered by WordPress • WordPress Themes • XHTML ..

No comments:

Post a Comment