As we already know, the extended network prefix is used and therefore VLSM requires it to be carried out. To accomplish the VLSM requirement, two protocols are used OSPF and I-IS-I as the Interior Gateway Protocol, even though you could use RIP-2 a fixed in RFC 1388. These protocols carry the extended network prefix in each advertisement. If the protocol does not carry the prefix information, the router makes a lookup in its global configured routing table. If the information is not found there it applies a local mask and delivers the information as long as the host exists.
Make note that the higher the extended network prefix is, it has less hosts and gets faster to its destination. This is known as a forwarding algorithm.
For example if a /16 class B network has been defined as /22 bit extended network-prefix which has 64 subnets (26), that leaves 10 bits for the hosts which is equal to (210-2) 1022 hosts per subnet.
Now the same /16 Class B network has been defined as /26 extended network-prefix gives us 1024 subnets (210) “10 bits were required to have 1024 subnets”. That leaves only 6 bits for our hosts. Now (26-2) defines only 62 hosts per subnet.
In those two examples, if a packet is sent to the router, which network is evaluated first? The router obviously will pick the /26 extended network-prefix because it has the greatest bit number corresponding to the destination IP address; in other words it is a shorter route and is more descriptive.
To get a clearer picture observe the following, a host has been picked up for delivering a packet to 18.104.22.168
|Route3|| => IP||42||3||1||20|
||-----------|| /24 Network||--------------||||-------Host-----||
Note. In this picture there is a /8 and a /16 network; however, the router jumps and evaluates the /24 network first because it has a longer descriptive network prefix.
According to what we have just seen, VLSM is the exact answer to using a network effectively. Now look at the following example. This is how a sub net is being sub-netted into more subnets.
Now let's assume that you were going to subnet 22.214.171.124/16 this address into other subnets; so let's do it. This IP address can be broken down as follows
Before I convert this network into another network, note that this is currently a /16 network.
My intention is to create another 16 subnets from it, and since 24= 16; I need 4 bits more to create it, and by creating these subnets, I now convert my network into a /20 extended network prefix.
12 bits are left for my host. (212-2) = 4094.
Now let's say that I need to break this further into a /27 extended network prefix. Now observe what happens.
Since I had a /20 network already, I needed 7 more bits to make it a 27 Network prefix therefore (27) = 128, 5 bits are left for my hosts (25-2) = 30
So this is how it is done…
You could even break this further to restrict a network into smaller, less host support. (Ideal for small needs)