mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-28 10:33:21 +01:00
f158c11a41
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@208 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
78 lines
3.5 KiB
HTML
78 lines
3.5 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="en-us">
|
|
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
|
<meta name="ProgId" content="FrontPage.Editor.Document">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
|
<title>Subnet Masks</title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" bgcolor="#400169" height="90">
|
|
<tr>
|
|
<td width="100%">
|
|
<h1 align="center"><font color="#FFFFFF">Subnet Masks/VLSM Notation</font></h1>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<p align="left">IP addresses and subnet masks are 32-bit numbers. The notation
|
|
w.x.y.z refers to an address where the high-order byte has value "w", the next
|
|
byte has value "x", etc. If we take 255.255.255.0 and express it in
|
|
hexadecimal,
|
|
we get:</p>
|
|
<blockquote>
|
|
<p align="left">FF.FF.FF.00</p>
|
|
</blockquote>
|
|
<p align="left">or looking at it as a 32-bit integer</p>
|
|
<blockquote>
|
|
<p align="left">FFFFFF00</p>
|
|
</blockquote>
|
|
<p align="left">Each "F" represents the bit pattern "1111" so if we look at the
|
|
number in binary, we have:</p>
|
|
<blockquote>
|
|
<p align="left">11111111111111111111111100000000</p>
|
|
</blockquote>
|
|
<p align="left">Counting the leading "1" bits, we see that there are 24 -- /24
|
|
in VLSM notation.</p>
|
|
<p align="left">It is handy to remember that the size of the subnet can be
|
|
obtained by subtracting the number of consecutive leading "1" bits from 32 and
|
|
raising 2 to that power. In the above case, 32 - 24 = 8 and 2 ** 8 = 256
|
|
addresses. Remember that the number of usable addresses is two less than that
|
|
(254) because the first and last address in the subnet are reserved as the
|
|
sub-network and broadcast addresses respectively.</p>
|
|
<p align="left">The size of a subnet can be any power of two so long as the
|
|
address of the subnet is a multiple of it's size. For example, if you want a
|
|
subnet of size 8, you could choose 192.168.12.8/29 (8 = 2 ** 3 and 32 - 3 = 29).
|
|
The subnet mask would be:</p>
|
|
<blockquote>
|
|
<p align="left">11111111111111111111111111111000 = FFFFFFF8 = 255.255.255.248.</p>
|
|
</blockquote>
|
|
<p align="left">This subnet would have 6 usable addresses: 192.168.12.9 -
|
|
192.168.12.14.</p>
|
|
<p align="left">You will still hear the terms "Class A network", "Class B
|
|
network" and "Class C network". In the early days of IP, sub-networks only came
|
|
in three sizes:</p>
|
|
<blockquote>
|
|
<p align="left">Class A - Subnet mask 255.0.0.0, size = 2 ** 24</p>
|
|
<p align="left">Class B - Subnet mask 255.255.0.0, size = 2 ** 16</p>
|
|
<p align="left">Class C - Subnet mask 255.255.255.0, size = 256</p>
|
|
</blockquote>
|
|
<p align="left">The class of a network was determined by the value of the high
|
|
order byte of its address so you could look at an IP address and immediately
|
|
determine the associated subnet mask. </p>
|
|
<p align="left">As the internet grew, it became clear that such a gross
|
|
partitioning of the 32-bit address space was going to be very limiting (early
|
|
on, large corporations and universities were assigned their own class A
|
|
network!). It was then that VLSM was devised -- today, any system that you are
|
|
likely to work with understands VLSM and Class-based subnetworking is largely a
|
|
thing of the past.</p>
|
|
<p align="left"><font size="2">Last updated
|
|
7/15/2002 - <a href="support.htm">Tom
|
|
Eastep</a></font></p>
|
|
<p><a href="copyright.htm"><font size="2">Copyright 2002 Thomas M. Eastep</font></a></p>
|
|
|
|
</body>
|
|
|
|
</html> |