Subnetting is essentially dividing up your network into segments. Doing this makes sense if you have a lot of computers, printers, and other host devices on your network, if you have a wide-area network spread across several offices and/or several cities, or if you anticipate major growth in your company in the future.
Big Bang Theory
Okay, subnetting doesn’t really have much to do with cosmic history or funny TV shows, but its history could conceivably be compared to the big bang theory. According to the big bang theory, there was a time when the universe was condensed into a very small area, and then exploded and evolved into the universe we know now. Like the big bang, there was a time when the Internet was very, very small. It was called the Arpanet and it could use one byte (255) to address every single device connected to it. If you could imagine the universe being the size of a pin head, this would be a very good analogy.
Then, some very smart graduate students at Stanford rewrote the Internet protocol, then called NCP, and called their version TCP/IP. They demonstrated that addresses could contain four bytes, thus containing a then-generous amount of addresses in their new protocol.
They also divided their addresses into classes based on the first byte of their protocol. They conceived of a few large networks (class A), more medium-sized networks (class B), and many small networks (class C). Their plan allowed for 126 Class A network addresses, 64,000 Class B network addresses, and almost 2 million Class C network addresses.
Unfortunately, each class C network only allowed for 254 devices, which meant that any medium-sized network wanted a class B of its own. By the early 1990s, the universe was expanding rapidly and the number of available class B networks was declining just as rapidly.
What IP addresses look like
When you had Internet access set up in your home, you may have had a technician come out to hook you up and you may have seen him plugging numbers into your Internet properties tab. Here’s my little “Don’t try this at home” warning: If you don’t know what you’re doing, do not change those! These numbers are your computer’s ID on the Internet and your IP address.
A typical IP address looks like this: nnn.nnn.nnn.nnn, where each n represents a number that can be up to three digits. Thus, an IP address can be 188.8.131.52 or 10.3.100.100, any four numbers separated by periods as long as it is unique. If you have the same IP address as someone else, there could be connectivity problems if you’re both online at the same time.
About IP Addresses
Using TCP/IP, a part of each IP address would identify the network and the rest would identify the specific machine, called a host. This would be like making an international call on your telephone. First you must call the other nation’s code, then the area code, and then the specific phone number.
But how much of a four-byte, 32-bit binary code is the network code? As computer geeks like to say, “It depends.” The addressing plan divided IP addresses into networking and host addresses along byte boundaries. A class A’s network address would reside on the first byte, as in the IP address 184.108.40.206. In this address, the network byte would be 126. and the rest (10.11.12) would be the host address. In a Class B address, the host address would reside in the first two bytes. If an address was 220.127.116.11, the 128.16. would be the network identifier and the 7.4 would be the host machine. In a Class C network, the first 3 bytes would be the network identifier and the last byte would be the host machine. If the IP address was 18.104.22.168, the network identifier would be 204.176.22 and the host machine would be 1.
The picture above gives you the IP address ranges for these three classes. In class A, the first octet goes from 1-126; in class B, the range is 128-191; and class C is 192-223.
If you looked closely, you may have noticed that I left out 127. This octet is reserved as a loopback, or testing, address.
It’s All About Binary
As every computer professional knows, binary code is made up of the ones and zeros, or positive and negative charges, that make up the digital “language” that all computing devices use. When technicians talk about IP addresses, they’re really talking about a series of thirty-two bits, or four bytes, and each number represents one of those bytes.
With binary, you really have two possible types of charges: one or zero. Therefore, each bit in a byte represents a power of two.
The Powers of Two
What do powers of 2 have to do with TCP/IP?
Good question! Let’s say you take a random IP address, say, 127.63.70.8. Each of numbers represent one byte, one octet, eight bits. When you convert each number to its binary value, you want to start with the highest power of 2, which is 27 or 128, and work your way down. Each time, you’re asking the question, “Can I subtract this power of 2 from my number, and have an answer greater than or equal to zero?” If the answer is yes, you get a one and your number decreases by that amount; if the answer is no, you get a zero and your number stays the same.
Let’s start with the first number in our IP address, 127. Can you subtract 27 from it and get a number greater than 0? The answer is no, so you put a 0 in the eighth position as shown in the chart. Next, you try subtracting 26, or 64, from 127. Obviously, you can, so you put a 1 in the seventh spot in the chart. Your new number is now 63.
If you have some ability with math, you should be able to work out the rest of it. You should end up with something that looks like 01111111. This is your first octet in digital language. You can repeat the process with your other three numbers; the result should look like 01111111.001111111.01000110.00001000.
About Subnet Masks
The default subnet mask a network will have will depend on which class it belongs to. If a network is class A, its default subnet mask will be 255.0.0.0; if class B, the mask will be 255.255.0.0; if it is class C, the mask will be 255.255.255.0. The 255 means all the bits in the octet are turned on (11111111); the zeros mean all the bits are turned off (00000000).
About Subnet Masks
As a general rule, the default masks are not used in a subnet. However, the masks we can actually use is calculated by determining how many subnets we need.
For class C networks, remember, the default subnet mask is 255.255.255.0. With Class C, it is possible to have 2,097,152 networks but only 254 hosts per network. Why? Because the 255th is reserved for broadcasting!
Let’s say you need 5 subnets and your network IP address is 22.214.171.124. You need to calculate the power of two (2n) will allow you five networks.
Since you need five subnets, the minimum power of 2 you need is 23, or 8 possible subnetworks. Certain legacy routers will not recognize the first or last one, which is where the (-2) of the Usable Subnets equation above comes in, so you should only use a maximum of six of those subnetworks to be on the safe side.
Create Your Subnets
First, you will need the masks for each of your subnets. Remember, the default subnet mask for a Class C network is 255.255.255.0. When you create subnets, you need to borrow bits from the host and use them as network bits. In the case of a class C network, you’re borrowing bits from the last octet, the 0, because the 255.255.255 are already used by the network.
Let’s go back to the powers-of-2 chart above. Since we already determined that we can have 23, or 8, possible subnetworks, we can draw a line just to the left of that. The result would look something like this:
This tells us how many bits we need to borrow. When we borrow bits, we start with 27, or 128, and move our way back through the powers of 2 (27, 26, 25, …) In this case, we need to borrow three of these bits and turn them on.
Now, we add these three numbers, 128 + 64 + 32, to get our new subnet mask. This gives us 224, so our subnet mask is now 255.255.255.224.
How many hosts can we have on each subnet?
Remember the equation, Usable Hosts = (2n) – 2 , where N = power of bits remaining? Each host is one device, such as a router, computer, or printer, on your network. Don’t worry, the cables don’t count, since they’re strictly used to carry the data from one device to another.
Again, for the purposes of this example, we’re using 23, or 32. Which means you can have up to 30 devices on each subnetwork.
Why should I subtract 2? Why can’t I just use all 32? Well, the first address in each subnet is usually reserved for the router that acts as a gateway for the subnet, and the last address is used for multicasting, or sending messages to more than one machine at once.
To get the IP addresses you can use for each subnet, you increment the last byte by 32. So you have:
When you reach 255, stop! Remember, in binary, 255 = 11111111, or all bits turned on in one byte.
Add Addresses to your Subnets
When Should You Subnet?
Subnets are recommended for large networks and/or companies, networks that cover large areas, and companies that need to control how their data flows over the network. If you are dealing with a small network that could reasonably be covered in a single subnet or a temporary network, it is usually not necessary to subnet.
A Subnetting Problem Demonstrated
Learn More About Technology
So you already have several certifications but you’d still like to impress your company’s IT manager with your technological skills in a legal way. These books can help.
Networking Supplies To Check Out