von todlamle In Networking

An

### Subnetting a class C network address

Subnetting a Class C network can be difficult to master. From MCSE to CCNA to RHCE and CNE, you must know it and know it well. Todd Lammle guides you through clear instructions and step-by-step examples to help you master this skill.

Let's face it, one day you're going to need to subnet a network. While IP addressing isn't a network administrator's favorite job, it's an important skill you must have.

**SEE****:Download: Time Management Tips for Tech Pros(TechRepublic)**

In this Daily Drill Down I will continue our discussionIP addressingby examining the process of taking a large range of IP addresses and dividing it into smaller, more manageable pieces. Since this is an intricate and complicated process, I will only address the process of breaking up class C networks. First we need to discuss why we would want to subnet a network and the benefits of doing so.

Why subnetting?

By creating smaller IP networks (rather than one large network) we can achieve better security, smaller collision and broadcast domains, and greater administrative control over each network. Think of a network like streets in a city. Each house in this network is known by street name and address. Think of the addresses on the houses as the hardware addresses of a host. In order for IP to communicate with a host, the IP address must be known, and the router connected to the network where that host resides must also know the hardware address of the house. What if a city didn't have many blocks, just one long street? The postman would go crazy trying to deliver the mail correctly to every house because he would need to know the address of every house. It's the same scenario with IP. By creating smaller networks, we can get data to each host more effectively. Subnetting a Class-C Network So you understand why you want to create a subnet, but how do you do it? Your goal is to look at a host's IP address and subnet mask, and then quickly determine three things:

- The subnet that the host is on
- 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 needs to be found. Why? Because these are not valid host addresses and cannot be assigned to host configurations. By determining the subnet and broadcast addresses, we can easily determine the host addresses as well, since 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, 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 create smaller networks, called subnetworks, we borrow bits from the host part of the mask. Since the class C mask only uses the last octet for host addressing, we only have 8 bits available. Therefore, only the following masks can be used in class C networks (**Table A**).

Subset Null: Note that I'm not assuming Subnet Null in the table below. While Cisco teaches a subnet null assumption, they don't test that way. I decided to take the exam.

Table A

mask | Binary | # subnet bits | # Host-Bits | subnets | host |

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 |

Class C masks

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

To determine the number of subnets, use 2x-2, where the x exponent is the number of subnet bits in the mask.

To determine the number of hosts, use 2x-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 needs. Count the number of networks and the number of hosts per network you need. Then determine the mask using the equations shown above - and don't forget to account for the growth.

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

24-2=14 subnets

24-2=14 hosts

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

Simple subnetting

Rather than memorizing the entire table (Table A), once you memorize the key parts of the table, it's possible to take a look at a host address and quickly determine the information you need. First you need to know your binary to decimal conversion. Note the number of bits used with each mask 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've memorized the two steps, you're ready to start subnetting. Our first example uses the class C mask 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 formula 256-*subnet mask*to get the first subnet and your variable. Add this number to itself until you get the subnet mask value to determine the valid subnets. Once you've checked all subnets, you can find the broadcast address by looking at the next subnet value. The broadcast address is the number immediately before the next subnet number. Once you have the subnet number and the broadcast address, the numbers in between are the valid hosts.

Here are the answers with 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 is 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 subnet 64 is 127. The broadcast address of subnet 128 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 subnet 64, the valid host range is 64-126. For subnet 128, the valid host range is 129-190.

Let's do a second example using the class C mask 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 (Found six subnets by adding 32 to itself.)
- What is the broadcast address of each subnet? Answer: The broadcast address for subnet 32 is 63. The broadcast address for subnet 64 is 95. The broadcast address for subnet 96 is 127. The broadcast address for the Subnet 160 is 191 The broadcast address for subnet 192 is 223 (since 224 is the mask).
- What is the valid host range of each subnet? Answer: The valid hosts are the numbers between the subnet and broadcast addresses. For example, the 32 valid subnet hosts are 33-62.

Let's do a third example using the class C mask 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 are found by adding 16 to itself adds .)
- What is the broadcast address of each subnet? Answer: Here are some examples of the broadcast address: The broadcast address for subnet 16 is 31. The broadcast address for subnet 32 is 47. The broadcast address for the subnet 64 is 79. The broadcast address for subnet 96 is 111. The broadcast address for subnet 160 is 175. The broadcast address for subnet 192 is 207.
- What is the valid host range of each subnet? Answer: The valid hosts are the numbers between the subnet and broadcast addresses. The 32 valid subnet hosts are 33-46.

Let's do a fourth example using the class C mask 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 on. The last subnet is 240 (30 subnets are found by adding 8 to itself).
- What is the broadcast address of each subnet? Answer: The broadcast address for subnet 8 is 15. The broadcast address for subnet 16 is 23. The broadcast address for subnet 48 is 55.
- What is the valid host range of each subnet? Answer: The valid hosts are the numbers between the subnet and broadcast addresses. For example, the 32 valid subnet hosts are 33-38.

Let's do a fifth example using the class C mask 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 on. 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 subnet 4 is 7. The broadcast address for subnet 8 is 11. The broadcast address for subnet 12 is 15. The broadcast address for the Subnet 20 is 23 .
- What is the valid host range of each subnet? Answer: The valid hosts are the numbers between the subnet and broadcast addresses. For example, the 16 valid subnet hosts are 17 and 18.

How do I use this information?

Let's look at an example that shows how the above information is applied.

A host configuration has an IP configuration of 192.168.10.17 255.255.255.248. What is the subnet, broadcast address, and host range this host belongs to? The answer is: 256-248=8, 16, 24. This host is on subnet 16, the broadcast address of subnet 16 is 23, and the valid host range is 17-22. Quite easy!

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

Let's consider a second example. A host configuration has an IP configuration of 192.168.10.37 255.255.255.240. What subnet, broadcast address, and host range is this host a member of? The answer is: 256-240=16, 32, 48. This host is on subnet 32, the subnet 32 broadcast address 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 subnet, broadcast address, and host range is this host a member of? The answer is: 256-224=32, 64. This host is on subnet 32, the subnet 32 broadcast address is 63, and the valid host range is 33-62.

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

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

Conclusion: It is important to be able to create subnets 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 only get easier. In my next Daily Drill Down, I'll take it a step further and discuss subnetting a Class B network address.

### Daily Tech Insider Newsletter

Stay up to date on the latest technology with Daily Tech Insider. We bring you news on industry-leading companies, products and people, as well as featured articles, downloads and top resources. You'll get introductory sessions on hot tech topics to help you stay one step ahead.

delivered on working days