#I have the IP address of a host and I want to get its subnet mask
#can any one tell me how I can do this?

I got the following information off of the Cisco website a while ago (I
think).  The IP address alone no longer gives you the netmask because of
CIDR.  Any IP address can have a number of different netmasks depending on
how the network engineers are divvying up the network.

Regards,
Jeffery Gieser


Netmasks and Netblock Sizes

Netblock Sizes, Netmasks, and Bit-sized Networks
The following table shows the relationship between IP network's block
sizes, classful interpretation, netmasks, "supernets" [bit-length], "cisco
wild bits" and the actual bit-sizes of the networks.


An IP address on its own does not communicate what size network block to
which it belongs. A netmask associated with an IP address describes
"masked" portions [the left-most bits 'blocked out' by the ones in the
netmask] of an IP address. These masked portions create the "network part"
of the address, commonly called the "prefix".

Block Size
The block size tells you how many addresses are within the network. The
"bottom" [all-zero] is reserved to refer to the network itself and "top"
[all-ones] is reserved as the broadcast address, so these are unusable.
therefore, any given netblock has two less usable addresses that the
literal block size.


Eg, a network 10.0.0.64 with a block size of four has only two usable
addresses, 10.0.0.65 and 10.0.0.66.

Netmask
The netmask indicates the final (or final two) octets of what should be
masked against the address to configure equipment or define routes with the
apropriately-sized network. All leading [leftmost] octets in a netmask are
ones.


Eg, a network 10.0.16.0 with a netmask of 252.0 would result in a network
netmask pair of 10.0.16.0 255.255.252.0, while the previous example from
block size would result in 10.0.0.64 255.255.255.252.
Cisco "Wild Bits"
The cisco wild bits indicate the apropos value for the final (or final two)
octets of what is needed when creating a Cisco router's access list for a
certain network size. It is one less than the block size, merely because
given the network number [the "zero" or "bottom" of the network], the "wild
bits" define all the remaining possible values within the network.

"Supernet"
The supernet notation indicates the literal bitsize of a network.
"Supernet" is actually a misnomer, stemming from the perceived need to
differentiate prefixes longer than 24-bits [subnets of "Class C" blocks]
from those shorter than 24-bits in traditional "Class C space" (eg, the
207.* network), calling ther latter "supernets". The number actually
represents the "prefix length" - what part of an address is the
network-part.


Given that IPv4 addresses are 32-bits long, this is the most common and
easy way of describing a network. A network of one device (a host route) is
defined as easily as a network of two hundred fifty-six devices:
10.0.99.99/32 is a host and 10.0.98.0/24 is a "C-sized block".


This notation is the UltraNet standard for describing network sizes.

Raw Bits
The raw bits define the bits "within" the network. These are the inverse of
the supernet notation, and are a bitwise representation of the blocksize.
Lastly, this is the exponent for "2" when describing the network
mathematically.

Classful
The classful row merely gives a "backwards compatible" reference. All
classful interpretations [Class A, B, C, D and E networks] of IPv4 space
are archaic. This row is provided to give a reference point when speaking
to customers that do not yet have a firm grasp of "supernet" notation.

Reference Table
Netmasks and Wild Bits refer to the RIGHTMOST octets.


block size     1    2    4    8    16    32   64   128  256
netmask   255  254  252  248  240  224   192  128  0
cisco wild bits     0    1    3    7     15   31   63   127  255
supernet  /32  /31  /30  /29  /28  /27   /26  /25  /24
raw bits       0    1    2    3    4     5    6    7    8
Classful  |------   Subnets of Class C addresses   ------|


block size     512  1024 2048 4096 8192  16384     32768
netmask   254.0     252.0     248.0      240.0     224.0     192.0
128.0
cisco wild bits     1.255     3.255      7.255     15.255    31.255
63.255    127.255
supernet  /23  /22  /21  /20  /19  /18   /17
raw bits       9    10   11   12   13    14   15

Classful  |---------     Subnets of Class B addresses   --------|


block size     65536
netmask   0.0
cisco wild bits     255.255
supernet  /16
raw bits       16
Classful  Class B

-
[To unsubscribe, send mail to [EMAIL PROTECTED] with
"unsubscribe firewalls" in the body of the message.]

Reply via email to