Subnetting a Class C network can be a tricky process to master. From MCSE to CCNA to RHCE to CNE, you'll have to know it and know it well. Todd Lammle walks you through clear instructions and step-by-step examples to help you learn this skill.

Let’s face it, some day you are going to have to subnet a network. Although IP addressing isn’t a network administrator’s favorite task, it’s a critical skill that you must have. In this Daily Drill Down, I will continue our discussion of IP addressing by exploring the process of taking a large IP address range and dividing it into smaller, more manageable pieces. Since this is a complicated, involved process, I will only discuss the process of breaking up Class C networks. First, we need to discuss why we want to subnet a network and the advantages of doing so.

Why subnetting?

By creating smaller IP networks (instead of having one large network), we can obtain better security, smaller collision and broadcast domains, and greater administrative control of each network. Think of a network like streets in a city. Each house on this network is known by the street and by the address. Think of the addresses on the houses as the hardware addresses of a host. For IP to communicate with a host, the IP address must be known, and the router connected to the network on which this host is located must also know the hardware address of the house.

What if a city didn’t have many blocks but just one long street? The mailman would go crazy trying to get the mail delivered to each house correctly because he would have to know the address of every house. It’s the same scenario with IP. By creating smaller networks, we can more effectively get data to each host.

Subnetting a Class C network

So you understand why you want to subnet, but how do you do it? Your goal is to look at an IP address and subnet mask of a host and then determine three things quickly:

- The subnet the host is located in
- The broadcast address of the subnet
- The valid host range of the subnet used to configure hosts

Once the subnet is determined, the broadcast address must be found. Why? Because these are not valid host addresses and cannot be assigned to host configurations. Also, by determining the subnet and broadcast addresses, we can easily determine the host addresses because the valid host range is always the numbers between the subnet address and the broadcast address.

If we use the default subnet mask with a Class C network address, then we already know that three bytes are used to define the network and only one byte is used to define the hosts on each network.

The default Class C mask is: 255.255.255.0. To make smaller networks, called subnetworks, we will borrow bits from the host portion of the mask. Since the Class C mask only uses the last octet for host addressing, we only have 8 bits at our disposal. Therefore, only the following masks can be used with Class C networks (

**Table A**).

Subset zero

Take note that in the table below I do not assume subnet zero. Cisco does teach a subnet zero assumption but they do not test that way. I have chosen to follow the exam.

Mask | Binary | # Subnet bits | # Host bits | Subnets | Hosts |

255.255.255.128 | 10000000 | 1 | 7 | 2 | 126 |

255.255.255.192 | 11000000 | 2 | 6 | 2 | 62 |

255.255.255.224 | 11100000 | 3 | 5 | 6 | 30 |

255.255.255.240 | 11110000 | 4 | 4 | 14 | 14 |

255.255.255.248 | 11111000 | 5 | 3 | 30 | 6 |

255.255.255.252 | 11111100 | 6 | 2 | 62 | 2 |

You can see in Table A that the bits that are turned on (1s) are used for subnetting, while the bits that are turned off (0s) are used for addressing of hosts. You can use some easy math to determine the number of subnets and hosts per subnet for each different mask.

To determine the number of subnets, use the 2

^{x}-2, where the x exponent is the number of subnet bits in the mask.

To determine the number of hosts, use the 2

^{x}-2, where the x exponent is the number of host bits in the mask.

To determine the mask you need for your network, you must first determine your business requirements. Count the number of networks and the number of hosts per network that you need. Then determine the mask by using the equations shown above—and don’t forget to factor for growth.

For example, if you have eight networks and each requires 10 hosts, you would use the Class C mask of 255.255.255.240. Why? Because 240 in binary is 11110000, which means you have four subnet bits and four host bits. Using our math, we’d get the following:

2

^{4}-2=14 subnets

2

^{4}-2=14 hosts

Many people find it easy to memorize the Class C information because Class C networks have few bits to manipulate. However, there is an easier way to subnet.

Easy subnetting

Instead of memorizing the entire table (Table A), it’s possible to glance at a host address and quickly determine the necessary information if you’ve memorized key parts of the table. First, you need to know your binary-to-decimal conversion. Memorize the number of bits used with each mask that are shown in Table A. Second, you need to remember the following:

256-192=64

256-224=32

256-240=16

256-248=8

256-252=4

Once you have the two steps memorized, you can begin subnetting. Our first example will use the Class C mask of 255.255.255.192. Ask five simple questions to gather all the facts:

- How many subnet bits are used in this mask?
- How many host bits are available per subnet?
- What are the subnet addresses?
- What is the broadcast address of each subnet?
- What is the valid host range of each subnet?

You already know how to answer questions one and two. To answer question three, use the formula 256-

*subnetmask*to get the first subnet and your variable. Keep adding this number to itself until you get to the subnet mask value to determine the valid subnets. Once you verify all of the subnets, you can determine the broadcast address by looking at the next subnet’s value. The broadcast address is the number just before the next subnet number. Once you have the subnet number and broadcast address, the valid hosts are the numbers in between.

Here are the answers using 255.255.255.192:

- How many subnet bits are used in this mask?

Answer: 2

2^{2}-2=2 subnets - How many host bits are available per subnet?

Answer: 6

2^{6}-2=62 hosts per subnet - What are the subnet addresses?

Answer: 256-192=64 (the first subnet)

64+64=128 (the second subnet)

64+128=192. However, although 192 is the subnet mask value, it’s not a valid subnet. The valid subnets are 64 and 128. - What is the broadcast address of each subnet?

Answer: 64 is the first subnet and 128 is the second subnet. The broadcast address is always the number before the next subnet. The broadcast address of the 64 subnet is 127. The broadcast address of the 128 subnet is 191. - What is the valid host range of each subnet?

Answer: The valid hosts are the numbers between the subnet number and the mask. For the 64 subnet, the valid host range is 64-126. For the 128 subnet, the valid host range is 129-190.

Let’s do a second example using the Class C mask of 255.255.255.224. Here are the answers:

- How many subnet bits are used in this mask?

Answer: 3 bits or 2^{3}-2=6 subnets - How many host bits are available per subnet?

Answer: 5 bits or 2^{5}-2=30 hosts per subnet - What are the subnet addresses?

Answer: 256-224 =32, 64, 96, 128, 160 and 192 (Six subnets found by continuing to add 32 to itself.) - What is the broadcast address of each subnet?

Answer: The broadcast address for the 32 subnet is 63. The broadcast address for the 64 subnet is 95. The broadcast address for the 96 subnet is 127. The broadcast address for the 160 subnet is 191. The broadcast address for the 192 subnet is 223 (since 224 is the mask). - What is the valid host range of each subnet?

Answer: The valid hosts are the numbers in between the subnet and broadcast addresses. For example, the 32 subnet valid hosts are 33-62.

Let’s do a third example using the Class C mask of 255.255.255.240. Here are the answers:

- How many subnet bits are used in this mask?

Answer: 4 bits or 2^{4}-2=14 subnets - How many host bits are available per subnet?

Answer: 4 bits or 2^{4}-2=14 hosts per subnet - What are the subnet addresses?

Answer: 256-240 =16, 32, 48, 64, 80, 96, 112, 128, 144. 160, 176, 192, 208 and 224 (14 subnets found by continuing to add 16 to itself.) - What is the broadcast address of each subnet?

Answer: Here are some examples of the broadcast address: The broadcast address for the 16 subnet is 31. The broadcast address for the 32 subnet is 47. The broadcast address for the 64 subnet is 79. The broadcast address for the 96 subnet is 111. The broadcast address for the 160 subnet is 175. The broadcast address for the 192 subnet is 207. - What is the valid host range of each subnet?

Answer: The valid hosts are the numbers in between the subnet and broadcast addresses. The 32 subnet valid hosts are 33-46.

Let’s do a fourth example using the Class C mask of 255.255.255.248. Here are the answers:

- How many subnet bits are used in this mask?

Answer: 5 bits or 2^{5}-2=30 subnets - How many host bits are available per subnet?

Answer: 3 bits or 2^{3}-2=6 hosts per subnet - What are the subnet addresses?

Answer 256-248 =8, 16, 24, 32, 40, 48, and so forth. The last subnet is 240 (30 subnets found by continuing to add 8 to itself). - What is the broadcast address of each subnet?

Answer: The broadcast address for the 8 subnet is 15. The broadcast address for the 16 subnet is 23. The broadcast address for the 48 subnet is 55. - What is the valid host range of each subnet?

Answer: The valid hosts are the numbers in between the subnet and broadcast addresses. For example, the 32 subnet valid hosts are 33-38.

Let’s do a fifth example using the Class C mask of 255.255.255.252. Here are the answers:

- How many subnet bits are used in this mask?

Answer: 6 bits or 2^{6}-2=62 subnets - How many host bits are available per subnet?

Answer: 2 bits or 2^{2}-2=2 hosts per subnet - What are the subnet addresses?

Answer: 256-252 =4, 8, 12, 16, 20, and so forth. The last subnet is 248 (62 subnets found by continuing to add 4 to itself). - What is the broadcast address of each subnet?

Answer: The broadcast address for the 4 subnet is 7. The broadcast address for the 8 subnet is 11. The broadcast address for the 12 subnet is 15. The broadcast address for the 20 subnet is 23. - What is the valid host range of each subnet?

Answer: The valid hosts are the numbers in between the subnet and broadcast addresses. For example, the 16 subnet valid hosts are 17 and 18.

How do I use this information?

Let’s take a look at an example that will highlight how the above information is applied.

A host configuration has an IP configuration of 192.168.10.17 255.255.255.248. What are the subnet, broadcast address, and host range that this host is a member of? The answer is: 256-248=8, 16, 24. This host is in the 16 subnet, the broadcast address of the 16 subnet is 23, and the valid host range is 17-22. Pretty easy!

Here is an explanation of this example: First, I used 256-subnetmask to get the variable and first subnet. Then I kept adding this number to itself until I passed the host address. The subnet is the number before the host address, and the broadcast address is the number right before the next subnet. The valid hosts are the numbers in between the subnet and broadcast address.

Let’s examine a second example. A host configuration has an IP configuration of 192.168.10.37 255.255.255.240. What are the subnet, broadcast address, and host range this host is a member of? The answer is: 256-240=16, 32, 48. This host is in the 32 subnet, the broadcast address of the 32 subnet is 47, and the valid host range is 33-46.

Let’s go through a third example: A host configuration has an IP configuration of 192.168.10.44 255.255.255.224. What are the subnet, broadcast address, and host range this host is a member of? The answer is: 256-224=32, 64. This host is in the 32 subnet, the broadcast address of the 32 subnet is 63, and the valid host range is 33-62.

Here’s a fourth example: A host configuration has an IP configuration of 192.168.10.17 255.255.255.252. What are the subnet, broadcast address, and host range this host is a member of? The answer is: 256-252=4, 8, 12, 16, 20. This host is in the 16 subnet, the broadcast address of the 16 subnet is 19, and the valid host range is 17-18.

Let’s go through a final example. A host configuration has an IP configuration of 192.168.10.88 255.255.255.192. What are the subnet, broadcast address and host range this host is a member of? The answer is: 256-192=64, 128. This host is in the 64 subnet, the broadcast address of the 64 subnet is 127, and the valid host range must be 65-126.

Conclusion

It is important to be able to subnet quickly and efficiently. After studying the examples presented in this Daily Drill Down, you should be familiar with this process with Class C addresses. Practice your subnetting as much as possible, and the process will get easier and easier. In my next Daily Drill Down, I’ll take subnetting a step further and discuss subnetting a Class B network address.