Unit Home Info Notes Assigns Quiz Activity


BTEC-Cisco Routing, Switching & Virtual LANs

  
 
 

 Chapter 1 - Introduction to Classless Routing


Variable Length Subnet Masks

These notes describe how to calculate variable length subnet masks.

Introduction

Fixed Length Subnets

Variable Length Subnet Masks

Exercises

Summary

 
 

Introduction

These notes demonstrate the advantage of dividing a network into variable length subnets over standard fixed sized subnets.

On completion of these notes you should be able to...

  • Understand the advantage of VLSM over fixed sized subnetting
  • Divide a network into variable length subnets
 

Fixed Length Subnetting

A corporate network with the network address of 206.12.10.0/24 is shown below. The network administrators plan to create separate 5 subnets. The requirements of each subnet are as follows:-

  • Net A requires 30 hosts
  • Net B requires 20 hosts
  • Net C requires 10 hosts
  • Each WAN connection requires 2 IP addresses on separate subnets

The first step in the subnet design process is to calculate the the maximum number of subnets required and then roundup to the nearest power of 2. Since, 5 subnets are needed, then the nearest power of 2 that will give enough subnets is 23 = 8.

But, will this give enough host address space for the largest subnet? Since 3 bits need to be borrowed from the last octet for subnetting, then this leaves 5 bits for the host addresses. This means the maximum number of hosts in each subnet can be 25-2 = 32 hosts. Remember, 2 has to be subtracted to allow for the subnet and broadcast address.

So, splitting the network address space into 8 subnets allows for up to 32 hosts in each subnet, which is adequate for the purpose. We will have...

Subnet Number
Subnet Address
0
       206.12.10.0/27
1
       206.12.10.32/27
2
       206.12.10.64/27
3
       206.12.10.96/27
4
       206.12.10.128/27
5
       206.12.10.160/27
6
       206.12.10.192/27
7
       206.12.10.224/27

Now, with classful routing, subnet 0 and subnet 7 cannot not be used. Why? - because there would be no way to tell the difference between the network address and subnet 0's address and also the network's broadcast address and subnet 7's broadcast address. However, with classless routing, it is possible to use subnet 0 if the ip subnet-zero command is appropriately set on a router.

So, for the corporate network above we can have...

  • Net A requiring 30 hosts on subnet 0 (there will be room for 2 more hosts)

  • Net B requiring 20 hosts on subnet 1 (there will be room for 12 more hosts)

  • Net C requiring 10 hosts on subnet 2 (there will be room for 22 more hosts)

  • WAN Link 1 requiring 2 addresses on subnet 3 (30 addresses are wasted )

  • WAN Link 2 requiring 2 addresses on subnet 4 (30 addresses are wasted )

  • A spare subnet on subnet 5 (with room for 32 hosts)

  • A spare subnet on subnet 6 (with room for 32 hosts)

Although all this seems reasonable, the design is inefficient. It is good that there are two spare subnets allowing for future expansion. However, it is not so good that subnet 0 and subnet 1 are almost full up. Moreover, there is a distinct wastage of addresses in subnet 3 and subnet 4 which will always be 2-node networks. Think about it, there are 60 valuable addresses stuck in those two subnets that cannot be used

There are various ways of overcoming address wastage. For example, the 2-node point-to-point WAN links could be addresses using private addressing. Another way of improving the efficiency of subnet design is to use variable length subnet masks, (VLSM.)

 

Variable Length Subnet Masks

Variable length subnet masks allow an organisation to use different subnet masks within a single network. In other words - to subnet a subnet. This means that IP addresses can be allocated more efficiently and with less waste.

Let's consider the same corporate network again:-

The previous subnet design was adequate but caused unacceptable loss of addresses due to the fixed size of each subnet. So I would like to think about the subnet design again. Suppose it were possible to divide the network so that the subnet sizes could vary. Perhaps we could...

  • Provide a 64 address subnet for Net A
  • Provide a 32 address subnet for Net B
  • Provide a 16 address subnet for Net C
  • Provide a 4 address subnet for each WAN link

This would be an efficient division of the network address space and would also allow for future expansion. Suppose we were to first divide the network into 4 subnets by borrowing 2 bits from the last octet of the Class C address.

22 = 4 subnets

26-2 = 62 useable hosts addresses

We would have...

Subnet Number
Subnet Address
0
       206.12.10.0/26
1
       206.12.10.64/26
2
       206.12.10.128/26
3
       206.12.10.192/26

Net A could go into subnet 0 and Net B could go into subnet 1. This is shown in the diagram below:-

This would leave plenty of room for Net A to expand since 30 host addresses would be required immediately, leaving 32 spare for future expansion. However, Net B needs only 20 hosts at the present, leaving 42 spare addresses. This seems rather a lot of spare addresses! Maybe subnet 1 could be used more efficiently?

What if we could divide subnet 1into 2 parts, half for Net B and half for Net C?

This is possible using VLSM. If subnet 1 were to be divided into two then each half would contain 32 total addresses. This would be equivalent of originally dividing up the whole network into eight subnets, I.e.

23 = 8 subnets

25 = 32 addresses of which 30 are useable

Examine the adjusted diagram below and you should see what I mean.

You may wonder why the subnet addresses for Net B and Net C have a new prefix of/27 instead of /26 like Net A. Well, imagine I had divided up the whole network into eight subnets, then this would have meant borrowing 3 bits from the last octet of the Class C address and the so the CIDR prefix would be /27.

Let's get back to the subnet design. We still need subnets for the two WAN links. These are point-to-point links requiring 2 useable addresses each. What if we could divide the Net C subnet into 2 parts, keeping half for Net C and half for the WAN links? Each half would contain 16 total addresses and one half would certainly be sufficient for Net C.

The other half, containing 16 addresses could be divided even further into four smaller subnets, each containing 4 addresses each. Two of these small subnets could be used for the WAN links and the other two subnets could be held in reserve. Examine the adjusted diagram below and you should see what I mean.

Again, you may wonder why the prefix for Net C has changed from /27 to /28. Well, imagine I had divided up the whole network into 16 subnets, each containing 16 addresses, then this would have meant borrowing 4 bits from the last octet of the Class C address and the so the CIDR prefix would be /28.

Why has the subnet prefix for each WAN link changed to /30? Each WAN link contains 4 addresses. This is as if I had divided up the whole network into 64 subnets, each containing 4 addresses. This would have meant borrowing 6 bits from the last octet of the Class C address and the so the CIDR prefix would be /30. I.e.

26 = 64 subnets

22 = 4 addresses of which 2 are useable

Here's how the subnets look in more tabular form...

This division of the total address space into subnets of variable size leads to a more efficient and flexible subnet design solution. For this particular network, there are a few different ways to divide the network using VLSM and I have illustrated just one solution. The use of VLSM has maximized the number of addresses and eliminated the waste from two point-to-point WAN links using a /27 subnet each.

Although there may be a variety of VLSM subnetting solutions for a particular network, the challenge is to choose the best division and sub-divisioning solution to meet an organisation's present and future needs.

~Now try the activity~

 Activity A
  1. Using VLSM, divide the network as efficiently as possible to meet the following requirements:-
  • A subnet for LAN A with at most 62 useable addresses
  • A subnet for LAN B with at most 30 useable addresses
  • A separate subnet for the WAN link

You can check your answers here

 

Exercises

Here are some more exercises.

 Activity B
  1. Using VLSM, divide the network shown below as efficiently as possible to meet the following requirements:-
  • A subnet for Net A with at most 126 useable addresses
  • A subnet for Net B with at most 62 useable addresses
  • A subnet for Net C large enough for 25 IP addresses
  • A subnet for Net D large enough for 10 IP addresses
  • A separate subnet for the WAN link

You can check your answers here

 

Summary

On completing these notes you should:-

  • understand the advantage of VLSM over fixed sized subnetting
  • be able to divide a network into variable length subnets
 


 

Site Home

Top

Unit Home


   

BTEC National Diploma
  

 

Folder101 Home

 

   
This Unit 

Unit Information

Assessment

Syllabus

Scheme of Work

Learning Resources

Notes & Lessons

Assignments

Quizzes

Activities

Resources

Books & Things

Links