An IPv4 address is a 32-bit number written as four decimal octets separated by dots (for example 192.168.1.10). It is made of a network portion and a host portion, separated by the subnet mask.
The essentials
- Mask — 255.255.255.0 is the same as the /24 prefix.
- Legacy classes — A (/8), B (/16), C (/24).
- Private addresses — 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
- The network address and the broadcast address cannot be assigned to hosts.
Network : 192.168.1.0 /24
Mask : 255.255.255.0
First host : 192.168.1.1
Last host : 192.168.1.254
Broadcast : 192.168.1.255
Usable hosts: 254
The number of usable hosts is 2^n – 2, where n is the number of host bits: you subtract the network address and the broadcast address. Telling the network portion from the host portion is the basis of all addressing work.
Key point: an IPv4 address = 32 bits, network + host split by the mask; usable hosts = 2^n – 2. See Lab 10 – Analysing an IPv4 addressing plan.