## VLSM Addressing Schemes

Variable-length subnet masking (VLSM) subnetting is similar to traditional subnetting in that bits are borrowed to create subnets. The formulas to calculate the number of hosts per subnet, and the number of subnets created still apply. The difference is that subnetting is not a single-pass activity.

### VLSM Review

You probably noticed that the starting address space in Subnetting Scenario 3 is not an entire classful address. In fact, it is subnet 5 from Subnetting Scenario 2. So in Subnetting Scenario 3, you “subnetted a subnet.” That is what VLSM is in a nutshell: subnetting a subnet.

Let’s use a small example. Given the address space 172.30.4.0/22 and the network requirements shown in Figure 9-1, apply an addressing scheme that conserves the most amount of addresses for future growth.

Figure 9-1 **VLSM Example Topology**

We need five subnets: four LAN subnets and one WAN subnet. Starting with the largest host requirement on LAN 3, begin subnetting the address space.

To satisfy the 250 hosts requirement, we leave 8 hosts bits (2^{8} – 2 = 254 hosts per subnet). Because we have 10 host bits total, we borrow 2 bits to create the first round of subnets (2^{2} = 4 subnets). The starting subnet mask is /22 or 255.255.252.0. We turn on the next two bits in the subnet mask to get /24 or 255.255.255.0. The multiplier is 1. The four subnets are as follows:

- Subnet 0: 172.30.4.0/24
- Subnet 1: 172.30.5.0/24
- Subnet 2: 172.30.6.0/24
- Subnet 3: 172.30.7.0/24

Assigning Subnet 0 to LAN 3, we are left with three /24 subnets. Continuing on to the next largest host requirement on LAN 4, we take Subnet 1, 172.30.5.0/24, and subnet it further.

To satisfy the 100 hosts requirement, we leave 7 bits (2^{7} – 2 = 128 hosts per subnet). Because we have 8 host bits total, we can borrow only 1 bit to create the subnets (2^{1} = 2 subnets). The starting subnet mask is /24 or 255.255.255.0. We turn on the next bit in the subnet mask to get /25 or 255.255.255.128. The multiplier is 128. The two subnets are as follows:

- Subnet 0: 172.30.5.0/25
- Subnet 1: 172.30.5.128/25

Assigning Subnet 0 to LAN 4, we are left with one /25 subnet and two /24 subnets. Continuing on to the next largest host requirement on LAN 1, we take Subnet 1, 172.30.5.128/25, and subnet it further.

To satisfy the 60 hosts requirement, we leave 6 bits (2^{6} – 2 = 62 hosts per subnet). Because we have 7 host bits total, we borrow 1 bit to create the subnets (2^{1} = 2 subnets). The starting subnet mask is /25 or 255.255.255.128. We turn on the next bit in the subnet mask to get /26 or 255.255.255.192. The multiplier is 64. The two subnets are as follows:

- Subnet 0: 172.30.5.128/26
- Subnet 1: 172.30.5.192/26

Assigning Subnet 0 to LAN 1, we are left with one /26 subnet and two /24 subnets. Finishing our LAN subnetting with LAN 2, we take Subnet 1, 172.30.5.192/26, and subnet it further.

To satisfy the 10 hosts requirement, we leave 4 bits (2^{4} – 2 = 14 hosts per subnet). Because we have 6 host bits total, we borrow 2 bits to create the subnets (2^{2} = 4 subnets). The starting subnet mask is /26 or 255.255.255.192. We turn on the next two bits in the subnet mask to get /28 or 255.255.255.240. The multiplier is 16. The four subnets are as follows:

- Subnet 0: 172.30.5.192/28
- Subnet 1: 172.30.5.208/28
- Subnet 2: 172.30.5.224/28
- Subnet 3: 172.30.5.240/28

Assigning Subnet 0 to LAN 2, we are left with three /28 subnets and two /24 subnets. To finalize our addressing scheme, we need to create a subnet only for the WAN link, which needs only two host addresses. We take Subnet 1, 172.30.5.208/28, and subnet it further.

To satisfy the two hosts requirement, we leave 2 bits (2^{2} – 2 = 2 hosts per subnet). Because we have 4 host bits total, we borrow 2 bits to create the subnets (2^{2} = 4 subnets). The starting subnet mask is /28 or 255.255.255.240. We turn on the next 2 bits in the subnet mask to get /30 or 255.255.255.252. The multiplier is 4. The four subnets are as follows:

- Subnet 0: 172.30.5.208/30
- Subnet 1: 172.30.5.212/30
- Subnet 2: 172.30.5.216/30
- Subnet 3: 172.30.5.220/30

We assign Subnet 0 to the WAN link. We are left with three /30 subnets, two /28 subnets, and two /24 subnets.

### VLSM Addressing Design Exercises

In the following VLSM addressing design exercises, you apply your VLSM addressing skills to a three router topology. Each exercise is progressively more difficult than the last. There may be more than one correct answer in some situations. However, you should always practice good addressing design by assigning your subnets contiguously.

#### Exercise 1

Assume that 4 bits were borrowed from the host portion of 192.168.1.0/24. You are *not* using VLSM. Starting with Subnet 0, label Figure 9-2 contiguously with subnets. Start with the LAN on RTA and proceed clockwise.

Figure 9-2 **Addressing Design Exercise 1 Topology: Subnets**

How many *total* valid host addresses will be wasted on the WAN links?

Now come up with a better addressing scheme using VLSM. Start with the same 4 bits borrowed from the host portion of 192.168.1.0/24. Label each of the LANs with a subnet. Then subnet the next available subnet to provide WAN subnets without wasting any host addresses. Label Figure 9-3 with the subnets.

Figure 9-3 **Addressing Design Exercise 1 Topology: VLSM Subnets**

List the address space that is still available for future expansion.

The topology shown in Figure 9-4 has LAN subnets already assigned out of the 192.168.1.0/24 address space. Using VLSM, create and label the WANs with subnets from the remaining address space.

Figure 9-4 **Addressing Design Exercise 1 Topology: WAN Subnets**

List the address space that is still available for future expansion.

#### Exercise 2

Your address space is 192.168.1.192/26. Each LAN needs to support ten hosts. Use VLSM to create a contiguous IP addressing scheme. Label Figure 9-5 with your addressing scheme. Don’t forget the WAN links.

Figure 9-5 **Addressing Design Exercise 2 Topology**

List the address space that is still available for future expansion.

#### Exercise 3

Your address space is 192.168.6.0/23. The number of hosts needed for each LAN is shown in Figure 9-6. Use VLSM to create a contiguous IP addressing scheme. Label Figure 9-6 with your addressing scheme. Don’t forget the WAN links.

Figure 9-6 **Addressing Design Exercise 3 Topology**

List the address space that is still available for future expansion.

#### Exercise 4

Your address space is 10.10.96.0/21. The number of hosts needed for each LAN is shown in Figure 9-7. Use VLSM to create a contiguous IP addressing scheme. Label Figure 9-7 with your addressing scheme. Don’t forget the WAN links.

Figure 9-7 **Addressing Design Exercise 4 Topology**

List the address space that is still available for future expansion.