In this article, we talk about subnetting an IPv4 network. More specifically, we will find out of which IP addresses a network is formed, what size can a network have and how.
Both IPv4 and IPv6 addresses use subnetting, which consists of splitting the IP address into two parts: the network address and the station address. Using a network mask, the computer can determine where to divide the IP address (according to the RFC 950 standard).
Subnetting appeared as a solution to the problem of IPv4 address depletion. Along with the notion of subnetworks, the distinction between “classfull” (which takes account of address classes) and “classless” (which provides support for the subnet field) appeared.
Subnetting is very important when it comes to designing a network and may involve additional costs if it is not done correctly.
The IPv4 address is made up of 32 bits. Here’s a classic networking IP address example: 192.168.0.0/24.
192.168.0.0 is the network itself similar to a street name, and /24 is the network mask which is the size of the network and the total number of IPs that make up the network, you can associate the mask as the maximum number of houses that can be built on a street.
To be able to subnet a network, we first have to answer the following questions:
1) How many IPs can I have on a network with a given mask, such as / 24
2) What is the first and last usable IP?
3) What IPs belong to the network?
Let’s take the network 170.10.5.0/27 and answer the first question:
1) 32 – 27 = 5, 2 ^ 5 = 32 – the maximum number of IPs in a mask / 27 network
2) First IP: 170.10.5.1, Last IP: 170.10.5.31
3) All IPs in the range 170.10.5.1 – 170.10.5.30 belong to the network.
The IPv4 address is made up of 32 bits.
A current definition for a subnet could be any network that belongs to a larger network address space.
The subnetting process consists of splitting a larger network across multiple networks that meet a set of requirements.
Understanding the subnetting process helps us answer the questions:
1. Is the bought address block enough for our organization’s requirements?
2. Can we organize our networks in such a way that we will be ready for the enlargement of the number of our stations?
3. Is an optimal address space allocation required or it is enough if we divide the IPs equally between departments?
4. Can we optimize routing tables if we have a vast network?
There are two types of subnetting:
1. In equal subnets
2. Optimal with minimal address loss
Example: Force the address space 192.168.10.0/24 to accommodate three types of networks: with 60 stations, 30 stations or 15 stations.
The networks obtained must be equal in size.
The answer is as follows:
We need 3 subnets so we need to borrow 2 bits for the subnet of the IP address
Subnetting network 192.168.10.0./24
First subnet 11000000.10101000.00001010.00 000000/26
Second subnet 11000000.10101000.00001010.01 000000/26
Third subnet 11000000.10101000.00001010.10 000000/26