J.
Let's break this out:
172.31.100.100 - Host address
1010 1100.0001 1111.0110 0100.0110 0100 - in binary
255.255.24.164 - Subnet mask
1111 1111.1111 1111.0001 1000.1010 0100 - in binary
We can tell this is a class B address, in the
traditional sense. As far as non-contiguous subnet
masks go, the rules are still the same. You count the
number of '1' bits to the right of the classful
boundry, which is 5. So you have five bits of
subnetting. This would equal 30 subnets or 31 subnets
if you count subnet-zero.
The subnets (not counting the first two octets) for
this mask in binary are:
.xxx0 0xxx.0x0x x0xx - 172.31.0.0 (subnet zero)
.xxx0 0xxx.0x0x x1xx - 172.31.0.4
.xxx0 0xxx.0x1x x0xx - 172.31.0.32
.xxx0 0xxx.0x1x x1xx - 172.31.0.36
.xxx0 0xxx.1x0x x0xx - 172.31.0.128
.xxx0 0xxx.1x0x x1xx - 172.31.0.132
.xxx0 0xxx.1x1x x0xx - 172.31.0.160
.xxx0 0xxx.1x1x x1xx - 172.31.0.164
.xxx0 1xxx.0x0x x0xx - 172.31.8.0
.xxx0 1xxx.0x0x x1xx - 172.31.8.4
.xxx0 1xxx.0x1x x0xx - 172.31.8.32
.xxx0 1xxx.0x1x x1xx - 172.31.8.36
.xxx0 1xxx.1x0x x0xx - 172.31.8.128
.xxx0 1xxx.1x0x x1xx - 172.31.8.132
.xxx0 1xxx.1x1x x0xx - 172.31.8.160
.xxx0 1xxx.1x1x x1xx - 172.31.8.164
.xxx1 0xxx.0x0x x0xx - 172.31.16.0
.xxx1 0xxx.0x0x x1xx - 172.31.16.4
.xxx1 0xxx.0x1x x0xx - 172.31.16.32
.xxx1 0xxx.0x1x x1xx - 172.31.16.36
.xxx1 0xxx.1x0x x0xx - 172.31.16.128
.xxx1 0xxx.1x0x x1xx - 172.31.16.132
.xxx1 0xxx.1x1x x0xx - 172.31.16.160
.xxx1 0xxx.1x1x x1xx - 172.31.16.164
.xxx1 1xxx.0x0x x0xx - 172.31.24.0
.xxx1 1xxx.0x0x x1xx - 172.31.24.4
.xxx1 1xxx.0x1x x0xx - 172.31.24.32
.xxx1 1xxx.0x1x x1xx - 172.31.24.36
.xxx1 1xxx.1x0x x0xx - 172.31.24.128
.xxx1 1xxx.1x0x x1xx - 172.31.24.132
.xxx1 1xxx.1x1x x0xx - 172.31.24.160
.xxx1 1xxx.1x1x x1xx - All ones subnet -- not used
The host bits are shown above as 'x' for clarity. We
have 11 bits of host, so we could have up to 2046
(2048-2) host addresses. If we do a bitwise logical
AND (a.b=?), we can tell what subnet host
172.31.100.100 is on:
1010 1100.0001 1111.0110 0100.0110 0100 - host
1111 1111.1111 1111.0001 1000.1010 0100 - subnet mask
---------------------------------------
1010 1100.0001 1111.0000 0000.0010 0100 - subnetwork
In decimal this is 172.31.0.36, the fourth subnet.
This represents, in the imortal words of one of my
instructors, the address of the waaaahhr (wire). The
first host would be (dashes show network/subnet bits):
1010 1100.0001 1111.0000 0000.0010 0101 - 172.31.0.37
---- ---- ---- ---- - - - - -
0000 0000.0010 0110 - 172.31.0.38 (second)
- - - - -
0000 0000.0010 0111 - 172.31.0.39 (third)
- - - - -
0000 0000.0010 1100 - 172.31.0.44 (fourth)
- - - - -
0000 0000.0010 1101 - 172.31.0.45 (fifth)
- - - - -
... and so on. The broadcast address would be:
1110 0111.0111 1111 - 172.31.231.127
- - - - -
Note there are all ones in the host bits.
I think you may see by now why so many people avoid
non-contiguous subnet masks. They're a royal pain to
use, it's next to impossible for a router to optimize
its table lookups without doing a one-for-one search,
and its difficult to look at two addresses and tell if
they're both on the same subnetwork.
Hope this helps...
Chris M.
--- "J. Kata" <[EMAIL PROTECTED]> wrote:
> Supposedly, non-contiguous subnet masks are
> legal because the rfc's don't restrict their
> use. Are there any good resources where I can
> read up on this subject? Has someone come across
> their use in the real world?
>
> And finally, can anyone answer these questions?
>
> IP: 172.31.100.100
> SM: 255.255.24.164
>
> What subnet does this ip address belong to?
> How many subnets does this mask support?
> How many hosts does this mask support?
> What is the broadcast address?
>
> Thanks.
>
> -- Janusz Kata
>
> _________________________________
> FAQ, list archives, and subscription info:
> http://www.groupstudy.com/list/cisco.html
> Report misconduct and Nondisclosure violations to
[EMAIL PROTECTED]
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
_________________________________
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]