The subnet mask is used to divide an IP address into two parts: the network portion and the host portion. It determines which part of the IP address identifies the network and which part identifies the specific device (host) within that network.
For example, in the IP address 192.168.1.10 with a subnet mask of 255.255.255.0 (or /24 in CIDR notation), the first three octets (192.168.1) represent the network, while the last octet (10) identifies the specific device on that network. The subnet mask helps routers and devices understand how to route traffic within and outside the local network.
