Link to home
Start Free TrialLog in
Avatar of K0ss
K0ss

asked on

How to Calculate node and Subnets

What's any easy way to calculate how many nodes and subnets are in a network?  For instance this IP and subnet  136.18.0.0/20?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of JonSh
JonSh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JonSh
JonSh

Typo correction for my last post:

>we take the mask (20 bits) 10001000.00010010.0000 and we add the last 12 bits and ones 1111.11111

this should read as:

we take the mask (20 bits) 10001000.00010010.0000 and we add the last 12 bits as ones 1111.11111111

sorry for confusion :)

Avatar of K0ss

ASKER

Thanks a lot, also is there any easy way to findout how many hosts per subnet?
Hi Koss,

Well, it depends on hand written calculation or electronically. If you prefer hand written, I would suggest you can use Jon's way, if you prefer electronically.. IP calcualtor is the most helpful tool for your case.

http://www.telusplanet.net/public/sparkman/netcalc.htm

You can download other type that can install in your workstation.

Cheers.. :)
Eugene
Take the amount of 0 bits in the subnet mask

IE 255.255.252.0 or /22 or 11111111.11111111.11111100.00000000
(the above is three ways of writing the same thing)

in this case, 10, take it to the power of 2, 10^2, equals 1024, subtract the network and broadcast addresses, the answer is 1022 valid hosts.
My head is spinning!  

<<For instance this IP and subnet  136.18.0.0/20? >>

That is only a IP range not a subnet.  A subnet masks the IP range address space.  The easiest way to think of it, is to look at the usual subnet 255.255.255.0.

the 255s mean there is NO variation in that number, it must be the number stated.  The 0 in the subnet means that 255 variations on that number are possible.  If the 0 were replaced by 128, that would mean there are only 128 variations possible on that number, 62 means 196 variations and so forth.

So, take you 136.18.0.0 and mask it with 255.255.255.0, and you can get everything from 136.18.0.0 up to 136.18.0.255.  IS THAT CLEAR???
sciwriter, the "/20" used is Cisco's notation, it's the same as the mask 255.255.240.0.  The example used doesn't break cleanly on an octet boundary. :)

K0ss: dullz is perfectly correct up above.  The practical answer I used to use was the number of hosts between this subnetwork and the next subnetwork (in your example of 136.18.0.0/20 = 4080 hosts per network) -2 (one lost for the network itself, one lost for broadcast).  If you want to be slick, use -3.  Take one off for the router that is sure to need a home on that network :)

OTOH, a subnet calculator is a very popular java application; might as well download one and forever be prepared :) (courtesy of eugene_goh)



Thanks,  I don't doubt yours is technically correct, Jon, but it is not as easy to follow as a numeric description, because of the intrinsic "unintuitiveness" of binary bits -- logical, yes -- clear, well ....

Cheers
I would add JonSh is right - about being slick. However, if you're studying for a test (CCNA), DO NOT DO THAT - only use the 2^N-2 rule.
The "easy way" would be to memorize where your classful boundries are.  Knowing that a 136 address is a class B and it's going to be a 16 subnet this would mean that the next 4 bits to the /20 (20-16=4) are going to give you 4 bits worth of subnets.  2^4 is 16 - so you have 16 subnets (counting network .0).  You have a total of 32 bits to work with, so you're left with 12 bits.  2^12 is 4096 and you'd have to subtract 2 for the network and broadcast = 4094 hosts.

The easy to learn the network numbers is to work from the left of 8 bits.  8 bits is 256.  Bit 8 is 128, Bit 8 & 7 is 192, Bits 8,7,6 is 224, Bits 8,7,6,5 is 240.  So, take 255-240=16.  So, your subnets will start at 0 and increase by 16 (in that octet).
I have an easy key sheet.  The Magic Key to Subnetting.  My instructor gave it to me with reprint rights.  If you want a copy let me know.
Cheat sheets are especially handy for cert testing .... 8-|
Just going to add a comment.  Subnetting, Superblocking, CIDR, this stuff is all *basic* handling of address space.  While I think it's a great thing that their are tools for network addressing, make sure you can do it independently from your tools first.  It's one of the first interview questions I ask - "Give me a quick overview of a subnetting model that has 64 or so subnets of 56 hosts per network.  Try and minimize wastage ans use an appropriate RFC 1918 address."

Just an opinion :)
Also, thanks to Pseudocyber for catching may math error (4080 hosts) lol that's what I get for not using paper and pen at 2am :)

If you good at binary this can be fairly easy.  If not and you are just needing quick answers download a IP Subnet Calculator from solarwinds.net its free.

http://solarwinds.net/Download-Tools.htm