IP addresses are unique identifiers assigned to hosts in computer networks. An IPv4 addresses is a 32-bit number. This bit sequence is divided into two groups. The most significant bits are the network prefix, which defines the subnet address. The group of less significant bits defines the host address on that subnet.
An IP address in CIDR notation ends with a slash followed by a number (e.g. 192.168.18.2/24). This number is the subnet mask, which specifies how many of the most significant bits of the IP address are part of the subnet address. The rest of the bits (less significant) are the host address on the subnet.
Below is a comparator for IP addresses written in CIDR notation. It allows you to determine whether the entered host addresses belong to the same subnet.
Author: Janusz Baczyński
copyrights: © 2024 Licence