Sie sind auf Seite 1von 3

Subnetting

If you are solving a subnetting problem involving same size subnets, the problem can be presented in one of two different ways. Either you are creating a minimum number of subnets (thereby maximizing the number of hosts per subnet) or you need a minimum number of hosts per subnet (thereby maximizing the number of subnets). Either way, you are trying to figure out how many bits to borrow from the host portion of the IP address in order to create subnets. Remember, an IP address is divided into a network portion followed by a host portion. The dividing line is defined by the subnet mask. The subnet mask begins with 1s and ends with 0s. The number of 1s in the subnet mask defines the number of bits in the network portion of the IP address. The number of bits in the network portion can be indicated with a shorthand notation (slash notation) in the form of /n where n is the number of bits in the network portion. For example, an IP address of 192.168.1.0 where the first three octets (24 bits) is the network portion and the last octet (8 bits) is the host portion can be written as 192.168.1.0/24 or 192.168.1.0 with a subnet mask of 255.255.255.0. You can never change the network portion of an IP address. This is the network number that has been assigned to you and any change might overlap with a network number assigned to someone else. You can do anything you want with the host portion of the address. In order to create subnets, you borrow bits from the host portion and thereby decrease the number of bits available for host addresses. When you do this, you have to increase the number of 1s in the subnet mask by the number of bits borrowed in order to indicate that the dividing line is farther to the right. The number of subnets created is defined by the number of unique combinations (values) of the borrowed bits. This can be computed by the formula 2 n where n is the number of bits borrowed. So if I borrow 3 bits, I can have a total of 8 subnets (2 3 = 2x2x2 = 8. The unique combinations of the borrowed bits are: 000 001 010 011 100 101 110 111 If I started out with 8 host bits and borrowed 3, I have 5 host bits remaining. There is a restriction on the host bit values that can be used for IP addresses in that they cannot be all 0s (that is the subnet ID) and they cannot be all 1s (that is the broadcast address for that subnet). So the formula for the number of valid host addresses is 2 n 2. In this case, n is 5 so 25 = 2x2x2x2x2 = 32. 25 2 = 32 2 = 30. To indicate there are

three more bits in the network portion, the subnet mask has to be changed so the last octet is 11100000, i.e. 255.255.255.224 (or /27). The subnet ID, host addresses, and subnet broadcast address are derived by writing the subnet portion and host portion together in binary and then converting to decimal. If we are given a network address of 192.168.1.0/24 and borrow three bits to create subnets, the first subnet is defined as (only writing the last octet in binary): 00000000 00000001 00000010 00000011 00000100 00000101 00000110 00000111 00001000 00001001 00001010 00001011 00001100 00001101 00001110 00001111 00010000 00010001 00010010 00010011 00010100 00010101 00010110 00010111 00011000 00011001 00011010 00011011 00011100 00011101 00011110 00011111 192.168.1.0/27 192.168.1.1/27 192.168.1.2/27 192.168.1.3/27 192.168.1.4/27 192.168.1.5/27 192.168.1.6/27 192.168.1.7/27 192.168.1.8/27 192.168.1.9/27 192.168.1.10/27 192.168.1.11/27 192.168.1.12/27 192.168.1.13/27 192.168.1.14/27 192.168.1.15/27 192.168.1.16/27 192.168.1.17/27 192.168.1.18/27 192.168.1.19/27 192.168.1.20/27 192.168.1.21/27 192.168.1.22/27 192.168.1.23/27 192.168.1.24/27 192.168.1.25/27 192.168.1.26/27 192.168.1.27/27 192.168.1.28/27 192.168.1.29/27 192.168.1.30/27 192.168.1.31/27 subnet ID valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address subnet broadcast address

The second subnet is defined by changing the subnet ID (the first three bits) from 000 to 001 and then converting to decimal (only writing the last octet in binary):

00100000 00100001 00100010 00100011 00100100 00100101 00100110 00100111 00101000 00101001 00101010 00101011 00101100 00101101 00101110 00101111 00110000 00110001 00110010 00110011 00110100 00110101 00110110 00110111 00111000 00111001 00111010 00111011 00111100 00111101 00111110 00111111

192.168.1.32/27 192.168.1.33/27 192.168.1.34/27 192.168.1.35/27 192.168.1.36/27 192.168.1.37/27 192.168.1.38/27 192.168.1.39/27 192.168.1.40/27 192.168.1.41/27 192.168.1.42/27 192.168.1.43/27 192.168.1.44/27 192.168.1.45/27 192.168.1.46/27 192.168.1.47/27 192.168.1.48/27 192.168.1.49/27 192.168.1.50/27 192.168.1.51/27 192.168.1.52/27 192.168.1.53/27 192.168.1.54/27 192.168.1.55/27 192.168.1.56/27 192.168.1.57/27 192.168.1.58/27 192.168.1.59/27 192.168.1.60/27 192.168.1.61/27 192.168.1.62/27 192.168.1.63/27

subnet ID valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address valid host address subnet broadcast address

The remaining 6 subnets are derived in the same way. So if the problem is to create a minimum number of subnets, you figure out how many bits you have to borrow using the formula 2 n. If the problem is to create subnets with a minimum number of hosts per subnet, you figure out how many bits you have to have left in the host portion using the formula 2n 2. You then subtract this number from the number of host bits you started with to determine the number of bits you borrow for subnetting.

Das könnte Ihnen auch gefallen