How to Subnet! Then, How to Subnet the Correct Way Using VLSMs

A “subnet” is nothing more than just a segmented network. When we subnet a network, we separate it into smaller networks. Network technicians are required to know how to subnet a network because it offers numerous benefits in terms of performance, security, and management. Unfortunately, the art of subnetting does require a bit of math and the ability to count by 16 and powers of 2. The math might seem difficult at first, and that’s what really turns students away. However, the math isn’t really all that bad. As for myself, I’m not great at math, but by researching different ways to subnet, I’ve gone from subnetting a network in an hour to just under 3 minutes.

Before learning how to subnet, you should already have a good foundation in networking topics. You should already know the ins-and-outs of IP addresses, subnet masks, CIDR notation, and you should know what a Class A, Class B, and Class C network are. Otherwise, you might have trouble following along. This discussion focuses on Class C networks only because this post will become to lengthy if I don’t. But, don’t fret. There’s no major differences between subnetting a Class C network and a Class A network. If you can subnet a Class C network, you can subnet a Class A network without any problems.

This discussion focuses on “Classful” subnetting first. Classful subnetting worked well in the past, but it did not scale well because it wasted IP addresses, as you’ll soon find out. After a while, we developed “Classessless Inter-Domain Routing (CIDR)” and “Variable Length Subnet Masks (VLSMs)” to help remedy this problem. You might be asking, “why do I have to learn classful subnetting if we don’t use it anymore?” It’s because classful subnetting will be great practice for VLSM subnetting. It’s much easier to do and that knowledge will help you learn how VLSM works when the time comes.

Why Do We Subnet?

By now, you’ve learned that having one giant network isn’t a good thing. By having a large network, we also have a large “broadcast domain.” Take a look at the network design below. It’s highly oversimplified, but good for demonstration purposes. This network is all just one network. It has 5 switches that connect to a backbone switch and then to a router. The host addresses indicated by a “.# – .#” range.

By examining this network design, we can see that every device in the 192.168.10.0/24 network is in the same Local Area Network (LAN) because they all belong on the same router interface. A /24 subnet only provides 254 hosts that available to use and this design has 103 devices. In some cases, it makes more sense to split this network up into smaller, manageable subnets. Keep in mind, what makes a large broadcast domain is relative from person-to-person. For example, a large broadcast domain might not actually be inherently bad if your network equipment can manage it. However, in many cases, large broadcast domains do introduce more broadcast traffic, such as ARP messages, which will transmit all on the same LAN segment.

giant broadcast domain.png

This network design also isn’t as bad as some other subnets out there, which might hold up to 2,000+ hosts. By subnetting our networks, it allow us to enjoy increased network performance by reducing broadcast and multicast traffic, save IP addresses, and improve network security.

Subnetting Class C Networks

Take another look at the network design above. How many networks do you think we can make from this one larger network? If you said 6, that’s right (although there is more than one answer). Normally, choosing how many subnets you need would really depend on how many hosts you need. In a Class C network, there are 8 bits available in the host address portion to assign host IP addresses. I’ve put together a table below that will help you subnet a Class C network. If you don’t understand how I produced these numbers, don’t worry. I will walk you through the steps.

Class C Networks.png

Knowing that we have the network address 192.168.10.0, let’s split this into 6 subnets. Using the table above, we’ll need a /27 network because the /26 network only yields 4 networks, which isn’t enough for this new network design. By using the /27 network, we have 8 subnets, leaving two subnets as a remainder. That’s just what we need.

Step 1

An easy way to find out how many subnets a chosen subnet mask can produce is to use the equation 2^x = the number of subnets. The represents the number of masked bits, or 1s, that are in the host section of the subnet mask. In a /27 network, there are 3 masked bits in the host address portion of the subnet mask. Therefore, 2^3 = 8 subnets, which is exactly what the table shows.

Step 2

The next step is to identify how many hosts are available for the /27 network. To find the number of hosts that are available, use the equation 2^y -2 = the number of hosts available. The y stands for the number of unmasked bits, or 0s,  in the host address portion. Therefore, 2^5 = 32 hosts. However, this isn’t our answer yet because we need to reserve 2 important address. These two addresses would be the network address and the broadcast address. This is why we subtract 2 at the end. So, in actuality, the true number of hosts is 30 per subnet.

Step 3

After we’ve identified the number of hosts, we identify the block size. This can be accomplished using the equation 256 – the octet of interest = the block size. The octet of interest is obviously the 4th octet in the subnet mask, which is 224. After plugging this into the equation, we get 256 – 224 = 32. With this number, we can identify our subnets: 0, 32, 64, 96, 128, 160, 192, and 224. These are our 8 subnets, but we only need 6. All I did was start from 0 and increment up by a block size of 32. We can’t go any further because the next number would be 256, which will not work.

Step 4

Now, it’s time to identify the broadcast address for each of the subnets above, which is always the number before the next sequential subnet number.

  1. The 0 subnet broadcast address is 31
  2. The 32 subnet broadcast address is 63
  3. The 64 subnet broadcast address is 95
  4. The 96 subnet broadcast address is 127
  5. The 128 subnet broadcast address is 159
  6. The 160 subnet broadcast address is 191,
  7. The 192 subnet broadcast address is 223, and
  8. The 224 subnet broadcast address is 255

As an example, if you wrote this out as actual IP addresses, the 192.168.10.96 subnet would have a broadcast address of 192.168.10.127. The 192.168.32 subnet would have a broadcast address of 192.168.10.63. Very simple!

Step 5

And for the final step, we must identify the host range for each subnet. These will be the numbers between the subnets and the broadcast address.

  1. The 0 subnet host range is 1-30
  2. The 32 subnet host range is 33-62
  3. The 64 subnet host range is 65-94
  4. The 96 subnet host range is 97-126
  5. The 128 subnet host range is 129-58
  6. The 160 subnet host range is 161-190
  7. The 192 subnet host range is 193-222, and
  8. The 224 subnet host range is 225-254

As an example, if you wrote this out using actual IP addresses, the 192.168.10.96 subnet would have a valid host range between 192.168.10.97 to 192.168.10.126. The 192.168.10.0 subnet would have a valid host range between 192.168.10.1 to 192.168.10.30. Are you starting to understand?

With this information, we can create a new network, which is depicted below. Looks better. This would be a typical “classful” network. Looking at the new network design, you can see that there are now 2 routers, which are connected through a serial link. We have now segmented our network into 6 subnets, which means our original network design that was 1 giant broadcast domain has now split into 6 smaller broadcast domains.

New Network.png

But, you’re not finished yet. We need to address an important issue first. This is obviously a better network design than the first, and it would work, but it could be better if we didn’t use a classful network design.

Variable Length Subnet Masks (VLSMs)

As I said, there’s something wrong with this new network design. What is it? The answer is we’re wasting valid host addresses. Notice that the 6 subnets in the new network design are all /27, meaning they can all hold a max of 30 hosts. But, subnet 192.168.10.0 /27 has 11 hosts (and that includes the switch and router interface), leaving 19 left over. As another example, subnet 192.168.10.160 /27 has only 2 hosts with a whopping 28 left over. This is because every router interface has the same /27 subnet mask. That is classful subnetting, and you can see where it gets us into trouble. This type of network would work; however, it would be much better if we gave each router interface its own subnet mask.

Keep in mind that this is just a small example! Now, imagine this on a larger scale and picture an organization that has 3,000 IP addresses and they had to subnet a Class B network block. That would waste 62,000 IP addresses. As we can see, classful subnetting wastes IP addresses. This is where “Variable Length Subnet Masks (VLSMs)” come in.

VLSM 1.png

Using the diagram above, let’s identify how many hosts are in each subnet by counting each device. Although the switches and the router interfaces are not within the boundary of the red line, they also count as hosts! This will help us identify the correct, new subnet mask to use for each network.

  1. Network A at 192.168.10.0 /27 needs 11 hosts.
  2. Network B at 192.168.10.32 /27 needs 24 hosts.
  3. Network C at 192.168.10.64 /27 needs 24 hosts.
  4. Network D at 192.168.10.96 /27 needs 24 hosts.
  5. Network E at 192.168.10.128 /27 needs 24 hosts.
  6. Network F at 192.168.10.160 /27 needs 2 hosts.

Using this information, let’s refer back to the Class C subnet table. Doing so will help us identify the correct subnets for VLSM.

Class C Networks

Which subnet mask should each network use?

  1. Network A has 11 hosts; therefore, it can use a /28 subnet.
  2. Network B has 24 hosts; therefore, it can use a /27 subnet.
  3. Network C has 24 hosts; therefore, it can use a /27 subnet.
  4. Network D has 24 hosts; therefore, it can use a /27 subnet.
  5. Network E has 24 hosts; therefore, it can use a /27 subnet.
  6. Network F has 2 hosts; therefore it can use a /30 subnet.

Do you see how each network has its own variable length subnet mask? Now, let’s create a table that helps us picture how this new network will look. This table will show us the new block size for each subnet and where each subnet will begin. By going through steps 1 through 5 one more time, we can begin to fill out the necessary information in each field.

New Network 1.png

With this table, we can identify each subnet. Network A starts at 192.168.10.0 and ends with its broadcast address at 192.168.10.15. Network B starts at 192.168.10.16 and ends at its broadcast address at 192.168.10.47. Network C starts at 192.168.10.48 and ends at its broadcast address at 192.168.10.79…You get the picture. The new network will now look like this:

New VLSM network.png

I know that with this new VLSM network, I’ve saved valuable IP addresses. This is because with VLSMs, we provide for only the needed amount of hosts on each router interface.

How do I know I saved IP address space? Recall how Network A used to be a /27 with 30 usable hosts available. Since there are 11 hosts on Network A, we were wasting 19 remaining host addresses. This new network, however, uses a /28, which uses only 14 usable hosts. Since we still have 11 hosts on Network A, we’re only wasting 3 hosts instead of 19! In addition, remember how Network F on the classful network was also using a /27 with 30 usable hosts? Network F only requires 2 hosts, which meant we were wasting 28 host addresses. With the new /30 subnet, we have a limit of only 2 usable hosts, which means we are no longer wasting any host addresses at all! The figure below shows how the new VLSM network uses the host addresses.

VLSM Table.png

This makes sure that no host address is overlapping into another subnet and it also ensures that each network is incrementing by the correct block size. Creating tables and figures like this help in both subnetting a network and when double-checking your work. With this, we can see how VLSMs are superior to classful subnetting.

 

References

Lammle, T. (2016). CCNA: Routing and Switching. Complete Study Guide. John Wiley & Sons: Indianapolis, IN.

Meyers, M. (2015). All in One CompTIA Network+ Certification Exam N10-006. McGraw-Hill Education: New York, NY.

 

 

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

WordPress.com.

Up ↑

%d bloggers like this: