0
0
Computer Networksknowledge~6 mins

CIDR notation in Computer Networks - Full Explanation

Choose your learning style9 modes available
Introduction
Imagine you have a big box of addresses but need to share them efficiently among different groups. Without a clear way to divide and label these groups, addresses get wasted or confused. CIDR notation solves this by showing exactly how many addresses belong to each group in a simple format.
Explanation
Basic Structure
CIDR notation combines an IP address with a number after a slash. This number tells how many bits in the address are fixed for the network part. The rest of the bits can be used for devices in that network.
CIDR notation shows the network size by indicating how many bits are fixed in the IP address.
Network and Host Parts
The fixed bits represent the network, which is like the street name in an address. The remaining bits represent hosts, like house numbers on that street. More fixed bits mean fewer houses but a smaller street; fewer fixed bits mean more houses but a bigger street.
CIDR splits an IP address into network and host parts by fixing some bits and leaving others variable.
Efficient Address Allocation
CIDR allows networks to be sized exactly as needed, avoiding waste. Instead of fixed blocks, networks can be any size, making address use flexible and efficient.
CIDR helps use IP addresses efficiently by allowing flexible network sizes.
Example Interpretation
For example, 192.168.1.0/24 means the first 24 bits are fixed for the network, leaving 8 bits for hosts. This gives 256 addresses, where 254 can be assigned to devices.
The number after the slash in CIDR shows how many bits are for the network, defining the size of the address block.
Real World Analogy

Think of a city with streets and houses. The street name is like the network part of an IP address, and the house number is like the host part. CIDR notation tells you how many streets there are and how many houses fit on each street.

Basic Structure → The full address with a street name and a number showing how many houses are on the street
Network and Host Parts → Street name as the network and house numbers as hosts
Efficient Address Allocation → Choosing street lengths to fit exactly the number of houses needed
Example Interpretation → A street with 256 houses, where the street name covers the first part of the address
Diagram
Diagram
┌─────────────────────────────┐
│        IP Address            │
│ 192 . 168 . 1 . 0           │
├─────────────┬───────────────┤
│ Network (24 bits) │ Host (8 bits) │
│ 192.168.10-255         │
└─────────────────────────────┘

CIDR Notation: 192.168.1.0/24

Network bits fixed, host bits variable
This diagram shows how CIDR notation divides an IP address into network and host parts using the slash number.
Key Facts
CIDRClassless Inter-Domain Routing is a method to allocate IP addresses flexibly.
Slash NumberThe number after the slash in CIDR shows how many bits are fixed for the network.
Network BitsBits fixed in the IP address that identify the network portion.
Host BitsBits left variable in the IP address that identify devices within the network.
Address Block SizeThe number of IP addresses available in a network depends on the host bits.
Common Confusions
Believing the slash number shows the number of hosts directly.
Believing the slash number shows the number of hosts directly. The slash number shows fixed network bits; the number of hosts is 2 raised to the power of remaining bits minus reserved addresses.
Thinking CIDR only applies to IPv4 addresses.
Thinking CIDR only applies to IPv4 addresses. CIDR notation applies to both IPv4 and IPv6 addresses for flexible network sizing.
Summary
CIDR notation shows how many bits of an IP address are fixed for the network, allowing flexible network sizes.
It splits an IP address into network and host parts, helping organize devices efficiently.
Using CIDR avoids wasting IP addresses by matching network size to actual needs.