IPv4 : Variable Length Subnet Masking (VLSM)

A Variable Length Subnet Mask (VLSM):  is a numerical masking sequence, or IP address subset, based on overall network requirements. A VLSM allows a network administrator to use long masks for networks with few hosts and short masks for networks with multiple hosts. A VLSM is used with a VLSM router and must have routing protocol support.
A VLSM is also known as a classless Internet Protocol (IP) address.

VLSM enables you to have more than one mask for a given class of address, albeit a class A, B, or C network number.

VLSM, originally defined in RFC 1812, allows you to apply different subnet masks to the same class address space Classful protocols, such as RIPv1 and IGRP, do not support VLSM. To deploy VLSM requires a routing protocol that is classless—BGP, EIGRP, IS-IS, OSPF, or RIPv2, for instance.

VLSM provides Two major advantages:

  • more efficient use of addressing
  • Ability to perform route summarization

when you perform classful subnetting, all subnets have the same number of hosts because they all use the same subnet mask. This leads to inefficiencies. For example, if you borrow 4 bits on a Class C network, you end up with 14 valid subnets of 14 valid hosts. A serial link to another router only needs 2 hosts, but with classical subnetting, you end up wasting 12 of those hosts. Even with the ability to use NAT and private addresses, where you should never run out of addresses in a network design, you still want to ensure that the IP plan that you create is as efficient as possible.

An efficient addressing scheme using VLSM:

  • Find the largest segment in the area—the segment with the largest number of devices connected to it.
  • Find the appropriate subnet mask for the largest network segment.
  • Write down your subnet numbers to fit your subnet mask.
  • For your smaller segments, take one of these newly created subnets and apply a different, more appropriate, subnet mask to it.
  • Write down your newly subnetted subnets.
  • For even smaller segments, go back to step 4.

Variable Length Subnet Masking (VLSM) is a way of further subnetting a subnet. Using Variable Length Subnet Masking (VLSM) we can allocate IPv4 addresses to the subnets by the exact need. Variable Length Subnet Masking (VLSM) allows us to use more than one subnet mask within the same network address space. If we recollect from the previous lessons, we can divide a network only into subnets with equal number of IPv4 addresses. Variable Length Subnet Masking (VLSM) allows to create subnets from a single network with unequal number of IPv4 addresses.

Example: We want to divide 192.168.10.0, which is a Class C network, into four networks, each with unequal number of IPv4 addresses requirements as shown below.

Subnet A : 126 IPv4 Addresses.
Subnet B : 62 IPv4 Addresses.
Subnet C : 30 IPv4 Addresses.
Subnet D : 30 IPv4 Addresses.

This type of division is not possible as described in previous lessons, since it divide the network equally, but is possible with Variable Length Subnet Masking (VLSM).

Original Network (Network to be subnetted) – 192.168.10.0/24

 

Variable Length Subnet Masking (VLSM) – First Division
Divide the two networks equally with 128 IPv4 addresses (126 usable IPv4 addresses) in each network using 255.255.255.128 subnet mask (192.168.10.0/25).

We will get two subnets each with 128 IPv4 addresses (126 usable IPv4 addresses).

1) 192.168.10.0/25, which can be represented in binaries as below.

11000000.10101000.00001010.00000000
11111111.11111111.11111111.10000000

2) 192.168.10.128/25, which can be represented in binaries as below.

11000000.10101000.00001010.10000000
11111111.11111111.11111111.10000000

Variable Length Subnet Masking (VLSM)- Second Division
Divide second subnet (192.168.10.128/25) we got from the first division again into two Networks, each with 64 IP Addresses (62 usable IPv4 addresses) using 255.255.255.192 subnet mask.

We will get two subnets each with 64 IPv4 addresses (62 usable IPv4 addresses).

1) 192.168.10.128/26, which can be represented in binaries as below.

11000000.10101000.00001010.10000000
11111111.11111111.11111111.11000000

2) 192.168.10.192/26

11000000.10101000.00001010.11 000000
11111111.11111111.11111111.11000000

Variable Length Subnet Masking (VLSM) – Third Division
Divide 192.168.10.192/26 Network again into two Networks, each with 32 IPv4 addresses (30 usable IPv4 addresses) using 255.255.255.224 subnet mask

We will get two subnets each with 32 IPv4 addresses (30 usable IPv4 addresses).

1) 192.168.10.192/27, which can be represented in binaries as below.

11000000.10101000.00001010.11000000
11111111.11111111.11111111.11100000

2) 192.168.10.224/27, which can be represented in binaries as below.

11000000.10101000.00001010.11100000
11111111.11111111.11111111.11100000

Now we have split the 192.168.10.0/24 network into four subnets using Variable Length Subnet Masking (VLSM), with unequal number of IPv4 addresses as shown below. Also note that when you divide a network using Variable Length Subnet Masking (VLSM), the subnet masks are also different.

1) 192.168.10.0 – 255.255.255.128 (126 (128-2) usable IPv4 addresses)
2) 192.168.10.128 – 255.255.255.192 (62 (64-2) usable IPv4 addresses)
3) 192.168.10.192 – 255.255.255.224 (30 (32-2) usable IPv4 addresses)
4) 192.168.10.224 – 255.255.255.224 (30 (32-2) usable IPv4 addresses)

Calculation of VLSM:

The step of necessary  1. In case of VLSM , network bit borrow host bit from right side of host bits. 2. We can find out how many host exists in network . VLSM mainly divided subnet into the subnet.

Example 1: 172.16.32.0/20. Number of user group are 500, 10 , 5 and 2. It’s needed 4 network. 

Solution:  172.16.32.0/20

172.16.00100000.00000000

user group 500 = 29   = 512 = 9 host bits required 

First step: 172.16.0010 | 000 | 0.00000000

Network bits  |          | host bits                                  ( 000, 001,010,011,100,101)

               172.16.32.0/23 – 500 hosts

2nd step: 172.16.0010 | 001 | 0.00000000 /23

               172.16.34.0/23

step 3: Next user group 10= 24   = 16

 172.16.0010 | 001 0.0000 | 0000

             172.16.34.0 /28

Step 4: for user group 5= 23   = 8

           172.16.0010 001| 0.0001 0 | 000

            172.16.34.16/29

step 5: for user group 2= 22  = 4

     172.16.0010 001| 0.0001 1 0 | 00

      172.16.34.24/30

Short Cut Method for VLSM:

For 2 host , need 4 bits because we need to cancel 2 usable host bits. and for find out broadcast address host bits all will be ‘1’ and we will consider highest number of user first.

 

Network Address

Broadcast Address

500 host = 29

               = 512

172.16.32.0/23

172.16.33.255/23

 

10 host =24

              =16      

172.16.34.0 /28

172.16.34.15/28

5 host =23

              = 8

2 host = 22 = 4                                          

172.16.34.16/29

172.16.34.24/30

172.16.34.23/29

172.16.34.27/30

 Example 2: 172.16.128.0/17 , user group are 1000, 1000, 50 , 100, 2, 2

 

Network Address

Broadcast Address

1000 host = 210

               = 1024

172.16.128.0/22

172.16.131.255/22

 

1000 host = 210

               = 1024

172.16.132.0 /22

172.16.135.255/22

100 host = 27

               = 128

172.16.136.0/25

172.16.136.127/25

50 host = 26

               = 64 (64-1=63 host)

172.16.136.128/26

172.16.136.191/26 (128+63=191 host)

2 host = 22

               = 4 (n-1) bit added

172.16.136.192/30

CIDR (32-2 =30)

172.16.136.195 /30 (192+3 =195)

2 host = 22

               = 4 (n-1) bit added

172.16.136.196/30

172.16.136.199/30

 

 

Thank you

Momataj Momo

                                                                                  

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s