Introduction: What is CIDR Notation?

If you work with computers in the context of enterprise networks, you’ve probably encountered CIDR (Classless Inter-Domain Routing) notation. It’s a flexible way of representing IP addresses and network masks. In this article, I will explore what CIDR is, how it works, and why it’s essential for efficiently managing networks today.

CIDR notation allows for more granular and efficient allocation of IP addresses compared to the outdated class-based addressing system. Let’s dive deeper into the history and benefits of CIDR to understand why it’s so crucial in modern networking.

The Problem Before CIDR: Classful Addressing

Before CIDR was introduced, networks followed a classful addressing system. There were three main classes of IP addresses: Class A, Class B, and Class C, each with fixed address ranges and subnet masks:

Class Start IP Default Subnet Mask Hosts per Network
A 0.0.0.0 - 127.x.x.x 255.0.0.0 ~16 million
B 128.0.0.0 - 191.x.x.x 255.255.0.0 ~65,000
C 192.0.0.0 - 223.x.x.x 255.255.255.0 254

This system had a major limitation: inflexibility. For example, if you needed just 1,000 IP addresses, you were forced to use a Class B network, which provides about 65,000 IPs, wasting a large number of them. The situation worsened as the internet grew, leading to the first global IP address shortage.

The Birth of CIDR

In response to this issue, CIDR was introduced in 1993 to replace the classful system. The goal was simple: to make IP address allocation more flexible and efficient.

CIDR allows variable-length subnet masking (VLSM), meaning that networks can be assigned address blocks of various sizes based on need, rather than being stuck in the fixed boundaries of Class A, B, or C networks. CIDR notation is defined in RFC 4632 by the IETF.

How CIDR Works: The Basics

CIDR notation simplifies the representation of IP addresses and network masks. A CIDR address looks like this: 192.168.1.0/24

  • 192.168.1.0 is the network address.
  • /24 means the first 24 bits are reserved for the network portion.

The number after the slash indicates the number of bits used for the network address (prefix length). The higher the number, the smaller the network and the fewer IP addresses available for hosts.

Benefits of CIDR

CIDR allows for flexible subnetting. For instance:

  • /30 means 4 IPs
  • /29 means 8 IPs
  • /28 means 16 IPs

This flexibility allows for better address utilization.

CIDR Notation and Subnetting

Here’s a quick guide to CIDR subnet sizes and how they relate to the number of available IPs:

CIDR Subnet Mask Total IPs Usable IPs Typical Use Case
/32 255.255.255.255 1 1 Single host
/31 255.255.255.254 2 2 Point-to-point links
/30 255.255.255.252 4 2 Router links
/29 255.255.255.248 8 6 Small LAN
/28 255.255.255.240 16 14 Small office
/27 255.255.255.224 32 30 Medium LAN
/26 255.255.255.192 64 62 Larger LAN
/25 255.255.255.128 128 126 Half of a Class C
/24 255.255.255.0 256 254 Classic Class C
/23 255.255.254.0 512 510 Two Class Cs

Real-World Example: Swiss IP Allocation

In Switzerland, IP addresses are managed by RIPE NCC:

  1. RIPE NCC (RIR) – Allocates large blocks to ISPs.
  2. Swisscom (ISP) – Gets blocks like 212.203.0.0/16.
  3. Home Users – Receive dynamic IPs like 212.203.74.18.
  4. Businesses – May receive static blocks like 212.203.100.0/29.

This example illustrates the flexibility of CIDR-based allocation.

CIDR and Routing: The Big Picture

Routers use CIDR prefixes to determine traffic flow. For example:

  • 172.24.112.181/20 tells the router that IPs in the 172.24.112.0/20 range belong to the same network and should be routed locally.

Practical Example: Subnet Calculations

For 172.24.112.181/20:

  • Binary IP: 10101100.00011000.01110000.10110101
  • Subnet Mask: 255.255.240.0 (binary: 11111111.11111111.11110000.00000000)

Network Address:

  • AND operation gives: 172.24.112.0

Broadcast Address:

  • Host bits set to 1: 172.24.127.255

Usable IP Range:

  • First: 172.24.112.1
  • Last: 172.24.127.254

Total Hosts:

  • 2^12 - 2 = 4094
Item Value
IP Address 172.24.112.181
Subnet Mask 255.255.240.0 (/20)
Network Address 172.24.112.0
Broadcast Address 172.24.127.255
First Usable IP 172.24.112.1
Last Usable IP 172.24.127.254
Total Hosts 4094

Key Takeaways

  • CIDR improves IP address efficiency.
  • Network Address marks the start of a subnet.
  • Usable IPs can be assigned to devices.
  • Broadcast Address is for sending data to all subnet devices.

Conclusion

Understanding CIDR notation is essential for any system engineer. It ensures efficient use of IP space, allows flexible subnetting, and supports network scalability. CIDR is a cornerstone of modern IP networking.