subnetting....can someone help explain an example to me please

leeland

Diamond Member
Dec 12, 2000
3,659
0
76
Ok, I understand the below example with the subnet mask...it is a class A ip address and the subnet mask tells us the first octet of it (255) is used up...then the second octet extends the network address another 7 bits (254). what does the portion mean that the subnet number is 10 ? how did that number come about ?

I remember IP addresses someone from school and am applying for a network analyst job and am studing up on this so if anyone else can give me a hand explaining this in retard terms I would appreciate it.

Thanks

leeland
-----------------------------------------------------------------

Example
Having the IP address 12.11.10.9 with a class A subnet mask of 255.254.0.0 (the same as 12.11.10.9/15) says:

Host address 12.11.10.9 Decimal => 00001100 00001011 00001010 00001001 Binary. The first bit is zero, therefore we have a class A network with the network address 12.0.0.0 (see classful network).

Subnet mask 255.254.0.0 Decimal => 11111111 11111110 00000000 00000000 Binary. The subnet mask extends the network address by 7 more bits (254). Thus we have a subnet number of 10 and an extended network address of 12.10.0.0 (decimal) = 00001100 00001010 00000000 00000000 (binary) (Bitwise AND of 12.11.10.9 with 255.254.0.0).

The remaining host part is 0.1.10.9 Decimal => 00000000 00000001 00001010 00001001 Binary.

Determining the number of hosts and subnets on a particular network is quite easy, if you know the subnet mask. Say you have the network address 204.4.32.0 with a subnet mask of 255.255.224.0. This network address can also be written as 204.4.32.0/19

Network address 204.4.32.0 Decimal => 11001100.00000100.00100000.00000000 Binary

Subnet mask 255.255.224.0 Decimal => 11111111.11111111.11100000.00000000 Binary

The subnet mask has 19 bits for the network portion of the address, and 13 bits for the host part.

23 = 8 possible subnets available according to RFC 1812, otherwise using the old RFC 950 standard the number of usable subnets is 6. This is due to RFC 950 not supporting subnets with either all 1's or all 0's.

213 - 2 = 8190 possible hosts available to each subnet.
 

ScottMac

Moderator<br>Networking<br>Elite member
Mar 19, 2001
5,471
2
0
The first Network bit is the "2" in the second octet; that makes the "magic number" 2 ... i.e., the subnets will increment by two.

The first non-zero subnet is 2, then 4 ... 10, 12, 14 ...

12.10.0.0 is one of the subnets produced by that mask.

The host ranges will go from 12.2.0.1 to 12.3.255.254 (in the first non-zero subnet)

or for the subnet you're asking about:

12.10.0.1 to 12.11.255.254

The "zero subnet" would be 12.0.0.0, first host 12.0.0.1, host range 12.0.1-12.1.255.254, broadcast 12.1.255.255

Does that help?

FWIW

Scott
 

leeland

Diamond Member
Dec 12, 2000
3,659
0
76
EDIT
Ok After re-reading your post and then looking up a different article and some other examples I think I understand it better to some degree.

So stay with me and i will see if this is right...and if the example I posted is just crap...

So you have the network ID of 12.0.0.0 with a subnet mask of 255.254.0.0

when you line up the network id and the subnet mask you zero out the first octet...but the 7 bits of the second octet are used to extend the original network id of 12.0.0.0

SO if you take 2^7 you get 14 there are 14 subnets that can be added to address of 12.0.0.0 is this correct ?

if so then you have the remaining bits to make up the host id which would then allow for 2^17 = 131,072 devices (hosts) on each subnet ?


I am not sure if this is correct or if it is a different way of stating what you originally posted...




Thanks for the post...actually I am not following you...so I will tell you what I think I know and you can tell me if I am right.

the address 12.11.10.9 broken down to binary shows that it is a class A network because the first bit is a 0

the subnet mask has a 255 in the first octet which means it is on the same network (I think this is correct)

the second portion of the subnet mask extends the network by using up 7 of the 8 bits in the second octet....so the first 15 bits are used for the subnet mask.

the part that confuses me is what you stated...the first Network bit is the "2" in the second octet

I guess I am not seeing the connection between the 255.254.0.0 and the 12.11.10.9 portion, or if they are even connected.

or to ask it a different way, how does the .254 which is the first 7 bits of the second octet in the subnet mask somehow = 10 ? which then extends the network ID to 12.10.0.0

Sorry if this sounds stupid...I am sure once i can conceptualize it I will laugh at myself...but at the moment it is confusing the hell out of me not to mention pissing me off :D


Thanks for the help

Leeland

Originally posted by: ScottMac
The first Network bit is the "2" in the second octet; that makes the "magic number" 2 ... i.e., the subnets will increment by two.

The first non-zero subnet is 2, then 4 ... 10, 12, 14 ...

12.10.0.0 is one of the subnets produced by that mask.

The host ranges will go from 12.2.0.1 to 12.3.255.254 (in the first non-zero subnet)

or for the subnet you're asking about:

12.10.0.1 to 12.11.255.254

The "zero subnet" would be 12.0.0.0, first host 12.0.0.1, host range 12.0.1-12.1.255.254, broadcast 12.1.255.255

Does that help?

FWIW

Scott

 

ScottMac

Moderator<br>Networking<br>Elite member
Mar 19, 2001
5,471
2
0
If you get around the INternet (forums) much, you *HAD* to have seen this in a sig:

"There are 10 kinds of people in the world, those that understand binary, and those that don't" (and for the binary-impared, "10" binary is a "two" in decimal).

To help you some with the vernacular:

(we're speaking classfull here .. Calss A, B, C ...)

The addresses are in dotted decimal notation (xx.xx.xx.xx); each of the postions (.xx.)are an octet, representing a binary value, expressed in decimal.

The "natural" mask (A: 255.0.0.0, B: 255.255.0.0, C: 255.255.255.0 ...) is the "Network Mask" - if you extend the mask into the host portion of the address (the zeros in the preceeding masks), those bits are the "Subnet Bits" or the "Subnet Mask" (trivisl verbage, but important for things like Cisco Tests).

So, if you have a Class A address (like 12.10.0.0 255.255.0.0) you have eight Network bits (the natural portion of the mask) and eight subnet bits (the extended portion of the mask ... the "extra" eight bits).

Now, back to the primary topic:

You are correct, the mask is fifteen bits (eight Net, seven subnet).

Looking at a binary number line for a single octet:

(10). 128 - 64 - 32 - 16 - 8 - 4 - 2 - 1. (0.0)

......|====seven bits=======>|
......|=== in the second octet ===

You can see (I hope) that there's a single bit left for the "host" portion of the address in the second octet. Hold that thought.

You should also notice the the mask extends to the second bit of the second octet (the "2" bit) ... that means that the first non-zero subnet is "2" (i.e., 12.2.0.0/15).

Because the very first (the least significant) bit in the mask is a "2," all of the resulting subnets generated by this mask will be multiples of "2" ... like this:

12.0.0.0
12.2.0.0
12.4.0.0
12.6.0.0
12.8.0.0
12.10.0.0 <--- this is the subnet you're asking about
12.12.0.0
12.14.0.0
(and so on for a long, long, time)

Now, back to the single bit of the second octet that's not part of the mask (or at least the "1"s portion of the mask).

The first host address of any of the above subnets is going to be x.x.x.1, and the last host address for any of the above subnets is going to be x.(net+1).255.254.

If you are talking about the 12.10.0.0 subnet, and you increment the host addresses such that the last bit of the second octet (the "1" bit, the "least significant" bit of the second octet) gets bumped up to "1" then the econd octet is going to be 12.(10+1).0.0 (12.11.0.0) and if you continue to increment up to the last host address, you'll end up with 12.11.255.254 (12.11.255.255 will be the "broadcast address," and the next subnet begins at 12.12.0.0).

To carry on one more round ... if you start with the 12.12.0.0 subnet, the first host is 12.12.0.1 ... counting up through 12.(12+1).0.0 to the last host (12.13.255.254). The 12.12.0.0 broadcast address is 12.13.255.255, and the next subnet is 12.14.0.0.

If you still are having trouble getting your head around this, write it all out in binary. Ignore the mask, except for the fact that that is where you're going to increment your subnets (and demarcs the boundry for the host portion of the address.

The first bit (the least significant bit) of the subnetwork portion of the address will represent the number that your subnets will increment by. If you had a /14 mask, the subnets would increment by 4 ... if you had a /13, the subnets would increment by 8 (and so on). This is the "Magic Number" method of figuring out subnets.

My fingers hurt .... I'm going to bed.

Good Luck

Scott
 

leeland

Diamond Member
Dec 12, 2000
3,659
0
76
Alright I think I finally got my brain around this to some extent...I do now understand your explaination...the magic number of 2...it makes sense now....

In the example I listed...the 10 is supposed to be the subnet mask part...what i was getting messed up on is that I thought it would start at 0 and didn't put two and two together...it does start at zero...

SO for one subnet it starts at 0.0.1 and goes to 1.1.254 thus to 2 digits in each subnet effectively (I think)

so the range of the first subnet is 12.0.0.1 to 12.1.255.254

You can't use the 12.0.0.0 address because that is the identifier of the network ID and you can't use the 12.1.255.255 address because it lists the broadcast address for the who network ID

I think I finally got it...now I can blow my brains out lol


Thanks for the help....

And if I missed anything let me know would you please ?

Leeland
 

leeland

Diamond Member
Dec 12, 2000
3,659
0
76
Just finished posting my response after looking some more on this and I saw you posted again...

I apprecaite you taking the time to write that all out...I am going to re-read your post tomorrow when my eyes aren't bugging out...

It makes a lot more sense now and I think I have got on the right track...

You were a big help I apprecaite it.


Thanks,

Leeland
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Its very difficult to "teach" somebody binary arithmatic.

I'll try to help, but its late. Dont' worry it takes many a good while to "get" it.
 

Nocturnal

Lifer
Jan 8, 2002
18,927
0
76
Originally posted by: spidey07
Its very difficult to "teach" somebody binary arithmatic.

I'll try to help, but its late. Dont' worry it takes many a good while to "get" it.

This is something good to hear. I've heard otherwise such as "If you don't even understand binary then don't go into Computer Science."
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Originally posted by: Nocturnal
Originally posted by: spidey07
Its very difficult to "teach" somebody binary arithmatic.

I'll try to help, but its late. Dont' worry it takes many a good while to "get" it.

This is something good to hear. I've heard otherwise such as "If you don't even understand binary then don't go into Computer Science."

Well that's pretty dang harsh.

But it does take time before the lightbulb goes off in peoples heads. I remember in my first EE class - the entire thing was to teach binary for the most part.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
I remember trying to "Get it" when I was working on it. I had an advantage of a lazy computer teacher in Jr. High who made us write our names in binary, write 1-1000 in binary, etc.

This was a mac lab too...and no networking.

Subnetting takes a bit of time (in my limted experience) but once you have a few big "Ahhh Haaa" moments, it gets easier.
 

spidey07

No Lifer
Aug 4, 2000
65,469
5
76
Originally posted by: nweaver
I remember trying to "Get it" when I was working on it. I had an advantage of a lazy computer teacher in Jr. High who made us write our names in binary, write 1-1000 in binary, etc.

This was a mac lab too...and no networking.

Subnetting takes a bit of time (in my limted experience) but once you have a few big "Ahhh Haaa" moments, it gets easier.

And when you've been doing it for a long time you can do all of it in your head in seconds and litererall count off the networks.
;)

154.89.79.4/18..

128...192 = 64..nets are 0/64/128/192
:D
 

ScottMac

Moderator<br>Networking<br>Elite member
Mar 19, 2001
5,471
2
0
I have to still count on my fingers 1 ... 31 (one hand).

Most kids get a charge out of the "four" finger ....

I'm just hoping I got it all right ... it was late.

FWIW

Scott