A Static Subnetting Example
|
Recall that an IP address consists of the pair <network address><host address>. For example, let us take a class A network; the address format is shown in
Let us use the following IP address: 00001001 01000011 00100110 00000001 a 32-bit address 9 67 38 1 decimal notation (9.67.38.1) 9.67.38.1 is an IP address (class A) having 9 as the <network address> 67.38.1 as the <host address>
Subnets are an extension to this by considering a part of the <host address> to be a subnetwork address. IP addresses are then interpreted as <network address><subnetwork address><host address>. For example, you may wish to choose the bits from 8 to 25 of a class A IP address to indicate the subnet addresses, and the bits from 26 to 31 to indicate the actual host addresses. Figure 9 shows the subnetted address that has thus been derived from the original class A address: We normally use a bit mask, known as the subnet mask, to identify which bits of the original host address field should indicate the subnet number. In the above example, the subnet mask is 255.255.255.192 in decimal notation (or 1111111111111111 11111111 11000000 in bit notation). Note that, by convention, the <network address> is masked as well. For each of these subnet values, only 2 18 -2 addresses (from 1 to 262143) are valid because of the all bits 0 and all bits 1 number restrictions. This split will therefore give 262142 subnets each with a maximum of 2 6 -2 or 62 hosts. You will notice that the value applied to the subnet number takes the value of the full byte with non-significant bits being set to zero. For example, the hexadecimal value 01 in this subnet mask assumes an 8-bit value 01000000 and gives a subnet value of 64 and not 1 as it might seem. Applying this mask to our sample class A address 9.67.38.1 would break the address down as follows: 00001001 01000011 00100110 00000001 = 9.67.38.1 (class A address) 11111111 11111111 11111111 11------ 255.255.255.192 (subnet mask) ===================================== logical_AND 00001001 01000011 00100110 00------ = 9.67.38 (subnet base address) This leaves a host address of: -------- -------- -------- --000001 = 1 (host address) IP will recognize all host addresses as being on the local network for which the logical_AND operation described above produces the same result. This is important for routing IP datagrams in subnet environments (see 2.1.3, “IP Routing” on page 35). Note that the actual subnet number would be: -------- 01000011 00100110 00------ = 68760 (subnet number) You will notice that the subnet number shown above is a relative number. That is, it is the 68760th subnet of network 9 with the given subnet mask. This number bears no resemblance to the actual IP address that this host has been assigned (9.67.38.1) and has no meaning in terms of IP routing. The division of the original <host address> part into <subnet> and <host> parts can be chosen freely by the local administrator, except that the values of all zeroes and all ones in the <subnet> field are reserved for special addresses. Note: Because the range of available IP addresses is decreasing rapidly, many routers do support the use of all zeroes and all ones in the <subnet> field, though this is not coherent with the standards. |

Favorite (0)