Understanding how devices communicate is foundational to modern software development and DevOps. In a recent explainer from the Chai aur Code series, the core concepts of networks, hosts, and CIDR notation are broken down in a way developers can actually use.
What Is a Network and a Host?
A network is simply the connection formed between multiple devices — a laptop, phone, and tablet all linked to a single router, for example. Devices on the same network can talk to each other directly using their IP addresses, even without internet access.
A host is any individual device on that network with its own unique IP address. If your router assigns your phone an IP, your phone is a host on that network.
How IP Addresses Get Assigned
When a new device joins a router, it typically receives a dynamic IP via DHCP (Dynamic Host Configuration Protocol). The router pulls an available address from its internal pool and hands it to the device, letting it start communicating on the Local Area Network (LAN).
Every network also has a Network IP — usually the very first address in the range (often ending in .0). This reserved address identifies the network as a whole and helps determine whether traffic is headed to a device inside or outside it.
Decoding CIDR Notation
CIDR (Classless Inter-Domain Routing) uses slash notation — like /24 — to define how much of an IP address is reserved for the network versus the host.
- Network bits vs. host bits: The network portion stays fixed for every device on that network. The remaining bits are used to generate unique host addresses.
- The /24 example: Reserves the first 24 bits (the first three octets) for the network, leaving 8 bits for hosts. Since 2⁸ = 256, a /24 can address 256 IPs total — though in practice 2 are reserved (the network address and the broadcast address), leaving 254 usable host addresses. Try to add a 255th usable device, and the network runs out of room.
- The /16 example: Reserves the first 16 bits for the network, leaving 16 bits for hosts — roughly 65,000 usable addresses.
- The
0.0.0.0/0case: The famous "entire internet" notation. A/0means zero bits are reserved for the network, so literally every IP address matches.
Why This Matters for Developers
These ideas are often treated as "network engineer territory," but they're essential once you're working with AWS, DigitalOcean, or any cloud infrastructure. Knowing how many hosts a network can support — and why the network portion of an IP stays constant — is the groundwork you need before tackling subnetting, default gateways, and routing.

0 Comments