This page is about IP Subnetting.

Some people may arrive here looking for a “subnetting chart”. If this is what's being sought, check out the Variable-Length Subnetting Chart and/or other VLSM charts in the section about making subnets.


IP Subnetting: Part 2: Key Subnet Rules

(This is meant as a follow-up of IP Subnetting.)

Frequent Questions
A test question

A great question for creators of tests/exams is to ask whether addresses are in the same subnet. For example: are and in the same subnet? In other words, is in the same group as the group that is in?

Clearly, the answer is: “That depends on how big each group is.”

If these addresses are split into groups of four addresses (as shown in the column that says “4 groups”), then the answer is: “No.” If the addresses are split into larger groups (as shown in the column that says “2 groups”), then these example addresses are in the same subnet. (If that isn't clear, then check out the sample groups, and you can easily find that each of those statements is true.)

Do all the subnets need to be the same size?

Some people may wonder if subnets may be different sizes. For example, could the sixteen addresses be split into three groups, by having one group of 8 addresses and then two groups of 4 addresses? To explain the question visually, can the addresses be split up like the sample chart that is named “Unevent Split”?

Uneven Split
1 subnet 3 subnets

(See the chart to the right.)

In the sample shown earlier, every subnet was the same size. Clearly, a group of 16 addresses could be split into 2 subnets (with 8 addresses in each subnet), or 4 subnets (with four addresses in each subnet). In that sample shown earlier, each of the smaller groups was the same size. In other words, the larger groups were split into equally-sized groups.

The basic question now is: is it legal to split one subnet into three subnets (of different sizes)? If so, the chart to the right demonstrates a legal example. Is this legitimate?

The answer to that specific question is, “yes”, that can be done. So, to answer the other question, “No”, there is not a requirement that all subnets need to be the same size. However, some things can become more complicated when subnets are different sizes. Therefore, having subnets that are the same size is often a good/recommended idea.

To accomplish the example that was just described, some addresses need to be split off into a group. (For instance, the latter half of the sixteen addresses were split up into a group going from through Then, that group needs to be split into two smaller groups ( through, and through

Creating the sunets, as shown on the right, involved having some addresses being split into subnets multiple times. For instance, the step of placing an address (like is a step that ends up occurring twice. (The first time, that address was placed in a group that ended with The second time, that address was placed in a group that ended with Because that address had to be placed into a group multiple times, this was technically more steps than if the splitting action only happened once. Therefore, creating such uneven subnet sizes is considered to be a bit more complicated, but there's no rule that prevents that from happening. So, to be clear, the answer is: yes, you can do this.

Frequently, steps need to be taken for each individual subnet, like adding a network “route” to the subnet so that a nearby “router” knows how to handle the subnet. Although this is possible, this is not necessarily recommended. Having additional subnets can create more work for the networking equipment. Communications may be slower when network equipment needs to perform more work. Also, having additional subnets can create more work for people who may need to perform a task for each of the individual subnets that are being used.

So, having a group of 12 addresses is possible, by having a subnet of eight addresses and also another subnet of four addresses is possible. However, in practice, that is often not the easiest way to go about things. Tasks might require less work overall if people try to split addresses into subnets that are equal in size. By the time people set up routes in a router, people may have enough experience to be able to understand that concept from experience.

Note that there is nothing particularly magical about the numbers of 16 addresses, 12 addresses, 8 addresses, or 4 addresses. Larger subnets may provide a considerably larger number of possible ways that things can be split up. The example that was just shown simply shows one way to split up a group of some IPv4 addresses. (Another way, of course, would be to smiply split the 16 addresses up into four equal-sized groups.)

How about making a subnet with 12 addresses in it?

For example, can a group of 16 addresses be split into a group of 12 addresses and then a group of 4 addresses?

So, since the last question indicated that this is legal:

Uneven Split
1 subnet 3 subnets

... the current question is... does the following chart show legal subnets?

1 subnet 2 groups?!?

The answer is: No. The second chart (which is labelled “Dozen-Big”, and which shows 2 groups) is not proper subnetting. A single subnet will not contain exactly 12 addresses.

A group of 4 addresses can be separated. This is shown in the workable example (in the table called “Uneven Split”), which shows through in a separate subnet. The remaining addresses could exist in a group of eight addresses and another group of four addresses, as shown in the earlier chart that shows 3 subnets and was created with valid subnetting technqieus. So, a person can use two subnets that are numerically right next to each other, and there may be 12 addresses contained in that combination of two subnets, while the remaining four addresses are in a seperate, third subnet.

A single subnet will not contain exactly twelve addresses because of the following specific rule about subnet sizes. Even though subnets of different sizes can exist on the same network, subnet sizes should always be a “power of two”. (Some “powers of two” include 4, 8, 16, 32, and 64.) (64 is not the largest subnet size. You can keep doubling those numbers to find some other possible subnet sizes. The entire IPv4 address range could be broken up into two very large subnets which each have 2,147,483,648 addresses.)

Subnet sizes should always be a “power of two”. This is the rule to remember when deciding how big to make a subnet.

Now, here is an explanation of why this requirement exists. The reason that the number of network addresses in a subnet is always a “power of two” is related to the fact that each IP address has a “host portion” that can be uniquely identified by using a certain number of bits. For example, three bits can be used to identify 8 different individual unique addresses. If four bits are used, then 16 individual addresses can be unique. If five bits are used, then 32 individual addresses can be unique. There is no number of bits that can support a maximum of exactly twelve network addresses, but which cannot also support 16 network addresses. If you have at least four bits, which would be needed to identify at least twelve addresses, then you also have enough bits to be able to support sixteen addresses. Since sixteen different addresses can be specified when at least four bits are being used to identify the individual hosts, we say that the subnet has at least sixteen addresses. (The subnet has sixteen addresses if you have exactly four bits, and more addresses if you have more bits.) Since each bit has two possible values, each additional bit doubles the number of addresses that are in a subnet. As a result, the number of addresses in a subnet will always be a power of two.

Recap: considering a group of 12 addresses

So, as just described by the prior two questions, a group of eight addresses and a group of four addresses could be made. Note that although this could be done, this is not necessarily preferred. Subnets of different sizes can be a bit more challenging to work with.

  • One reason is because groups may need to get split multiple times to accomplish an uneven split.
  • Another reason is that there are some costs for having multiple subnets.
    • There may be a need to support more networking routes, which can take additional time to set up.
    • Also, more IPv4 addresses may be classified as “unusable” when there are multiple smaller IPv4 subnets.

For at least these reasons, creating a group of eight addresses and another group of four addresses may be less desirable than just using a group of sixteen addresses, if possible.

Could the addresses have been split into groups of two addresses each?

Some people may wonder if a group of sixteen addresses could be split into eight separate groups.

This is not generally supported for IPv4 addresses. Basically, there are some problems if people try to do this. These problems might not be problems that were absolutely technically necessary. (There is no mathematical properties that caused such prolems.) However, the simple fact is that some software and some hardware might not like dealing with the first address of a subnet, or the last address of a subnet. As a result, using those addresses as standard IPv4 addresses is not recommended. Some courses may even describe such activity as being a violation of standard networking rules. So, to avoid problems, simply don't do this.

(For anyone who is still remaining curious about the reasons why this is not recommended, some further information may be read by viewing the descriptions in the glossary entry for “network ID” and perhaps glossary entry for “broadcast address”.)

Do all of the splits need to be the same size?

Each time there is a split, all of the groups become the same size.

For instance, consider the example where there were three subnets:

Uneven Split
1 subnet 3 subnets

The way those results were obtained was by subnetting multiple times. The following chart will help to show the subnetting actions that were taken.

How 3 Subnets Were Identified
16 per group 8 per group 4 per group

As you can see from the chart called “How 3 Subnets Were Identified”, each of the subnets in the “Uneven Split” chart's “3 subnets” column was able to be obtained simply by splitting a larger subnet in half.

So, from that point, can through just be combined with through to just create one combined subnet that goes from through

While sometimes subnets can be combined, network professionals might not like the above grouping, because one of those groups has 12 addresses. That really means that group technically isn't a proper subnet, because subnets should always have a number of addresses which is a power of two.

However, the following is legal:

16 per group 8 per group 4 per group

The first split that occurred was splitting the through into two subnets, the subnet containing through and also the subnet containing through Then, the second split was going from through into two smaller subnets, which are the subnet going from through and the subnet going from through

Some people may prefer to take fewer steps, and may prefer to just perform one complex operation. So, instead of:

  • Getting a subnet with the first half of the addresses
  • Getting another subnet that contains the second half of the addresses
  • and then splitting that second subnet in half

Instead, some people might want to try to save a step, by following this process...

  • Getting a subnet with the first half of the addresses
  • Getting another subnet that contains the third quarter of the addresses
  • and then havinga nother subnet that contains the final quarter of the addresses

This second approach involves trying to divide by 4 once, and mentally combining the first two groups, instead of performing two separate simple splits which involves going through the division process multiple times (when dividing by 2 twice).

Doing that really requires a bit more mental effort to keep track of things, similar to trying to keep track of dividend and a divisor and a partial quotient and subtraction results while performing “long division” all in a person's head. Although some people may be able to do some mental “long division” successfully (and that can get harder and harder as more non-repeating digits get calculated), there are other people who probably struggle more with trying to do such tasks in their head.

Thinking of this as multiple simple splits is probably the simpler way to safely producing working results, and so that is the recommended process for people who are initially learning the technique. If some people start to feel comfortable with splitting numbers into subnets, and think they can do things faster, they are hereby recommended to be careful enough to not do the humiliating thing of getting incorrect results. Some people may feel daring and try to risk keeping track of things mentally, and end up making mistakes because of an attempt to take a “shortcut” by doing things quickly in their heads, instead of systematically performing each step of the process in a slower, deliberate and careful way.

Each person can judge their own comfort level and desire of how much they wish to mentally keep track of things, but do keep in mind that errors are highly undesirable, and so people should be very careful that trying to take shortcuts doesn't humiliatingly lead to making mistakes that could have easily been avoided. If there's any doubt, do things the long way (even if it is slower), and gain the comfort from verifying accuracy.

The discussion continues, being carried on by “IP Subnetting: Part 3: Details Specific to IPv4 and IPv6”.