Subnetting Workshop SARA AKERS SEPTEMBER 2014
Disclaimer If you notice any mistakes with any of the slides, please let me know so I can correct. Thank you! Sara Akers
SUBNETTING
Class A ( ) – Default subnet mask for a Class A is or /8 The IP address would split up Network vs Host bits like this: NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHHHHH (See subnet mask in Title – Since it is a /24 subnet mask, the first 24 bits are on (1) – thus network bits) I only have 8 host bits to work with. I cannot use Network Bits already taken. Therefore, I cannot use I can only use the host bits when subnetting. In my network, I need at least 8 host addresses per network. (8 is a variable number depending on your network) _ _ _ _ _ _ _ _Count host bits from the right to left; network bits from the left to rt I can get 2 hosts in the first bit from the right (a 0 or a 1) So to get 8 host addresses – my line goes here: | 8 4 2However, we need to add 2 more hosts for Broadcast and Network Address – so I really need 10 hosts - thus my line goes here: |
_ _ _ _ | _ _ _ _ So everything to the left of the line is now a Network bit and everything to the right of the line is a Host bit NNNNHHHH (Giving me approximately 16 Network Address and 16 Host Addresses) I want to solve for Subnet 3. Subnet 0 would look like this: |0000 /28 Subnet 3 would look like this: /28 How did I get this? | - Remember I am only working with the network bits to the left of the line. So I use the standard Binary-Decimal conversion of 128, 64, 32, 16, 8, 4, 2, 1 (for a byte) Since I only have 4 network bits to work with, I only use 8, 4, 2, 1. To get Subnet 3 – 0 for the 8 bit, 0 for the 4 bit, 1 for the 2 bit, 1 for the 1 bit.
/28 What is the IP address now? I need to look at the whole byte. So convert from binary to decimal the following byte – (as shown above) Using the Binary to Decimal conversion of 128, 64, 32, 16, 8, 4, 2, 1: (32+16 = 48) This is the network address for subnet 3. The subnet mask would be a count (Binary to Decimal) of all network bits. In our example the network bits are: NNNNNNNN.NNNNNNNN.NNNNNNNN.NNNNHHHH or = or /28 (/28 is a count of all network bits turned on) The 1 st available IP Address for our hosts would look like this in binary: (This is our network address) 0001 (Host address) =
/28 Our last IP address would be all Host bits turned on (except the last one) or: (This is our network address) 1110 (Host address) = The broadcast address would be all Host bits turned on or: (This is our network address) 1111 (Host address) =
Network Address: Subnet Mask: or /28 1 st Available IP Address: Last Available IP Address: Broadcast Address: On to the next problem?
Try solving for: I need at least 3 subnets. Solve for Subnet 1.
Class A ( ) – Default subnet mask for a Class A is or /8 The IP address would split up Network vs Host bits like this: NNNNNNNN.NNNNNNNN.HHHHHHHH.HHHHHHHH (See subnet mask in Title – Since it is a /16 subnet mask, the first 16 bits are on (1) – thus network bits) I have 16 host bits to work with. I cannot use Network Bits already taken. Therefore, I cannot use I can only use the host bits when subnetting. In my network, I need at least 3 subnet addresses per network. (8 is a variable number depending on your network) 56.2._ _ _ _ _ _ _ _._ _ _ _ _ _ _ _Count host bits from the right to left; network bits from the left to rt …I can get 2 network bits in the first bit from the left to right (a 0 or a 1) So to get 3 subnet (network) addresses – my line goes here: | …
_ _ | _ _ _ _ _ _. _ _ _ _ _ _ _ _ So everything to the left of the line is now a Network bit and everything to the right of the line is a Host bit NNHHHHHH.HHHHHHHH (Giving me approximately 4 Network Address and Host Addresses) I want to solve for Subnet 1. Subnet 0 would look like this: | /18 Subnet 1 would look like this: | /18 How did I get this? 2 1 | - Remember I am only working with the network bits to the left of the line. So I use the standard Binary-Decimal conversion of 128, 64, 32, 16, 8, 4, 2, 1 (for a byte) Since I only have 2 network bits to work with, I only use 2, 1. To get Subnet 1 –0 for the 2 bit, 1 for the 1 bit.
/18 What is the IP address now? I need to look at the whole byte. So convert from binary to decimal the following byte – (as shown above) Using the Binary to Decimal conversion of 128, 64, 32, 16, 8, 4, 2, 1: This is the network address for subnet 1. The subnet mask would be a count (Binary to Decimal) of all network bits. In our example the network bits are: NNNNNNNN.NNNNNNNN.NNHHHHHHHH.HHHHHHHH or = or /18 (/18 is a count of all network bits turned on) The 1 st available IP Address for our hosts would look like this in binary: (This is our network address) (Host address) =
/18 Our last IP address would be all Host bits turned on (except the last one) or: (This is our network address) (Host address) = The broadcast address would be all Host bits turned on or: (This is our network address) (Host address) =
Network Address: Subnet Mask: or /18 1 st Available IP Address: Last Available IP Address: Broadcast Address:
ANDing ANDing is the process a router uses to determine the network address for a packet. Which interface should this packet go out? It takes the destination address and adds it to the subnet mask to determine the number address destination address + subnet mask = network address For example, let’s and a packet going to /24. Which network does this belong to? To determine this I need to convert from decimal to binary.
/ Destination Address Subnet Mask Network Address How did I get this? 0+0=0 0+1=0 1+0=0 1+1=1 Then convert the Network address back to decimal to get – Now the router “knows” which network this packet belongs and can send it out the appropriate interface.
/ Destination Address Subnet Mask Network Address How did I get this? 0+0=0 0+1=0 1+0=0 1+1=1 Then convert the Network address back to decimal to get –
/ Destination Address Subnet Mask Network Address How did I get this? 0+0=0 0+1=0 1+0=0 1+1=1 Then convert the Network address back to decimal to get –
VLSM VLSM or Variable Length Subnet Mask is a more efficient way to subnet a network. You do not waste as many IP addresses. Let’s look at this picture of our network: Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts So in our picture above: LAN - Sydney needs 30 hosts LAN – Melbourne needs 30 hosts LAN – Perth needs 30 hosts LAN – Brisbane needs 60 hosts WAN – Connection between Sydney and Melbourne (2 host addresses – one for each router connection) WAN – Connection between Melbourne and Perth (2 host addresses) WAN – Connection between Perth and Brisbane (2 host addresses) WAN – Connection between Brisbane and Sydney (2 host addresses)
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts In VLSM – always solve for the most networks down to the least networks. Let’s say we were given the IP address How would we use this address to subnet for all the networks shown in the picture? (4 LAN and 4 WAN) Starting with the “most networks” we would first solve for the LAN Brisbane network which needs 60 host addresses Remember we can only work with host bits to subnet; we cannot use network bits already used. So all we have to work with are the last 8 host bits (See Subnet Mask – which determines this)
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts LAN Brisbane needs 60 hosts from IP Address / _ _ _ _ _ _ _ _Count host bits from the right; network bits from the left I can get 2 hosts in the first bit from the right (0 or 1) So to get 60 host addresses – my line goes here: | NN | HHHHHH In VLSM – start with subnet 0
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts LAN - BRISBANE 60 hosts NN | HHHHHH In VLSM – start with subnet 0 So the network address is: | or The subnet mask is: or or /26 The first IP host address to assign is: | or The last IP host address to assign is: | or The broadcast address for this network is: | or Since our next largest network is either LAN – Sydney, LAN-Melbourne, or LAN-Perth, we can do these in any order.
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts LAN – SYDNEY 30 hosts NNN | HHHHH In VLSM – start with subnet 0; Already used; Now let’s use Subnet 1: So the network address is: | 00000or The subnet mask is: or or /27 The first IP host address to assign is: | 00001or The last IP host address to assign is: | 11110or The broadcast address for this network is: | 11111or
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts LAN – MELBOURNE 30 hosts NNN | HHHHH So the network address is: | 00000or The subnet mask is: or or /27 The first IP host address to assign is: | 00001or The last IP host address to assign is: | 11110or The broadcast address for this network is: | 11111or
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts LAN – PERTH 30 hosts NNN | HHHHH So the network address is: | 00000or The subnet mask is: or or /27 The first IP host address to assign is: | 00001or The last IP host address to assign is: | 11110or The broadcast address for this network is: | 11111or
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts WAN – Sydney to Melbourne - 2 hosts needed (one for each router on each end) NNNNNN | HH So the network address is: | 00or The subnet mask is: or or /30 The first IP host address to assign is: | 01or The last IP host address to assign is: | 11or The broadcast address for this network is: | 11or
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts WAN – Melbourne to Perth- 2 hosts needed (one for each router on each end) NNNNNN | HH So the network address is: | 00or The subnet mask is: or or /30 The first IP host address to assign is: | 01or The last IP host address to assign is: | 10or The broadcast address for this network is: | 11or
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts WAN –Perth to Brisbane- 2 hosts needed (one for each router on each end) NNNNNN | HH So the network address is: | 00or The subnet mask is: or or /30 The first IP host address to assign is: | 01or The last IP host address to assign is: | 10or The broadcast address for this network is: | 11or
Brisbane Sydney Melbourne Perth 30 hosts 60 hosts 30 hosts WAN –Brisbane to Sydney - 2 hosts needed (one for each router on each end) NNNNNN | HH So the network address is: | 00or The subnet mask is: or or /30 The first IP host address to assign is: | 01or The last IP host address to assign is: | 10or The broadcast address for this network is: | 11or
VLSM Network for Australia ConnectionNetwork Address LAN Brisbane /26 LAN Sydney /27 LAN Melbourne /27 LAN Perth /27 WAN Sydney to Melbourne /30 WAN Melbourne to Perth /30 WAN Perth to Brisbane /30 WAN Brisbane to Sydney /30 Notice the subnet mask varies thus VLSM (Variable Length Subnet Mask)