Network, Host & CIDR
Splitting an IP into a network part and a host part — and writing it as /24
An IP address secretly has two halves: one part says which network you are on, the other says which device you are within that network. Understanding this split is the key that unlocks subnetting, routing, and almost everything that follows.
We will build a small home network, hand out IPs, and then learn CIDR notation — the compact /24 style that engineers use everywhere from home routers to AWS.
What is a network?
A network is simply a set of devices connected together so they can communicate. Picture a home router with a laptop, a phone, and a tablet attached to it. Those devices form one network, and within it they can talk to each other directly — no internet required.
Key point: Devices on the same network reach each other directly. Reaching anything else means leaving the network (later chapters).
What is a host?
A host is any single device on the network that holds a unique IP. In our example the router is 192.168.1.1, the phone is .2, the tablet is .3, and the laptop is .4. Each host has its own address so data can be delivered to exactly the right one.
DHCP hands out the IPs
You never type in these IPs by hand. When a new device joins, the router assigns it one automatically using DHCP (Dynamic Host Configuration Protocol). The router keeps a table of who has which address.
See it: Your device’s current IP (and its gateway) is visible in your WiFi/network settings — all handed out by DHCP.
LAN vs WAN
Our little home network is a LAN — a Local Area Network. Everything beyond it — the wider internet — is the WAN (Wide Area Network). Most of networking is about how a device on your LAN reaches something out on the WAN.
CIDR notation
CIDR (Classless Inter-Domain Routing) is a compact way to describe a whole range of addresses, written as an IP followed by a slash and a number: 192.168.1.0/24.
- The .0 address
- The first IP of a range (like 192.168.1.0) is reserved to represent the network itself — not assigned to a device.
- The /24
- The number after the slash = how many bits are reserved for the network portion.
Network bits vs host bits
In 192.168.1.0/24, the /24 means the first 24 bits — the first three octets (8+8+8) — are the network part. They stay the same for every device on the network. The remaining 8 bits (the last octet) are the host part, unique per device.
So plugging in a new printer gives it 192.168.1.5: the first three octets are unchanged (same network), only the last octet differs (a new host).
Rule of thumb: Network bits = fixed across the network. Host bits = free to change per device.
How many hosts fit?
The host bits decide how many devices fit. With 8 host bits (a /24), you get 2⁸ = 256 possible host addresses. Try to add more than that and you run out of bits to assign — the network is full.
In practice: A couple of those 256 are reserved (the network address and the broadcast address), so usable hosts are slightly fewer — but 2^(host bits) is the number to remember.
Reading different CIDR ranges
Change the slash number and you change the split:
- /24
- First 3 octets are network; 256 host addresses.
- /16
- First 2 octets network, last 2 host — a much bigger network (~65,536 hosts).
- /0
- Zero network bits — matches every IP. 0.0.0.0/0 means "the entire internet".
Where you will meet CIDR
CIDR is not just theory — it is everywhere in DevOps. When you create a VPC on AWS or DigitalOcean, you define its address range with CIDR (e.g. 10.0.0.0/16). Security-group and firewall rules use it too.
Next: CIDR tells us the split; the subnet mask (next chapter) is how a machine actually computes it.