|
Viewed
Inside MCSE
|
SubnettingWhile the conceptual notion of subnetting by utilizing host bits are straightforward, the actual mechanics of subnetting are a bit more complicated. Subnetting is a three-step procedure: 1. Determine the number of host bits to be used for the subnetting. 2. Enumerate the new subnetted network IDs. 3. Enumerate the IP addresses for each new subnetted network ID. Step 1: Determining the Number ofHost BitsThe number of host bits being used for subnetting determines the possible number of subnets and hosts per subnet. Before you choose how many host bits, you should have a good idea of the number of subnets and hosts you will have in the future. Using more bits for the subnet mask than required will save you the time of reassigning IP addresses in the future. The more host bits that are used, the more subnets (subnetted network IDs) you can have—but with fewer hosts. If you use too many host bits, it will allow for growth in the number of subnets, but will limit the growth in the number of hosts. If you use too few hosts, it will allow for growth in the number of hosts, but will limit the growth in the number of subnets. For example, Figure 9 illustrates the subnetting of up to the first 8 host bits of a class B network ID. If we choose one host bit for subnetting, we obtain 2 subnetted network IDs with 16,382 hosts per subnetted network ID. If we choose 8 host bits for subnetting, we obtain 256 subnetted network IDs with 254 hosts per subnetted network ID.
Figure 9 Subnetting a class B network ID In practice, network administrators define a maximum number of nodes they want on a single network. Recall that all nodes on a single network share all the same broadcast traffic; they reside in the same broadcast domain. Therefore, growth in the amount of subnets is favored over growth in the amount of hosts per subnet. Follow these guidelines to determine the number of host bits to use for subnetting.1. Determine how many subnets you need now and will need in the future. Each physical network is a subnet. WAN connections may also count as subnets depending on whether your routers support unnumbered connections. 2. Use additional bits
for the subnet mask if: To determine the desired subnetting scheme, you will start with an existing networkID to be subnetted. The network ID to be subnetted can be a class-based network ID, a subnetted network ID, or a supernet. The existing network ID will contain a series of network ID bits which are fixed, and a series of host ID bits which are variable. Based on your requirements for the number of subnets and the number of hosts per subnet, you will choose a specific number of host bits to be used for the subnetting. Table 16 shows the subnetting of a class A network ID. Based on a required number of subnets, and a maximum number of hosts per subnet, a subnetting scheme can be chosen. Table 16 Subnetting a Class A Network ID
Table 17 Subnetting a class B network ID
Table 18 Subnetting a class C network ID
Step 2: Enumerating Subnetted Network IDsBased on the number of host bits you use for your subnetting, you must list the new subnetted network IDs. There are two main approaches:
Either method produces the same result—the enumerated list of subnetted network IDs. Note There are a variety of documented shortcut techniques for subnetting. However, they only work under a specific set of constraints (for example, only up to8 bits of a class-based network ID). The methods described below are designed to work for any subnetting situation (class-based, more than 8 bits, supernetting, variable length subnetting). Binary Subnetting Procedure1. Based on n, the number of host bits chosen for subnetting, create a 3-column table with 2 face= Arialsize=1>n entries. The first column is the subnet number (starting with 1), the second column is the binary representation of the subnetted network ID, and the third column is the dotted decimal representation of the subnetted network ID. For each binary representation, the bits of the network ID being subnetted are fixed to their appropriate values and the remaining host bits are set to all 0's. The host bits chosen for subnetting will vary. 2. In the first table entry, set the subnet bits to all 0's and convert to dotted decimal notation. The original network ID is subnetted with its new subnet mask. 3. In the next table entry, increase the value within the subnet bits. 4. Convert the binary result to dotted decimal notation. 5. Repeat steps 3 and 4 until the table is complete. As an example, a 3-bit subnet of the private network ID 192.168.0.0 is needed. The subnet mask for the new subnetted network IDs is 255.255.224.0 or /19. Based on n = 3, construct a table with 8 (= 2 3) entries. The entry for subnet 1 is the all 0's subnet. Additional entries in the table are successive increments of the subnet bits as shown in Table 19. The host bits used for subnetting are underlined. Table 19 Binary subnetting technique for network ID 192.168.0.0
Decimal Subnetting Procedure1. Based on n, the number of host bits chosen for subnetting, create a 3-column table with 2n entries. The first column is the subnet number (starting with 1), the second column is the decimal (Base 10 numbering system) representation of the 32-bit subnetted network ID, and the third column is the dotted decimal representation of the subnetted network ID. 2. Convert the network ID (w.x.y.z) being subnetted from dotted decimal notation to N, a decimal representation of the 32-bit network ID. N = w*16777216 + x*65536 + y*256 + z 3. Compute the increment value I based on h, the number of host bits remaining. I = 2h 4. In the first table entry, the decimal representation of the subnetted network ID isN and the subnetted network ID will be w.x.y.z with its new subnet mask. 5. In the next table entry, add I to the previous table entry's decimal representation. 6. Convert the decimal representation of the subnetted network ID to dotted decimal notation (W.X.Y.Z) through the following formula (where s is the decimal representation of the subnetted network ID): W = INT(s/16777216) X = INT((s mod(16777216))/65536) Y = INT((s mod(65536))/256) Z = s mod(256) INT( ) denotes integer division, mod( ) denotes the modulus - the remainder upon division. 7. Repeat steps 5 and 6 until the table is complete. As an example, a 3-bit subnet of the private network ID 192.168.0.0 is needed. Based on n = 3, we construct a table with 8 entries. The entry for subnet 1 is the all 0's subnet. N, the decimal representation of 192.168.0.0, is 3232235520, the result of 192*16777216 + 168*65536. Since there are 13 host bits remaining, the increment I is 2 13 = 8192. Additional entries in the table are successive increments of 8192 as shown in Table 20. Table 20 Decimal subnetting technique for network ID 192.168.0.0
The All-Zeros and All-Ones SubnetsRFC 950 originally forbade the use of the subnetted network IDs where the bits being used for subnetting are set to all 0's (the all-zeros subnet) and all 1's (the all-ones subnet). The all-zeros subnet caused problems for early routing protocols and the all-ones subnet conflicts with a special broadcast address called the all-subnets directed broadcast address. However, RFC 1812 now permits the use of the all-zeros and all-ones subnets in a Classless Interdomain Routing (CIDR)-compliant environment. CIDR-compliant environments use modern routing protocols which do not have a problem with the all-zeros subnet and the use of the all-subnets directed broadcast has been deprecated. Before you use the all-zeros and all-ones subnets, verify that they are supported by your hosts and routers. Windows NT supports the use of the all-zeros and all-ones subnets. Step 3: Enumerating IP Addresses for Each Subnetted Network IDBased on the enumeration of the subnetted network IDs, you must now list the valid IP addresses for new subnetted network IDs. To list each IP address individually would be too tedious. Instead, we will enumerate the IP addresses for each subnetted network ID by defining the range of IP addresses (the first and the last) for each subnetted network ID. There are two main approaches:
Either method produces the same result—the range of IP addresses for each subnetted network ID. Binary Procedure1. Based on n, the number of host bits chosen for subnetting, create a 3-column table with 2n entries. Alternately, add two columns to the previous table used for enumerating the subnetted network IDs. The first column is the subnet number (starting with 1), the second column is the binary representation of the first and last IP address for the subnetted network ID, and the third column is the dotted decimal representation of the first and last IP address of the subnetted networkID. 2. For each binary representation, the first IP address is the address where all the host bits are set to 0 except for the last host bit. The last IP address is the address where all the host bits are set to 1 except for the last host bit. 3. Convert the binary representation to dotted decimal notation. 4. Repeat steps 2 and 3 until the table is complete. As an example, the range of IP addresses for the 3 bit subnetting of 192.168.0.0 isshown in Table 21. The bits used for subnetting are underlined. Table 21 Binary enumeration of IP addresses
Decimal Procedure1. Based on n, the number of host bits chosen for subnetting, create a 3-column table with 2n entries. Alternately, add two columns to the previous table used for enumerating the subnetted network IDs. The first column is the subnet number (starting with 1), the second column is the decimal representation of the first andlast IP address for the subnetted network ID, and the third column is the dotted decimal representation of the first and last IP address of the subnetted network ID. 2. Compute the increment value J based on h, the number of host bits remaining.
3. For each decimal representation, the first IP address is N + 1 where N is the decimal representation of the subnetted network ID. The last IP address is N + J. 4. Convert the decimal representation of the first and last IP addresses to dotted decimal notation (W.X.Y.Z) through the following formula (where s is the decimal representation of the first or last IP address): = INT(s/16777216) X = INT((s mod(16777216))/65536) Y = INT((s mod(65536))/256) Z = s mod(256) INT( ) denotes integer division, mod( ) denotes the modulus, the remainder upon division. 5. Repeat steps 3 and 4 until the table is complete. As an example, the range of IP addresses for the 3 bit subnetting of 192.168.0.0 is shown in Table 22. The increment J is 2^13 - 2 = 8190. Table 22 Decimal enumeration of IP addresses
|
| The MCP Logo is displayed on this web site in accordance with Microsoft Certified Professional Program and Logo Agreement. © Paramvir Likhari 1997 - 1999 |