Classless Subnetting Using the Worksheet CIS 81 and CST 311 Rick Graziani Fall 2006 Determining Network and Subnet Information • Use the Classless Subnetting Worksheet (Excel Spreadsheet) to do • • the following: Given any IP address and major network mask we can determine: – Major Network Address – First host address of the network – Last host address of the network – Broadcast address of the network – Number of usable hosts in the network If the network is subnetted and we know the subnet mask we can determine: – Subnet (network) Address – First host address of the subnet – Last host address of the subnet – Broadcast address of the subnet – Number of usable hosts in the subnet – Number of usable subnets in this network Rick Graziani graziani@cabrillo.edu 2 See these spreadsheets on my website Nutshell: Classless Subnetting in a Nutshell (Excel spreadsheet) Worksheet: Classless Subnetting Worksheet (Excel spreadsheet) Rick Graziani graziani@cabrillo.edu 3 Part 1: Determine Major Network Information Rick Graziani graziani@cabrillo.edu 4 Convert IP Address/Network Mask to Binary • • • • • First, let’s determine the Major Network Information. This is the information for the entire network, whether or not there are subnets. Using the Major Network Mask, determine the major network Address, the broadcast address for the entire network, and the number of hosts for the entire network. The Major Network Mask (or Base Mask, Subnet Mask) is provided by the ISP. Convert these addresses to binary. Host IP Address:138.101.114.250 Major Network Mask: 255.255.0.0 (/16) Rick Graziani graziani@cabrillo.edu 5 Determine Network Address • • • • • Determine the Network Address by using the AND operation. Perform a bit-wise AND operation on the IP Address and the Subnet Mask Note: 1 AND 1 results in a 1, 0 AND anything results in a 0 Express the result in Dotted Decimal Notation The result is the Major Network Address of this for this host IP Address is 138.101.0.0 Rick Graziani graziani@cabrillo.edu 6 Determine Network Address A simple way of doing the AND operation: 1. In the Network mask locate where the 1’s end and the 0’s begin and draw a line. (I call this the “Major Network Divide” or “MD” on the worksheet.) 2. Now copy all of the bits above the 1 bits in the Network mask, to the Network address. 3. For the rest of the bits in the Network address (the bits below the 0’s in the Network mask) write all 0’s. MD Network Portion Copy the bits from the Host IP Address to the Major Network Address Rick Graziani graziani@cabrillo.edu Host Portion Write all 0’s below the 0’s in the Major Network Mask 7 Network: Determine First Host, Last Host, Broadcast Addresses • • • • • Remember that the network mask separates the network portion of the address from the host portion. Major Network Mask: 255.255.0.0 or /16 The network address has all 0’s in the host portion of the address The broadcast address has all 1’s in the host portion of the address The first host is all 0’s and a 1 in the host portion of the address. The last host is all 1’s and a 0 in the host portion of the address. Network Portion Rick Graziani graziani@cabrillo.edu Host Portion 8 Network: Determine First Host, Last Host, Broadcast Addresses • • • • The network address has all 0’s in the host portion of the address The broadcast address has all 1’s in the host portion of the address The first host is all 0’s and a 1 in the host portion of the address. The last host is all 1’s and a 0 in the host portion of the address. Network Portion Rick Graziani graziani@cabrillo.edu Host Portion 9 Network: Determine the number of usable hosts • By counting the number of host bits we can determine the total number of usable hosts for this network (before subnetting). Host bits: 16 Total number of hosts: 216 = 65,536 65,536 – 2 = 65,534 (Can’t use the all 0’s address, network address, or the all 1’s address, broadcast address.) Network Portion Host Portion = 16 bits Rick Graziani graziani@cabrillo.edu 10 Part 2: Determine Subnet Information Rick Graziani graziani@cabrillo.edu 11 Convert IP Address/Subnet Mask to Binary • • • • • Now we will determine the Subnet Network Information. (Assuming we are subnetted.) This is the information only for that subnet. Using the Subnet Mask, determine the Subnet Address, the broadcast address for the entire network, and the number of hosts for the subnet. The Subnet Mask is determined by the network administrator, depending upon the number of subnets and the number of hosts per subnet that are needed. Convert these addresses to binary. Host IP Address:138.101.114.250 Subnet Mask: 255.255.255.192 (/26) Rick Graziani graziani@cabrillo.edu 12 Determine Subnet Address • • • • • Determine the Network Address by using the AND operation. Perform a bit-wise AND operation on the IP Address and the Subnet Mask Note: 1 AND 1 results in a 1, 0 AND anything results in a 0 Express the result in Dotted Decimal Notation The result is the Major Network Address of this for this host IP Address is 138.101.114.192 Rick Graziani graziani@cabrillo.edu 13 Determine Subnet Address A simple way of doing the AND operation: 1. In the Subnet mask locate where the 1’s end and the 0’s begin and draw a line. (I call this the “Subnet Divide” or “SD” on the worksheet.) 2. Now copy all of the bits above the 1 bits in the Subnet mask, to the Network address. 3. For the rest of the bits in the Subnet address (the bits below the 0’s in the Network mask) write all 0’s. SD Network/Subnet Portion Copy the bits from the Host IP Address to the Major Network Address Rick Graziani graziani@cabrillo.edu Host Portion Write all 0’s below the 0’s in the Major Network Mask 14 Subnet: Determine First Host, Last Host, Broadcast Addresses • • • • • Remember that the network mask separates the network portion of the address from the host portion. Subnet Mask: 255.255.255.192 or /26 The network address has all 0’s in the host portion of the address The broadcast address has all 1’s in the host portion of the address The first host is all 0’s and a 1 in the host portion of the address. The last host is all 1’s and a 0 in the host portion of the address. Network Portion Subnet Portion Host Portion Rick Graziani graziani@cabrillo.edu 15 Subnet: Determine First Host, Last Host, Broadcast Addresses • • • • The subnet address has all 0’s in the host portion of the subnet address The broadcast address has all 1’s in the host portion of the subnet address The first host is all 0’s and a 1 in the host portion of the subnet address. The last host is all 1’s and a 0 in the host portion of the subnet address. Network Portion Subnet Portion Host Portion Rick Graziani graziani@cabrillo.edu 16 Subnet: Determine the number of usable hosts • By counting the number of host bits we can determine the total number of usable hosts for this subnet. Host bits: 6 Total number of hosts: 26 = 64 64 – 2 = 62 (Can’t use the all 0’s address, network address, or the all 1’s address, broadcast address.) SD Network Portion Rick Graziani graziani@cabrillo.edu Subnet Portion Host Portion 17 Subnet: Determine the number of usable subnets • • • By counting the number of subnet bits we can determine the total number of usable hosts for this subnet. Subnet bits: 10 Total number of hosts: 210 = 1,024 1,024 – (0, 1, or 2) = ? 1,024 – 1 = 1,023 usable subnets The number of usable subnets depends upon whether or not we can use the first and/or last subnets. In today’s networks, both the first and last subnets are generally usable. In this example, the network administrator has determined the last subnet is not to be used. MD Network Portion Rick Graziani graziani@cabrillo.edu Subnet Portion SD Host Portion 18 Overall Visual • • • • The subnet address has all 0’s in the host portion of the subnet address The broadcast address has all 1’s in the host portion of the subnet address The first host is all 0’s and a 1 in the host portion of the subnet address. The last host is all 1’s and a 0 in the host portion of the subnet address. Rick Graziani graziani@cabrillo.edu 19 Overall Visual The following information must be provided: • IP Address (host or network) • Major Network Mask If subnetted: • Subnet Mask • Number of usable subnets (less 0, 1, or 2) Rick Graziani graziani@cabrillo.edu 20 Notes Quick check • First host: 1 more than network/subnet address • Last host: 1 less than broadcast • Does the host IP address fall in the range of network host addresses? Of subnet host addresses? How do hosts view the network? • Hosts receive a host IP address and mask. • Hosts only see themselves as part of their subnet (or network if not subnetted). • They don’t know or care if they are in a network or subnet. • Almost all networks are a subnet of some larger network. NAP (Network Access Point) Network Service Provider Regional Service Provider ISP Subscribers ISP Subscribers Rick Graziani graziani@cabrillo.edu ISP Subscribers Network Service Provider Regional Service Provider Regional Service Provider ISP ISP Subscribers Subscribers Regional Service Provider ISP Subscribers ISP Subscribers ISP Subscribers 21 See these spreadsheets on my website Nutshell: Classless Subnetting in a Nutshell (Excel spreadsheet) Worksheet: Classless Subnetting Worksheet (Excel spreadsheet) Rick Graziani graziani@cabrillo.edu 22 Tips • • • • Use worksheets Don’t do short-cuts unless you understand the process we just discussed and you know what you are doing. Only use a subnet calculator to check your answers. – You must know how to subnet, then you can use the calculator. – Interviews, exams, and certification exams do not allow subnet calculators. Practice, practice, practice! Rick Graziani graziani@cabrillo.edu 23 Classless Subnetting Using the Worksheet CIS 81 and CST 311 Rick Graziani Fall 2006