Introduction to Networking (Yarnfield) Classful subnetting
Objective To cover the subnetting process Be able to subnet from a variety of information
Subnetting The process of dividing a network up into subnets and to assign each subnet a valid network IP address, and the hosts on that subnet valid IP addresses Subnet 2 Subnet 1 Subnet 3
We need to find out How many subnets does the subnet mask provide? How many valid hosts per subnet are available? What are the valid subnets? What is the broadcast address of each subnet? What are the valid hosts in each subnet?
We need An IP address to subnet And The number of subnets we wish to make Or The subnet mask The number of borrowed bits
Example 192.5.5.35 255.255.255.224
Example IP address: 192.5.5.35 Subnet mask: 255.255.255.224 Work out Network ID Class Major network address Major broadcast address First host of the major network Last host of the major network Class C 192.5.5.0 192.5.5.255 192.5.5.1 The network ID class is determined by observing the FIRST octet. Bear in mind the following: 1-126 = Class A 128 - 191 = Class B 192 - 223 = Class C The major broadcast address is the very last address in the network. The address of the first host on the network is always immediately AFTER the network address. The address of the last host on the network is always immediately BEFORE the network broadcast address. 192.5.5.254
Example IP address: 192.5.5.35 Subnet mask: 255.255.255.224 Now we need to work out the subnet information Number of subnet bits Number of host bits Subnet address for the given host IP address Range of host addresses for this subnet Broadcast address for this subnet 3 subnet bits 5 host bits 192.5.5.32 To determine the number of subnet bits you must convert the last octet of the subnet mask to its binary equivalent and count the number of one’s (or ON bits). 224 in binary is 11100000, therefore there are three one’s, meaning we have used three bits to create subnets with. To determine the number of host bits you must convert the last octet of the subnet mask to its binary equivalent and count the number of zeroes (or OFF bits). 224 in binary is 11100000, therefore there are five zeroes, meaning we have five bits to create host addresses with. To determine the subnet address for the given IP address we first subtract the value of the last octet from 256. In our example 256-224=32. This is called the block value. To determine the other subnets in the scheme we add to block value to the PRECEEDING subnet address. Therefore our subnet addresses will be: 0+32=32 32+32=64 64+32=96 96+32=128 128+32=160 160+32=192 *Note* that we start at 0; this indicates the major network address. Also, we stop at 192. This is because if we continue 192+32=224 which is our subnet address. We cannot use this as one of our sub networks. Once we have worked out our subnets we simply observe where our given IP address falls within the scheme. Our example is 192.5.5.35. This is greater than 32, and less than 64, so the subnet address for our given IP address is 192.5.5.32. The range of host addresses for the subnet can be determined once you have completed the above step. The range always starts immediately after the subnet address, and ends immediately before the broadcast address. In our example, 192.5.5.32 is the subnet address, so our beginning of range is 192.5.5.33. The end of range will be 192.5.5.62 as 192.5.5.63 is the broadcast address, and 192.5.5.64 is the next subnet address. The broadcast address is the address immediately before the next subnet. If our example subnet is 192.5.5.32 and the block size is 32, the next subnet will be 129.4.4.64. The address immediately before this subnet address is therefore 192.5.5.63, which will be used as the broadcast address for the 192.5.5.32 subnet. 192.5.5.33 – 192.5.5.62 192.5.5.63
Example IP address: 192.5.5.35 Subnet mask: 255.255.255.224 Now we need to find other subnet information Total number of useable subnets Number of valid host IP addresses per subnet Convert given subnet mask to binary Convert given host IP address to binary Subnetwork address with slash (/) mask for the assigned subnet 6 30 11111111.11111111.11111111.11100000 To determine the total number of useable subnets we use the formula 2n-2 where n refers to the number of borrowed bits (or put another way, the number of bits that are turned on, i.e. 1). In our example we have borrowed three bits, so 23-2=6. We have to take 2 away because this refers to the major network address and the subnet mask, which we can’t use. To determine the number of valid host IP addresses we use the formula 2n-2. This time n refers to the bits we have not borrowed (or put another way, the number of bits that are turned off, i.e. 0) In our example we borrowed 3 bits, therefore we have 5 bits left. So 25-2=30. Once again we have to take 2 away from our answer because this refers to the subnet address and the broadcast address, which we cannot use. To convert the given subnet mask to binary and the given host IP address to binary you simply perform a decimal to binary conversion. The subnetwork address with a slash (/) is simply a way to represent and IP address and its subnet mask conveniently without having to write the subnet mask. The number following the slash is simply the number of bits that are turned on (1’s) in the subnet mask. In our example our subnet mask is 255.255.255.224 which is 11111111.11111111.11111111.11100000 in bianry and if you count the 1’s is 27 one’s. So the format would be 192.5.5.35 / 27 11000000.00000101.00000101.00100011 192.5.5.32 / 27
Exercise IP address 202.168.2.40 Subnet mask 255.255.255.240 Find out: Network ID Class Major network address Major broadcast address First host of the major network Last host of the major network Number of subnet bits Number of host bits Subnet address for the given host IP address Range of host addresses for this subnet Broadcast address for this subnet Total number of useable subnets Number of valid host IP addresses per subnet Convert given subnet mask to binary Convert given host IP address to binary Subnetwork address with slash (/) mask for the assigned subnet
Questions... ... are there any?