Vaidikalaya

Classful IP Addressing


Classful IP Addressing is the original method used in IPv4 to divide the entire IP address space into fixed blocks called classes. Introduced in 1981 (RFC 791), it organizes IP addresses into 5 classes:

  • Class A
  • Class B
  • Class C
  • Class D
  • Class E

Each class has a fixed size, fixed network/host distribution, and is identified by the first few bits of the IP address. This method was used before CIDR (Classless Addressing) was introduced in 1993.


Why Classful Addressing Was Designed?

The idea was to simplify network design by giving:

  • Very large networks (Class A)
  • Medium networks (Class B)
  • Small networks (Class C)

But the problem: Many organizations received far more IPs than they needed, causing massive wastage. This led to the creation of Classless Addressing (CIDR).


Class A

Class A is designed for very large networks that require millions of IP addresses. It has the largest number of host addresses per network among all classes.

Class A addresses use 8 bits for the Network portion and 24 bits for the Host portion. The first octet ranges from 1 to 126, and the most significant bit (first bit) of this octet is always ‘0’. The remaining seven bits in the first octet form the Network ID. The next 24 bits (the last three octets) represent the Host ID, allowing approximately 16.7 million hosts per Class A network.

Address Format of Class A

An IPv4 address = 32 bits. Class A divides these bits as:

Network
8 bits
Host
8 bits 
8 bits
8 bits

So the address format is:

Network . Host . Host . Host
Example:
10.20.30.40

When we see in binary then the first octet always starts with 0 and next seven bits use to create the Network ID. So the numerical range of the first octet becomes:

00000001 (1) → 01111110 (126)
Binary Format
0xxxxxxx . xxxxxxxx . xxxxxxxx . xxxxxxxx

Note: The first network address (0) is reserved for special identification (default route) and the last network address (127) is reserved for loopback functions. Thus, two addresses are subtracted.
So, the valid address range of Class A
1.0.0.0 → 126.255.255.255

Key Points
  • Class A is designed for very large networks.
  • Uses 8 bits for Network ID and 24 bits for Host ID.
  • Address format: N.H.H.H
  • First octet range: 1 to 126
  • First bit is always 0 in the first octet.
  • Total Class A networks: 126 networks.
  • Hosts per network: 16,777,214 usable hosts.
  • Default subnet mask: 255.0.0.0 (/8)
  • Supports 2³² / 2⁸ hosts = 2²⁴ (~16.7 million) hosts.
  • Private Class A range: 10.0.0.0 to 10.255.255.255 (10/8)
  • Public Class A examples: 3.x.x.x, 5.x.x.x, 22.x.x.x, 126.x.x.x
  • Reserved ranges:
    • 0.x.x.x → special use
    • 127.x.x.x → loopback (NOT usable Class A)
  • Very commonly used by:
    • ISPs
    • Government networks
    • Large enterprises
    • Cloud networks (AWS, Azure internal VPCs)
  • Has the largest host capacity among Classes A, B, C.
  • Easy to subnet because you have 24 host bits to borrow.

Class B

Class B is a category of IPv4 addresses designed for medium-sized networks — bigger than Class C, smaller than Class A.

Class B addresses use 16 bits for the Network portion and 16 bits for the Host portion. The first octet ranges from 128 to 191, and the two most significant bits of this octet are always ‘10’. These two bits identify the address as Class B, while the remaining 14 bits of the first two octets form the Network ID. The final 16 bits (last two octets) represent the Host ID, providing support for up to approximately 65,534 hosts per Class B network.

Address Format of Class B

Class B addresses use 16 bits for the Network portion and 16 bits for the Host portion. So, It divides these bits as:

Network
8 bits
8 bits
Host
8 bits 
8 bits

So the address format is:

Network . Network . Host . Host
Example:
128.1.30.40

In Class B, the first octet always starts with 10, and the next 14 bits (remaining bits of first and second octet) are used to form the Network ID. So the numerical range of the first octet becomes:

10000000 (128) → 10111111 (191)
Binary Format
10xxxxxx . xxxxxxxx . xxxxxxxx . xxxxxxxx

Note: In Class B, the first two bits of the first octet are fixed as ‘10’, which determines the class type. Unlike Class A, there are no reserved first-octet values such as 0 or 127 inside the Class B block. Therefore, the entire numerical range from 128 to 191 is valid for Class B network addresses.
So, the valid address range of Class B
128.0.0.0 → 191.255.255.255

Key Points

Class B is designed for medium-sized networks.

  • The first octet ranges from 128 to 191.
  • The first two bits of the first octet are always 10 (identifies Class B).
  • Class B uses 16 bits for the Network portion and 16 bits for the Host portion.
  • Address structure: Network . Network . Host . Host.
  • Default subnet mask: 255.255.0.0 (/16).
  • Total possible networks: 2¹⁴ = 16,384 networks.
  • Hosts per network: 216 = 65,534 usable hosts (out of 65,536).
  • Private Class B range: 172.16.0.0 → 172.31.255.255.
  • Suitable for: universities, mid-sized companies, ISPs, hospitals, government departments.
  • Binary pattern: 10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx.
  • Valid public Class B range: 128.0.0.0 → 191.255.255.255.
  • Balances quantity of networks and hosts — more networks than Class A, more hosts per network than Class C.

Class C

Class C is a category of IPv4 addresses designed for small networks — like small companies, small offices, home networks, and LANs. Many networks do not need thousands or millions of IPs. They only need around 200–250 devices. So Class C provides:

  • Large number of networks
  • Small number of hosts per network

Class C addresses use 24 bits for the Network portion and 8 bits for the Host portion. The first octet ranges from 192 to 223, and the three most significant bits of this octet are always ‘110’. These three bits identify the address as Class C, while the remaining 21 bits of the first three octets form the Network ID.

The final 8 bits (last octet) represent the Host ID, providing support for up to 254 usable hosts per Class C network (out of 256 total combinations, subtracting the network and broadcast addresses).

Address Format of Class C

Class C addresses use 24 bits for the Network portion and 8 bits for the Host portion. So, It divides these bits as:

Network
8 bits
8 bits
8 bits
Host
8 bits 

So the address format is:

Network . Network . Network. Host
Example:
192.168.1.10

In Class C, the first octet always starts with 110, and the next 21 bits (remaining bits of the first, second, and third octets) are used to form the Network ID. So the numerical range of the first octet becomes:

11000000 (192) → 11011111 (223)
Binary Format
110xxxxx . xxxxxxxx . xxxxxxxx . xxxxxxxx

Note: In Class C, the first three bits of the first octet are fixed as ‘110’, which identifies the address as belonging to Class C. Since there are no reserved first-octet values within this block, the entire numerical range from 192 to 223 is valid for Class C network addresses.
So, the valid address range of Class C
192.0.0.0 → 223.255.255.255

Key Points
  • Class C is designed for small networks.
  • The first octet ranges from 192 to 223.
  • The first three bits of the first octet are always 110 (identifies Class C).
  • Uses 24 bits for the Network portion and 8 bits for the Host portion.
  • Address structure: Network . Network . Network . Host.
  • Default subnet mask: 255.255.255.0 (/24).
  • Hosts per network: 254 usable hosts (out of 256 total).
  • Total possible networks: 2²¹ = 2,097,152 networks (because 21 bits for network ID after fixing 110).
  • Private Class C range: 192.168.0.0 → 192.168.255.255.
  • Widely used in home WiFi networks, small offices, and local LANs.
  • Binary range: 11000000 (192) → 11011111 (223).
  • Best suited for networks with fewer than 254 devices.

Why do we subtract 2 from total hosts?

We subtract 2 host addresses in every IPv4 network because two special addresses cannot be assigned to devices. This rule applies to Class A, B, C, and even modern CIDR subnets.

In every IP network, 2 addresses are reserved:

  • Network Address (All host bits = 0)
  • Broadcast Address (All host bits = 1)

ClassNetwork AddressBroadcast Address
Class AA.0.0.0 (10.0.0.0)A.255.255.255 (10.255.255.255)
Class BA.B.0.0 (172.16.0.0)A.B.255.255 (172.16.255.255)
Class CA.B.C.0 (192.168.1.0)A.B.C.25 (192.168.1.255)

So, because 2 addresses are reserved, we subtract 2 from the total. Therefore, the formula becomes:

Usable hosts = (2ⁿ) − 2.
where n=host_bits


Advantages of Classful Addressing

1. Simple and easy to understand
  • Classful addressing is based on fixed boundaries (Class A, B, C).
  • Anyone can look at the first octet and immediately identify the class.
  • Easy for beginners and early routers to process.
2. Straightforward routing
  • Early routers only required the first few bits to determine the network.
  • Routing tables were smaller and easier to manage.
3. No need to specify subnet mask
  • Each class had a default subnet mask:
    • Class A → 255.0.0.0
    • Class B → 255.255.0.0
    • Class C → 255.255.255.0
  • Networks automatically knew their mask, making configuration simpler.
4. Suitable for early internet
  • The early internet had fewer organizations and simple structure.
  • Large companies needed large blocks (Class A) → easy to allocate.
5. Faster processing in old hardware
  • Because classes were fixed, routing decisions were computed quickly.
  • Good for routers in the 1980s with limited processing power.

Limitations of Classful Addressing

1. Wastage of IP addresses (Biggest problem)
  • Class A grants 16 million IPs to a single organization—even if it only needs 10,000.
  • Class B gives 65,534 IPs—even if the company needs only 2,000.

Huge wastage → accelerated IPv4 exhaustion.

2. No flexibility (fixed size blocks)
  • Network sizes are only in 3 fixed sizes:
    • Class A → too big
    • Class B → medium
    • Class C → too small
  • Cannot create customized networks like /27 or /20 → wastes space.
3. Cannot support real-world requirements

Organizations often need subnets of various sizes, which classful addressing does not allow.

Example:

  • HR department needs 50 hosts
  • IT needs 300
  • Security needs 20

Classful addressing cannot support these variations efficiently.

4. Routing tables grew large
  • Each network was treated separately.
  • No concept of CIDR aggregation or route summarization.
  • Result: routing tables became unmanageable as the internet grew.
5. Private IP ranges were limited
  • Only three fixed private ranges existed (Class A, B, C).
  • Many organizations struggled to fit their network into a single class.
6. IPv4 depletion (addresses started running out)

Because of massive wastage in Class A and Class B address assignments, IPv4 began exhausting rapidly. This became the main reason for introducing:

  • CIDR (Classless Inter-Domain Routing)
  • VLSM (Variable Length Subnet Masking)

Classful addressing is simple but highly inefficient due to fixed network sizes and huge IP wastage, leading to the creation of classless addressing (CIDR).


MCQ

Classful IP Addressing