In the realm of networking, CIDR, or Classless Inter-Domain Routing, has emerged as a game-changer in the allocation of IP addresses. This method surpasses the traditional classification system (A, B, C) by offering a more flexible and efficient approach. In this blog post, we will explore the intricacies of CIDR Notation, its working principles, and its significance in conserving address space while simplifying network management.

Understanding CIDR Notation/Blocks:

Imagine you have an apartment building with many floors and apartments on each floor. CIDR blocks are like sections of this building where everyone shares the same building address (network prefix) but has their own unique apartment number (host identifier).

What is a CIDR block?

A CIDR block is a group of IP addresses that share the same network prefix and a specific number of consecutive bits. The network prefix is like the building address that identifies the network itself. The remaining bits act as unique identifiers for individual devices (apartments) within the network.

Advantages of CIDR Blocks:

Efficiency: They allow for more flexible allocation of IP addresses, preventing waste compared to older methods.

Scalability: You can easily create subnets (sections of floors) within a larger network by changing the number of bits used for the network prefix.

Simplified routing: Routers can identify the destination network more efficiently with CIDR notation.

There are two main ways to calculate the CIDR range:

Using a subnet mask:

A subnet mask is a 32-bit number (for IPv4) with ones in the network prefix bits and zeros in the host identifier bits. Convert the subnet mask to binary

(e.g., 255.255.255.251 becomes 11111111.11111111.11111111.11111011).

Using the CIDR notation directly:

Count the number of consecutive one bit from the left. This is your CIDR prefix length (e.g., 29 in the above example).

The CIDR notation is written as the IP address followed by a forward slash and the number of bits in the network prefix (e.g., 192.168.1.42/29). The number after the slash directly tells you the CIDR prefix length.

Example:

Let’s say you have a network with the IP address 192.168.1.42 and a subnet mask of 255.255.255.251

the CIDR notation is 192.168.1.42/29.

A /29 subnet means that there are 29 bits dedicated to the network portion of the IP address, leaving 32 – 29 = 3 bits for host addresses. This means there are 8 possible IP addresses in this network (2 raised to the power of 3, where 3 is the number of bits remaining for host identifiers). the first and last addresses are reserved for network and broadcast addresses, respectively.

Calculating IP Addresses:

So, in the case of 192.168.1.42/29:

Network address: 192.168.1.40
Usable IP range: 192.168.1.41 to 192.168.1.46
Broadcast address: 192.168.1.47

Therefore, there are a total of 6 usable IP addresses in the subnet 192.168.1.42/29.

Let’s see how we end up with these numbers.

As a first step, Convert IP address and subnet mask to binary:

IP address: 192.168.1.42 -> 11000000.10101000.00000001.00101010

Subnet mask (/29): 255.255.255.251 -> 11111111.11111111.11111111.11111011

Isolate host identifier bits:

Look at the last 3 bits (marked in red above), These are the bits used for assigning unique addresses to devices within the network.

Calculating Usable IPs:

Initial network address: the least number we can generate with the last 3 bits is 000, so the initial IP Address is 11000000.10101000.00000001.00101000 – (192.168.1.40). Remember, the network address itself cannot be assigned to a device.

Broadcast address: This is reserved for network-wide communication, not assignable to any device. It’s the network address with all host identifier bits set to 1: 11000000.10101000.00000001. 00101111 -> 192.168.1.47.

When we convert these binaries to decimal, its representing 0 and 7 respectively. The remaining numbers are 1 (001) to 6 (110).

Usable IP range: 192.168.1.41 to 192.168.1.46

Key Points:

Changing bits based on the subnet mask helps isolate the network prefix and host identifier sections.
Only bits in the host identifier section can be modified to generate usable IP addresses.
The number of usable addresses depends on the number of bits available for host identification.

Conclusion

CIDR has revolutionized IP address allocation, providing efficiency, scalability, and simplified routing. By mastering CIDR blocks and understanding how to calculate CIDR ranges, network administrators can optimize address space utilization and enhance overall network management. Embrace the power of CIDR for a more streamlined and resource-efficient networking experience.

Leave a Reply

Your email address will not be published. Required fields are marked *