Classless IP Addresses

Classless IP Addresses

In a previous lesson I discussed classful IP addresses and the problems that they cause. Classful IP addressing is wasteful and caused the IPv4 address space to be consumed far more rapidly than was necessary.

In this lesson, I will be discussing classless IP addresses which is far more efficient than classful IP addressing.

What are classless IP addresses?

With classless IP addresses, the network portion is of variable length instead of the fixed lengths that we had with classful IP addresses. This is possible because we use a subnet mask to define where the network portion ends and where the host portion begins.

Network engineers can now assign IP addresses based on the actual requirements instead of being forced into the fixed network sizes that classful IP addressing dictated. This means that IP address wastage is greatly reduced.

Classless Inter-Domain Routing (CIDR)

Classless IP addressing is also known as CIDR (Classless Inter-Domain Routing).

With CIDR we use a prefix to indicate the network portion of the IP address. So instead of saying that an IP address is class A, B, or C, we would say that 192.168.1.0/24 has a /24 prefix. This /24 means that the first 24 bits represent the network portion and the remaining 8 bits represent the host portion.

CIDR Example

Let me demonstrate CIDR with an example.

Company A has been assigned the 203.0.113.0/24 network. This company has 4 departments each requiring their own subnet:

  • Sales – 50 hosts
  • Marketing – 25 hosts
  • IT – 10 hosts
  • Management – 5 hosts

The 203.0.113.0/24 network can accommodate 254 hosts (2^8 – 2 = 254). This is more than sufficient for Company A's total requirement of 90 hosts (50+25+10+5).

If we were using classful IP addressing, we would need to assign each department an entire class C network. This would mean:

  • Sales would get 203.0.113.0/24 (254 hosts available, 204 wasted)
  • Marketing would get 203.0.114.0/24 (254 hosts available, 229 wasted)
  • IT would get 203.0.115.0/24 (254 hosts available, 244 wasted)
  • Management would get 203.0.116.0/24 (254 hosts available, 249 wasted)

Total wasted hosts: 926 out of 1016 total hosts available!

With CIDR, we can subnet the 203.0.113.0/24 network efficiently:

  • Sales: 203.0.113.0/26 (62 hosts available, 12 wasted)
  • Marketing: 203.0.113.64/27 (30 hosts available, 5 wasted)
  • IT: 203.0.113.96/28 (14 hosts available, 4 wasted)
  • Management: 203.0.113.112/29 (6 hosts available, 1 wasted)

Total wasted hosts: 22 out of 112 total hosts used!

As you can see, CIDR allows for much more efficient use of IP addresses.

CIDR Benefits

The main benefits of CIDR are:

  • Efficient use of IP addresses: Networks can be sized according to actual requirements
  • Reduced routing table size: Route summarization becomes possible
  • Flexibility: Network administrators have more control over network design

Conclusion

Classless IP addressing (CIDR) solved many of the problems created by classful IP addressing. By allowing variable-length subnet masks, network engineers can design networks that efficiently use the available IP address space while meeting the specific requirements of each organization.

Understanding CIDR is essential for modern network design and is a fundamental concept that every network engineer should master.