In this Cisco CCNA training tutorial, you’ll learn how to subnet Class C networks and how Variable Length Subnet Masking or VLSM works. Scroll down for the video and also text tutorial.
Subnetting Class C Networks and VLSM Video Tutorial
Class C /31 Subnet
Let’s say that we’ve been allocated the Class C network 220.127.116.11/24. We’re going to move the line all the way to the right and we’re going to go with a /31.
Obviously, we can’t do a /32 if we want to have more than one available host. You can use a /32 subnet for a single host which is mostly used for loopback addresses.
If we wrote that subnet mask in dotted decimal notation, it would be 255.255.255.254. We get the 254 because it’s 128 plus 64, 32, 16, 8, 4 plus 2 comes up to 254. That leaves one bit for the host address, which has a possible value of a one or a zero.
Class C /31 borrows 7 bits for the network address from the host address. That gives us 128 subnets, which is 2 to the power of 7. /31 can accommodate two hosts each.
The valid host addresses would be 18.104.22.168 to 22.214.171.124, 126.96.36.199 to 188.8.131.52, 184.108.40.206 to 220.127.116.11, all the way up to 18.104.22.168 and 22.214.171.124. We’re using 126.96.36.199, the first three octets are never going to change. In the last octet, you just start with all zeros. Then, it would be 0000001 and zero and one, 0000010 and zero and one, etc.
But wait, if we’re using a /31, there are only two possible values to assign to the host. What about the network and broadcast address?
/31 subnet breaks the standard rules of IP addressing where we have to have the network address and the broadcast address. /31 subnets are supported on Cisco routers for point-to-point links.
If you think about it, a point-to-point link is for just one side and the other side. Any traffic that comes from this side needs to go out on the other side and vice versa. The traffic has nowhere else to go, therefore, there’s no point in having a network and a broadcast address. Hence, Cisco allowed that exception.
Class C /30 Subnet
Next up, we’re going to create a /30. The subnet mask in dotted decimal is 255.255.255.252 and it will be going to leave 2 bits for the host address.
That is 2 to the power of 2 is 4, minus 2 for the network and the broadcast address, and that gives us 2 possible hosts. It borrows 6 bits for the network address and it can accommodate 2 hosts each.
On the first subnet, the network address is 188.8.131.52 and the broadcast address is 184.108.40.206. The valid addresses are 220.127.116.11 and 18.104.22.168. The next subnet has the network 22.214.171.124 and the broadcast is 126.96.36.199. The valid range would be 188.8.131.52 to 184.108.40.206.
In the next subnet, the network would be 220.127.116.11, the valid addresses would be 18.104.22.168 and 22.214.171.124, and the broadcast would be 126.96.36.199, and so on.
As you look at this, you can calculate what the different valid subnets are going to be by noticing where the line is. It’s after number 4, so the network address is going to go up in values of 4. The first network address is 188.8.131.52, next would be network address 184.108.40.206. The next network address is 220.127.116.11, 18.104.22.168, 22.214.171.124, etc.
We know the network addresses therefore, we can work out what the broadcast and the range of valid IP addresses are going to be. In our example, it’s going up in values of 4.
The first subnet is going to be a zero. 126.96.36.199 is the network address and because the next range starts at 188.8.131.52, the broadcast address must be 184.108.40.206.
If 220.127.116.11 is the network address, and 18.104.22.168 is the broadcast address, the valid host addresses must be 22.214.171.124 and 126.96.36.199. The next subnet starts at 188.8.131.52.
The next subnet after that is 184.108.40.206, so the broadcast address must be 220.127.116.11. The network address of 18.104.22.168 and broadcast address of 22.214.171.124 leaves the addresses in between 126.96.36.199 and 188.8.131.52 which are available to be assigned to our hosts.
/31 vs /30
/31 and /30 both supported two hosts per subnet. But a /31 supports 128 subnetworks and a /30 only supports 64 subnets. You’re maybe thinking, “Oh well we’re always going to use /31 then.” A /31 is useful if you need to maximize the use of your address space, but a /30 is more commonly used. It’s more standardized.
For the CCNA exam, if you get a question where you’ve got to choose whether you would use either a /31 or a /30, always use a /30. If the question requires you to come up with a subnet that supports 2 hosts, use a /30 unless the question explicitly tells you to use a /31.
Class C /29 Subnet
Next up is a /29, we’re going to move the line back a space again. A /29 in dotted decimal is 255.255.255.248. Again, we got the 248 because it’s 128, plus 64, plus 32, plus 16, plus 8, up to where the line is.
That leaves 3 bits for the host address. 2 to the power of 3 is 8 minus 2 for the network address and the broadcast address will give us 6 available host addresses. The default subnet mask for Class C is /24.
Here, we’re using a /29 so we’re borrowing 5 bits for the network address. 2 to the power of 5 is 32 so, we’ve got 32 available subnets here.
Notice that the line is after the 8, therefore, the network addresses are going to go up in values of 8. The first one will be 184.108.40.206, then 220.127.116.11, then 18.104.22.168, and so on.
In the first subnet, the network address is 22.214.171.124. The next subnet the network address is 126.96.36.199, so the broadcast address for the first subnet must be one less, which is 188.8.131.52. If the network address is 184.108.40.206 and the broadcast address is 220.127.116.11, that leaves 18.104.22.168 to 22.214.171.124 available addresses to be assigned for our hosts.
The next subnet starts with 126.96.36.199, and the following subnet is at 188.8.131.52. Our broadcast address now must be 184.108.40.206, which leaves the available host addresses of 220.127.116.11 to 18.104.22.168. We can go on up to network address 22.214.171.124 and 126.96.36.199 broadcast address, with host addresses 188.8.131.52 to 184.108.40.206.
Other Class C Subnet Masks
We can carry on moving the line back a place. We did /31, /30, /29. We could also do a /28, which is 255.255.255.240. It will give us 16 networks of 14 hosts each on a Class C. Again, the default is a /24.
If we are using a /28 we’ve borrowed 4 bits and 16 available subnets. We’ve also got 4 bits available for our host addressing. That is 2 raised to the power of 4 equals 16 minus 2, for the network and broadcast addresses, and it gives us 14 usable hosts.
We can move the line back again to a /27. That’s going to be borrowing 3 bits. So that is 8 available networks. Leaving 5 bits available for our hosts, which will be 32 minus 2, gives us 30 available hosts.
A /26 is 4 networks and 62 hosts. A /25 is 2 networks and 126 hosts. /24 is the default 1 network with 254 hosts. That’s how we carry out subnetting and figure out how many networks, and how many hosts we’re going to have.
Variable Length Subnet Masks VLSM
The next thing to tell you about is Variable Length Subnet Masks. With early routing protocols, like RIP version 1, they only supported fixed-length subnet masks. It means that you could perform subnetting but all subnets in a particular network had to be the same size.
All of your different subnets had to accommodate 14 hosts, for example, or 30 hosts for example. If you had one subnet that needed up to 30 hosts, you have to allot all your subnets a size of 30 hosts even if only one of them had 3 hosts in it.
With later routing protocols, they came out with support for Variable Length Subnet Masks. That means that within the same range you can have different sizes of subnets in there.
Let’s say, I’ve got one part of my network which has got 10 hosts in it. I could give them 14 available hosts and another part of the network that’s got 28 hosts there. I could give them a subnet mask that gives them 30 available hosts.
Variable Length Subnet Masking means we can use different length subnet masks within the same network. This is a good thing because it lets us be much more precise with the size of our networks and we’re going to be wasting a lot fewer addresses.
Cisco Networking Basics: IP Addressing: https://www.networkcomputing.com/networking/cisco-networking-basics-ip-addressing
Constructing an IP Network Addressing Scheme: https://www.learncisco.net/courses/icnd-1/lan-connections/network-addressing-scheme.html
Cisco CCENT Practice and Study Guide: Subnetting IP Networks: https://www.ciscopress.com/articles/article.asp?p=2169292&seqNum=2
Subnetting Practice Questions: https://www.flackbox.com/subnetting-practice-questions