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. Anonymous
    January 22nd, 2013

    pliz anyone with the revision materials for the exam,pliz send me at winkibz@yahoo.com.i am taking my exam on friday this week.

  2. route summarization
    January 30th, 2013

    @9tut: do we have a route summarization topic here? thanks

  3. parvez
    February 6th, 2013

    can i made soft copy for this?

  4. parvez
    February 6th, 2013

    can i made soft copy for this? akhtar1615@gmail.com

  5. Ganesh Patil
    February 9th, 2013

    could you please send me Subneting and VLSM examples at ganeshpatil62@gmail.com

  6. subnet master
    February 17th, 2013

    Subnet is very easy Promise!

  7. manoj
    February 22nd, 2013

    thankyou

  8. hiba
    March 17th, 2013

    Thanks
    good job

  9. Patrick
    April 4th, 2013

    Superb Tutorial!!!!

  10. TeeyaC
    April 5th, 2013

    I have a CCNA Dump from examcollection.com, I will share e-mail me at Teeya2000@aol.com, I would also like some help with subnetting, Thanks!!!

  11. Vikas thorat
    April 10th, 2013

    its nice to read that all subnetting……..

  12. Anonymous
    April 12th, 2013

    good job. thanks

  13. sarenzalando
    April 16th, 2013

    Even if the person doesn‘w not love you how you would would like them to make sure you,doesn‘w not suggest they can father‘w not love you along with they’ve got. sarenzalando http://sarenza-lando.com/

  14. Anonymous
    April 17th, 2013

    Pls i want 2 b ur frn am a ccna 1 student at unijos dis is my email addrs shamdee101@gmail.com

  15. hamayun
    April 29th, 2013

    In example 3, /28 will give us 2^4=16 subnets.Isn’t it so???

  16. Anonymous
    May 19th, 2013

    pls i needs somebody to send me any dump on EIGRP,VLM,AND ACCESS LIST 2,to my mail,bsogbaike@yahoo.com.i have to retake my icndi exam again come this ending,i have to come to realised my errors and the more reason i failed my ist exam,thankx for ur coperation.yusuff

  17. Abdullah Basem
    May 28th, 2013

    There is a mistake in exercise 3 as we borrowed 6 bits not 2 bits, so:
    No. of subnets=64

    Please rectify this error.

    Thanks
    Abdullah

  18. Abdullah Basem
    May 28th, 2013

    Ok when I continue reading I realized that it was not a mistake as we depended on the assigned subnet mask not the default subnet mask.

    Thanks for the accurate information.

    Tricky !!!

  19. Anonymous
    May 30th, 2013

    Great Stuff ! Thank you

  20. Anonymous
    June 13th, 2013

    That’s nice

  21. Anonymous
    June 24th, 2013

    very gooooooooooood

  22. yve
    June 29th, 2013

    hi guys. i am too scared to do that ccna exam. so any help! my e-mail goldraphael@gmail.com

  23. Anonymous
    July 11th, 2013

    very good explanation … really awesome .. thank u

  24. John Kalokoh
    July 12th, 2013

    Hi friends what I have learnt from this website today as a new viewer, amazes me. Can someone please help sending Networking tutorial into my email jkaloko@hotmail.com I really appreciate the individual thanks 9tut management.

  25. John Kalokoh
    July 12th, 2013

    Can someone pls help me with Networking Tutorials? You can send them into my email jkaloko@hotmail.com thanks for the concern and help.

  26. DB
    July 21st, 2013

    Okay, I get the math for finding subnets, right up until you did this…
    The initial network 198.23.16.0/28 is also the first subnet, so:
    + The first subnet: 198.23.16.0/30
    + The second subnet: 198.23.16.4/30
    How or why did you go from /28 to /30? As much as I read and work the math out, I’m not seeing how or why you made this transition. I think it has something to do with planned vs assigned subnet mask as stated near the bottom of page 2, but I’m just not getting it. Do you have any other ways to explain it?
    Thanks!
    D :-)

  27. DB
    July 22nd, 2013

    Okay, never mind. I was reading the question wrong. Doh!! :-)

  28. Gayathrie
    July 25th, 2013

    Superb… (y) Thankx for the tutorial…

  29. Anonymous
    August 27th, 2013

    oh it’s very very gooD.

  30. Mamun
    September 8th, 2013

    Thanks a lot, best explanation ……………

  31. praipliet
    September 9th, 2013

    http://www.azurema.com/
    (動画) しばらく安定していたのに.。笑顔を忘れずギターを弾きながら歌う彼らから本物のプロとしての姿勢とともに長い間付き合ってきた友人のような雰囲気を感じることができた」と伝えたBusker BuskerのスペシャルグラビアはNYLON私のようなアジア人特有の低い鼻にはフィットしないのです(^^;。?

  32. sridevi.p
    September 10th, 2013

    Very Nice!

  33. David Okeri
    September 23rd, 2013

    I did the CCNA exam on 20 sept,2013 and i highly passed it!!! Eureka 9tut and may all who contribute here be blessed. Those ready to do due course of the week do more on VTP show commands, EIGRP configurating via troubleshooting and ACL (Extended). Remember subnetting is ever there!
    olesimbe@yahoo.com

  34. Growprutt
    September 23rd, 2013

    http://www.truefina.com/c-149.html
    It is an online travel agency offering bus tickets in affordable price. I did not get a chance to use my free drink ticket, Pennsylvania at 12:00 pm at our Sandcastle!.

  35. Anonymous
    September 24th, 2013

    The first subnet: 198.23.16.0/30
    + The second subnet: 198.23.16.4/30 because the increment is 4 so we plus the network address with it to get the next network address (0 + 4 = 4)
    + The third subnet: 198.23.16.8/30 (4 + 4 = 8)
    + The fourth subnet: 198.23.16.12/30 (8 + 4 = 12)

    I dint understand this Part
    i cannot go further without it . please someone help

  36. Deep
    September 24th, 2013

    + First subnet: 198.23.16.0/30 (the 4th octet is 00000000)
    + Second subnet: 198.23.16.4/30 (the 4th octet is 00000100)
    + Third subnet: 198.23.16.8/30 (the 4th octet is 00001000)
    + Fourth subnet: 198.23.16.12/30 (the 4th octet is 00001100)

    I meant this part
    Please please help

  37. antetteEngasp
    September 28th, 2013

    当店では本物のみを扱っておりますが、熱くなってきたメンズコーチ。シグネチャーステッチパテント トートバッグ SV/BY ベリー!
    http://www.redstaing.com/
    then the receivers run through a series of inside routesin Florida’s flora and faunaespecially birds However, Usually this is something like,?

  38. EstisyFalia
    September 29th, 2013

    http://www.yellowvw.com/c-144.html
    The bound ubiquitin on NF p65 was analyzed by western blotting. Adelaide Class frigates are armed with Standard mediumrange antiaircraft missiles,I was a social work major,?

  39. Cynthia
    October 3rd, 2013

    9tut can you please explain the impact of no ip subnet zero. I hav asked so many and of course we must know this for the exam.

  40. 9tut
    October 4th, 2013

    @Cynthia: This link explains “ip subnet-zero” very well, please read it: https://learningnetwork.cisco.com/thread/8388

  41. medi abbasi
    November 12th, 2013

    hello anybody.
    i have the problem in the subneting so i’ve problem in the class a
    who can help me?
    please send a seperate examples to my mehdi_abbasi23@yahoo.com
    tnx anybody

  42. ruephan
    November 19th, 2013

    hello anybody.
    i have the problem in the subneting so i’ve problem in the class a
    who can help me?
    please send a seperate examples to my ruephan@ymail.com
    tnx anybody

  43. Daya
    December 13th, 2013

    Example 3 is bit confusing

  44. squirrel
    December 24th, 2013

    Why the broadcast address is 198.23.16.3?
    I know the first address is always the router address but I thought the last address is the broadcast right? But 198.23.16.3 is not the last address.

  45. squirrel
    December 24th, 2013

    omg I just realized that you gave the specific IP in the question 198.23.16.0/28. And with /30 and for this IP, the first address of the next subnet is 198.23.16.4 /30 and so the address right before that must be the broadcast address for the 1st subnet which is what we want.
    Man !!!

  46. Am getting a wider insight on subnetting. thanks for effort
    January 3rd, 2014

    Ebrahim .S. Dawo(Sudent of NJALA UNIVERSITY IN SIERRA LEONE.

  47. Ali Tauni
    January 8th, 2014

    nice tutorial bit learn thanx

  48. CCENT Someday
    January 29th, 2014

    If you need help learning to subnet, etc. Here is a video that I used to refresh and/or learn from:

    http://www.youtube.com/watch?v=rs39FWDhzDs

  49. suman
    February 4th, 2014

    Hi any one have Best ccna material send to sumankumar_pagadala@live.com

  50. Anonymous
    February 19th, 2014

    good presentation regarding subnet,pl do more to learn more v.v ramana bsnl vm

Comment pages
Add a Comment