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
| Class | Starting Bits | First Byte Range | Prefix Length | Purpose |
|---|---|---|---|---|
| A | 0 | 0–127 | 8 bits | Very large networks |
| B | 10 | 128–191 | 16 bits | Medium-sized networks |
| C | 110 | 192–223 | 24 bits | Small networks |
| D | 1110 | 224–239 | Not applicable | Multicast |
| E | 1111 | 240–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
Therefore, there can be 128 Class A networks.
Number of nodes
The remaining 24 bits are available for the suffix:
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
Therefore, there can be 16,384 Class B networks.
Number of nodes
The suffix has 16 bits:
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
Therefore, there can be 2,097,152 Class C networks.
Number of nodes
The suffix contains 8 bits:
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–127 | A |
| 128–191 | B |
| 192–223 | C |
| 224–239 | D |
| 240–255 | E |
Examples
| IP Address | First Octet | Class |
|---|---|---|
25.10.2.5 | 25 | A |
128.20.5.10 | 128 | B |
172.16.5.20 | 172 | B |
192.168.1.10 | 192 | C |
210.10.5.8 | 210 | C |
230.10.5.1 | 230 | D |
245.10.5.1 | 245 | E |
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:
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:
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
| Feature | Class A | Class B | Class C |
|---|---|---|---|
| Network length | 8 bits | 16 bits | 24 bits |
| Class-identifying bits | 1 (0) | 2 (10) | 3 (110) |
| Actual network ID bits | 7 | 14 | 21 |
| Number of networks | |||
| Suffix length | 24 bits | 16 bits | 8 bits |
| Intended size | Very large | Medium | Small |
| Main problem | Huge 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
Post a Comment