Classful Addressing in IPv4

 

Classful Addressing in IPv4

Classful addressing was the original IPv4 addressing scheme. It was designed when the Internet started, when the number of connected networks was much smaller.

The basic idea was to divide the 32-bit IPv4 address into a network part (prefix) and a host/node part (suffix). To support networks of different sizes, three fixed prefix lengths were defined:

  • 8 bits → Class A
  • 16 bits → Class B
  • 24 bits → Class C

The entire IPv4 address space was divided into five classes: A, B, C, D, and E.


1. Basic Structure

For Classes A, B, and C, an IPv4 address is divided into:

                32-bit IPv4 address
        ┌────────────────┬──────────────┐
        │ Network Prefix │ Node/Suffix  │
        └────────────────┴──────────────┘

The prefix identifies the network, while the suffix identifies the connection/node within that network.

The important point is that the prefix length was fixed for each class.


2. The Five IPv4 Classes

ClassStarting Bits First Byte Range  Prefix LengthPurpose
A00–127 8 bits     Very large networks
B10128–191 16 bits     Medium-sized networks
C110192–223 24 bits     Small networks
D1110224–239 Not applicable     Multicast
E1111240–255 Not applicable     Reserved/future use

The first bits of the address are used to identify which class the address belongs to.





3. Class A

Structure

Class A uses an 8-bit network length.

However, the first bit is always 0 to identify Class A.

Therefore:

32 bits
┌────────┬───────────────────────────────┐
│0       │                               │
│Network │           Suffix              │
│7 bits  │          24 bits              │
└────────┴───────────────────────────────┘

So only 7 bits are actually available for identifying networks.

Number of networks

27=1282^7 = 128

Therefore,  there can be 128 Class A networks.

Number of nodes

The remaining 24 bits are available for the suffix:

224=16,777,2162^{24}=16,777,216

So a Class A network can accommodate a very large number of nodes.

Example

Consider:

25.10.20.30

The first byte is 25.

Since:

0–127 → Class A

this is a Class A address.

Conceptually:

25.10.20.30
└─┘└───────┬───────┘
 Network       Suffix

The original classful boundary is after the first byte.

Main idea

Class A was intended for very large organizations/networks.


4. Class B

Structure

Class B has a 16-bit network length.

The first two bits are 10, which identify Class B.

Therefore, only 14 bits remain for the actual network identifier.

32 bits
┌───────────────┬─────────────────────────┐
│10 + 14 bits   │       16-bit suffix     │
│Network        │         Node            │
└───────────────┴─────────────────────────┘

Number of networks

214=16,3842^{14}=16,384

Therefore, there can be 16,384 Class B networks.

Number of nodes

The suffix has 16 bits:

216=65,5362^{16}=65,536

So each Class B network provides a much smaller address space than Class A but much larger than Class C.

Example

Consider:

150.20.10.5

The first byte is 150.

Since:

128–191 → Class B

this is a Class B address.

The classful division is:

150.20 | 10.5
 Network   Suffix

So the first two bytes represent the network portion and the last two bytes represent the node portion.

Main idea

Class B was designed for medium-sized organizations.


5. Class C

Class C has a 24-bit network length.

The first three bits are 110, which identify Class C.

Therefore, only 21 bits remain for the actual network identifier.

32 bits
┌───────────────────────────┬───────────┐
│       Network             │  Suffix   │
│       21 bits             │  8 bits   │
│ class bits 110            │           │
└───────────────────────────┴───────────┘

Number of networks

221=2,097,1522^{21}=2,097,152

Therefore, there can be 2,097,152 Class C networks.

Number of nodes

The suffix contains 8 bits:

28=2562^8=256

Thus, a Class C network has only 256 possible address values in the suffix.

Example

Consider:

200.10.5.25

The first byte is 200.

Since:

192–223 → Class C

this is a Class C address.

The classful division is:

200.10.5 | 25
  Network   Node

The first three bytes identify the network and the last byte identifies the node.

Main idea

Class C was intended for small networks.


6. Class D

Class D is different from Classes A, B, and C.

It is not divided into a network prefix and node suffix.

The first four bits are:

1110

The first-byte range is:

224–239

Class D is used for multicast addresses.

Example

224.0.0.1

belongs to Class D because the first byte, 224, is in the range 224–239.


7. Class E

Class E also does not have the normal prefix/suffix division.

The first four bits are:

1111

The first-byte range is:

240–255

Class E was reserved for future use.


8. Easy Way to Identify the Class

For undergraduate students, the easiest method is to look at the first octet.

First Octet   Class
0–127A
128–191B
192–223C
224–239D
240–255E

Examples

IP AddressFirst OctetClass
25.10.2.525A
128.20.5.10128B
172.16.5.20172B
192.168.1.10192C
210.10.5.8210C
230.10.5.1230D
245.10.5.1245E

9. Why Did Classful Addressing Become Obsolete?

The major problem was address depletion—IPv4 addresses were being used inefficiently.

Problem with Class A

A Class A network could have:

224=16,777,2162^{24}=16,777,216

node addresses.

But only a small number of organizations needed networks this large.

Therefore, if an organization received a Class A block but used only a small fraction of those addresses, millions of addresses were wasted.


Problem with Class B

Class B was intended for medium-sized organizations.

However, many organizations also did not need the large number of addresses provided by a Class B network.

Again, many addresses remained unused.


Problem with Class C

Class C had the opposite problem.

It provided only:

28=2562^8=256

addresses.

This was often too small for organizations.

So an organization might need several Class C networks, making address allocation inefficient.


Problem with Class E

Class E was reserved and was almost never used, so that portion of the address space was largely unavailable for normal addressing.

10.Advantage of Classful Addressing

Although classful addressing had several problems and became obsolete, it had one advantage: Given an address, we can easily find the class of the address and, since the prefix length for each class is fixed, we can find the prefix length immediately. In other words, the prefix length in classful addressing is inherent in the address; no extra information is needed to extract the prefix and the suffix.


11. The Main Problem — A Simple Example

Imagine three organizations:

Organization A → needs 10 million addresses
Organization B → needs 5,000 addresses
Organization C → needs 100 addresses

Classful addressing gives them fixed-sized blocks.

Class A → Very large block
Class B → Medium block
Class C → Small block

The sizes do not necessarily match what organizations actually need.

This causes wastage.

Too many addresses
       ↓
Unused addresses
       ↓
Address space gets depleted
       ↓
IPv4 address shortage

This is why classful addressing became obsolete and was replaced by classless addressing, which allows a variable-length network prefix.


12. Quick Comparison

FeatureClass AClass BClass C
Network length8 bits 16 bits 24 bits
Class-identifying bits1 (0) 2 (10) 3 (110)
Actual network ID bits7 14 21
Number of networks27=1282^7=128 214=16,3842^{14}=16,384 221=2,097,1522^{21}=2,097,152
Suffix length24 bits 16 bits 8 bits
Intended sizeVery large Medium Small
Main problemHuge blocks → wastage Many unused addresses Blocks too small

Key takeaway

Classful addressing divides the IPv4 address space into fixed classes. Classes A, B, and C use fixed network-prefix lengths of 8, 16, and 24 bits respectively, while Class D is used for multicast and Class E is reserved. The fixed sizes caused inefficient allocation and address depletion, which led to the adoption of classless addressing.

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Computer Networks

TCP/IP Protocol Suite