Classful vs Classless Addresses

Once upon a time, every IP address would belong to an address class (refer to RFC 791) – it states the following:

[…] in class A, the high order bit is zero, the next 7 bits are the network, and the last 24 bits are the local address; in class B, the high order two bits are one-zero, the next 14 bits are the network and the last 16 bits are the local address; in class C, the high order three bits are one-one-zero, the next 21 bits are the network and the last 8 bits are the local address.

Even though the RFC 971 makes no explicit reference to the network mask, it does reference the number of bits assigned to the network part of the IP address.

Other RFCs (RFC5735, RFC 1112) also make reference to a Class D – reserved for Multicast addressing and, Class E – reserved for future use.

  • Class A :: Binary { 0 _ _ _ _ _ _ _ } | Decimal Range { 0 – 127 } | Mask: 255.0.0.0 | Unicast IP range
  • Class B :: Binary { 1 0 _ _ _ _ _ _ } | Decimal Range { 128 – 191 } | Mask: 255.255.0.0 | Unicast IP range
  • Class C :: Binary { 1 1 0 _ _ _ _ _ } | Decimal Range { 192 – 223 } | Mask: 255.255.255.0 | Unicast IP range
  • Class D :: Binary { 1 1 1 0 _ _ _ _ } | Decimal Range { 224 –  239 } | Mask: n/a | Multicast IP range
  • Class E :: Reserved

The framework above defines what is known as classfull addresses. Let’s take a few examples:

Note that the first IP address is the “zero” network more commonly referred to as the Major Network. Additionally, the last IP address in the range is the Broadcast address. Traditionally, neither could be assigned to hosts.


THE PROBLEM

Classfull addressing introduces two major problems:

  1. Subneting is not flexible enough leading to a waste of the IP address space. For instance, the major network of 193.25.20.0 could accommodate 254 hosts (193.25.20.1 – 193.25.20.254); however a small network might only need 50 addresses.
  2. Route aggregation could only be done on the major network boundaries resulting in an increase of the routing tables size.

THE SOLUTION

The Internet community proposed a special technique known as VLSM – Variable Length Subnet Masks allowing network engineers to split network ranges into smaller subnets as needed by using “custom” network masks.

VLSM introduces Classless addresses.

As an example, let’s consider the same major network used above – 193.25.20.0 and that our network has 50 hosts only. To accommodate 50 hosts, we need to use 6 bits which gives us a range of 62 host addresses (2^6 = 64).

So our network mask would be 255.255.255.192, giving us four extra network ranges  to choose from:

We could even further subnet as below:


Despite the RFC 971 making reference to the length of the network mask for each class, we find that in classfull routing protocols implementations, it is allowed to use a class A address with a class C network mask. Though in classfull routing environments, the mask will always be set at the octet boundary – i.e. 255.0.0.0, 255.255.0.0 or 255.255.255.0

 

Thank you,

Rafael A. Couto Cabral • LinkedIn Profile
Cisco​ | F5 | VMware Certified • PRINCE2 Practitioner

Originally posted 2015-05-17 23:51:13.

Related Post

Comments are closed.