Vaidikalaya

Classless IP Addressing

Classless Addressing is a modern method of assigning IPv4 addresses without using fixed classes (A, B, C). Instead of depending on class boundaries, it allows networks to be created with any size using variable-length subnet masks (VLSM).

This method is also called:

  • CIDR (Classless Inter-Domain Routing)
  • Classless Routing
  • Prefix-based addressing

Why Classless Addressing Was Introduced?

Classful addressing wasted huge numbers of IP addresses.

  • A full Class A gave 16 million hosts (too large for most)
  • A Class C gave only 254 hosts (too small for many)
  • Class D addresses are used for multicast routing and are therefore available as a single block only. Class E addresses are reserved.

There was no flexibility, and IPs were running out. So, Classful networking was replaced by Classless Inter-Domain Routing (CIDR) in 1993. We will be discussing Classless addressing in the next post.


Address Formatting of Classless Addressing

In classless addressing, an IPv4 address is represented using two components:

A.B.C.D + prefix_length (Subnet)

General Format

A.B.C.D / prefix_length (Subnet)

Where

  • A.B.C.D → 32-bit IPv4 address
  • prefix_length → Number of bits used for the Network portion
  • Remaining bits → Host portion

This is called CIDR notation (Classless Inter-Domain Routing).

Example:

  • 192.168.1.0/24 (/24 = 24 bits for network)
  • 10.0.5.0/20  (/20 = 20 bits for network)
  • 172.16.10.0/28 (/28 = 28 bits for network)

This lets us create networks of any size, not just fixed Class A/B/C sizes.


Working of Classless

An IPv4 address is a 32-bit address, represented in the format:

xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

These 32 bits are divided into two parts:

  • Network ID – identifies which network the IP address belongs to
  • Host ID – identifies which device (host) is within that network

In Classless Addressing (CIDR), we do not depend on fixed classes (A, B, C). Instead, the IP address comes with a prefix/subnet, such as:

A.B.C.D/20, A.B.C.D/24, A.B.C.D/26

Here, /26 means that 26 bits are used for the Network portion, i.e., 26 bits are ON (1) and the remaining bits are for the Host portion:

/26 → 11111111.11111111.11111111.11000000
             255      .    255    .   255     . 192

The 6 OFF bits (0) represent the Host bits, and these bits determine the number of hosts.

From this, we can calculate:

  • Network Bits (N) = Prefix value
  • Host Bits (H) = 32 − Prefix value
  • Total Addresses per Subnet = 2Host bits
  • Usable Hosts per Subnet = (2Host bits − 2) (We subtract 2 for Network ID and Broadcast)
  • Block size = 256 − last_octet_of_subnet_mask
  • Number of subnets = Total addresses / Block size
  • Network Address (Network ID) = IP address AND Subnet mask (First address in the block) or (Multiple of Block Size)
  • Broadcast = Last address of the block or  (Network ID + (Block size − 1))
  • Host Range = (Network ID + 1) -> (Broadcast − 1)
Examples 
1) IP Address = 192.168.1.0/24

/24 = 11111111.11111111.11111111.00000000
            255     .  255      .     255    .  0

  • Network bits = 24
  • Host bits = 32 − 24 = 8
  • Total addresses = 28 = 256
  • Usable hosts = 256 − 2 = 254
  • Subnet mask = 255.255.255.0
  • Network ID: 192.168.1.0
  • Block size = 256 − 0 = 256 → only 1 network
  • Subnets = 256 / 256=1

Block size 256 means: 'Use all 256 IPs (0–255) in one subnet'. Since there is no space left to make another block, only 1 network is possible. no break / split possible.

  • Broadcast: 192.168.1.255
  • Host range: 192.168.1.1 → 192.168.1.254

Network Id also calculate using IP AND Subnet Mask (192.168.1.0 AND 255.255.255.0)

11000000 . 10101000 . 00000001 .00000000
                             AND
 11111111  .  11111111  . 11111111  . 00000000
--------------------------------------------------------------
 11000000 . 10101000. 000000001.00000000  (192.168.1.0)   <- Network Id 

2. IP Address = 192.168.1.0/25
  • Network bits = 25
  • Host bits = 32 − 25 = 7
  • Total addresses = 27 = 128
  • Usable hosts = 128 − 2 = 126
  • Subnet mask = 255.255.255.128
  • Network ID: 192.168.1.0
  • Block size = 256 − 128 = 128 (So each subnet has 128 addresses.)
  • Subnets = 256/128 = 2
Subnet 1
  • Network ID: 192.168.1.0
  • Broadcast: 192.168.1.127
  • Host Range: 192.168.1.1 – 192.168.1.126
Subnet 2
  • Network ID: 192.168.1.128
  • Broadcast: 192.168.1.255
  • Host Range: 192.168.1.129 – 192.168.1.254

3. IP Address = 192.168.1.0/26
  • Network bits = 26
  • Host bits = 32 − 26 = 6
  • Total addresses = 26 = 64
  • Usable hosts = 64 − 2 = 62
  • Subnet mask = 255.255.255.192
  • Network ID: 192.168.1.0
  • Block size = 256 − 192 = 64 (So each subnet has 128 addresses.)
  • Subnets = 256/64 = 4
Subnets
SubnetNetwork IDBroadcastHost Range
1192.168.1.0192.168.1.63192.168.1.1 - 192.168.1.62
2192.168.1.64192.168.1.127192.168.1.65 - 192.168.1.126
3192.168.1.128192.168.1.191192.168.1.129 - 192.168.1.190
4192.168.1.192192.168.1.255192.168.1.193 - 192.168.1.254

Note: Everything explained above (finding Network ID, Broadcast, Host Range, Block Size, Usable Hosts, etc.) is called Subnetting.

What is Subnetting?

Dividing a large block of addresses into several contiguous sub-blocks and assigning these sub-blocks to different smaller networks is called subnetting. It is a practice that is widely used when classless addressing is done. It allows you to decide:

  • How many networks you want
  • How many hosts each network should have
  • How IP addresses will be arranged
  • How to calculate network ID, broadcast, and host range
Subnetting breaks a big network into smaller networks so IP addresses can be used efficiently and networks can be organized better.

Advantages of Classless Addressing

1. Efficient use of IP addresses (No wastage)

Classful addressing wasted many IPs because network sizes were fixed (A, B, C). CIDR allows networks of any size, so IP addresses are not wasted.

Example: A company needs 30 hosts → With CIDR, make a /27 subnet (30 hosts). No need for full Class C (254 hosts).

2. Supports Variable Length Subnet Mask (VLSM)

Different subnets can have different sizes in the same network.

Example:

  • /26 → 62 hosts
  • /28 → 14 hosts
  • /30 → 2 hosts

This flexibility is not possible in classful addressing.

3. Better routing efficiency (Route Summarization)

CIDR can combine many small networks into one prefix.

Example:

192.168.0.0/24  

192.168.1.0/24  

192.168.2.0/24  

192.168.0.0/22  (summarized)

Routers store fewer routes, so routing becomes faster.

4. No dependence on Class A/B/C

Network size is defined by prefix (/x), not by the first octet. You can create Big, Small and Medium networks. Exactly as required.

5. Better scalability for ISPs

ISPs can assign IP ranges more flexibly:

  • Small customers get /30
  • Medium get /29 or /28
  • Large get /24 or /22

Limitations of Classless Addressing

1. Calculation is more complex

Subnetting, CIDR notation, prefix lengths, and route summarization can be difficult for beginners.

You must calculate:

  • Network ID
  • Broadcast ID
  • Host range
  • Subnet mask

Unlike classful, which was simple.

2. Requires CIDR-capable routers

Older routing protocols/hardware (pre-1993) did not support CIDR. Modern devices support it, but outdated systems may not.

3. More chances of misconfiguration

Because networks can be any size (/20, /23, /26, /29, /30), mistakes like:

  • Overlapping subnets
  • Wrong prefix
  • Wrong summarization

…can break routing.

4. Harder for humans to memorize

Classful was easy:

  • Class A → 255.0.0.0
  • Class B → 255.255.0.0
  • Class C → 255.255.255.0

Classless requires understanding:

  • 255.255.255.192
  • 255.255.255.248
  • 255.255.255.252
5. Requires detailed planning

You must carefully design subnet sizes, address allocation, and routing summarization.Poor planning may waste IPs or create routing issues.


MCQ

Classless IP Addressing

Subnetting