A subnet is a smaller logical partition of a larger IP network. The size of an organisation determines typically the size of a subnet to use. Subnets are usually divided according to the size of an organisation to aid in reducing traffic. Each computer or host on the network usually has a unique identifier known as an IP (Internet Protocol) address. Subnetting also helps to improve network speed.
How Network Subnets work
You use a router in your network to control how subnets are connected. Through the IP addresses, devices in a subnet can connect. The size of a subnet is dependent on the network technology used and the connectivity requirements of an organisation. A point-to-point subnet allows two devices to connect, while for connection of many more devices, a data centre subnet is used/created.
You split an IP address into 2 parts:
- Network prefix (Network ID)
- Host ID
These 2 parts also have classes (class A, B and C) which separate the Host and Network ID.
Figure 1 shows an IPv4 Class B address, 172.16.37.5. Its Network Prefix is 172.16.0.0, and the Host ID is 37.5.
You can identify individual subnets using a Host ID field portion.
In figure 2 above:
The third group of the 172.16.0 network a subnet ID.
Subnet Mask is used to identify the part of the IP address as the subnet ID.
‘AND’ operations are used in network addresses to create the subnet ID.
In Figure 2 above, we see the ‘AND’ of the IP address, as well as the subnet mast, giving the subnet ID; the parts remaining identify the Host ID, i.e. 172.16.2.0 (subnet) and 5 as the Host ID.
Subnet ID Used by networks to give the best route between sub-networks.
The figure above shows only 4 subnets out of a possible 256, and one router connects them. The host ID always gets assigned the value of 0. In the figure, the router interfaces get the host ID of 1, e.g. 172.16.3.1.
A router works by examining its routing table to determine where to send packets it has received by using subnet masks to determine subnet IDs.
Subnets can also be partitioned into smaller subnets to fit the needs of an organisation. The smaller subnets improve the efficiency of the organisation network address utilisation. Always check if there is sufficient address space available.
Modern routing architectures allow subnet masks to be distributed with routes and can be summarised together as a single routing table entry. IPv4 and IPv6 networks both use subnets and subnetting.
Advantages of using Subnets
- Reallocating IP addresses
- Aiding in network congestion
- They are improving network security by making it difficult for hackers/trespassers to access various organisation networks.