Introduction to Networking (Yarnfield) Variable Length Subnet Masking (VLSM)
Objectives Define VLSM Describe the difference between classful subnetting Describe the advantages of VLSM Be able to perform VLSM operations on give IP addresses
Classful subnetting exercise Find The first five subnet addresses First host, last host and broadcast of each subnet Default gateway How many subnets can be made? How many hosts per subnet?
VLSM defined More than one subnet mask Using classful subnetting wastes IP addresses Why? – – – – –
We need An IP address to perform VLSM on The number of hosts involved in each part of the network
We will... Create a number of subnet masks that suit our needs more efficiently than a classful subnetting scheme could
Example using a Class C network address 120 hosts 60 hosts 30 hosts
Process 1. Find the segment with the largest number of hosts connected to it 2. Find an appropriate subnet mask for the largest segment 3. Write down the subnet addresses to fit the subnet mask 4. Take one of the newly created subnet addresses and apply a new subnet mask to it that is more appropriate 5. Write down the subnet addresses to fit the new subnet mask 6. Repeat from step 4 for smaller segments
Example continued 1. Find the segment with the largest number of hosts connected to it In the example the largest segment has 120 hosts connected so we must start with this segment To accomodate120 hosts we need to use 7 bits from the host portion of the address ( = 126)
Example continued 2. Find an appropriate subnet mask for the largest segment If we have borrowed 7 bits for our hosts the subnet mask (in binary) will be Convert this to decimal and we get
Example continued 3. Write down the subnet addresses to fit the subnet mask Now we need to find the subnet addresses that this subnet mask will create 256 – 128 = 128 Therefore the subnets would be and (remember we can now use subnet zero!) We can now assign /25 to accommodate the 120 segment and have to use for the other two segments
120 hosts (126 in total) /25 60 hosts (62 in total) 30 hosts (30 in total)
Example continued 4. Take one of the newly created subnet addresses and apply a new subnet mask to it that is more appropriate We still have two segments to deal with and we have a new subnet address to work with of We must start with the larger segment, which has 60 hosts To accommodate 60 hosts we need to borrow 6 bits from the host portion of the given IP address 2 6 – 2 = 62 hosts This will give us a subnet mask of which is the same as
Example continued 5. Write down the subnet addresses to fit the new subnet mask Now we need to find the subnet addresses that this subnet mask will create 256 – 192 = 64 Therefore the new subnet addresses would be and We can now use /26 for the segment with 60 hosts
120 hosts (126 in total) /25 60 hosts (62 in total) /26 30 hosts (30 in total)
Example continued 4. Take one of the newly created subnet addresses and apply a new subnet mask to it that is more appropriate We still have the segment with 30 hosts to deal with We work this out in the same way as before To accommodate 30 hosts we need to borrow 5 bits from the host portion of the IP address 2 5 – 2 = 30 hosts This will give us a subnet mask of which is
Example continued 5. Write down the subnet addresses to fit the new subnet mask Now we need to find the subnet addresses that this subnet mask will create 256 – 224 = 32 Therefore the new subnet addresses would be and We can now use /27 for the segment with 30 hosts We still have the new subnet which could be used for future growth
Result 120 hosts (126 in total) /25 60 hosts (62 in total) /26 30 hosts (30 in total) /
Summary To determine the number of hosts a subnet can support use the formula 2 n – 2 Always start the process with the segment with the largest amount of hosts to accommodate Classless subnetting deals with the hosts as opposed to classful subnetting which deals more with subnets
Exercise /24 7 remote sites, 30 hosts each P to P links between routers Remote A 30 hosts Remote B 30 hosts Remote C 30 hosts Remote D 30 hosts Remote E 30 hosts Remote F 30 hosts Remote G 30 hosts Central
Exercise Backbone 126 hosts 6 hosts 30 hosts
Questions... ...are there any?