![]() |
VOOZH | about |
In the vast expanse of the internet, every device requires a unique identifier to communicate with others. This identifier is known as an IP address, and for many years, the prevalent version has been IPv4 (Internet Protocol version 4). IPv4 addresses are 32-bit numbers represented in a dotted-decimal format, such as 192.168.1.100. To effectively manage and distribute these addresses, a system called Classless Inter-Domain Routing (CIDR) was introduced.
An IPv4 address is divided into four octets, each represented by a decimal number ranging from 0 to 255. These octets are separated by periods, creating a familiar dotted-decimal notation.
👁 Screenshot-01-(1)| Class | First Octet Range | Network Portion | Host Portion | Default Subnet Mask |
|---|---|---|---|---|
| Class A | 1 – 126 | 1st Octet (8 bits) | Last 3 Octets (24 bits) | 255.0.0.0 (/8) |
| Class B | 128 – 191 | 1st & 2nd Octets (16 bits) | Last 2 Octets (16 bits) | 255.255.0.0 (/16) |
| Class C | 192 – 223 | 1st, 2nd, & 3rd Octets (24 bits) | 4th Octet (8 bits) | 255.255.255.0 (/24) |
The problem with classful addressing was its rigidity. If an organization needed 300 addresses, they were too big for Class C (254) and had to take a Class B (65,534), wasting over 65,000 addresses.
To solve this, Classless Inter-Domain Routing (CIDR) was introduced in 1993. CIDR ignores these fixed boundaries and uses a Subnet Mask (or prefix length like /24) to define exactly where the network portion ends. This allows the network "boundary" to exist anywhere, even in the middle of an octet.
Example: A /25 network uses 25 bits for the network. This means the network portion takes the first three octets plus the first bit of the fourth octet, leaving only 7 bits (126 usable addresses) for hosts.
Key Features of CIDR
Variable-Length Subnet Masking (VLSM): CIDR allows network administrators to create subnets of varying sizes, rather than being restricted to the rigid class-based addressing scheme. This enables more granular control over address allocation and reduces the waste of IP addresses.
Benefits of CIDR
CIDR emerged as a more flexible and efficient way to manage IP addresses compared to the older classful addressing scheme. Instead of assigning addresses based on rigid class boundaries, CIDR allows for the creation of subnets, which are smaller divisions within a network. Each subnet has its own unique prefix length, represented by a number following a slash in the CIDR notation. For instance, 192.168.1.0/24 indicates a subnet with a prefix length of 24, meaning that the first 24 bits are dedicated to the network address and the remaining 8 bits are for host addresses. CIDR notation simplifies the representation of subnets and makes it easier to manage and identify different network segments.
Example 1. What is the maximum number of usable host addresses in this subnet and how many network bits are there in this subnet?
Subnet:192.168.1.0/24
Given:-
IP address: 192.168.1.0
Prefix length: 24
Calculation:
Convert the IP address to binary format:
192.168.1.0 = 11000000.10101000.00000001.00000000
Separate the network bits from the host bits based on the prefix length:
Network bits: 11000000.10101000.00000001
Host bits: 00000000
Determine the number of usable host addresses:
2^host bits - 2 = 2^8 - 2 = 254
Result:
The subnet 192.168.1.0/24 has a network address of 192.168.1.0 and a broadcast address of 192.168.1.255. There are 254 usable host addresses in this subnet.
Example 2. What is the maximum number of usable host addresses in this subnet?
Subnet: 192.168.0.0/16
Given:-
IP address: 192.168.1.0
Prefix length: 16
Calculation:
Convert the IP address to binary format:
192.168.0.0 = 11000000.10101000.00000000.00000000
Separate the network bits from the host bits based on the prefix length:
Network bits: 11000000.10101000
Host bits: 00000000.00000000
Determine the number of usable host addresses:
2^host bits - 2 = 2^16 - 2 = 65534
Result:
The subnet 192.168.0.0/16 has a network address of 192.168.0.0 and a broadcast address of 192.168.255.255. There are 65534 usable host addresses in this subnet.