The network portion is the leading part of an IP address that identifies the network containing the addressed host. The remaining bits form the host portion. Hosts on the same LAN share the same network portion while using different host portions, allowing routers to distinguish separate networks. section 7.3.1 section 7.4
Identify the network portion by following these rules:
- Read the prefix length, written as /X; X gives the number of network bits, and the remaining IPv4 bits belong to the host portion. section 7.3.1
- Use the netmask, or subnet mask, as the same boundary: mask bits set to 1 select the network portion, while bits set to 0 select the host portion. section 7.4
- Write the network address by setting every host bit to 0; this is the first address in the network. section 7.4
Same LAN, shared network portion
For 192.168.100.100/24, the first 24 bits—or first three octets, 192.168.100—are the network portion, leaving the final octet for the host portion. Addresses such as 192.168.100.1, 192.168.100.178, and 192.168.100.234 therefore belong to the same LAN when the same prefix applies. By contrast, 192.168.1.0/24 and 192.168.2.0/24 identify different networks that can communicate through a router. section 7.3.1
The network portion also appears in routing. A router can advertise an interface’s network prefix—the network address together with its netmask. In OSPF, the network command selects interfaces whose addresses match the specified range, activates OSPF there, and advertises their network prefixes. section 17.4
