Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class B Subnet Mask 255.255.255.192 2

Status
Not open for further replies.

ElijahBaley

IS-IT--Management
May 4, 2001
1,598
GB
Hi

I am having real trouble working with masks that use more than 8 BITS, in particular this 10 BIT class B : 255.255.255.192

I would be very grateful if someone could walk me through this as I am struggling to understand it using the Sybex Lammle book,

Thanks very much for your help,

EB
 
you are not identify that which routing protocol you trying to use because it will be doing all right with ospf and eigrp but not with RIP and IGRP because they are supported the subnetting. please identify what type of problem u r facing.
 
Actully that is a 26bit mask.
See if this helps:

Address 128 64 32 16 8 4 2 1
x.x.x.1 0 0 0 0 0 0 0 1

Mask
x.x.x.192 1 1 0 0 0 0 0 0

Subnet
x.x.x.0 0 0 0 0 0 0 0 0

Think of the 4 possiable combinations of the first 2 bits, since we are subnetting these bits. The IP address will determine the subnet it resides in. Remember you can't use all zero's or all one's.

128 64 Subnet Hosts
0 0 = 0 1-62 (63=broadcast)
0 1 = 64 65-126 (127=broadcast)
1 0 = 128 129-190 (191=broadcast)
1 1 = 192 193-254 (255=broadcast)

See below for more info:
Todd VanDerwerken, CCNA, CCDA
Technical Consultant
"If at first you don't succeed...then sky diving isn't for you!"
 
My apologies, what I meant was that I am having real trouble working with subnet masks that "borrow" more than 8 HOST BITS, in particular this 26 BIT class B subnet mask: 255.255.255.192

The way that I have learnt to subnet is this five stage decimal approach:

2 power of 10 minus 2 = 1022 (Number of subnets possible)
2 power of 6 minus 2 = 62 (Number of hosts per subnet)
What are the Subnets?
What are the hosts?
What are the broadcast addresses?

the part that I am having trouble with is step 3 (What are the subnets) I am getting confused when the subnet mask borrows more than 8 bits from the host portion

I find a class C mask such as 255.255.255.224
straight forward as I can use 256-224=32 in the 3rd stage to get a variable to use to work out the subnets:

0 Invalid
32 Valid
64 Valid
96 Valid
128 Valid
160 Valid
192 Valid
224 Invalid

And from there I can work out broadcast addresses and valid hosts.

But how can I apply this to a mask that uses 10 host bits???

Thanks for your help,

EB


 
Just look at the bit position of the last subnet bit.

<fourth octect>

1 6 3 1 8 4 2 1
2 4 2 6
8

x x - - - - - -

So your subnets increment on the 64 boundary.

Let's take an example:

150.150.0.0 255.255.255.192

first subnet: 150.150.0.0
second subnet: 150.150.0.64
third subnet: 150.150.0.128
fourth subnet: 150.150.0.192
fifth subnet: 150.150.1.0

The network address is the first IP and the broadcast address is the last. In the case of the third subnet, the network number is 150.150.0.128, the first host address is 150.150.0.129, the last host address is 150.150.0.190, and the broadcast is 150.150.0.191.

It will help you greatly if you stop thinking in decimal (256-224=32, etc) and start thinking in binary (what is the final subnet bit position?). If this is still fuzzy, do it yourself by hand with a couple of ip ranges. Draw it out in binary to really see what is going on below the surface.
 
svermill
Good advice on forgetting decimal and just using binary.

ElijaBailey
Most IP addressing schemes have the 3rd octet masked at 255, or a 24 bit mask.
You understand that subnetting scheme, right?

150.150.0.0
255.255.255.0

Your subnet's would be
150.150.1.0
150.150.2.0
150.150.3.0, etc..

So by borrowing 2 bits from the 4th octet you are taking each of these subnet's and breaking them into 4 smaller subnets.

150.150.1.0
255.255.255.192

Makes the following subnets

150.150.1.0
150.150.1.64
150.150.1.128
150.150.1.192

If you draw the fourth octet out in binary and due the math, I think you'll see what we mean.

Todd VanDerwerken, CCNA, CCDA
Technical Consultant
&quot;If at first you don't succeed...then sky diving isn't for you!&quot;
 
svermill, tcvander

Thankyou for your help I think that I have finally got it!

When I was doing the decimal calc (256-224=32, etc) I was not aware of the significance of the result, so although I was producing the answer I was not really sure how and why.

So just to clarify, if I was given a IP address and Subnet mask:

150.150.35.99 (Ip Address)
255.255.255.192 (Subnet Mask)

I would know that this node was in the subnet
150.150.35.64 because the 8 masked host bits in the 3rd octet give 254 positions that increment at +1 and the 2 masked bits in the 4th octet increment at the +64 boundary
and the IP address falls within this host range

150.150.35.64 (Subnet Address)
150.150.35.65 (First Host)
150.150.35.127 (Last Host)
150.150.35.128 (Broadcast Address)

So all I really need to do when I need to know what subnet a IP address falls into is look at that last bit position to get the subnet increment value, no need to work out how many subnets and hosts per subnet a mask produces, though I can see that with experience this would become second nature.

Please correct me if I am wide of the mark, but by golly I think I have it!!

Much appreciated

Thanks

EB
 
I think you have it exactly. Except that in your above example, the last host would be 150.150.35.126 and your broadcast address would be 150.150.35.127. 150.150.35.128 starts your next subnet, and is the network address for that subnet. But that was just an oversight. You've got the concept and are thinking in binary now.

I've seen lots of tricks over the years to manipulate this stuff in your head. Some were good, most were shortcuts that allowed one to avoid understanding what was really happening. Once you realize that once all host bits have been incremented through, the final subnet bit will increment to the next subnet (and eventually some bits to the left of it will increment too, but the last bit will *always* increment or &quot;flip&quot; when changing to the next adjacent subnet), and then all host bits in that subnet will be incremented, and so on, and so on....you really don't need shortcuts anymore.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top