# Subnetting, Supernetting, and CIDR

> Subnetting splits one IP network into smaller subnets, and supernetting combines several contiguous blocks into one larger block routed as a single entry. CIDR (Classless Inter-Domain Routing) notation describes both with a suffix like /24, which states how many bits of the address are the fixed network portion.

Canonical: https://devsunite.com/resources/core-subjects/computer-networks/subnetting-supernetting-cidr
Last updated: 2026-11-22

Subject: Computer Networks · Category: Network Layer · 3 min read

Subnetting, supernetting, and CIDR notation are all about one core idea: dividing the IP address space efficiently so organizations get roughly the number of addresses they actually need, no more, no less.

## Subnetting

Subnetting takes one larger network and splits it into multiple smaller networks (subnets), each with its own range of addresses. This is useful for organizing a network logically (separating departments, or separating servers from user devices) and for security (isolating traffic between subnets with firewall rules).

## CIDR notation

CIDR (Classless Inter-Domain Routing) notation describes a network's size using a suffix like `/24`, which tells you how many bits of the address are fixed as the "network" portion, with the rest available for individual devices ("host" addresses).

`192.168.1.0/24` means the first 24 bits are the fixed network portion, leaving 8 bits (2^8 = 256 addresses, though 2 are reserved) for hosts within that subnet. `/24` is a very common size for a small office or home network.

## A worked subnetting example

Say a company is given the block `192.168.0.0/24` (256 addresses total) and needs to split it into 4 equally sized subnets for 4 departments.

Since 4 subnets requires borrowing 2 extra bits from the host portion (2^2 = 4), the new subnet mask becomes `/26` instead of `/24`. Each `/26` subnet has 2^(32-26) = 64 addresses (2 reserved, 62 usable per subnet):

- Subnet 1: `192.168.0.0/26` (usable range 192.168.0.1 to 192.168.0.62)
- Subnet 2: `192.168.0.64/26` (usable range 192.168.0.65 to 192.168.0.126)
- Subnet 3: `192.168.0.128/26` (usable range 192.168.0.129 to 192.168.0.190)
- Subnet 4: `192.168.0.192/26` (usable range 192.168.0.193 to 192.168.0.254)

Each department gets its own 62-usable-address subnet, carved cleanly out of the original 256-address block.

## Supernetting

Supernetting is the reverse idea: combining several smaller, contiguous network blocks into one larger block that can be represented and routed as a single entry. If an ISP owns four contiguous `/24` blocks, they can often be represented as a single `/22` supernet, which is enormously useful for keeping internet routing tables smaller: instead of every router needing to know about all four individual `/24` blocks, they only need one `/22` entry.

## Where this matters in real systems

CIDR notation replaced the older, rigid "class A/B/C" system specifically because it wastes far fewer addresses: a company needing 300 addresses under the old class system would have had to take an entire class B block (65,536 addresses), wasting the vast majority of it, whereas CIDR lets that same company get a right-sized allocation (like a `/23`, which is 512 addresses) instead. Internet backbone routers rely heavily on supernetting (also called route aggregation) to keep their routing tables from growing to an unmanageable size as the internet has scaled to billions of devices.

## What interviewers actually ask about subnetting and CIDR

- **"What does the `/24` in `192.168.1.0/24` mean?"** The first 24 bits of the 32-bit address are fixed as the network portion, leaving 8 bits for host addresses within that subnet (256 total addresses, 254 usable).
- **"How would you split a `/24` network into 4 equal subnets?"** Borrow 2 bits from the host portion to get four `/26` subnets, each with 64 addresses (62 usable).
- **"What's the difference between subnetting and supernetting?"** Subnetting splits a larger network into smaller ones; supernetting combines multiple smaller, contiguous networks into one larger routable block.
- **"Why did CIDR replace the old class-based addressing system?"** CIDR allows right-sized address allocations instead of forcing organizations into fixed class sizes, dramatically reducing wasted address space.

## Key takeaways

- Subnetting divides one network into smaller subnets; supernetting combines multiple networks into one larger block.
- CIDR notation (like `/24`) specifies how many bits of an address are the fixed network portion.
- A smaller CIDR suffix number means a larger network (more host addresses); a larger suffix number means a smaller network.
- CIDR replaced rigid class-based addressing specifically to reduce wasted IP address space, and supernetting keeps internet routing tables manageable at scale.

## Related

- [Previous: IPv4 vs IPv6 Addressing](https://devsunite.com/resources/core-subjects/computer-networks/ipv4-vs-ipv6-addressing)
- [Next: Routing Algorithms (Distance Vector, Link State)](https://devsunite.com/resources/core-subjects/computer-networks/routing-algorithms)
- [More in Network Layer: Routing Protocols (RIP, OSPF, BGP)](https://devsunite.com/resources/core-subjects/computer-networks/routing-protocols)
- [More in Network Layer: IP Protocol Concepts (ARP, RARP, ICMP, IGMP)](https://devsunite.com/resources/core-subjects/computer-networks/ip-protocol-concepts)
- [More in Network Layer: NAT (Network Address Translation)](https://devsunite.com/resources/core-subjects/computer-networks/nat)
- [More in Network Layer: How the Internet Actually Works](https://devsunite.com/resources/core-subjects/computer-networks/how-the-internet-works)
- [All 101 Computer Networks interview questions](https://devsunite.com/resources/core-subjects/computer-networks)
