Definition
A Network ID is the first address of a subnet, with every host bit zero. Compute it as IP address AND netmask.
Intuition
Addresses are divided into equal-sized, aligned blocks. A 16-address block starts at 0, 16, 32, and so on within the last octet; it cannot start at an arbitrary address such as 24.
Worked example
For 130.192.1.24/28, the final four bits are host bits:
24: 0001 | 1000
mask: 1111 | 0000
AND: 0001 | 0000 = 16The Network ID is 130.192.1.16/28, broadcast .31, and ordinary usable hosts .17-.30.
Important rules
- /30: last-octet starts are multiples of 4.
- /29: last-octet starts are multiples of 8.
- /28: last-octet starts are multiples of 16.
- These last-octet shortcuts apply when the boundary is in that octet. For /23, inspect the third octet instead.
- Compute broadcast by setting all host bits to one.
Common mistakes
- Calling
.24/28an invalid IP address: it is a valid host address, but not a valid Network ID. - Assuming a Network ID always ends in
.0:130.192.1.4/30is valid. - Ignoring the prefix:
.4/30names a subnet, but.4/29lies inside.0/29.
Related concepts
- CIDR Prefixes and Netmasks
- IPv4 Interfaces and Special Addresses
- IPv4 Host Counts and Point-to-Point Subnets
Source
Lecture 01 - IPv4 Addressing and Routing, PDF page 11. Binary calculation and host range are added explanation.