Single IP is purchased by the company and this single IP is responsible for networking of all the departments in a company. Being interested in networking, this is the first question that comes in the minds, How a single IP can be used by all the departments? The answer to this lies in the concept of subnetting. So, the question arises, what is subnetting? Converting single IP into more networks is called subnetting.
What is subnetting?
In my previous post, IP Addressing, network and host bits are explained in detail. An IP consists of network and host bits. For example, 192.168.7.1 is a class C IP Address. 24 bits are network bits and 8 bits are host bits. This number of network bits can be increased or decreased depending on our demand. This concept of increasing network bits is called subnetting.
For example, a company purchased this IP, 192.168.7.1. But the company has two departments. Depending on a number of departments, company needs two networks. We need to divide this single IP into two networks. This can be done by increasing the number of network bits. This is called subnetting.
How is subnetting done?
We need to convert the above mentioned IP into two networks. This process is done in seven steps:
- Find the class of IP. In our example, class is C.
- Write number of network and host bits of the class. In our example, class C means, 24 network bits and 8 host bits.
- Write default subnet masl of the class in binary. In our example,
255 . 255 . 255 . 0
11111111.11111111.11111111.0 - Formula “2^n = number of branches(networks)” is used. In this formula,
n = Number of bits increased in network bits.
In our example, we need two networks, therefore, 2^1 = 2 will work for us. This means we need one bit to be added in default network bits and one bit to be subtracted from default host bits. - Adding and subtracting the calculated number of bits in default number of bits.
Network Bits = 24 + 1 = 25
Host Bits = 8 – 1 = 7 - New subnet mask = 11111111 . 11111111 . 11111111 . 10000000
255 . 255 . 255 . 128 - Finding new networks. This can be done by expanding the subnetting octet into binary. For example, in our example, subnetting octet is last octet, therefore, 192.168.7 will remain same and last octet will be changed. This is done as follows:
Network Bits (24) : Subnetting bits (1) : Host bits (7)
192.168.7. : 0 : 0000000
192.168.7. : 1 : 0000000
So, new networks in our example are:
1) 192.168.7.0 / 25
2) 192.168.7.128 / 25
These new network IDs after subnetting are called as subnetting IDs.
When and Why is subnetting required?
- When number of users is more than the number of IPs available. For example, we purchased one IP, with number of bits equal to 8. This means we have 254 IPs available. But let’s suppose we want 500 IPs. Then we are required to split one IP into two network IDs, so that, we could have 500 IPs.
- Relieving network congestion. For example, we have one network and all the data will be transferred through that one network. Therefore, we will use switches and hubs. Switches and hubs make network slow and this results in colliding and damaging of packets. To avoid this, sinlge network is divided into different networks, so that, traffic can be forwarded through different networks.
I hope this will be helpful for a lot of people who still have confusion! Please comment, if you know something else which I missed or stated incorrectly.
More blogs related to networking coming soon. So, Stay tunned!
Thanks!