IPv6 is the newest version of the internet protocols, and should overcome the central issues of its predecessors. Included in these issues is the impending shortage of IPv4 addresses as well as the violation of the end-to-end principle by the strict separation of public and private IPs. This article gives an overview of the functions of IPv6 as well as the structure and distribution of address...
Like any computer network, the internet is a connection between many computers that communicate with one another. By now, dividing the huge Internet network into different subnets has become unavoidable. To understand what subnetting is, why it was introduced, and how to compute a subnetmask, it will be useful to first clarify a few basics on computer networks.
How does communication inside a network take place?
Since 1981, the internet has been operating on the basis of the ‘internet protocol’: a network protocol that regulates the dispatch routes of users. To send a data packet in a network, the transmitter must know the IP address of the receiver. The Net ID and Host ID are hidden inside the IP address. Thus, the corresponding network and its host – e.g. a PC or a network printer – can be identified. Based on this information, routers are able to forward data packets to the correct recipients.
Computers only understand zeros and ones, so they operate in binary systems and as a result of this, IP addresses are also configured in binary. The current operating IPv4 system consists of 32 bits, i.e. 32 zeros or ones. To make it easier to understand and to save space, IP addresses are usually represented in decimal notation, and by dots – the ‘dotted decimal notation’: 192.168.88.3.
Each position corresponds to a power of two. Whether or not this is added to the sum is indicated by 1 or 0. This means:
1 * 2^7 + 1 * 2^6 + 0 * 2^5 + 0 * 2^4 + 0 * 2^3 + 0 * 2^2 + 0 * 2^1 + 0 * 2^0 = 128 + 64 = 192
This format provides a finite number of possible addresses – to be exact: 232(i.e. 4.294.967.296) addresses can be assigned. It sounds like a lot, but these addresses are consumed faster than you would think. Subsequently, subnetting was introduced in 1985.
What is subnetting?
According to a simple subnetting definition, this means the division of a network into several subnetworks. For example, subnetting allows network administrators to split their own company network into subnets, without making them known on the internet. That means that the router which eventually connects the network to the internet is still specified as the actual address, but many hosts can be concealed within it. The number of possible hosts available to the administrator is greatly increased. With the introduction to IPv6, which comprises 128 bits and will replace the older version in the coming years, missing IP addresses will no longer be the main reason for creating subnets.
Because IPv6 addresses with 128 bits are very long, even in decimal notation, they are represented in hexadecimal. Additionally, bit blocks containing only zeroes remain empty in the notation: 2001:620::211:24FF:FE80:C12C. For more information, see our internet protocol 6 article.
However, there are even more reasons for subnetting: subnets work independently and data transfer is faster. Why? Subnetting makes networks easier to manage. A broadcast, which is when a subscriber sends data to the entire network, runs relatively uncontrolled through a subnet. Subnets are used to route data packets through the router much more specifically to the receivers. If the sender and receiver are in the same subnet, the information can be delivered directly and need not be redirected.
When the internet protocol was introduced, the Engineering Task Force (IETF) had classified four types of IP address: A, B, C, D, and E. They recognise the class by the address range in which they are located.
|Class A||Class B||Class C||Class D||Class E|
|0.0.0.0 - 127.255.255.255||188.8.131.52 - 184.108.40.206||192.0.0.0 - 220.127.116.11||18.104.22.168 - 22.214.171.124||240.0.0.0 - 255.255.255.255|
The class determines how many network addresses are available and how many hosts there are in each network. In class A, only the first block of numbers (sometimes called an octet because there is a block of 8 bits) is reserved for the network address, while the three remaining are available for host IDs. This results in fewer networks, but many hosts. In class B, the first two blocks are responsible for the net IDs – that is, more networks but fewer hosts. In class C, only the last octet for the host addresses remain. The class D and E address ranges are reserved but not assigned.
the classes for the size of the networks have been meaningless since 1993. However, since subnetting was introduced in 1985 and was conceived as a solution to the problem of restricted network size, it is useful to now understand the system. The Internet is now based on the principle of Classless Inter-Domain Routing (CIDR). The IP address is no longer the size of a network.
How does subnetting work?
In subnetting, bits are ‘borrowed’ from the host ID to create a subnet. If you only borrow one bit, you have the possibility to create exactly two subnets, because only 0 or 1 are possible. For further subnets, more bits must be released, leaving fewer places for host addresses. IP addresses with a subnet look exactly the same as those without. Even a computer cannot recognize the difference, so ‘subnetmasks’ are created. If data packets are sent from the Internet to their own network, the router decides which subnet it uses to distribute the data. Just like the IPv4 addresses, subnet masks consist of 32 bits (or bytes) and are placed on the address like a mask or template. A typical subnetmask looks like this: 255.255.255.128
The Windows IP address and subnet mask can be found using the command prompt and the command ipconfig.
Again, this can be shown in binary form: 11111111.11111111.11111111.10000000
Now we can make a logical AND comparison:
In the comparison, it is assumed that only the combination of two ones in the same place yields a one again. All other comparisons (1/0, 0/1 and 0/0) yield 0 are not only done by you, the router also performs these calculations.)
The AND comparison yields the network address. The host address takes into account all digits that appear in the right-hand area of the zeroes. In our example:
IP address 192.168.88.3
Within a subnet, the first and last IP addresses are only used to a limited extent. The first IP address (this has only zeros in the host part) is called the network address. This means that there are always two hosts less than addresses available.
How do you calculate a subnetmask?
We have now shown which conclusions can be made from IP addresses and subnetmasks. However, network administrators are regularly confronted with another problem: the network address and the number of hosts that must be accommodated in the given subnet. Admin must calculate a subnetmask that allows enough hosts, and to do so uses this formula:
x = 2^n - 2.
Since we are still in the binary system, we calculate in powers of two. N corresponds to the number of bits which are zero in the subnet mask. The value 2 is subtracted to make the broadcast and network address disappear from the result. X yields the possible hosts.
Let’s say the network administrator has 150 PCs in his network. First, he looks for the next highest power of two. 27 cannot be considered since 128 is too small. Therefore he decides on 28-2, thus 254 hosts. The last 8 bits of the subnetmask are then 0:
The subnetmask 255.255.255.0 allows enough hosts to be released. It should also be noted that you can only generate subnets by borrowing bits from the host part one by one from left to right. This results in the proper structure of the subnet mask and the fact that only nine different values can be used in an octet:
Subnetmasks are often represented by a suffix. Instead of specifying the IP address and subnet mask, you can specify the set of 1-bits as an addendum to the IP address. In our original example: 192.168.88.3 / 25
Why is subnetting so important?
The series of numbers, binary conversions, and logical comparisons have a deterrent effect. Particularly in the context of the approach to IPv6, some might ask themselves: Is it worth it at all? The answer is clear: yes! This is why subnetting remains useful in the future:
- Extending the address range within a network: By subnetting, the network administrator can decide how large his networks will be.
- ast connection between hosts of a subnet: Data packets are directly sent from the sender to the receiver and are not routed through the entire network via the router.
- Improved, logical organization of network users: in order to keep a better overview of the hosts, it makes sense to segment by local criteria (different buildings or floors) or by departments.
- More security: If an external network is attacked, the entire network is quickly threatened. Subnetting makes network administrators easier to partition the subnets.
the opposite of subnetting is called supernetting: networks or subnets are grouped together and the network share of an address is reduced to allow more hosts within a network.
For medium to larger networks, it is therefore more than reasonable to create subnets. The initial effort is extremely useful to the company: the structure of the company network helps to keep the overview and to localise problems more quickly. As is often the case, good order is paid order.