Subnetting
Instead of putting all of Nakhla's devices in one big network, we split it into smaller subnets: one for finance, one for the warehouse, one for guests. Why? Better security (we control who talks to whom), better performance (less noise), and easier management.
The number after the slash (the prefix) says how many bits belong to the network. The rest are for hosts. The number of usable hosts is:
Why subtract 2? The first address of every subnet is the network address itself, and the last is the broadcast address that reaches every device. Neither can be given to a device.
| Prefix | Mask | Usable hosts |
|---|---|---|
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /30 | 255.255.255.252 | 2 |
Try it yourself: change the address or prefix and watch the subnet change. Highlighted bits are the network part:
Quick method, no calculator: block size = 256 − the last mask number. With /26 the mask ends in 192, so the block is 64 and subnets start at 0, 64, 128 and 192. The address 192.168.10.77 falls between 64 and 127, so its network is 192.168.10.64 and its broadcast is 192.168.10.127.
/27 gives 30 addresses and fits; a /24 would waste 254.