A scalable routing protocol should be able to handle IP address challenges such as

• routing to a non-local
  address
|
• understanding non-
  standard prefix lengths
|
It should also support hierarchical topology.
|
IP routers make decisions based on hierarchical addressing.
|
An IP address consists of a prefix part and a host part.
|
Routers use the prefix to determine the path for a destination address that is not local.
|
The host part is used to reach local hosts.
|
A prefix identifies a block of host numbers and is used for routing to that block.
|
IP addresses contain the information needed to determine which part of the address "the leftmost contiguous bits" - should be treated as the prefix.
|
In other words, IP routers and other devices must work out how many bits from the left of a binary IP address should be treated as the prefix. 
|
Traditionally this was done using an indication of the address class and a subnet mask.
|
The original IP specification, RFC 760, did not use prefixes of a standard length (address classes).
|
The network number was defined as the first eight bits, or octet, of the address.
|
This limited the number of networks that could have a unique prefix to 254.
|
The maximum number is 254 because a 'full' octet - 11111111 binary  - equals 255 decimal.

An octet of zeros could not be allowed, or an octet of ones, reducing the number by 1 to 254.
|
A new system of addressing was introduced when the number of networks on the Internet approached 254, threatening to collapse the system.
|
This new system is known as classful addressing.
|
Classful addressing is specified in RFC 791.

This is usually considered the standard IP specification.
|
Classful addressing divides all IP addresses into a number of classes.
|
Each class is identified by one of the letters from A to E.
|
The three most widely used IP address classes each define a prefix of a different length.
|
Class A addresses have a prefix length of 8 bits.
|
Class B addresses have a prefix length of 16 bits.
|
Class C addresses have a prefix length of 24 bits.
|
Traditional classful IP hosts only knew about the three prefix lengths - 8, 16, and 24 bits.
|
But when subnetworks were introduced, a classful host or router could be configured to understand extended prefixes.
|
This was done by using a subnet mask.
|
Subnet masks extend the range of network addresses available on an IP address.
|
They do this by allowing part of the address ordinarily reserved for the node addresses to be used for sub-network addresses.
@@
Traditional classful routing does not transmit any information about the prefix length.
|
The prefix length is calculated from the information on the address class provided in the first few bits of an address.
|
A Class A address always starts with 0.
|
A Class B address always starts with 10.
|
A Class C address always starts with 110.
|
Classful hosts have a limited ability to understand prefix lengths.
|
Classful hosts know the prefix length for local but not for remote configurations.
|
They assume prefix lengths of 8, 16, or 24 bits for non-local prefixes.
|
In classful routing, the leftmost contiguous bits (or the prefix) in an address are usually indicated by address classes and subnet masks. 
|
More recently, in classless routing, a length indication has followed a network number and slash, for example 172.16.168.4/21.
|
Unlike classful routers, which only accept prefixes of 8, 16, or 24 bits length, "classless" routers can accept any prefix length.
|
The prefix length doesn't need to be a multiple of eight, representing a complete octet of the address.
@@
Variable length subnet masking (VLSM) involves the further division of already existing subnets into smaller subnets.
|
VLSM makes more efficient use of address space by allowing you to create both big and small subnetworks.
|
Let's look at how VLSM could be used for a Class B network.
|
First, we apply an 8-bit subnet mask to the network's address.
|
Next, we take one of the big subnets and further subnet it with an extended mask.
|
You should group small subnets so that routing information concerning them can be consolidated.
|
Optimal consolidation occurs with contiguous blocks of addresses in powers of two.
|
This is in accordance with the number of subnets available in any one network.
|
For any given network the number of possible subnets is deduced from calculating the formula:
    
2 (^Rn^r)  - 2 where ^Rn^r is the number of masked bits

We subtract two from the number because octets of all ones or zeros are never used as subnets.
|
So, for example, there could be 4 minus 2, or 8 minus 2 subnets in one given subnet, and all those addresses could be represented by a single routing entry.
|
Here are some design guidelines for using VLSM:

• group VLSM subnets so that
  routing information about
  them can be consolidated
|
• allocate VLSMs by taking
  one regular subnet and
  subnetting it further
|
• avoid using more than two
  subnet masks for a given
  subnet
@@
Variable-length subnet masks are typically used to number serial lines.
|
Each serial line needs its own subnet number.
|
And each serial line has only two host addresses.
|
This wastes scarce subnet numbers, so variable length subnet masks are used.
|
Using VLSMs saves subnet numbers when allocating meshed serial lines in the WAN.
|
For example, VLSM is used to number all the serial links in the core.
|
Regular subnet 172.16.14.0 is further subnetted with six additional bits.
|
The six additional bits make 62 additional subnets available.
|
For example, 172.16.14.4 is a valid subnet with two valid host addresses.
|
Each subnet has a subnet identifier, two host addresses and a subnet broadcast.

So for subnet 172.16.14.4:

• 172.16.14.4 is the subnet identifier
• 172.16.14.5 is the first host address
  (one end of the serial line)
• 172.16.14.6 is the second host address
• 172.16.14.7 is the subnet broadcast

Then 172.16.14.8 is the subnet id of the next subnet and so on. 
|
The aggregate routes for all the subnets in the core is 172.16.14.0. 
|
VLSM relies on providing prefix length information explicitly with each use of the IP address.
|
The length of the prefix is evaluated independently at each place it is used.
|
This is really no different from traditional routing, where a subnet mask within a network is hidden from outside internetworks.
|
Classless routing supports VLSM.
|
This is because classless routing transmits prefix length.
|
And different prefix lengths  can be identified and are available at different points.
|
These capabilities support more efficient use of the IP address space, and help reduce routing traffic.
