What are network prefixes?
A network prefix is an aggregation of IP addresses. Currently, the Internet runs two protocol versions of IP: version 4 and 6.
An IP address version 4 (or short IPv4) consists of a 32-bit number. Whereas an IPv6 consists of a 128-bit number.
While 32 bits allow for about 4 billion IP addresses, the growth of the Internet pushed IPv4 to its limits, thus forcing it to a hard switch to IPv6. This transition has been occurring for years and will continue for the next decade.
Currently, only 10% of Internet traffic runs on IPv6. The bitmask or prefix length defines the size of the aggregation. It effectively defines the amount of bits that determine the aggregation itself.
For example, 126.96.36.199/17 defines the first 17 bits of the IP address to identify the address aggregation. The remaining 15 bits may be either sub-aggregated or assigned to devices within the network that owns the prefix.
A single device might get an IP address from the range 188.8.131.52 to 184.108.40.206.
The network prefix determines the number of IP addresses within a particular host section of IP addresses.
Network Prefixes Simplified
To paint a simpler picture, let’s think about the Internet, as a metropolitan city. If this is the case, a network prefix is like a city block and an IP address is a building on that city block.
If you have a city block, it is square with finite space, and some buildings sit on the block. Let us think about the buildings as each being their own individual IP addresses. With each building being their own IP address, the block itself would be the network prefix.
If we think about network prefixes in this manner, it becomes a bit less complicated. Just like a city block, a network prefix has a capacity for the amount of IP Addresses associated with it.
It is difficult to discuss network prefixes without discussing IP Addresses. IP addresses are how you identify devices connected to the Internet. Wikipedia defines it as follows:
“An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication.”
With an IP address, every connected device to the Internet has their own unique identifier (in theory). If you have a computer connected to the Internet in your home, the computer has its own IP address.
This becomes somewhat complicated with WiFi, so let’s take a closer look.
IP Addresses and Wi-Fi
A question may arise when discussing WiFi and IP addresses. If I have multiple devices connected to the same WiFi router, do they all share the same IP address?
The simple answer to this question is yes.
The devices connected to the WiFi router all share the same IP address to an external search. Internally, the network router assigns the devices different identifiers.
What all this has to do with network prefixes is how the IP addresses are organized.
The Type of Prefixes
IP addresses are organized in the way we discussed in the city block example. To come back to network prefixes, they are a way to organize IP addresses. The current system for assigning a network prefix follows either the IPv4 or IPv6.
The IPv4 allocation of network prefixes is the 4th version of Internet protocols. This utilizes 32-bit addresses.
The IPv6 allocation of network prefixes is an updated system for providing network prefixes. This was developed as the expansion of the Internet was increasing. There was a need to generate more IP addresses. The IPv6 utilizes 128-bit addresses.
IP addresses and network prefixes provide organization to the devices connected to the Internet. Complex as it is, if we keep in mind a prefix in networking is like a city block, it becomes easier to understand.
To learn more terms related to DevOps and networking, you can download the DevOps Networking Terms eBook.