Skip to main content

help me how to subnet class A, B & C

More
17 years 7 months ago #20755 by durk21
Replied by durk21 on topic subnet this
2^ number of 0's - 2 = Number of Usable Hosts

2^ number of 1's - 2 = Number of Usable Subnets


How ever many 0's you use to get the number of hosts that you need is the number of bits borrowed

I.E if you need 14 hosts you would borrow 4 bits

Because 2 to the power of 4 ZEROS minus 2 Equals the Number of usable hosts

so

2^ 4 - 2 = 14 USABLE HOSTS

So lets say this was a class B address and you had 16 bits to play with.


255.255.0.0 =

11111111.11111111.00000000.0000 {0000}

>4 bits borrowed to get 14 hosts

11111111.11111111.[00000000.0000]
>12 bits borrowed for subnets {0000}


Now you have already used 4 bits for hosts so now you subtract 4 from 16 {for a class B} giving you your 1's bits. So 16 - 4 is 12. You have 12 1's left for subnetting or for subnets.

SO

now you have 12 bits left to borrow for subnetting

2^12 - 2 = Number USABLE SUBNETS

2^12 - 2 = 4094 USABLE SUBNETS

This type of calculation does not account for the use of the zero subnets when using CLASSLESS SUBNET TING

Also on a side note 255.255.0.0 falls under CLASS A but for right now we will call it a class B to simply show the math. The first Class B subnet is 255.255.128.0
More
17 years 7 months ago #20756 by Smurf
Replied by Smurf on topic Re: subnet this

2^ number of 1's - 2 = Number of Usable Subnets


Yes thats the general rule of thumb however for the subnets it still depends on the vendors interperation of the TCP/IP stack on if it allows the lower and upper value.

Also on a side note 255.255.0.0 falls under CLASS A but for right now we will call it a class B to simply show the math. The first Class B subnet is 255.255.128.0


Eh ? Go on then explain further....

Wayne Murphy
Firewall.cx Team Member
www.firewall.cx

Now working for a Security Company called Sec-1 Ltd in the UK, for any
Penetration Testing work visit www.sec-1.com or PM me for details.
More
17 years 7 months ago #20759 by durk21
lower and upper value? What do you mean by that? Do you mean the Zero subnet? Because the logic I've shown is for usable subnets which purposefully excludes the first usable.

So what do you mean by the upper and lower value of a TCP/IP stack? Because I'm going purely by what Cisco has shown me so far in the curriculum.

I've been through CCNA 1 through 4 and never heard of anything like that?
More
17 years 7 months ago #20766 by durk21
And to explain this

Also on a side note 255.255.0.0 falls under CLASS A but for right now we will call it a class B to simply show the math. The first Class B subnet is 255.255.128.0


255.254.0.0 is a Class A and then Cisco says the next step up

255.255.0.0 Also falls under a Class A Subnet/IP layout.

Then to progress into Class B you add 1 bit to that from the left

giving you 255.255.128.0 Thus making 255.255.128.0 the first class B subnet range i guess is the term for it

then its 255.255.192.0 and so on so that is what i was stating earlier.[/quote]
More
17 years 7 months ago #20767 by Smurf
Sorry, the upper/lower values is refering to the all 0's and all 1's of the NetworkID, not the TCP/IP Stack.

I know that Cisco will quote the 2^n - 2 rule for hosts and networks however in some vendor implementations of their TCP/IP stacks, they do allow addresses/routing to the NetworkID with all 0's and all 1's.

For studies, you need to include the -2 for hosts and networks.

The Class A/B stuff is a new one on me, do you have any links to what you read as i'm Intrigued now.

Wayne Murphy
Firewall.cx Team Member
www.firewall.cx

Now working for a Security Company called Sec-1 Ltd in the UK, for any
Penetration Testing work visit www.sec-1.com or PM me for details.
More
17 years 7 months ago #20770 by durk21
Replied by durk21 on topic no links
no sorry I have no links it is just in the Cisco certification material I am reading from their website and also from their books.

yeah I know what you are talking about your referring to the broadcast networks. Yes you are correct there it does depend on the vendor. You are referring to whether or not they choose to use classless routing protocols. Which deal with (VLSM). Which in any case you should I believe be able to change the math to

(the subnet you want - 1) * (The number of hosts) = subnet range for that subnet

i.e 0 to 16 and so on

or something similar to it

if I remember correctly but please do not quote me on that.
Time to create page: 0.184 seconds