VLSM Variable Length Subnet Mask Example

In this Cisco CCNA training tutorial, we’re going to carry on with our subnetting theme, and by the end of the tutorial, you will be able to carry out a Variable Length Subnet Mask design for a real-world network topology. Scroll down for the video and text tutorial.

 

VLSM Variable Length Subnet Mask Example Video Tutorial

YouTube video

Todd Howe

Todd Howe

Hi Neil, I took your course and ended up passing the exam on my first try! I wanted to say thank you for your course. Prior to this I had little to no networking knowledge. The way you explained the processes really helped me retain and learn the information. Great job!

Todd Howe

 

It's only a small network in the example of it we're going to work through, but you can apply the same things that you're going to learn here to larger networks in the real world.

 

Back in the day with early routing protocols, whenever you did subnetting, each of the subnets had to be exactly the same size. If you had one subnet that was a /28 for example, they all had to be a /28. You couldn't mix and match /27, /28, /29 within the same larger network.

 

That ended up wasting a lot of addresses. So with later routing protocols, they did have support for Variable Length Subnet Masks, and now we can mix and match the size of our subnets within that greater network.

 

VLSM Variable Length Subnet Mask

 

Subnetting Considerations

 

The things that we need to consider when we're going to do the design are:

  • How many different locations do we have in the network that are going to need subnets?
  • How many hosts are going to be in each of those subnets?
  • What are the IP addressing requirements for each of the different locations? Should different departments or types of hosts be in different subnets?
  • What size is appropriate for each subnet?

 

Subnetting Considerations

 

For example, you might have one office but within that office, you've got a Sales department, a Research and Development department, and an Accounting department. You want the accounting department to be secured from different departments.

 

In that case, you would put it in its own subnet because we have to route between different subnets. It's easy to secure them at the Layer 3 level based on their IP address.

 

For the last question, we don't want to waste addresses, but we want to leave some room for growth. Don't make it too big, we're wasting addresses, but don't make it too small that we're going to run out of addresses and then going to have to do a redesign later.

 

Network Topology Diagram

 

For example, this is our network topology diagram shown below. We've got an organization and they've got an office in New York and a branch office in Boston.

 

New York is our headquarters, and they've got 28 hosts in the Engineering department and 14 hosts in Sales. In Boston, they also got Engineering and Sales. They got 28 in engineering, the same as in New York, and they've got 7 hosts in the Sales department.

 

Network Topology Diagram

 

These are the different parts of the network that we need to apply IP addresses to, and we've been allocated the Class C network of 200.15.10.0/24 from our Internet Service Provider.

 

Another thing that we need to do is don't forget about our point-to-point links between the routers. They need to have connectivity between each other and each is going to need IP addresses. The outside interface in the New York router is connected to the outside interface on the Boston router.

 

Subnetting Design Steps

 

You would create that subnet at the start of our available address space and then just keep working your way down. So, you start with the largest subnet. Then move to the next one until you've allocated addresses for all of your different subnets.

 

In a real-world deployment, you want to have a scalable design. You want to have room for growth in your networking design.

 

Let's say that I've got a subnet that has got 14 hosts on there. Well, you know that one of our subnet sizes is exactly for 14 hosts. Don't give a subnet that exact size because maybe in a few weeks, a couple of extra people are going to join the department, and now how are you going to fix that problem?

 

Make the subnet size big enough that it's going to be able to grow. Another thing is because we're going to sequentially go from largest down to smallest. Let’s say we're going to have a subnet with 30 hosts, and then another subnet with 30 hosts, and then a subnet with 14 hosts.

 

Subnetting Design Steps

 

We have a spare subnet with 30 hosts in it, so don't just do two subnets of 30. Do three or four subnets or 30 because if you do have a new department that acquires up to 30 hosts later, you've got a spare subnet and everything is still sequential, contiguous, and logical, going from largest down to smallest.

 

Doing design for what is right right now, designed for what is going to be the best fit in the future. Leave some scalability there, for a room for growth. That's what you do in the real world.

 

However, don't do that in the CCNA exam. Do not think about, "Oh, this is what I would do in the real world. This would be the best practice." Do exactly what the exam question tells you to do even if you think that would be a stupid thing to do.

 

Don't overthink things. Don't think, "Oh, well it would be better to do it this way." Do exactly black and white. Do what the question asks you to do, and then you're going to get the question right.

 

Engineering Departments

 

For our example, we had the Engineering departments in New York and Boston and they have got 28 hosts each, and that was the largest subnets we required.

 

Let's say the exam question says that the departments will not grow and we need to use the smallest subnets possible to maximize our available address space. So do not leave any room for future growth here because the question says "Make it optimal. Maximize your use of the address space."

 

So, back to the question. We will calculate the optimal subnet mask for the Engineering departments. So no bigger than is necessary, but make sure it's at least big enough to support 28 hosts. Once you've done that, you'll be able to determine the network and broadcast addresses.

 

Do that for both Engineering departments, for both New York and Boston, and figure out what the range of host addresses will be.

 

Engineering Departments

 

We have been allocated 200.15.10.0/24, a class C network. We've got two different departments that we want two different subnets for and they had got 28 hosts each.

 

A /27 supports 30 hosts. A /28 supports 14, it's not big enough so, we can't use that. The smallest that we can use is a /27. In the real world, you might argue that you'd prefer to use a /26. Again, this is not the real world, it's an exam question and we're going to use the smallest possible, which was a /27.

 

/27 in dotted decimal notation is 255.255.255.224. So that was the first part of the question, figure out the subnet mask. The next thing we have to do is to divide up our address space.

 

Engineering Departments 1

 

The headquarters was in New York, so let's give them the first subnet. The network address is going to be 200.15.10.0/27 and if we look at the line, we can see it's after 32. Therefore, /27 is going to go up in increments of 32.

 

The next network address is going to be 200.15.10.32, which means that the first subnet's broadcast address is going to be 1 less than that. It's going to be 200.15.10.31. That leaves addresses available for our hosts of 200.15.10.1 up to 200.15.10.30. So, that's for the Engineering subnet.

 

Next is the Boston Engineering subnet. The last broadcast address used was 200.15.10.31, so the network address we're going to be using is 200.15.10.32. We’re still using that /27 where the line is after the 32. So, the next network address would be 200.15.10.64.

 

Our broadcast address must be 200.15.10.63 which is 1 less, and our hosts are going to be what's between the network and broadcast address, that's 200.15.10.33 up to 200.15.10.62. That was the Engineering departments taken care of.

 

New York Sales Department

 

The next largest subnet is New York Sales which requires 14 hosts. The smallest possible subnet we can use is a /28. /28 means we've got 4 bits available for host addresses that gives us the 14 hosts. 200.15.10.0 to 200.15.10.63 were already being used by the Engineering departments.

 

New York Sales Department

 

So for the network address, we'll start with 200.15.10.64. If we look at the line, we can see it's after the 16. 64 plus 16 is 200.15.10.80, take 1 away for our broadcast address and it is going to be 200.15.10.79.

 

The available host addresses are 200.15.10.65 to 200.15.10.78, which are the addresses that are between the network address and the broadcast address.

 

New York Sales Department 1

 

Boston Sales Department

 

That's our first 3 departments done. The last department was Boston Sales which requires 7 hosts. We're going to use a /28 again here, same as what we did for the last department.

 

Boston Sales Department

 

A /29 supports 6 hosts which is not enough, so we're going to use a /28 which supports 14 hosts. The last broadcast address was 200.15.10.79, therefore, our network address will be 200.15.10.80. Again, the line is after the 16, so the next network address would be 200.15.10.96.

 

Our broadcast address is going to be 200.15.10.95. The valid host addresses are 200.15.10.81 to 200.15.10.94. So that's it. That was our 4 departments. So we're done, right? No.

 

Boston Sales Department 1

 

Subnetting

 

Remember, we have to allocate addresses for the point-to-point link between the routers in Boston and New York. Another thing you would do in the real world is you would also allocate address space for your loopback addresses.

 

Loopback addresses are used for management but are logical addresses. So there's not anything physical on the other end. We'll usually allocate a /32 to our loopback addresses.

 

Subnetting

 

New York to Boston Link

 

The last subnet is the link between the New York and Boston routers. We want to support 2 hosts. Remember a /31 and a /30 supports two hosts.

 

Hopefully, you remember I told you before. Unless the exam explicitly tells you, if you need to support 2 hosts, go with a /30 because that's the standard that we use. It complies with all of the Internet standards.

 

New York to Boston Link

 

We're going to use a /30 here for our two hosts. We're already using up to 200.15.10.95 for our departments. So our network address will be one up from there, 200.15.10.96. If you look at the line, it's after the 4, therefore, the network address is going to go up in increments of 4.

 

The network address would be 200.15.10.100. One less of that gives us our broadcast of 200.15.10.99. Which leaves the host addresses to be 200.15.10.97 and 200.15.10.98.

 

New York to Boston Link 1

 

Network Topology Diagram

 

When we did our design, we started off with the largest subnets which were the Engineering departments:

  • 200.15.10.0/27 for New York
  • 200.15.10.32/27 for Boston

 

Then I got the Sales department:

  • 200.15.10.64/28 for New York
  • 200.15.10.80/28 for Boston

 

The subnet I used for the point-to-point link:

  • 200.15.10.96/30.

 

Next, we're going to use the first available address as the IP address in our router interfaces:

  • 200.15.10.1 for New York Engineering department
  • 200.15.10.33 for Boston Engineering department
  • 200.15.10.65 for New York Sales department
  • 200.15.10.81 for Boston Sales department
  • 200.15.10.97 on the New York point-to-point link
  • 200.15.10.98 on the Boston point-to-point link

 

This would be an acceptable network diagram in a real-world environment.

 

Network Topology Diagram

Additional Resources

 

Subnetting practice questions.

Advanced IP Addressing Management: https://www.ciscopress.com/articles/article.asp?p=330807&seqNum=4

Concepts in IP Addressing: https://www.pearsonitcertification.com/articles/article.aspx?p=2169746&seqNum=6

VLSM Subnetting Explained with Examples: https://www.computernetworkingnotes.com/ccna-study-guide/vlsm-subnetting-explained-with-examples.html

 

Want to practice Cisco CCNA technologies on your laptop? Download my complete 350-page Cisco CCNA Lab Guide for free.

 

Click Here to get my Cisco CCNA Gold Bootcamp, the highest rated CCNA course online with a 4.8 star rating from over 20,000 public reviews.

 

Libby Teofilo

Text by Libby Teofilo, Technical Writer at www.flackbox.com

Libby’s passion for technology drives her to constantly learn and share her insights with others. When she’s not immersed in the world of tech, you’ll find her lost in a good book with a cup of coffee or out exploring nature on her next adventure—always curious, always inspired.