CCNA 1. Networking Basics v3.1.1 Student Lab Manual (796248), страница 25
Текст из файла (страница 25)
This is compared to the source IPaddress bit for bit. The first bit of the IP address is compared to the first bit of the subnet mask, thesecond bit to the second, and so on. If the two bits are both ones, the ANDing result is a one. If thetwo bits are a zero and a one, or two zeros, the ANDing result is a zero. Basically, this means that acombination of 2 ones results in a one, anything else is a zero. The result of the ANDing process isthe identification of the network or subnet number that the source or destination address is on.Step 3 Two Class C networks using the default subnet maskThis example shows how a Class C default subnet mask can be used to determine which network ahost is on.
A default subnet mask does not break an address into subnets. If the default subnet maskis used, the network is not being subnetted. Host X, the source on network 200.1.1.0 has an IPaddress of 200.1.1.5. It wants to send a packet to Host Z, the destination on network 200.1.2.0 andhas an IP address of 200.1.2.8. All hosts on each network are connected to hubs or switches and2-7CCNA 1: Networking Basics v 3.1 – Lab10.3.5aCopyright 2003, Cisco Systems, Inc.then to a router.
Remember that with a Class C network address, the first 3 octets, or 24 bits, areassigned as the network address. So, these are two different Class C networks. This leaves oneoctet, or 8 bits for hosts, so each Class C network could have up to 254 hosts:•82 = 256 – 2 = 254Source net:200.1.1.0Destination net: 200.1.2.0Subnet mask: 255.255.255.0Subnet mask: 255.255.255.0RouterHostXHubHubHost IP 200.1.1.5HostZHost 200.1.2.8Router interfaceRouter interfaceIP 200.1.1.1IP 200.1.2.1The ANDing process helps the packet get from Host 200.1.1.5 on network 200.1.1.0 to Host200.1.2.8 on network 200.1.2.0 by using the following steps:1. Host X compares its own IP address to its own subnet mask using the ANDing process.Host X IP address 200.1.1.511001000.00000001.00000001.00000101Subnet Mask 255.255.255.011111111.11111111.11111111.00000000ANDing Result (200.1.1.0)11001000.00000001.00000001.00000000Note: The result of the ANDing process is the network address of Host X, which is 200.1.1.0.2.
Next, Host X compares the IP address of the Host Z destination to its own subnet mask usingthe ANDing process.Host Z IP address 200.1.2.811001000.00000001.00000010.00001000Subnet Mask 255.255.255.011111111.11111111.11111111.00000000ANDing Result (200.1.2.0)11001000.00000001.00000010.00000000Note: The result of the ANDing process is the network address of Host Z, which is 200.1.2.0.Host X compares the ANDing results from Step 1 and the ANDing results from Step 2, and notesthey are different.
Host X now knows that Host Z is not in its local-area network (LAN). Therefore, itmust send the packet to its default gateway, which is the IP address of the router interface of200.1.1.1 on network 200.1.1.0. The router then repeats the ANDing process to determine whichrouter interface to send the packet out to.3-7CCNA 1: Networking Basics v 3.1 – Lab10.3.5aCopyright 2003, Cisco Systems, Inc.Step 4 One Class C network with subnets using a custom subnet maskThis example uses a single Class C network address (200.1.1.0) and shows how a Class C customsubnet mask can be used to determine which subnetwork (or subnet) a host is on and to routepackets from one subnetwork to another. Remember that with a Class C network address, the first 3octets, or 24 bits are assigned as the network address. This leaves one octet, or 8 bits, for hosts.So, each Class C network could have up to 254 hosts:•82 = 256 – 2 = 254Perhaps less than 254 hosts, workstations and servers combined, are desired on one network.
Thiscould be for security reasons or to reduce traffic. It can be done by creating two subnetworks andseparating them with a router. This will create smaller independent broadcast domains and canimprove network performance and increase security. This is possible because these subnetworkswill be separated by one or more router. Assume at least two subnetworks will be needed and thatthere will be at least 50 hosts per subnetwork. Because there is only one Class C network address,only 8 bits in the fourth octet are available for a total of 254 possible hosts. Therefore, a customsubnet mask must be created.
The custom subnet mask will be used to borrow bits from the hostportion of the address. The following steps help accomplish this:1. The first step to subnetting is to determine how many subnets are needed. In this case, its twosubnetworks. To see how many bits should be borrowed from the host portion of the networkaddress, add the bit values from right to left until the total is equal to or greater than the numberof subnets needed.
Because two subnets are needed, add the one bit and the two bit, whichequals three. This is greater than the number of subnets needed. To remedy this, borrow at leasttwo bits from the host address starting from the left side of the octet that contains the hostaddress.Network address: 200.1.1.0th4 octet Host address bits:11111111Host address bit values(from right)1286432168421Add bits starting from the right side, the 1 and the 2, until the sum is greater than the number ofsubnets needed.Note: An alternate way to calculate the number bits to be borrowed for subnets is to take thenumber of bits borrowed to the power of 2. The result must be greater than the number ofsubnets needed.
As an example if 2 bits are borrowed the calculation is two to the secondpower, which equals four. Since the number of subnets needed is two this should beadequate.2. After we know how many bits to borrow, we take them from the left side of the of the hostthaddress, the 4 octet. Every bit borrowed from the host address bit leaves fewer bits for thehosts.
Even though the number of subnets is increased, the number of hosts per subnet isdecreased. Because two bits need to be borrowed from the left side, that new value must beshown in the subnet mask. The existing default subnet mask was 255.255.255.0 and the newcustom subnet mask is 255.255.255.192.
The 192 results from adding the first two bits from theleft, 128 + 64 = 192. These bits now become 1s and are part of the overall subnet mask. This6leaves 6 bits for host IP addresses or 2 = 64 hosts per subnet.th4 Octet borrowed bits for subnet: 11000000Subnet bit values: (from left side) 1286432168421With this information, the following table can be built. The first two bits are the subnet binary value.The last 6 bits are the host bits. By borrowing 2 bits from the 8 bits of the host address 4 subnets,2^2, with 64 hosts each, can be created. The 4 networks created are as follows:4-7CCNA 1: Networking Basics v 3.1 – Lab10.3.5aCopyright 2003, Cisco Systems, Inc.!The 200.1.1.0 network!The 200.1.1.64 network!The 200.1.1.128 network!The 200.1.1.192 networkThe 200.1.1.0 network is considered unusable, unlesss the networking device supports the IOScommand ip subnet-zero, which allows using the first subnet.Subnet No.Subnet BitsBorrowedBinary ValueSubnet BitsDecimalValueHost Bits PossibleBinary Values (Range)(6 Bits)Subnet/HostDecimalRangeUseable?0 Subnet000000000–1111110–63Nost0164000000–11111164–127Yesnd10128000000–111111128–191Yesrd11192000000–111111192–254No1 Subnet2 Subnet3 SubnetNotice that the first subnet always starts at 0 and, in this case, increases by 64, which is the numberof hosts on each subnet.
One way to determine the number of hosts on each subnet or the start ofeach subnet is to take the remaining host bits to the power of 2. Because we borrowed two of the 86bits for subnets and have 6 bits left, the number of hosts per subnet is 2 or 64. Another way to figurethe number of hosts per subnet or the increment from one subnet to the next is to subtract thesubnet mask value in decimal, 192 in the fourth octet, from 256, which is the maximum number ofpossible combinations of 8 bits. This equals 64. This means start at 0 for the first network and add 64for each additional subnetwork. For example, if the second subnet is used, the 200.1.1.64 networkcannot be used for a host ID since the network ID of the 64 subnet has all zeros in the host portion.Another common way to represent a subnet mask, is the use of the “slash/number” (/#) where the #following the slash is the number of bits used in the mask (network and subnet combined).
As anexample, a Class C network address such as 200.1.1.0 with a standard subnet mask(255.255.255.0) would be written as 200.1.1.0 /24, indicating that 24 bits are used for the mask. Thesame network, when subnetted by using two host bits for subnets, would be written as 200.1.1.0 /26.This indicates that 24 bits are used for the network and 2 bits for the subnet. This would represent acustom subnet mask of 255.255.255.192 in dotted decimal format.A Class A network of 10.0.0.0 with a standard mask (255.0.0.0) would be written as 10.0.0.0 /8.
If 8bits (the next octet) were being used for subnets it would be written as 10.0.0.0 /16. This wouldrepresent a custom subnet mask of 255.255.0.0 in dotted decimal format. The “slash” number afterthe network number is an abbreviated method of indicating the subnet mask being used.Step 5 Use the following information and the previous examples to answer the followingsubnet-related questionsA company has applied for and received a Class C network address of 197.15.22.0. The physicalnetwork is to be divided into 4 subnets, which will be interconnected by routers.
At least 25 hosts willbe needed per subnet. A Class C custom subnet mask needs to be used and a router is neededbetween the subnets to route packets from one subnet to another. Determine the number of bits thatneed to be borrowed from the host portion of the network address and the number of bits that will beleft for host addresses.Note: There will be 8 possible subnets, of which 6 can be used.Fill in the following table and answer the following questions:5-7CCNA 1: Networking Basics v 3.1 – Lab10.3.5aCopyright 2003, Cisco Systems, Inc.Subnet No.Subnet BitsBorrowedBinary ValueSubnet BitsDecimal andSubnet No.Host Bits PossibleBinary Values(Range) (5 Bits)Subnet/HostDecimalRangeUse?0 Subnetst1 Subnetnd2Subnetrd3 Subnetth4 Subnetth5 Subnetth6 Subnetth7 SubnetNOTES:______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________Use the table just developed to help answer the following questions:1.