Delving into network prefixes and subnet masks
In this book, you may have seen various IPv4 and IPv6 addresses written in the format of 192.168.1.1/24
or 2001:DB8:0:1111:FE99:47FF:FE75:CEE0/64
and you’re wondering what the /24
and /64
values are at the end of the IP addresses. The /x
value that’s appended to the end of the IP address is referred to as the network prefix and represents the subnet mask in a simplified format. Additionally, the x
value is calculated based on the total number of bits, which are 1s within the subnet mask of the IPv4 or IPv6 address.
To gain a better understanding, let’s consider an IPv4 address such as 10.1.2.3
, which has a default subnet mask of 255.0.0.0
. The following table shows the binary notation of the Class A subnet mask:
Figure 5.2 – Class A subnet mask
As shown in the preceding table, there are a total of 8
bits, which are 1s within the subnet mask. Therefore, the network prefix is /8
. Rather...