The Wayback Machine - https://web.archive.org/web/20240828213643/https://www.geeksforgeeks.org/classful-vs-classless-addressing/
Open In App

Classful vs Classless Addressing

Last Updated : 23 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Classful and classless addressing are methods used in networking to manage IP addresses. Classful addressing divides IP addresses into fixed classes (A, B, C, D, E), each with predefined ranges. In contrast, classless addressing, also known as CIDR (Classless Inter-Domain Routing), offers more flexibility by allowing addresses to be subdivided into smaller blocks called subnets. This flexibility helps optimize address allocation and supports the growth of the internet by efficiently managing IP address resources.

What is Classful Addressing?

Classful addressing was introduced in 1981, with classful routing, IPv4 addresses were divided into 5 classes(A to E), each with a predetermined range. The class of an IP address determines the network portion and the host portion based on its class-specific subnet mask. Classful addressing was inflexible and led to inefficiencies in address allocation, which prompted the development of classless addressing (CIDR) for more efficient use of IP address space.

Classes A-C: unicast addresses
Class D: multicast addresses
Class E: reserved for future use
Classfull-Addressing

Classful Addressing

Class A

In a class A address, the first bit of the first octet is always ‘0’. Thus, class A addresses range from 0.0.0.0 to 127.255.255.255(as 01111111 in binary converts to 127 in decimal). The first 8 bits or the first octet denote the network portion and the rest 24 bits or the 3 octets belong to the host portion. Its Subnet mask is 255.0.0.0.

Example: 10.1.1.1 

Exception –

- 127.X.X.X is reserved for loopback
- 0.X.X.X is reserved for default network

Therefore, the actual range of class A addresses is: 1.0.0.0 to 126.255.255.255 

Class B

In a class B address, the first octet would always start with ’10’. Thus, class B addresses range from 128.0.0.0 to 191.255.255.255. The first 16 bits or the first two octets denote the network portion and the remaining 16 bits or two octets belong to the host portion. Its Subnet mask is 255.255.0.0.

Example: 172.16.1.1 

Class C

In a class C address, the first octet would always start with ‘110’. Thus, class C addresses range from 192.0.0.0 to 223.255.255.255. The first 24 bits or the first three octets denote the network portion and the rest 8 bits or the remaining one octet belong to the host portion. Its Subnet mask is 255.255.255.0.

Example: 192.168.1.1 

Class D

Class D is used for multicast addressing and in a class D address the first octet would always start with ‘1110’. Thus, class D addresses range from 224.0.0.0 to 239.255.255.255. Its Subnet mask is not defined.

Example: 239.2.2.2 

Class D addresses are used by routing protocols like OSPF, RIP, etc. 

Class E

Class E addresses are reserved for research purposes and future use. The first octet in a class E address starts with ‘1111’. Thus, class E addresses range from 240.0.0.0 to 255.255.255.255. Its Subnet mask is not defined.

Disadvantage of Classful Addressing

  • Class A with a mask of 255.0.0.0 can support 128 Network, 16,777,216 addresses per network and a total of 2,147,483,648 addresses. 
  • Class B with a mask of 255.255.0.0 can support  16,384 Network, 65,536 addresses per network and a total of 1,073,741,824 addresses. 
  • Class C with a mask of 255.255.255.0 can support 2,097,152 Network, 256 addresses per network and a total of 536,870,912 addresses. 

But what if someone requires 2000 addresses ? 
One way to address this situation would be to provide the person with class B network. But that would result in a waste of so many addresses. 
Another possible way is to provide multiple class C networks, but that too can cause a problem as there would be too many networks to handle. 

To resolve problems like the one mentioned above CIDR was introduced. 

What is Classless Inter-Domain Routing (CIDR)?

CIDR or Class Inter-Domain Routing was introduced in 1993 to replace classful addressing. Classless Inter-Domain Routing (CIDR) is a method for efficiently allocating IP addresses and routing Internet Protocol (IP) packets. Unlike classful addressing, which divides IP addresses into fixed classes (A, B, C, etc.), CIDR allows for variable-length subnet masks (VLSM). This means that networks can be divided into smaller, more flexible subnets according to their specific needs, rather than being constrained by predefined class boundaries.

CIDR Notation

In CIDR subnet masks are denoted by /X. For example a subnet of 255.255.255.0 would be denoted by /24. To work a subnet mask in CIDR, we have to first convert each octet into its respective binary value. For example, if the subnet is of 255.255.255.0. then : 

First Octet

255 has 8 binary 1's when converted to binary 

Second Octet

255 has 8 binary 1's when converted to binary 

Third Octet

255 has 8 binary 1's when converted to binary 

Fourth Octet

0 has 0 binary 1's when converted to binary 

Therefore, in total there are 24 binary 1’s, so the subnet mask is /24.

While creating a network in CIDR, a person has to make sure that the masks are contiguous, i.e. a subnet mask like 10111111.X.X.X can’t exist. 

With CIDR, we can create Variable Length Subnet Masks, leading to less wastage of IP addresses. It is not necessary that the divider between the network and the host portions is at an octet boundary. For example, in CIDR a subnet mask like 255.224.0.0 or 11111111.11100000.00000000.00000000 can exist.

Difference Between Classful Addressing and Classless Addressing

Parameter Classful Addressing Classless Addressing
Basics In Classful addressing IP addresses are allocated according to the classes- A to E. Classless addressing came to replace the classful addressing and to handle the issue of rapid exhaustion of IP addresses.
Practical It is less practical. It is more practical.
Network ID and Host ID The changes in the Network ID and Host ID depend on the class. There is no such restriction of class in classless addressing.
VLSM It does not support the Variable Length Subnet Mask (VLSM). It supports the Variable Length Subnet Mask (VLSM).
Bandwidth Classful addressing requires more bandwidth. As a result, it becomes slower and more expensive as compared to classless addressing. It requires less bandwidth. Thus, fast and less expensive as compared to classful addressing.
CIDR It does not support Classless Inter-Domain Routing (CIDR). It supports Classless Inter-Domain Routing (CIDR).
Updates Regular or periodic updates Triggered Updates
Troubleshooting and Problem detection Troubleshooting and problem detection are easy than classless addressing because of the division of network, host and subnet parts in the address. It is not as easy compared to classful addressing.
Division of Address 
  • Network
  • Host 
  • Subnet
  • Host 
  • Subnet

Conclusion

In conclusion, classful addressing divides IP addresses into fixed classes (A, B, C, D, E) with predefined ranges, which can lead to inefficient use of address space. Classless addressing (CIDR), on the other hand, allows for variable-length subnet masks (VLSM), enabling more flexible subnetting and efficient use of IP addresses. CIDR has become the standard method for IP allocation and routing, offering better scalability and resource management in modern networking.

Classful vs Classless Addressing – FAQs

How are IP addresses structured in Classful Addressing?

In classful addressing structure of IP address is :

  • Class A: Starts with 0-127, large networks.
  • Class B: Starts with 128-191, medium-sized networks.
  • Class C: Starts with 192-223, small networks.
  • Class D: 224-239, used for multicast.
  • Class E: 240-255, reserved for future use.

How are IP addresses structured in Classless Addressing?

In classless addressing, any IP address can be combined with any prefix length. For example, 192.168.1.0/24, where /24 means the first 24 bits are the network portion.

Which is more efficient, Classful or Classless Addressing?

Classless addressing is more efficient because it allows for better use of IP address space. It can accommodate networks of any size, reducing wasted addresses.

Why did we move from Classful to Classless Addressing?

We moved to classless addressing to overcome the limitations and inefficiencies of classful addressing. The Internet was growing, and the rigid classful system could not handle the increasing number of networks effectively.



Previous Article
Next Article

Similar Reads

Classless Addressing in IP Addressing
The Network address identifies a network on the internet. Using this, we can find a range of addresses in the network and total possible number of hosts in the network. Mask is a 32-bit binary number that gives the network address in the address block when AND operation is bitwise applied on the mask and any IP address of the block. The default mas
7 min read
Difference Between Classful Routing and Classless Routing
Classful and classless routing are two different ways through which the IP addresses are managed and structured in a network. Classful Routing is an older approach whereby the IP addresses are divided by fixed classes such as A, B, C, and the rest all with a preset mask. This way, the subnet mask information is not carried in routing updates and it
5 min read
Introduction of Classful IP Addressing
An IP address is an address that has information about how to reach a specific host, especially outside the LAN. An IP address is a 32-bit unique address having an address space of 232. Classful IP addressing is a way of organizing and managing IP addresses, which are used to identify devices on a network. Think of IP addresses like street addresse
10 min read
Difference between Implied addressing mode and Immediate addressing mode
Prerequisite - Addressing Modes 1. Implied Addressing Mode : In implied addressing mode, the operands are specified implicitly in the definition of the instruction. All the instructions which reference registers that use an accumulator are implied mode instructions. Zero address instructions in a stack organised computer are also implied mode instr
3 min read
Difference between Relative Addressing Mode and Direct Addressing Mode
Prerequisite - Addressing Modes In an Instruction Fetch operation of the Instruction Cycle Process, addressing mode plays a crucial part. Addressing Mode is how the operand is addressed in an instruction word before being executed. 1. Relative Address Mode: In this mode, the Effective Address (EA) of the operand is calculated by adding the content
5 min read
IPv4 Classless Subnet equation
Prerequisite - Classless Addressing, Supernetting Problem - How to calculate Network Address, Broadcast Address, First and Last IP address of a given IP Address in the CIDR(Classless Inter-Domain Routing) Notation. There is a simple equation to calculate the above mentioned Addresses which is used and tested with Class C Networks. Firstly, remember
2 min read
Classless Inter Domain Routing (CIDR)
Classless Inter-Domain Routing (CIDR) is a method of IP address allocation and IP routing that allows for more efficient use of IP addresses. CIDR is based on the idea that IP addresses can be allocated and routed based on their network prefix rather than their class, which was the traditional way of IP address allocation. CIDR addresses are repres
6 min read
Computer Networks | IP Addressing | Question 8
Which of the following IP address can be used in WAN? (A) 10.0.0.1 (B) 172.16.0.10 (C) 15.1.5.6 (D) None Answer: (C) Explanation: 10.0.0.1  and 172.16.0.10 are private IP address. Thus cannot be used in WAN.  15.1.5.6 is a public IP address.Quiz of this Question
1 min read
Computer Networks | IP Addressing | Question 2
Which of the following can be used as both Source and Destination IP? (A) 198.168.1.255 (B) 10.0.0.1 (C) 127.0.0.1 (D) 255.255.255.255 Answer: (B) Explanation: 192.168.1.255 is a Direct Broadcast Address (DBA),  DBA  can't be used as Source Address. 127.0.0.1 Loopback address again can't be used as the source address. 255.255.255.255 is Limited Bro
1 min read
Computer Networks | IP Addressing | Question 8
If Direct Broadcast address is 201.15.16.31, which of the following can be subnet mask? (A) 255.255.255.240 (B) 255.255.255.248 (C) 255.255.255.252 (D) All of the Above Answer: (D)Explanation: All of the following address can become the subnet mask. Quiz of this QuestionPlease comment below if you find anything wrong in the above post
1 min read
Computer Networks | IP Addressing | Question 5
If subnet mask 255.255.255.224, which of the following will be Direct Broadcast address ? (A) 202.15.19.127 (B) 202.15.19.63 (C) Both a and b (D) None of the Above Answer: (C) Explanation: Subnet mask is   255.255.255.11100000 In DBA all host bits are 1. from option 202.15.19.011 11111 , this can be a DBA. 202.15.19.001 11111 ,this can also be a DB
1 min read
Computer Networks | IP Addressing | Question 6
Which of the following is public IP address ? (A) 10.15.14.12 (B) 192.168.52.62 (C) 172.32.1.1 (D) None of the Above Answer: (C) Explanation: Range of Private IP 10.0.0.0 - 10.255.255.255 172.16.0.0 - 172.31.255.255 192.168.0.0 - 192.168.255.255 Option C doesn't belong to this rangeQuiz of this Question
1 min read
Computer Networks | IP Addressing | Question 7
In class B if subnet mask is 255.192.0.0 Total Number of networks than can be joined (A) 32 (B) 64 (C) 16 (D) None of the Above Answer: (B) Explanation: Number of network can be joined is 2^n , n is the number bits borrowed from network bits. Default Subnet mask 255.255.0.0 .i.e 11111111.11111111.00000000.0000000 Given Subnet mask is 11111111.11000
1 min read
Difference between Memory based and Register based Addressing Modes
Prerequisite - Addressing Modes Addressing modes are the operations field specifies the operations which need to be performed. The operation must be executed on some data which is already stored in computer registers or in the memory. The way of choosing operands during program execution is dependent on addressing modes of instruction. "The address
4 min read
Difference between Direct and Indirect Addressing Modes
Prerequisite: Addressing Modes 1. Direct Addressing Mode: In direct addressing mode, the address field in the instruction contains the effective address of the operand and no intermediate memory access is required. Nowadays it is rarely used. Example: Add the content of R1 and 1001 and store back to R1: Add R1, (1001) Here 1001 is the address where
3 min read
IPv6 Addressing Format and Conventions
We know that IPv4 addresses are mostly represented in a dotted decimal form like 192.168.10.1, and if written with a prefix mask then it would be written like 192.168.10.1/24, where /24 is the network mask. But IPv6 is long addressing format. IPv6 is 128 bit long and usually represented in hexadecimal format of addressing. IPv6 representation inclu
2 min read
Difference between Indirect and Immediate Addressing Modes
Prerequisite - Addressing Modes 1. Indirect Addressing Mode: In indirect addressing mode, the address field in the instruction points to the memory location or register where the effective address of the operand is present. Two memory accesses are required. One to get the value stored at the given address field. Second to get the effective address
2 min read
Difference between Direct and Immediate Addressing Modes
Prerequisite - Addressing Modes 1. Direct Addressing Mode: In direct addressing mode, the address field contains the address of the operand. Effective Address (EA) = address field of operand Example: Add the contents of register 1303 to the accumulator. Add (1303) Only a single memory reference is required to access data. So no additional calculati
2 min read
Difference between PC relative and Base register Addressing Modes
Prerequisite - Addressing Modes 1. PC relative addressing mode: PC relative addressing mode is used to implement the intra-segment transfer of control, In this mode effective address is obtained by adding displacement to the PC. EA = PC + Address field value PC = PC + Relative value 2. Base register addressing mode: Base register addressing mode is
2 min read
Difference between Direct and Implied Addressing Modes
Prerequisite - Addressing Modes 1. Direct Addressing Mode : In direct addressing mode, the address field contains the address of the operand. Effective Address(EA) = address field of operand Example - Add the contents of register A to the accumulator. ADD A Look in memory at address A for operand. Only a single memory reference is required to acces
2 min read
What is IPv6 Intra Site Automatic Tunnel Addressing Protocol (ISATAP)?
ISATAP is a routable tunneling protocol developed by the IETF as an extension to IPv6, used in scenarios where no other encapsulation is available. It uses IPv4 to transmit data packets over the network. IPv6 Intra Site Automatic Tunnel Addressing Protocol (ISATAP): It is a tunneling protocol that was developed as an extension to IPv6 by the IETF a
2 min read
Difference Between IP Addressing and Subnetting
In computing networks, IP addressing and sub-networks are linked ideas. The subnet is the act of dividing a network into smaller subnets, or subnets, while IP addressing is the process of giving unique addresses to devices over a network. IP AddressingEach device that uses a network receives an IP address, which is a special identifier number. IP a
3 min read
Computer Networks | IP Addressing | Question 8
If Direct Broadcast Address of subnet is 201.15.16.31. Which of the following will be subnet mask ? (A) 255.255.255.239 (B) 255.255.255.192 (C) 255.255.255.198 (D) None Of the Above Answer: (D) Explanation: Last octet of given DBA is 0001 1111. So, in Subnet mask address all should be 1\'s except last 5 digits, i.e., 255.255.255.224. So, option (D)
1 min read
Computer Networks | IP Addressing | Question 8
If block contains 32 IP address which of the following is first address of the block ? (A) 10.0.0.5 (B) 10.0.0.16 (C) 10.0.0.68 (D) 10.0.0.160 Answer: (D) Explanation: As here block contains total IP addresses = 32To represents all 32 IP address we need 5 bit so #of host bits=5.Now, As It belongs to CLASS A we have to focus only on the last octet b
1 min read
Top 50 IP Addressing Interview Questions and Answers
In today's interconnected world, every device that is connected to the internet has a unique identifier known as IP Address. Now, understanding an IP address is essential for anyone who looking to pursue a career in IT or networking, then this blog post, we'll dive into the most frequently asked IP address interview questions. We'll cover the basic
15+ min read
What is APIPA (Automatic Private IP Addressing)?
APIPA ​comprises Automatic Private IP Addressing, a networking functionality that enables computers to automatically assign themselves an IP address when they are unable to acquire one from a DHCP server. APIPA will be employed when a device that is intended to use DHCP for obtaining an IP address fails to connect with the DHCP server. In this case
7 min read
Difference between Indirect and Implied Addressing Modes
Indirect and implied addressing modes are two common techniques used to specify the memory address of an operand for an instruction in computer architecture. Indirect addressing mode the address of effective address is specified by the instruction whereas in implied addressing mode address is not specified explicitly. In this article we will explor
5 min read
Types of Operating Systems
An Operating System performs all the basic tasks like managing files, processes, and memory. Thus operating system acts as the manager of all the resources, i.e. resource manager. Thus, the operating system becomes an interface between the user and the machine. It is one of the most required software that is present in the device.  Operating System
10 min read
What is OSI Model? - Layers of OSI Model
OSI stands for Open Systems Interconnection, where open stands to say non-proprietary. It is a 7-layer architecture with each layer having specific functionality to perform. All these 7 layers work collaboratively to transmit the data from one person to another across the globe. The OSI reference model was developed by ISO - 'International Organiza
15+ min read
Types of Network Topology
Network topology refers to the arrangement of different elements like nodes, links, or devices in a computer network. It defines how these components are connected and interact with each other. Understanding various types of network topologies helps in designing efficient and robust networks. Common types include bus, star, ring, mesh, and tree top
11 min read