We cover all sorts of different topics on this site. Today, we are starting a multipart series on subnetting. These concepts are fundamental building blocks for network administrators, engineers and architects. The subnetting topics outlined in this series should be well understood prior to moving into advanced design or configuration topics. Moreover, the underlying technical concepts of this subject should be understood prior to utilizing any shortcuts to calculate subnet addresses and useable address space.
So the question I ask today is–
What is a Subnet?
If I asked this as a multiple choice question, which one of the possible answers would you choose?
- In OSI terms, the layer under the network layer–also known as the data link layer.
- A subset of a Classful Network
If you chose answer B, you are correct. A subnet is a subset of a Classful Network. So the next logical question is, “What is a Classful Network?”
As we answer these questions, we will use “Classful Network” and Network interchangeable. As we move to discussions about subnets, we will explicitly address them as such.
Classful Networks, in TCP/IP terminology are outline in RFC791. It specifically states the following–
Addresses are fixed length of four octets (32 bits). An address
begins with a network number, followed by local address (called the
“rest” field). There are three formats or classes of internet
addresses: in class a, the high order bit is zero, the next 7 bits
are the network, and the last 24 bits are the local address; in
class b, the high order two bits are one-zero, the next 14 bits are
the network and the last 16 bits are the local address; in class c,
the high order three bits are one-one-zero, the next 21 bits are the
network and the last 8 bits are the local address.
In short we can look at these two ways. We can consider the binary definition given in the RFC. This definition was expanded on in a previous article. Another option is to consider the table of useable IP address ranges.
Useble IP Addresses per Class
- Class A — 1.H.H.H–126.H.H.H
- Class B — 128.N.H.H–191.N.H.H
- Class C — 192.N.N.H–223.N.N.H
In the above example, H indicate an address portion used for host addressing. Likewise, N windicate a portion of the IP address that would be considered to be part of the network address.
Using these definitions, we can quickly determine the Class an IP address falls into. An address like 10.2.2.2 would be a Class A address and be considered part of network 10.0.0.0. The address 172.16.24.5 would be considered Class B and the associated network address would be 172.16.0.0. The concept of subnetting is a way to carve these classful address space into several, smaller address spaces.
So why do we need subnets?
The short answer is that we need subnets for flexibility and scale. Based on the definitions in RFC791, we could only define a relatively small number of networks.
- Class A — 126 Networks Available (16,777,214 hosts per network)
- Class B — 16,384 Networks Available (65,534 hosts per network)
- Class C — 2,097,152 Networks Available (254 hosts per network)
While 2,113,662 seems like a lot of networks, it really isn’t enough in practice. It is necessary to consider the fact that every network segment needs to have a network assigned to it. The reason we need IP Subnets is so we can better utilize the IP address space that is available. Few networks need the ability to connect 16,777,214 or 65,534 hosts, but the total number of networks available is simply too limited.
So as I mentioned, subnets are subset of the networks we just talked about. We can take a simple example and work through the process of allocating a large network into smaller subnets as necessary.
Considering an example of 10.2.2.2, this would be one of 16,777,214 useable IP addresses (10.0.0.1-10.255.255.254) on a network. There exists the very real possibility that only a couple hundred IP addresses are needed in a given area. Wouldn’t it be nice to somehow describe this network as 10.2.2.1 through 10.2.2.254? That is exactly what subnetting does. Furthermore, this allows for adjacent subnets to be used as necessary. For example, 10.2.3.x (10.2.3.1 – 10.2.3.254) can be used in another part of the network.
Stay tuned for more articles that will systematically step through simple to complex examples of the subnetting concepts.