In a nutshell An IP address is a device's number on a network, and a subnet mask splits that number into "which network" and "which host on it." Understanding this lets you read a target's address range, know how big a network is, and tell
nmapexactly what to scan.
The IP address
An IPv4 address is four numbers 0–255 joined by dots — 192.168.1.10 — really 32 bits (four bytes). Every device needs a unique one to be reached. Some ranges are private, reserved for internal networks and never routed on the public internet:
10.0.0.0 – 10.255.255.255 (one huge block)
172.16.0.0 – 172.31.255.255 (16 blocks)
192.168.0.0 – 192.168.255.255 (home routers live here)
Seeing 192.168.x.x or 10.x.x.x in a scan means you're on an internal network.
The subnet mask — where the network ends
An address has two parts: the network part (which network) and the host part (which device on it). The mask is the line between them.
Analogy — a postal address. "City + street" is the network part (gets a letter to the right neighbourhood); "house number" is the host part (which door). The mask says how much of the address is neighbourhood vs house.
Reading CIDR quickly
The number after the slash is how many bits belong to the network; the rest are hosts.
| CIDR | Mask | Usable hosts | Meaning |
|---|---|---|---|
/24 |
255.255.255.0 | 254 | one typical LAN |
/16 |
255.255.0.0 | 65,534 | a big environment |
/30 |
255.255.255.252 | 2 | a point-to-point link |
/32 |
255.255.255.255 | 1 | a single host |
For 192.168.1.0/24: network is .0, usable hosts .1–.254, and .255 is the broadcast address (talks to everyone at once).
Why it matters in practice
nmap 192.168.1.0/24 # scan all 254 hosts of this LAN in one command
nmap 10.10.10.5/32 # exactly one host
- Scanning scope. Get the mask wrong and you either miss hosts or accidentally scan the whole internet.
- Reading recon. A
/16says "large environment"; a/30is just a link between two routers. - Finding neighbours. Once you land on a machine, its IP + mask reveal the rest of its subnet — the other targets you can now reach (pivoting).
IPv6 exists too, with vastly more addresses and a different notation, but the same idea of a network part and a host part holds.