VLSM
VLSM occurs when an internetwork uses more than one mask in different subnets of a single Class A, B, or C network. VLSM allows engineers to reduce the number of wasted IP addresses in each subnet, allowing more subnets and avoiding having to obtain another registered IP network number from regional IP address assignment authorities.
At this stage, I actually took a little bit of time to re-remember subnetting. Had to brush back up on it.
A common VLSM mistake is thinking “using more than one mask” rather than “using more than one mask in a single classful network”.
Classless and Classful Routing Protocols
For a routing protocol to support VLSM, it must advertise not only the subnet number but also the subnet mask when advertising routes. A routing protocol must include subnet masks in its routing updates to support manual route summarization.
Each IP routing protocol is considered to be either classless or classful, based on whether the routing protocol does (classless) or does not (classful) send the mask in routing updates. All routing protocols are either classless or classful.
| Routing Protocol | Is It Classless? | Sends Mask in Updates | Supports VLSM | Supports Manual Route Summarization |
|---|---|---|---|---|
| RIP-1 | No | No | No | No |
| IGRP | No | No | No | No |
| RIP-2 | Yes | Yes | Yes | Yes |
| EIGRP | Yes | Yes | Yes | Yes |
| OSPF | Yes | Yes | Yes | Yes |
Overlapping VLSM Subnets
Subnets chosen to be used in an IP internetwork design must not overlap their address ranges. With a single subnet mask in a network, the overlaps are obvious; however, with VLSM, the overlapping subnets might not be as obvious. When multiple subnets overlap, a router’s routing table entries overlap. As a result, routing becomes unpredictable, and some hosts can be reached from only particular parts of the internetwork. In short, a design that uses overlapping subnets is considered to be an incorrect design, and should not be used.
The two types of problems that relate to overlapping VLSM subnets are analyzing an existing design to find overlaps and choosing new VLSM subnets so that you do not create an overlapped subnet.
To determine whether subnets overlap:
Step 1: Calculate the subnet number and subnet broadcast address of each subnet; this gives you the range of addresses in that subnet.
Step 2: Compare the ranges of addresses in each subnet and look for cases in which the address ranges overlap.
Designing a Subnetting Scheme Using VLSM
To design the IP addressing scheme for a new internetwork by choosing IP subnets when using a single subnet mask throughout a classful network involves several steps. The process first analyzes the design requirements to determine the number of subnets and the number of hosts in the largest subnet. Then, a subnet mask is chosen. Finally, all possible subnets of the network, using that mask, are identified, and then the actual subnets used in the design are picked from that list.
When using VLSM in a design, the process starts by deciding how many subnets of each size are required. Prefix lengths refer to the amount of numbers in the CIDR notation. The more numbers, the longer the prefix lengths.
After the number of subnets with each mask has been determined, the next step is to find subnet numbers that match those requirements.
Step 1: Determine the number of subnets needed for each mask/prefix based on the design requirements.
Step 2: Using the shortest prefix length, identify the subnets of the classful network when using that mask, until the required number of such subnets has been identified.
Step 3: Identify the next numeric subnet number using the same mask as in the previous step.
Step 4: Starting with the subnet number identified at the previous step, identify smaller subnets based on the next-longest prefix length required for the design, until the required number of subnets of that size have been identified.
Step 5: Repeat Steps 3 and 4 until all subnets of all sizes have been found.
By allocating the larger subnets first, then the smaller subnets, you can generally choose subnets so that the address ranges do not overlap.
Adding a New Subnet to an Existing Design
Another task required when working with VLSM-based internetworks is to choose a new subnet number for an existing internetwork. Extra care must be taken when choosing new subnet numbers to avoid causing an overlap between the new subnet and any existing subnets.
Use the following steps to do so:
Step 1: If not already listed as part of the quest, pick the subnet mask based on the design requirements, typically based on the number of hosts needed in the subnet.
Step 2: Calculate all possible subnet numbers of the classful network, using the mask determined at Step 1.
Step 3: For all subnets found at Step 2, calculate the subnet broadcast address and range of addresses for each assumed subnet.
Step 4: Compare the lists of potential subnets and address ranges to the existing subnets and address ranges. Rule out any of the potential subnets that overlap with an existing subnet.
Step 5: Pick a subnet number from the list found at Step 2 that does not overlap with any existing subnets, noting whether the question asks for the smallest or largest subnet number.
VLSM Configuration
Routers do not enable or disable VLSM as a configuration feature. VLSM is simply a side effect of the ip address interface subcommand. Routers configure VLSM by virtue of having at least two router interfaces, on the same router or among all routers in the internetwork, with IP addresses in the same classful network but with different masks. Support for VLSM is a feature inherent to classless routing protocols.
Manual Route Summarization
As routing tables grow, they consume memory on a router. Larger routing tables will slow down routing, as searching a larger routing table simply takes longer. Large routing tables take more time to troubleshoot, as well.
Route summarization reduces the size of routing tables while maintaining routes to all the destinations in the network. Summarization improves convergence time, because the router that summarizes the route no longer has to announce any changes to the status of the individual subnets. By advertising only that the entire summary route is either up or down, the routers that have the summary route do not have to reconverge every time one of the component subnets goes up or down.
Route Summarization Concepts
Route summarization causes more-specific routes to be replaced with a single route that includes all of the IP addresses covered by the subnets in the original routes.
Route summarization works better when the network was designed with it in mind.
Route summarization configuration differs with different routing protocols. ip summary-address is an interface subcommand that defines a new summarized route that advertises routes out an interface and doesn’t advertise any routes contained in the larger summary.
Routes referring to an outgoing interface of the null0 interface mean that packets matching this route are discarded.
Route Summarization Strategies
Some summarized routes combine many routes into one route, but that might not be the best summarization. The best summarization means that the summary should include all the subnets specified in the question but as few other addresses as is possible.
The following list describes a generalized binary process by which you can find a best summary route for a group of subnets:
Step 1: List all to-be-summarized subnet numbers in binary.
Step 2: Find the first N bits of the subnet numbers for which every subnet has the same value, moving from left to right.
Step 3: To find the summary router’s subnet number, write down the in-common bits from Step 2 and binary 0s for the remaining bits. Convert back to decimal, 8 bits at a time, when finished.
Step 4: To find the summary route’s subnet mask, write down N binary 1s, with N being the number of in-common bits found at Step 2. Complete the subnet mask with all binary 0s. Convert back to decimal, 8 bits at a time, when finished.
Step 5: Check your work by calculating the range of valid IP addresses implied by the new summary route, comparing the range to the summarized subnets. The new summary should encompass all IP addresses in the summarized subnets.
By looking at the subnets in binary, you can easily discover the bits in common among all the subnet numbers. By using the longest number of bits in common, you can find the best summary. To refresh on this: Read example on page 216, 217.
Autosummarization and Discontiguous Classful Networks
Because classful routing protocols do not advertise subnet mask information, the routing updates simply list subnet numbers but no accompanying mask. A router receiving a routing update with a classful routing protocol looks at the subnet number in the update, but the router must make some assumptions about what mask is associated with the subnet. Classful routing protocols require a static-length subnet mask (SLSM) throughout each classful network so that each router can then reasonably assume that the mask configured for its own interfaces is the same mask used throughout that classful network. When a router has interfaces in more than one Class A, B, or C network, it can advertise a single route for an entire Class A, B, or C network into the other classful network. This feature is called autosummarization and is described as follows:
When advertised on an interface whose IP address is not in network X, routes related to subnets in network X are summarized and advertised as one route. That route is for the entire Class A, B, or C network X.
Classful routing protocols expect autosummarization to occur.
Discontiguous Classful Networks
Autosummarization does not cause any problems as long as the summarized network is contiguous rather than discontiguous.
* Contiguous network: A classful network in which packets sent between every pair of subnets can pass only through subnets of that same classful network, without having to pass through subnets of any other classful network.
* Discontiguous network: A classful network in which packets sent between at least one pair of subnets must pass through subnets of a different classful network.
Autosummarization prevents an internetwork with a discontiguous network from working properly. Autosummarization would cause load balancing to occur if s0/0 and s0/1 were both pointing to a 10.* network. Which is bad if you don’t want to load balance, as autosummarization assumes 10.0.0.0/8.
The solution to this problem is to disable the use of autosummarization. Because classful routing protocols must use autosummarization, the solution requires migration to a classless routing protocol and disabling the autosummarization feature.
Autosummarization Support and Configuration
Some classless routing protocols support autosummarization, defaulting to use it, but with the ability to disable it with the no autosummary router subcommand.
| Routing Protocol | Classless? | Supports Autosummarization | Defaults to Use Autosummarization? | Can Disable Autosummarization? |
|---|---|---|---|---|
| RIP-1 | No | Yes | Yes | No |
| RIP-2 | Yes | Yes | Yes | Yes |
| EIGRP | Yes | Yes | Yes | Yes |
| OSPF | Yes | No | - | - |
Autosummary impacts routers that directly connect to parts of more than one classful network, but it has no impact on routers whose interfaces all connect to the same single classful network.